Montellese / mediaimporter.emby

Media importer add-on for Kodi to import items from Emby servers into Kodi
GNU General Public License v2.0
12 stars 3 forks source link

No artwork mapped to thumb for music videos #16

Closed Long-Man closed 4 years ago

Long-Man commented 4 years ago

mediaimporter.emby does not map any music video artwork from Emby to thumb in Kodi, while Emby for Kodi does. The result is that no artwork shows on widgets and VideoInfo.xml

MediaImporter

def _mapArtwork(embyServer, itemId, itemObj):
        artwork = {}
        images = itemObj.get(PROPERTY_ITEM_IMAGE_TAGS)
        if images:
            Api._mapSingleArtwork(embyServer, artwork, itemId, images, PROPERTY_ITEM_IMAGE_TAGS_PRIMARY, 'poster')
            Api._mapSingleArtwork(embyServer, artwork, itemId, images, PROPERTY_ITEM_IMAGE_TAGS_LOGO, 'clearlogo')
            Api._mapSingleArtwork(embyServer, artwork, itemId, images, PROPERTY_ITEM_IMAGE_TAGS_ART, 'clearart')
            Api._mapSingleArtwork(embyServer, artwork, itemId, images, PROPERTY_ITEM_IMAGE_TAGS_BANNER, 'banner')
            Api._mapSingleArtwork(embyServer, artwork, itemId, images, PROPERTY_ITEM_IMAGE_TAGS_THUMB, 'landscape')
            Api._mapSingleArtwork(embyServer, artwork, itemId, images, PROPERTY_ITEM_IMAGE_TAGS_DISC, 'discart')

        images = itemObj.get(PROPERTY_ITEM_BACKDROP_IMAGE_TAGS)
        if images:
            artwork['fanart'] = embyServer.BuildImageUrl(itemId, 'Backdrop/0', images[0])

        return artwork

Emby for Kodi

def add(self, artwork, *args):
''' Add all artworks.
'''
KODI = {
'Primary': ['thumb', 'poster'],
'Banner': "banner",
'Logo': "clearlogo",
'Art': "clearart",
'Thumb': "landscape",
'Disc': "discart",
'Backdrop': "fanart"
}
Montellese commented 4 years ago

Based on the feedback from @enen92 it sounded to me like it's the job of the skin to choose the proper (and available) artwork. So I'm not sure if this needs to be fixed in the skin or in mediaimporter.emby.

Long-Man commented 4 years ago

Can confirm that it can be fixed in the skin.
The interesting thing is
!String.IsEqual(listitem.dbtype,musicvideo) is used to deliberately not display a poster for music videos. removing it solves the problem. It appears that poster is displayed for movies, tv shows and seasons while thumb is used for music videos and episodes

enen92 commented 4 years ago

Does this happen in estuary? @Long-Man What skin is it?

sualfred commented 4 years ago

@Montellese Without checking it by myself (too late), music video Primary should be mapped to Thumb and not to Poster.

Long-Man commented 4 years ago

Yes. It is Estuary

Long-Man commented 4 years ago

InfoWallThumbVar in Variables.xml for the Widgets

There is a separate group for music video in DialogVideoInfo.xml to be visible with String.IsEqual(ListItem.DBType,musicvideo

Long-Man commented 4 years ago

Viewtype Wall - No Art Shift - Art InfoWall - No Art WideList - Art

Montellese commented 4 years ago

I always thought the proper artwork types are:

and thumb is just a default selected from one of the above. This also seems to be what @enen92 said (unless I misunderstood). But in case of my music video library (which I've never spent any time on) it looks like thumb has its own image even though the format would correspond to landscape.

Don't get me wrong: adding thumb to the artwork table is no problem but I don't want to break other skins which handle this differently.

sualfred commented 4 years ago

From my understanding ( @enen92 pls correct me if I'm wrong): ListItem.Icon is ListItem.Art(thumb) - or if empty DefaultXXX.png - and only the fallback from ListItem.Art(poster) to ListItem.Art(thumb) (if empty) has been removed for better skinning handlings. ListItem.Art(thumb) can be everything like a 1:1, 4:3 or 16:9 image. eg addon icons (usually 1:1 ratio) or episode thumbs (usually 4:3 or 16:9 ratio).

enen92 commented 4 years ago

No, thumb is a valid artwork, is the thumbnail of the item. According to the views of estuary it looks like it is the default artwork displayed in music videos views: https://kodi.wiki/view/Music_videos (I don't have any to be honest). According to longman description of someviews working and others not working, I think the problem is that the views of the skin that are using thumb are showing no artwork and others (that use other art types) work fine. From the add-on side I think you'll need to also fill the thumb if available.

In fact artwork is just a map, you can assign any other items to the map and they'll be available to consumers (ofc it depends on the skin).

The only thing that was removed in v19 was the internal definition of thumb (to poster and banner) if it was not defined in the first place.

@sualfred has a few musicvideos in emby and is a skinner, maybe he can help better than I can (at least saving me the time to set up all this to reproduce the issue)

enen92 commented 4 years ago

That's it @sualfred (my comment was being written while you posted)

sualfred commented 4 years ago

@Montellese

Yep, ListItem.Art(thumb) is not filled, but ListItem.Art(poster). This has to be changed. If the server is locally available Kodi is extracting the thumb on its own from the file.

sualfred commented 4 years ago

@Montellese Same applies for episodes. Their Primary value is filled to poster instead of thumb