jurialmunkey / plugin.video.themoviedb.helper

GNU General Public License v3.0
203 stars 96 forks source link

[Feature] Studio/Network logo #860

Closed matke-84 closed 2 years ago

matke-84 commented 2 years ago

Describe the feature that you'd like

Now we currently have a variant to display only the first logo from the list. If the first logo doesn't exist in resource.images.studios or is named differently than the studio from the list we will not get the logo. In skin helper service, it does this, and if the first logo doesn't exist, it chooses the second one. I don't know how, but it works nice. I would like to see something similar in the tmdb helper. Now it happens that a lot of logos are not displayed.

Why is this feature needed? What problem does it solve?

/

Steps to reproduce.

/

Screenshots and Additional Info

/

Checklist

jurialmunkey commented 2 years ago

Got a link to documentation of this feature in SHS?

I can't see how it is possible in any way that doesn't require constant disk reads. The resources:// are texture packed, so inspecting their contents requires unpacking them. Also what happens if the skinner wants to use a different resources:// pack or files shipped with the skin?

I can't see any good way that it could possibly work like that and I have to assume it is doing something that is either slow, very constraining, or very hacky.

jurialmunkey commented 2 years ago

Nevermind, found the docs: https://github.com/kodi-community-addons/script.skin.helper.service/wiki/Listitem-Properties---Studio-logos

jurialmunkey commented 2 years ago

Ah it's a hack. Reads all the filenames in the given directory and generates a whitelist of filenames to use. https://github.com/kodi-community-addons/script.module.metadatautils/blob/b5975e1d5bb53b21869b18ce3110b9c0835f478f/lib/helpers/studiologos.py#L27-L112

I'm not sure that this is a good method. It'll be delayed because you need to wait for the service monitor to do these manipulations rather than just reading directly from the listitem property.

Surely the better approach is to simply add the missing logos to the resource pack. Then everyone benefits from a more complete set rather than using a workaround to avoid adding them...

https://github.com/XBMC-Addons/resource.images.studios.coloured https://github.com/XBMC-Addons/resource.images.studios.white

These get updated relatively regularly by ronie and I'm sure he would appreciate people contributing.

matke-84 commented 2 years ago

Pity. I thought it could be done without consequences. Yes, you are right there is a slight delay but there are a lot of studio logos that are missing with current situation. Even for some very popular movies. It's not really clear to me what's going on for all logos (wrong name, missing logo, empty space in the name...), so thats why is what shs is doing seemed to me like best solution.

matke-84 commented 2 years ago

I found a way to get another available logo. It works well, so if someone wants to, they can use the code.

        <control type="image" id="1234">
        <visible>!String.IsEmpty(Control.GetLabel(1234))</visible>
            <top>46</top>
            <left>-7</left>
                <width>102</width>
                <height>66</height>
            <aspectratio>keep</aspectratio>
                <fadetime>300</fadetime>
        <texture background="true">$VAR[StudioLogoImg]</texture>
        </control>

    <control type="image" id="4321">
        <visible>!String.IsEmpty(Control.GetLabel(4321)) + String.IsEmpty(Control.GetLabel(1234))</visible>
        <top>46</top>
        <left>-7</left>
                <width>102</width>
                <height>66</height>
        <aspectratio>keep</aspectratio>
                <fadetime>300</fadetime>
        <texture background="true">$VAR[StudioLogoImg2]</texture>
    </control>

    <variable name="StudioLogoImg">
        <value condition="!String.IsEmpty(Window(Home).Property(TMDbHelper.ListItem.Network.1.Name))">$INFO[Window(Home).Property(TMDbHelper.ListItem.Network.1.Name),resource://resource.images.studios.coloured/,.png]</value>
        <value condition="!String.IsEmpty(Window(Home).Property(TMDbHelper.ListItem.Studio.1.Name))">$INFO[Window(Home).Property(TMDbHelper.ListItem.Studio.1.Name),resource://resource.images.studios.coloured/,.png]</value>
    </variable>

    <variable name="StudioLogoImg2">
        <value condition="!String.IsEmpty(Window(Home).Property(TMDbHelper.ListItem.Network.2.Name))">$INFO[Window(Home).Property(TMDbHelper.ListItem.Network.2.Name),resource://resource.images.studios.coloured/,.png]</value>
        <value condition="!String.IsEmpty(Window(Home).Property(TMDbHelper.ListItem.Studio.2.Name))">$INFO[Window(Home).Property(TMDbHelper.ListItem.Studio.2.Name),resource://resource.images.studios.coloured/,.png]</value>
    </variable>
jurialmunkey commented 2 years ago

BTW, you do know that you can just get the studio logo directly from TMDb if you're using window properties?

window(home).property(tmdbhelper.listitem.studio.1.icon)
window(home).property(tmdbhelper.listitem.network.1.icon)

There's not really standardised sizing and they can be quite large, but it is definitely an option here. Annoyingly TMDb preferences black logos though, so you'd need to put them on a light background.

matke-84 commented 2 years ago

Yes, I know, but the quality is not the best. But it can pass as a fallback.

Annoyingly TMDb preferences black logos though, so you'd need to put them on a light background.

Skin helper service has a white studio logo. They are much more visible. Look in the code, maybe they can be obtained in the tmdb helper. https://github.com/kodi-community-addons/script.module.metadatautils/blob/abe63b1c9a290058743240239937a86281b593a0/lib/helpers/tmdb.py#L341