Jump to content

Accessing existing Series Metadata from within IRemoteMetadataProvider<Season, SeasonInfo>


Tobi Uchiha
Go to solution Solved by Luke,

Recommended Posts

Tobi Uchiha

Hello,

 

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!

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Ah, sorry, I misread this. You're asking about Season lookups, and you want SeriesName.

 

Yes this could be added to SeasonInfo, I suppose. But I'm curious, what do you need it for?

Link to comment
Share on other sites

Tobi Uchiha

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").

Link to comment
Share on other sites

Tobi Uchiha

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.

Link to comment
Share on other sites

Tobi Uchiha

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! :)

Link to comment
Share on other sites

Tobi Uchiha

Not currently but it's possible for the future. Are you a full time software developer?

Yes, but currently "only" a junior developer.

Link to comment
Share on other sites

Tobi Uchiha

What tech do you work with?

.NET Core (mostly ASP.NET Core), Docker and Azure / Azure DevOps (if you can count those as tech)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...