Environment
- OS Version: 27.0
- App Version: 5.22.0
Importing an audiobook from a Jellyfin server via the Jellyfin integration fails immediately when opening the book's details screen (before any download starts), with the generic error:
The data couldn't be read because it isn't in the correct format.
This happens for any Jellyfin item where a People entry has Type: "Narrator" — a completely standard tag for audiobooks.
Root cause
BookPlayer pins jellyfin-sdk-swift at 0.4.0 (Package.resolved: https://github.com/TortugaPower/BookPlayer/blob/main/BookPlayer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved). In that version, PersonKind (Sources/Entities/PersonKind.swift: https://github.com/jellyfin/jellyfin-sdk-swift/blob/0.4.0/Sources/Entities/PersonKind.swift) does not include a .narrator case:
public enum PersonKind: String, Codable, CaseIterable {
case unknown = "Unknown"
case actor = "Actor"
...
case translator = "Translator"
// no "Narrator" case
}
The narrator = "Narrator" case was added upstream in a later release (present as of 3.2.0, absent in 0.4.0 — BookPlayer is several major versions behind current).
Because ChapterInfo/BaseItemDto decoding is not lenient about unknown enum raw values, any People[] entry with Type: "Narrator" causes the entire item to fail Codable decoding with DecodingError.dataCorrupted, which surfaces to the user as the generic, unhelpful "data couldn't be read" message — with no indication of what's actually wrong.
Reproduction
- On a Jellyfin server, have an audio item whose metadata credits someone with PersonType: "Narrator" (e.g. via the Bookshelf/AudiobookShelf-style metadata providers, or manually via Jellyfin's edit-metadata UI).
- In BookPlayer, connect to that Jellyfin server and open that item's details, or attempt to download it.
- Observe the "data couldn't be read because it isn't in the correct format" error, with no further detail.
Verification
I reproduced this deterministically outside the app by compiling BookPlayer's actual vendored jellyfin-sdk-swift v0.4.0 source against a real GET /Items/{id} response from an affected item:
dataCorrupted at People.Index 1.Type: Cannot initialize PersonKind from invalid String value Narrator
Changing that person's Type server-side from Narrator to any value present in v0.4.0's enum (e.g. Actor) makes the same response decode successfully.
Suggested fix
- Bump the jellyfin-sdk-swift dependency to a current release (3.2.0 as of this writing), which includes PersonKind.narrator and presumably other enum cases added since 0.4.0.
- Longer-term/defense-in-depth: consider decoding PersonKind (and similar server-defined enums) leniently — falling back to .unknown for an unrecognized raw value instead of throwing — so a single unfamiliar enum value from a newer server doesn't take down decoding of the whole item. This class of failure (client enum lags server enum) will recur for other fields too.
Extra versions
- Jellyfin server version: 12.1.0
- jellyfin-sdk-swift: 0.4.0 (pinned)
Environment
Importing an audiobook from a Jellyfin server via the Jellyfin integration fails immediately when opening the book's details screen (before any download starts), with the generic error:
This happens for any Jellyfin item where a People entry has Type: "Narrator" — a completely standard tag for audiobooks.
Root cause
BookPlayer pins jellyfin-sdk-swift at 0.4.0 (Package.resolved: https://github.com/TortugaPower/BookPlayer/blob/main/BookPlayer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved). In that version, PersonKind (Sources/Entities/PersonKind.swift: https://github.com/jellyfin/jellyfin-sdk-swift/blob/0.4.0/Sources/Entities/PersonKind.swift) does not include a .narrator case:
The narrator = "Narrator" case was added upstream in a later release (present as of 3.2.0, absent in 0.4.0 — BookPlayer is several major versions behind current).
Because ChapterInfo/BaseItemDto decoding is not lenient about unknown enum raw values, any People[] entry with Type: "Narrator" causes the entire item to fail Codable decoding with DecodingError.dataCorrupted, which surfaces to the user as the generic, unhelpful "data couldn't be read" message — with no indication of what's actually wrong.
Reproduction
Verification
I reproduced this deterministically outside the app by compiling BookPlayer's actual vendored jellyfin-sdk-swift v0.4.0 source against a real GET /Items/{id} response from an affected item:
Changing that person's Type server-side from Narrator to any value present in v0.4.0's enum (e.g. Actor) makes the same response decode successfully.
Suggested fix
Extra versions