Local Trailer Support
#16
(2018-09-30, 04:32)Karellen Wrote:
Quote:But from what I gather you're mistaken about the naming.
I am speaking generally as I don't know your full setup, so tell me how the video file is named. Of course there is one way to know for sure... test it.      
OK. I tested by playing a movie, selecting trailer, removing movie, re-adding, then selecting trailer again. Debug log shows that it's getting trailer from youtube each time:
:
09:02:21.160 T:4080517712 DEBUG: StartScript - calling plugin YouTube('plugin://plugin.video.youtube/','2','?action=play_video&videoid=XXXXX')]

Trailer file file name is (and I have many in this format):
Movie.YYYY.720p.BluRay.x264-blah[TRAILER-Theatrical Trailer].mp4

(relavent) AdvancedSettings are:

:

<advancedsettings>
<video>
<excludefromscan>
<regexp>[-\._ ](extrafanart|trailer|extrathumbs)[-\._ ]</regexp>
</excludefromscan>
<excludefromscan action="append">
<regexp>/extras/</regexp>
<regexp>[\\/]extras[\\/]</regexp>
</excludefromscan>
<excludefromlisting>
<regexp>[-._ \\/](extrafanart|trailer|extrathumbs)[-._ \\/]</regexp>
</excludefromlisting>
<excludetvshowsfromscan action="append">
<regexp>/extras/</regexp>
<regexp>[\\/]extras[\\/]</regexp>
</excludetvshowsfromscan>
</video>
<trailermatching>
<regexp>(.*?)(trailer)(}|]|\))?(\.[^.]+)$</regexp>
</trailermatching>
</advancedsettings>]

I'm assuming problem with advancedsettings.  Help appreciated on that specifically.  I took the above "excludefromscan" and "excludefromlisting" parts directly from the recommendations regarding Extras addon in the wiki.  I'm assuming there's a problem with the specific exclusion of scanning or listing "trailer".   What's the difference between "scanning" and "listing"?  

FWIW, I see no debug log indication of Kodi looking for a trailer when (re-)adding the movie, let alone finding one.  I wonder if there's a way to query the database (via SSH?) to see if a trailer was found for a movie, instead of trying to inspect the logs?

Ultimate goals are of course:  
1. make sure "trailers" don't get stacked onto main feature (thus the exclusion settings);
2. have "Extras" folder available with official Extras addon,
3. Have Kodi play local trailers that match the given regex, in this case ones that may end with "trailer].ext" or "trailer).ext" etc. (the regex exp. given above should do that with that title).

I have 2 features requests in all this as well:

1. Kodi should look in local folders when chosing to watch a trailer – at least by option – even if one wasn't found initially when adding to library.   Wouldn't be a big resource use problem, as chosing to watch a trailer would be infrequent.   (Removing and readding movies just to achieve this seems unnecessary)
2. Kodi should also look in "Extras" folder for local trailers
Reply
#17
(2018-09-30, 15:39)ctawn Wrote: Movie title is (and I have many in this format):
Move.YYYY.720p.BluRay.x264-blah[TRAILER-Theatrical Trailer].mp4
So you name your movies with Trailer? That is pretty weird. Sorry I cannot assist you any further. Your use case is just too far off left field.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#18
(2018-09-30, 20:29)Karellen Wrote:
(2018-09-30, 15:39)ctawn Wrote: Movie title is (and I have many in this format):
Move.YYYY.720p.BluRay.x264-blah[TRAILER-Theatrical Trailer].mp4
So you name your movies with Trailer? That is pretty weird. Sorry I cannot assist you any further. Your use case is just too far off left field.   
Sorry that's a mistake. That's the trailer file name, of course. Located in the same directory as the movie. (fixed in post #16)
Reply
#19
I'm still looking for a resolution here. My use case is quite ordinary.  All I want is for Kodi to play local trailers when available, while not stacking them onto movies.  I take it that's what it's supposed to do.  The only thing I'm trying to achieve here is for Kodi to consider as trailers files that have the word (or phrase ending in) "Trailer" bracketed, as I described.   I've tested the regex given above (and below) with another RegEx utility, and it matches the file name I specified originally.

So the only issue seems to be in the advancedsettings.xml.  Seems could only be 3 things wrong:  
1) either trailermatching doesn't work at all, or
2) the "Trailer" button doesn't look for any kind of local trailer anyway (which is almost the same thing)
3) I'm not acurately understanding how "excludefromscan" and "excludefromlisting" might affect trailer matching.

So I experimented as follows: 

#1. I took "trailer" out of both excludefromscan & excludefromlisting nodes*.   As expected, the trailer file now shows in the browse files listing.  Somewhat unexpected is that the trailer also does not get stacked onto the movie, even though I'm no longer explicitly excluding it from scan. (Which I thought was the purpose of those exclusions.).  Result:  Local trailer file is still not played.  And still, there's no indication in the log of any kind of recognition of that file let alone an attempt to play it. Youtube video played.

#2.  I renamed the trailer file to end with "…Trailer.mp4" as is supposed to be the default.  Exactly the same results as #1, with the same advancedsettings*.

#3. I kept the trailer file named as in #2.  But this time I took out the entire  "trailermatching" node.  Same results.

#4. I put back the trailermatching node where it was as in #1 & #2, but changed the regex to almost exactly what it says in the wiki.  Just changed the "(_Trailer)" part to simply "(Trailer)" because now I'm trying to match ending with "Trailer.mp4" not "_Trailer.mp4".  (This regex also tested in utility.)  Same results.

#5. [edit] I moved the entire "trailermatching" node, with the original regex, to after the video node (as I saw in another thread).  Changed trailer file name back to what it was.  Same result.  In inspecting the logs, it seemed Kodi was pulling the youtube trailer URL from IMDB, because it found an .nfo file in that directory that had the IMDB URL to the movie.  That was an ah so moment, but… 

#6. Leaving that node and the file name as in #5, I renamed the .nfo file to .nfo.bak.   Again (as in each step above), I removed movie from library and re-added it.  Same result.  Interestingly, from the log I could not determine where Kodi was getting the youtube video URL.  (Previously it was clearly coming from .nfo file via IMDB URL, now it's not reading that .nfo file, and the first reference to the trailer's videoid ("dQw4w9WgXcQ" – changed for this post) is on call to plugin.video.youtube from context.trailer addon.) So where did that come from?:

Code:
23:56:38.671 T:3307238144    INFO: CPythonInvoker(33, /home/osmc/.kodi/addons/context.trailer/addon.py): script successfully run
23:56:38.703 T:4074492496   DEBUG: StartScript - calling plugin YouTube('plugin://plugin.video.youtube/','2','?action=play_video&videoid=dQw4w9WgXcQ')

Conclusions:
1) trailer matching doesn't work at all.
2) Debug log needs to better log where it gets trailer files or URLs to play, i.e. exactly when a trailer match occurs.

Thoughts (edit):
maybe it really doesn't work.  but maybe it might have if everything was right the first time, but since it found the IMDB URL, it used that, and persists in storing (in some kind of index) the resulting youtube URL independent of whether movie remains in the library.  So removing it and adding again never looks for a local option.

* Experiment #1 & #2 (and #3 & #4 with either no trailermatching node or a near default one):
Code:

<video>
        <trailermatching>
            <regexp>(.*?)(trailer)(}|]|\))?(\.[^.]+)$</regexp>
        </trailermatching>
        <excludefromscan>
            <regexp>[-\._ ](extrafanart|extrathumbs)[-\._ ]</regexp>
        </excludefromscan>
        <excludefromscan action="append">
            <regexp>/extras/</regexp>
            <regexp>[\\/]extras[\\/]</regexp>
        </excludefromscan>
        <excludefromlisting>
            <regexp>[-._ \\/](extrafanart|extrathumbs)[-._ \\/]</regexp>
        </excludefromlisting>
        <excludetvshowsfromscan action="append">
            <regexp>/extras/</regexp>
            <regexp>[\\/]extras[\\/]</regexp>
        </excludetvshowsfromscan>
    </video>
Reply
#20
@ctawn were you ever able to resolve this issue?

FYI, I have a fresh install of Kodi v18.1 that I just uploaded media to, including movies. I tried the default <movie name>-trailer.ext approach in the same directory as a single movie file, then flushed and re-loaded Kodi's movie database. I then attempted to play the trailer, via the Context menu. It worked.

YMMV, but I wonder if you've attempted to make it work on your system with stock settings and a fresh install. Often not a preferred choice for most folks, but from a QA perspective it eliminates doubt when starting from as bone-stock of a position as possible when testing features/functionality.

Also, based on my experimentation, it appears in order to get trailers to work with ripped DVDs in the DVD file structure (i.e. VIDEO_TS sub-directory), one must place the trailer inside the VIDEO_TS folder and name it VIDEO_TS-trailer.ext; a process I personally find less than intuitive. Actually, the whole trailer process is not intuitive, period. It's also quite time consuming to discover this type of information. This is an area where Kodi could benefit from improved documentation (or at least consolidated documentation on the subject of trailers).

All that said, I do share your desire for the ability of Kodi to natively support multiple trailers assigned to a single work of art. Although I can do it (more or less) via the Extras add-on, this results in additional steps to play trailers and Extras is limited to presenting filenames to the user, which is less than ideal with regards to a media/cinema experience. Just my 2 cents. The bottom line is for now - from what I have observed - the process appears to be WAD (Working As Designed). Oo
Headless Linux Kodi box [Ubuntu 16.04.6 LTS Server] | Dedicated Media Server [Ubuntu 16.04.6 LTS Server]
Reply

Logout Mark Read Team Forum Stats Members Help
Local Trailer Support1