Jump to content

C# possible to get image type from baseitem fetcher request?


mickle026

Recommended Posts

mickle026

Hi,

Is it possible to get the image type requested in a fetcher, instead of fetching them all for every request?

I have two places where it could be gleemed from but have no idea how to query the ImageType requested when the plugin is called

public Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, LibraryOptions libraryOptions, CancellationToken cancellationToken)

or the Async

public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken)

I don't see it in BaseItem or LibraryOptions to get the request type, its probably there , but where??

 

I would really be able to do something like this (test which image type is requested) with ImageType, but item is always MusicArtist, Movie, MusicAlbum, Person etc

if (item.GetType() == typeof(ImageType.Primary))

 

Many thanks for helping the clueless :)

Link to comment
Share on other sites

mickle026
1 hour ago, Luke said:

Hi, no, you're supposed to send back all of them and then the server will filter in the core.

Thats fine,

However when you swap from Primary to Logo , Backdrop etc its fetching them all again each individual time, so thats a waste of resources and remote server requests as it already has them so I wanted to them individually as the user requests the ImageType.

I suppose the next question is, Is the server supposed to be doing this i.e, retriggering the GetImages everytime a search icon is pressed if its done them all the first time - whilst the edit images dialog is still open ? - it seems odd...

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