Android How do I exclude "Trailer.*" from video library?
#1
Question 
Device: Amazon Fire TV Stick
Kodi version: 17 "Krypton" beta
Data source: SMB, connected to my NAS

My movie folder structure consists of one folder per movie under which I typically have the following files:
  • Movie_Name.avi
  • Trailer.mp4
  • Poster.jpg

I want to exclude all "Trailer.*" files from my library. Following this wiki, I created the following advancedsettings.xml file and placed it in my Fire TV Stick's "Android/data/org.xbmc.kodi/files/.kodi/userdata/" folder, as per this other wiki.

Code:
<advancedsettings>
    <video>
        <excludefromscan>
            <regexp>^(?i)trailer\..+$</regexp>
        </excludefromscan>
        <excludefromlisting>
            <regexp>^(?i)trailer\..+$</regexp>
        </excludefromlisting>
    </video>
</advancedsettings>

I even tried a more restrictive, but also more straightforward regex that matches exactly the name of my trailer files, including capitalization, all with the same result.

Code:
<advancedsettings>
    <video>
        <excludefromscan>
            <regexp>Trailer\.mp4</regexp>
        </excludefromscan>
        <excludefromlisting>
            <regexp>Trailer\.mp4</regexp>
        </excludefromlisting>
    </video>
</advancedsettings>


However, nothing changes. I have tried all of the following to no avail:
  • Restarting Kodi
  • Rebooting my Fire TV Stick
  • Refreshing my library
  • Cleaning my library
  • Completely removing and readding my library

By the way, whether I have an advancedsettings.xml file or not, the trailer files only show in the main Kodi screen where you see Movies, TV Shows, Music, etc. on the left-side menu and you see sections "Recently added movies", "Unwatched movies", etc. If I actually click on Movies to go to the main movie list, the trailers never show, with or without these changes above. You can see that in these screenshots below.

Image

Image

Any other ideas?
Reply
#2
Add this to your advanced settings file, it excludes trailers, extrafanart, and extrathumbs from the scan and from the listing. You can add more as long as there is a | between and it's case sensitive.

Code:
<advancedsettings>
<video>
<excludefromscan>
<regexp>[-\._ ](extrafanart|trailer|extrathumbs)[-\._ ]</regexp>
</excludefromscan>
<excludefromlisting><!-- Regular expressions that if evaluated to true won't be displayed in Files View -->
<regexp>[-._ \\/](extrafanart|trailer|extrathumbs)[-._ \\/]</regexp>
</excludefromlisting>
</video>
</advancedsettings>
Reply
#3
(2016-12-23, 04:07)PatK Wrote: Add this to your advanced settings file, it excludes trailers, extrafanart, and extrathumbs from the scan and from the listing. You can add more as long as there is a | between and it's case sensitive.

Just tried that. Didn't work. Right after replacing the xml file with the updated version, I went to Settings > Media Settings > Library > Clean Library... No change. I then turned off Kodi and went back in. The trailers are still there. The only difference I notice now is that some were actually identified as the movie, meaning I have 2 identical thumbnails for some movies now, one of which is the movie and the other one, the trailer. I know because I am going into the Information window and place the mouse on the Refresh button, which tells me the file name.

By the way, I mentioned this in my OP above, plus it's also visible in the screenshots. This only happens in the Kodi home page. Whenever I click on Movies, no trailers every show. And this was the case even before I created an advancedsettings.xml file. Is that normal?

I've also made sure several times I'm placing the file in the right location. Here:

Image

Thank you for trying to help!
Reply
#4
Check your debug log to ensure the advanced settings file is being loaded, it looks like you have the correct location but might be in a different spot if it's a win 10 from the windows store version. I did run into this in the past and once the -trailers are scanned in as videos and you have meta-data for it, you'll have to manually delete or clean out on rescan to get rid of the 'extras', the the scripts should preclude anything new... Take a trailer, rename it to something that has no trailer... insert it into the folder and do a trail scrape, if it shows up with a cover, then your advanced setting is not working.

A proper debug log (wiki) will show the advancedsettings file and if it loads... I've amended the 'code' I left in the previous message, use that as the sole advanced settings text and make sure you call it advancedsettings.xml Should be easy to make a smart playlist for -trailer and start deleting.
Reply
#5
(2016-12-23, 05:25)PatK Wrote: Check your debug log to ensure the advanced settings file is being loaded, it looks like you have the correct location but might be in a different spot if it's a win 10 from the windows store version. I did run into this in the past and once the -trailers are scanned in as videos and you have meta-data for it, you'll have to manually delete or clean out on rescan to get rid of the 'extras', the the scripts should preclude anything new... Take a trailer, rename it to something that has no trailer... insert it into the folder and do a trail scrape, if it shows up with a cover, then your advanced setting is not working.

A proper debug log (wiki) will show the advancedsettings file and if it loads... I've amended the 'code' I left in the previous message, use that as the sole advanced settings text and make sure you call it advancedsettings.xml Should be easy to make a smart playlist for -trrailer and start deleting.

The file does seem to be loaded, as you can see here in the log. I actually shut off Kodi and reopened so that it would start a new log. I checked the time and I'm looking at the right log. The file location is fine. By the way, this is Android (Fire TV Stick), not Windows. You mentioned Windows 10.The exact path is \Android\data\org.xbmc.kodi\files\.kodi\temp\kodi.log.

Image

The trailers are still there. So, instead of deleting them, I removed my entire library... Gone. I then added a single folder that only had a movie file and a trailer file to use this as test and they're both still showing, as you can see here.

Image

It looks like the advancedsettings.xml file is getting loaded, but it's doing nothing. Sad Potential bug in Krypton?
Reply
#6
Quote:By the way, I mentioned this in my OP above, plus it's also visible in the screenshots. This only happens in the Kodi home page. Whenever I click on Movies, no trailers every show. And this was the case even before I created an advancedsettings.xml file. Is that normal?

I'm leaning towards the actual skin widget being the culprit more then anything else.
Reply
#7
Looking back at the first message I see "My movie folder structure consists of one folder per movie under which I typically have the following files: Movie_Name.avi Trailer.mp4 Poster.jpg"I'm wondering if the naming convention is followed,

Media\Movies\Movie Name (2013)
Movie Name (2013).ext
Movie Name (2013)-trailer.ext

I did go to the effort of scraping in a local hires -trailer with a new movie using Krypton and couldn't replicate your issue.
Reply
#8
(2016-12-23, 18:16)PatK Wrote: Looking back at the first message I see "My movie folder structure consists of one folder per movie under which I typically have the following files: Movie_Name.avi Trailer.mp4 Poster.jpg"I'm wondering if the naming convention is followed,

Media\Movies\Movie Name (2013)
Movie Name (2013).ext
Movie Name (2013)-trailer.ext

I did go to the effort of scraping in a local hires -trailer with a new movie using Krypton and couldn't replicate your issue.

All of my trailer files are named "Trailer.mp4" (sometimes different extension, but the name is ALWAYS Trailer). That's why the name in my OP was "Trailer.mp4" and not "Movie_Trailer.mp4" or "Movie-Trailer.mp4" and why the two versions of the advancedsettings.xml file in that post read "<regexp>^(?i)trailer\..+$</regexp>" and "<regexp>Trailer\.mp4</regexp>". Even then, I still got the trailers to scan and to list and I also removed and readded my entire library when testing those two advancedsettings.xml files, unsuccessfully.

I know I'm asking a lot of you, but could you name your trailer "Trailer.mp4" and see if you can replicate this condition in Krypton please? Short of going through my hundreds of trailer files and renaming them to something I personally don't like, I'm not sure what else to do.

Unrelated story... I also own a Boxee Box and also have my movie library looking at the same NAS directory and, without making any type of special configuration, SOMEHOW, it knows not to scan or list these trailer files. How? I have no idea. File size perhaps? I'm not home now, so I can't check, but I think I remember a setting that says "Ignore video files smaller than 50 MB", where 50 is the default, but it can be configured.

Thank you again!
Reply
#9
(2016-12-23, 15:54)helta Wrote: I'm leaning towards the actual skin widget being the culprit more then anything else.

Huh... Would you suggest I switch to a different skin and see if I can replicate the issue? If I remember correctly, I have the Krypton default.
Reply
#10
Quote:All of my trailer files are named "Trailer.mp4" (sometimes different extension, but the name is ALWAYS Trailer). That's why the name in my OP was "Trailer.mp4" and not "Movie_Trailer.mp4" or "Movie-Trailer.mp4" and why the two versions of the advancedsettings.xml file in that post read "<regexp>^(?i)trailer\..+$</regexp>" and "<regexp>Trailer\.mp4</regexp>". Even then, I still got the trailers to scan and to list and I also removed and readded my entire library when testing those two advancedsettings.xml files, unsuccessfully.

I know I'm asking a lot of you, but could you name your trailer "Trailer.mp4" and see if you can replicate this condition in Krypton please? Short of going through my hundreds of trailer files and renaming them to something I personally don't like, I'm not sure what else to do.
Of course if I name the movie trailer to "Trailer.avi" it's going to scan in as a movie.... If I use Movie-Trailer.avi it's still going to scrape in as another movie... (case is important). In one of your examples of advanced settings, case was an issue, the other had Trailer\.mp4 not just "Trailer" Why not take my proven example, change the case on the word "trailer" to "Trailer" and see if that will handle it, I've found that the - minus symbol seems to be an active participant in some way and you might have to preface the word with it, but try it out on a few (copy the movie out of the library complete with trailer, delete and clean-up the library re-insert and scrape manually and see if you get one or two?

I do note the wiki shows

<trailermatching>
<!-- This regexp will match moviename_Trailer.avi -->
<regexp>(.*?)(_Trailer)(\.[^.]+)$</regexp>
</trailermatching>

and naming has changed from what you posted Artwork (wiki)
Reply
#11
(2016-12-24, 05:25)PatK Wrote: Of course if I name the movie trailer to "Trailer.avi" it's going to scan in as a movie.... If I use Movie-Trailer.avi it's still going to scrape in as another movie... (case is important). In one of your examples of advanced settings, case was an issue, the other had Trailer\.mp4 not just "Trailer" Why not take my proven example, change the case on the word "trailer" to "Trailer" and see if that will handle it, I've found that the - minus symbol seems to be an active participant in some way and you might have to preface the word with it, but try it out on a few (copy the movie out of the library complete with trailer, delete and clean-up the library re-insert and scrape manually and see if you get one or two?

The thing is I have hundreds of trailers, all named "Trailer.mp4". I am looking for a way to have Kodi ignore these when scanning and listing and, by definition, there should be a way to configure advancedsettings.xml to do just this that doesn't require me renaming my files. That's all I am trying to do, meaning I'd rather not reference the Kodi naming standards unless absolutely necessary, mostly because it'll cost me a lot of manual renaming to get there.

The first regex I provided reads "^(?i)trailer\..+$". From what I know, (?i) makes the entire regex that follows case-insensitive. The second regex reads "Trailer\.mp4". That should match "Trailer.mp4". In fact, I used regex101.com to test both and they both should work.

Here's the thing... I've been doing all that on my Fire TV Stick. I just got a Fire TV (the box) and haven't added anything. I am going to start over and play with all this and come back and report progress. However, if you can think of anything else, I can't thank you enough.

UPDATE: The following advancedsettings.xml worked like a charm. My library was fully added and no trailers.

Code:
<advancedsettings>
  <video>
    <excludefromscan>
      <regexp>[Tt][Rr][Aa][Ii][Ll][Ee][Rr]</regexp>
    </excludefromscan>
    <excludefromlisting>
      <regexp>[Tt][Rr][Aa][Ii][Ll][Ee][Rr]</regexp>
    </excludefromlisting>
  </video>
</advancedsettings>

Thank you for all of your help!!!
Reply
#12
Seasons greetings, just hope anything else is not excluded.
Reply
#13
Well, I did try adding ^ at the beginning, to make sure the T from Trailer is the first letter in the name, but that didn't work and trailers were scanned and listed. So I'm praying no movie has "Trailer" in the name. LOL
Reply



Logout Mark Read Team Forum Stats Members Help
How do I exclude "Trailer.*" from video library?0
This forum uses Lukasz Tkacz MyBB addons.