Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception thrown when trying to retrieve data from music and photo libraries #8

Open
ayaxdev opened this issue Jan 22, 2025 · 2 comments

Comments

@ayaxdev
Copy link

ayaxdev commented Jan 22, 2025

Hello,

I've been trying to use this library for my program but when doing so I've encountered an issue fetching library items' metadata from the music library on my personal Plex media server.

When I try and call:

_plexAPI_.library().getLibraryItems(GetLibraryItemsRequest.builder().tag(Tag.ALL).sectionKey(_sectionKey_).build())

I get the following exception:

[15:28:20] [STDERR]: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `dev.plexapi.sdk.models.operations.GetLibraryItemsLibraryType` from String "artist": not one of the values accepted for Enum class: [movie, season, show, episode]
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 579] (through reference chain: dev.plexapi.sdk.models.operations.GetLibraryItemsResponseBody["MediaContainer"]->dev.plexapi.sdk.models.operations.GetLibraryItemsMediaContainer["Metadata"]->java.util.ArrayList[0]->dev.plexapi.sdk.models.operations.GetLibraryItemsMetadata["type"])
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:1959)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.DeserializationContext.handleWeirdStringValue(DeserializationContext.java:1245)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.std.EnumDeserializer._deserializeAltString(EnumDeserializer.java:447)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.std.EnumDeserializer._fromString(EnumDeserializer.java:304)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.std.EnumDeserializer.deserialize(EnumDeserializer.java:273)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:543)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:585)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:447)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1497)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:348)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:185)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:361)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:246)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:30)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.deserialize(ReferenceTypeDeserializer.java:207)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:543)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:585)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:447)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1497)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:348)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:185)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.deserialize(ReferenceTypeDeserializer.java:207)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:543)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:585)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:447)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1497)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:348)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:185)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:342)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4917)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3860)
[15:28:20] [STDERR]: 	at knot//com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3843)
[15:28:20] [STDERR]: 	at knot//dev.plexapi.sdk.Library.getLibraryItems(Library.java:1192)
_I omitted rest of the stacktrace as it was irrelevant_

All my other libraries work fine. From my uneducated point of view, this looks like you haven't implemented the metadata types for music content, therefore this would be an issue in the library, hence why I'm creating an issue.

Thank you.

@ayaxdev
Copy link
Author

ayaxdev commented Jan 22, 2025

I forgot to mention I'm using the latest version of the library (0.11.1 as of me typing this) and running on JDK23.

@ayaxdev
Copy link
Author

ayaxdev commented Jan 22, 2025

After testing with my friend's server, it looks like the same issue happens with photo libraries, it's the exact same exception except 'from String "artist"' has been replaced with 'from String "photo"'.

@ayaxdev ayaxdev changed the title Bug when trying to retrieve data from a music library Exception thrown when trying to retrieve data from music and photo libraries Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant