Accessing existing Series Metadata from within IRemoteMetadataProvider<Season, SeasonInfo>IRemoteMetadataProvider
Posted 13 October 2019 - 07:40 AM
I was wondering how I would access existing Series Metadata from within a class that implements IRemoteMetadataProvider<Season, SeasonInfo>.
I need the series name in order to search for related seasons.
I can get the Series Id from info.SeriesProviderIds, but to get the name I would have to once again query the API, which is unneeded, since the series metadata is already present at the time the RemoteMetadataProvider of the Season is called.
Is there any Metadata store i can query or something of the likes?
Thanks in advance!
Posted 13 October 2019 - 08:23 PM
Hi, you can't. Why do you need the name?
Remember that these same methods are also used by the Identify feature. The user could try to identify using a series provider Id without any name, so how would your provider handle that if it has to rely on having the name?
Posted 14 October 2019 - 12:40 AM
I partially can infer related seasons via my provider, but in some instances I would need something like a fallback method where I would search for a Series name + Season number combo.
I tested it via the search feature manually and in 90% of the cases this would allow me to correctly "guess" the season and download its metadata.
This "guess" mechanism would be great for metadata providers where the API presents no seasonal connection and rather stores continuing seasons as their own series (e.g. "One Punch Man", "One Punch Man 2").
Posted 16 October 2019 - 11:02 AM
Ok, i can add SeriesName to SeasonInfo for the next release. Thanks.
Thank you. Much appreciated!
But if you can expose the series name wouldn't it make sense to either expose all of the Metadata in form of a SeriesInfo object on SeasonInfo or have an extension method for SeasonInfo that returns SeriesInfo, if available!?
Just the SeriesName might be fine for my case, but I can image that somebody might need access to another property like ProductionYear, if the series has two versions from different years.
You could of course then add this as SeriesProductionYear as well, but I think it would make more sense to group the existing SeriesProviderIds, the hopefully upcoming SeriesName and other Metadata on a single Series property.
I haven't looked extensively at the original source code, but if an SeriesInfo object is already present for the Season you're resolving you could just include it on SeasonInfo and avoid cluttering the SeasonInfo object with Properties.
Posted 17 October 2019 - 02:11 PM
Let's just start with SeriesName and we can always add more. Thanks.
Is the MediaBrowser.Server.Core package open source? I can't find it on GitHub and the NuGet repository Link just redirects to the main repository, where I can't make out the package. :/
I'd love being able to contribute and maybe implement it myself!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users