PlexKodiConnect icon indicating copy to clipboard operation
PlexKodiConnect copied to clipboard

Prefer kodi trailers over Plex

Open xenophobentx opened this issue 3 years ago • 7 comments

As with matrix many skins support trailer autoplay all of them expecting youtube urls, which works flawlessly but kodikonnect triggers fullscreen play which breaks skins funcionality.

As plex kodikonnect already scraping missing trailers for synced content it would be great to have such options to prefer kodi trailers in kodiconnect.

Feathub errors for me whole day thats why opening here sorry for that.

xenophobentx avatar Jan 29 '22 14:01 xenophobentx

Actually currently hacking by modifing the if statement of your trailer collection. And wow your solution is mutch better than plex at it is getting trailers for me in my native language due to it getting the settings.getSettingString('searchlanguage') from the scraper. I got way superior results that i had with the plex auto trailer collection.

xenophobentx avatar Jan 30 '22 14:01 xenophobentx

Nice! What exactly did you modify?

croneter avatar Jan 30 '22 14:01 croneter

Well actually just for experimental, i saw that your are checking the trailer property prefix for plugin:// and adjusted this to garbage like (plugin1://) therefore collection happens. That way it updated all my library with the preferred trailers, but assume that means itt will always trigger the collection that's bad. I wish i would have to knowledge to implement such thing properly.

Maybe adding to check if the prefix is plugin://plugin.video.youtube that means it will always use kodi scraper

xenophobentx avatar Jan 30 '22 15:01 xenophobentx

Yep it seems that works is the prefix check is changed to that:

if trailer and (trailer.startswith(f'plugin://plugin.video.youtube') or not refresh): # No need to get a trailer

Quick question does trailers only collected if additional artwork is enabled?

EDIT: Actually not really working for all scenarios maybe for initial sync? Unfortunately don't understand how the trailer collection works but trying. Somehow trying to achieve to update if no youtube url is stored in the item trailer property. But no real experience with phyton. :(

xenophobentx avatar Jan 30 '22 15:01 xenophobentx

ok that way i can update them during refresh artwork:

Adjusted: resources/lib/library_sync/additional_metadata_tmdb.py to do a lookup even on refresh artwork:

    with KodiVideoDB() as kodidb:
        trailer = kodidb.get_trailer(db_item['kodi_id'],
                                     db_item['kodi_type'])
    if trailer and (trailer.startswith(f'plugin://plugin.video.youtube')):
        # No need to get a trailer

Kind of hacky but really happy with the results as now my library full of goergeous hungarian trailer links which autoplay in the background after 3 sec of focus on a movie with artic zephyr reloaded skin. Real netflix experience. :) see it in action: https://www.youtube.com/watch?v=uDLpnNzYqyE

Ok now the question is that how to trigger this one during item addition from plex? That only works if i refresh all artwork after library sync.

xenophobentx avatar Jan 30 '22 19:01 xenophobentx

Ok, so after many trial and error it seems that during initial sync the trailer_synced plexdb column is set true. Therefore it will not auto lookup with the async additional data collection therefore the real hack is to set the Movie item definition to a fixed trailer_synced=0 that way itt will trigger trailer collection during initial sync aswell.

xenophobentx avatar Jan 31 '22 16:01 xenophobentx

Ok, so after many trial and error it seems that during initial sync the trailer_synced plexdb column is set true. Therefore it will not auto lookup with the async additional data collection therefore the real hack is to set the Movie item definition to a fixed trailer_synced=0 that way itt will trigger trailer collection during initial sync aswell.

I'm currently trying to get trailer autoplay working with the Netflix views in Arctic zephyr: reloaded skin on Kodi Nexus (in conjunction with PKC). What actual file do I access to make this trailer_synced=0 change in order for trailer collection to happen immediately when new media is added? It's somewhat irritating to have to force an artwork refresh in order for trailer autoplay to work correctly. In a perfect world, a "hack" wouldn't be necessary, and there would be a toggle in PKC settings to 'prefer kodi trailers' so that I can use autoplay trailers without having to completely disable trailer collection on my Plex server. @xenophobentx @croneter

noakd8601 avatar Dec 27 '23 22:12 noakd8601