openapi: 3.0.3 info: title: Album Tracker - Ignored Albums API description: API contract for album ignore/un-ignore functionality version: 1.0.0 contact: name: Album Tracker servers: - url: http://localhost:3035/api description: Local development server tags: - name: Albums description: Album management operations paths: /albums/{albumId}: patch: summary: Update album properties (including ignored status) description: | Partially updates an album's properties. This endpoint is extended to support the new `is_ignored` field for marking albums as ignored or un-ignoring them. **Ignored Albums Feature**: - Set `is_ignored: true` to hide the album from views and exclude from statistics - Set `is_ignored: false` to restore the album to normal view - Owned albums (ownership_status = 'Owned') cannot be ignored (returns 403) - When an album's ownership_status changes to 'Owned', is_ignored is automatically cleared tags: - Albums operationId: updateAlbum parameters: - name: albumId in: path description: Unique identifier of the album to update required: true schema: type: integer format: int64 minimum: 1 example: 123 requestBody: description: Album properties to update (all fields optional for PATCH) required: true content: application/json: schema: type: object properties: is_ignored: type: boolean description: | Set to true to mark album as ignored (hidden from views and statistics). Set to false to un-ignore the album. Cannot be set to true if ownership_status is 'Owned'. example: true matched_folder_path: type: string nullable: true description: Filesystem path where album is located example: "/music/Artist Name/Album Title" ownership_status: type: string enum: [Owned, Missing, Ambiguous] description: Physical ownership state of the album example: "Missing" examples: ignoreAlbum: summary: Mark album as ignored value: is_ignored: true unignoreAlbum: summary: Un-ignore album value: is_ignored: false updateOwnership: summary: Update ownership status value: ownership_status: "Owned" matched_folder_path: "/music/Pink Floyd/The Wall" responses: '200': description: Album successfully updated content: application/json: schema: $ref: '#/components/schemas/Album' examples: ignoredAlbum: summary: Successfully ignored album value: id: 123 artist_id: 45 mbid: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" title: "The Wall" release_year: 1979 release_date: "1979-11-30" disambiguation: null ownership_status: "Missing" matched_folder_path: null match_confidence: null is_manual_override: false is_ignored: true created_at: "2025-01-01T00:00:00Z" updated_at: "2025-12-14T12:34:56Z" '400': description: Invalid request (malformed album ID or invalid field types) content: application/json: schema: $ref: '#/components/schemas/Error' examples: invalidAlbumId: summary: Invalid album ID format value: error: "Album ID must be a positive integer" status: 400 code: "INVALID_ALBUM_ID" invalidFieldType: summary: is_ignored is not a boolean value: error: "is_ignored must be a boolean" status: 400 code: "INVALID_FIELD_TYPE" '403': description: Forbidden - Business rule violation content: application/json: schema: $ref: '#/components/schemas/Error' examples: cannotIgnoreOwned: summary: Attempting to ignore an owned album value: error: "Cannot ignore owned albums" status: 403 code: "CANNOT_IGNORE_OWNED" '404': description: Album not found content: application/json: schema: $ref: '#/components/schemas/Error' examples: albumNotFound: summary: Album ID does not exist value: error: "Album not found" status: 404 code: "ALBUM_NOT_FOUND" '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' example: error: "Internal server error" status: 500 /artists/{artistId}/albums: get: summary: Get all albums for an artist description: | Retrieves all albums for a specific artist. By default, ignored albums are excluded from the results. Use the `includeIgnored` query parameter to show all albums. tags: - Albums operationId: getArtistAlbums parameters: - name: artistId in: path description: Unique identifier of the artist required: true schema: type: integer format: int64 minimum: 1 example: 45 - name: includeIgnored in: query description: | Set to 'true' to include ignored albums in the results. Default is 'false' (ignored albums are hidden). required: false schema: type: boolean default: false example: true responses: '200': description: List of albums for the artist content: application/json: schema: type: array items: $ref: '#/components/schemas/Album' examples: withIgnored: summary: Albums including ignored ones (includeIgnored=true) value: - id: 123 artist_id: 45 mbid: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" title: "The Wall" ownership_status: "Owned" is_ignored: false created_at: "2025-01-01T00:00:00Z" updated_at: "2025-01-15T12:00:00Z" - id: 124 artist_id: 45 mbid: "b2c3d4e5-f6a7-8901-bcde-f12345678901" title: "The Final Cut" ownership_status: "Missing" is_ignored: true created_at: "2025-01-01T00:00:00Z" updated_at: "2025-01-15T12:30:00Z" withoutIgnored: summary: Albums excluding ignored ones (default) value: - id: 123 artist_id: 45 mbid: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" title: "The Wall" ownership_status: "Owned" is_ignored: false created_at: "2025-01-01T00:00:00Z" updated_at: "2025-01-15T12:00:00Z" '404': description: Artist not found content: application/json: schema: $ref: '#/components/schemas/Error' example: error: "Artist not found" status: 404 code: "ARTIST_NOT_FOUND" components: schemas: Album: type: object required: - id - artist_id - mbid - title - ownership_status - is_manual_override - is_ignored - created_at - updated_at properties: id: type: integer format: int64 description: Unique album identifier (auto-increment) example: 123 artist_id: type: integer format: int64 description: Foreign key reference to the parent artist example: 45 mbid: type: string format: uuid description: MusicBrainz release-group UUID (stable identifier) example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" title: type: string description: Album title example: "The Wall" release_year: type: integer nullable: true description: Year extracted from release_date example: 1979 release_date: type: string nullable: true description: ISO date in format YYYY, YYYY-MM, or YYYY-MM-DD example: "1979-11-30" disambiguation: type: string nullable: true description: Disambiguation text from MusicBrainz example: "2011 remaster" ownership_status: type: string enum: [Owned, Missing, Ambiguous] description: | Physical ownership state: - Owned: Album found in filesystem with high confidence match - Missing: Album not found in filesystem - Ambiguous: Album matched with low confidence (<0.8) example: "Missing" matched_folder_path: type: string nullable: true description: Filesystem path where album is located (if owned) example: "/music/Pink Floyd/The Wall" match_confidence: type: number format: float nullable: true minimum: 0.0 maximum: 1.0 description: Similarity score for automatic matching (0.0-1.0) example: 0.95 is_manual_override: type: boolean description: | True if ownership was manually set by user (prevents automatic updates). False if ownership was determined automatically. example: false is_ignored: type: boolean description: | True if user has marked album as ignored (hidden from views and excluded from statistics). False if album is visible normally. Cannot be true if ownership_status is 'Owned'. example: true created_at: type: string format: date-time description: ISO 8601 timestamp of album creation example: "2025-01-01T00:00:00Z" updated_at: type: string format: date-time description: ISO 8601 timestamp of last update example: "2025-12-14T12:34:56Z" Error: type: object required: - error - status properties: error: type: string description: Human-readable error message example: "Cannot ignore owned albums" status: type: integer description: HTTP status code example: 403 code: type: string description: Machine-readable error code for client handling example: "CANNOT_IGNORE_OWNED" responses: BadRequest: description: Invalid request parameters or body content: application/json: schema: $ref: '#/components/schemas/Error' Forbidden: description: Request violates business rules content: application/json: schema: $ref: '#/components/schemas/Error' NotFound: description: Resource not found content: application/json: schema: $ref: '#/components/schemas/Error' InternalServerError: description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error'