From 3cf6bfe09aa436e018ec4baea93db5cf9669dba9 Mon Sep 17 00:00:00 2001 From: RXWatcher <14085001+RXWatcher@users.noreply.github.com> Date: Tue, 26 May 2026 23:28:13 +0200 Subject: [PATCH] fix(audiobooks): emit media.tags so ABS Android downloads parse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ABS Android client's Kotlin Book model declares var tags: List // 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) --- internal/audiobooks/abs/libraries_handler.go | 1 + internal/audiobooks/abs/types.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/internal/audiobooks/abs/libraries_handler.go b/internal/audiobooks/abs/libraries_handler.go index 3e36497c..127921ad 100644 --- a/internal/audiobooks/abs/libraries_handler.go +++ b/internal/audiobooks/abs/libraries_handler.go @@ -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, diff --git a/internal/audiobooks/abs/types.go b/internal/audiobooks/abs/types.go index f5ee26b3..363a7e20 100644 --- a/internal/audiobooks/abs/types.go +++ b/internal/audiobooks/abs/types.go @@ -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` 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