[Bug]: PublishedYear in Book metadata has mismatched type #1033

Closed
opened 2026-04-24 23:29:33 +02:00 by adam · 4 comments
Owner

Originally created by @jakoss on GitHub (Mar 21, 2023).

Describe the issue

I'm trying to use the API. When i download by library i stumbled upon issue in the Book Metadata model. The property "PublishedYear" sometimes is returned as string (with quotes) and sometimes as an integer. This is quite an issue for static typed languages and their json decoders setup

Steps to reproduce the issue

I don't know if there is an reproduction pattern. In my library one of the books i have returns the PublishedYear as an integer

Audiobookshelf version

v2.2.17

How are you running audiobookshelf?

Docker

Originally created by @jakoss on GitHub (Mar 21, 2023). ### Describe the issue I'm trying to use the API. When i download by library i stumbled upon issue in the Book Metadata model. The property "PublishedYear" sometimes is returned as string (with quotes) and sometimes as an integer. This is quite an issue for static typed languages and their json decoders setup ### Steps to reproduce the issue I don't know if there is an reproduction pattern. In my library one of the books i have returns the PublishedYear as an integer ### Audiobookshelf version v2.2.17 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:29:33 +02:00
adam closed this issue 2026-04-24 23:29:34 +02:00
Author
Owner

@advplyr commented on GitHub (Mar 21, 2023):

Have you updated any data via the API? I think this should always be a string unless you passed in a number via the API.

We should coerce to a string even when updating via the API but we are moving to a new relational model so I don't think this is an important update with the current API.

@advplyr commented on GitHub (Mar 21, 2023): Have you updated any data via the API? I think this should always be a string unless you passed in a number via the API. We should coerce to a string even when updating via the API but we are moving to a new relational model so I don't think this is an important update with the current API.
Author
Owner

@jakoss commented on GitHub (Mar 22, 2023):

I didn't update data via the api, but i did update it via the "match" functionality, maybe issue was something there? The issue is minor, i can just ignore that field for now.

@jakoss commented on GitHub (Mar 22, 2023): I didn't update data via the api, but i did update it via the "match" functionality, maybe issue was something there? The issue is minor, i can just ignore that field for now.
Author
Owner

@advplyr commented on GitHub (Mar 22, 2023):

This can fall under the same issue as #1434

@advplyr commented on GitHub (Mar 22, 2023): This can fall under the same issue as #1434
Author
Owner

@advplyr commented on GitHub (Mar 22, 2023):

Duplicate of #1434

@advplyr commented on GitHub (Mar 22, 2023): Duplicate of #1434
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1033