roaku 797 Posted October 18, 2022 Share Posted October 18, 2022 Let me ask a feasibility question up front in case what I want can't currently be done... @Luke Is it possible for a plugin to offer an ImageProvider for Movie Extras? I'd like to create an image provider for Movie Extras that utilizes the parent Movie's art as a base but am new to creating Providers. ILocalImageProvider or IDynamicImageProvider seem like candidates for what I'm trying to do. I've managed to get the Provider implementation registered as a provider an can get log output when Emby calls the supports method as I open an Extras image modal. But, I can't seem to figure out how to get Emby to call the GetImage method, so I can actually try to provide an image. Can anyone provide some insight into how this is supposed to work? Link to comment Share on other sites More sharing options...
roaku 797 Posted October 18, 2022 Author Share Posted October 18, 2022 I just had some luck with ILocalImageFileProvider. It appears to fire GetImages() when refreshing metadata. 1 Link to comment Share on other sites More sharing options...
roaku 797 Posted October 18, 2022 Author Share Posted October 18, 2022 Well, I just managed to clone the Primary image from the Extra's owner over as a primary image for the Extra on metadata refresh. The next, hopefully successful, step is to modify the parent image in fun, interesting, and useful ways before saving it with the Extra. Link to comment Share on other sites More sharing options...
softworkz 3349 Posted October 19, 2022 Share Posted October 19, 2022 Please note that in GetImages() you should not do anything else than return a list of images. You should not perform any library operations like loading or saving items there. Generally, a metadata provider must not make changes to any other item than the one it's called for. That means, when you want to make changes to the Extra's owner item, it should be done when the metadata provider is called for that item. The images you return in an image provider might be merged or overwritten by results from other image providers (depending on the configured order). For the provider types: ILocalImageProvider For cases where the images exist on disk already IRemoteImageProvider When images are retrieved from a remote service IDynamicImageProvider When you are building the image in code in some way. You can return the image as stream and Emby will handle the saving. If you want images to be refreshed based on other conditions than a change to the item itself, you can implement IHasItemChangeMonitor on the provider. For maximum control, you can create an ICustomProvider. It's not an image provider and you cannot configure its use in the library options, but you can modify all item properties and it runs after all other providers (and image providers). 1 Link to comment Share on other sites More sharing options...
roaku 797 Posted October 19, 2022 Author Share Posted October 19, 2022 (edited) Thanks for the insights @softworkz Taking your advice, I switched over to IDynamicImageProvider. It took some banging of head against wall to get the Task/stream pipeline all worked out, but I'm now able to generate derivative images on metadata refresh for an Extra by overlaying its Name and Type onto its parent's image(s): Lots more to do now. Edited October 19, 2022 by roaku 1 Link to comment Share on other sites More sharing options...
softworkz 3349 Posted October 19, 2022 Share Posted October 19, 2022 I'm glad to hear it works out for you! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now