fix(audiobooks): emit media.tags so ABS Android downloads parse

The ABS Android client's Kotlin Book model declares
    var tags: List<String>  // non-nullable
and Jackson throws MissingKotlinParameterException when the field is
absent from /api/items/{id} responses. ApiHandler.getLibraryItem
WithProgress catches the exception and resolves cb(null), at which
point AbsDownloader silently aborts — the user sees no error, the
download just never starts.

Add Tags to LibraryItemMedia and initialise it to []string{} at
construction. Verified end-to-end: download URL the Android client
builds (/api/items/{id}/file/{ino}/download) returns HTTP 206 with
audio/mpeg bytes; the parent /api/items/{id} response now carries
"tags": [] so Jackson deserialises cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
RXWatcher
2026-05-26 23:28:13 +02:00
co-authored by Claude Opus 4.7
parent bdf1da6f2e
commit 3cf6bfe09a
2 changed files with 8 additions and 0 deletions
@@ -571,6 +571,7 @@ func siloItemToLibraryItem(item *models.MediaItem, lib AudiobookLibrary, baseURL
Tracks: []AudioTrack{},
Chapters: []ChapterABS{},
NumTracks: 0, // populated by item-detail handler
Tags: []string{},
},
AddedAt: addedAtMs,
UpdatedAt: updatedAtMs,
+7
View File
@@ -121,6 +121,13 @@ type LibraryItemMedia struct {
Tracks []AudioTrack `json:"tracks"`
Chapters []ChapterABS `json:"chapters"`
NumTracks int `json:"numTracks"`
// Tags is a book-level tag list. NEVER null on the wire — the ABS
// Android client's Kotlin `Book.tags: List<String>` is non-nullable,
// so Jackson throws MissingKotlinParameterException when the field
// is absent (or null) and the entire LibraryItem fails to parse —
// which silently breaks downloads (the downloader's apiHandler
// callback receives null and gives up). Always emit [] in v1.
Tags []string `json:"tags"`
}
// CollapsedSeriesV1 is the per-item annotation real ABS attaches when