Kodi Community Forum

Full Version: Regex to avoid all trailers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to come up with a regex to not sort the trailer structure I have on my NAS. My NAS is primarily setup for MediaBrowser, as I use a lot of cablecard (and everything is protected, so WMC it is on my main, plus XBOX extender) but for my downstairs, I'm playing with XBMC. The good is it seems to all work fine, but when I point it at my network share of movies, it wants to give each "trailer" it's own entry..

they are all stored in MBC format like:
\\storage\action\movie1\
\\storage\action\movie1\trailer\trailer.mov

etc.

In my advancedsettings.xml, located in the userdata folder, I shaped it like this:
<video>
<excludefromscan>
<regexp>[-._ \\/]trailer[-._ \\/]</regexp>
<regexp>[-._ \\/]trailers[-._ \\/]</regexp>
<regexp>[-._ \\/]extras[-._ \\/]</regexp>
<regexp>[-._ \\/]sample[-._ \\/]</regexp>
</excludefromscan>
</video>
<video>
<excludefromlisting> <!-- Regular expressions that if evaluated to true won't be displayed in Files View -->
<regexp>[-\._ ](sample|trailer)[-\._ ]</regexp>
</excludefromlisting>
</video>


But it still wants to bring in the trailers...

Any help appreciated (and yes, I went through the scrapers thread quickly, which turned me onto the regex solution, but I must have some expression here I've goofed)
I don't quite understand your folder structure. Is movie1 a folder, and the name of a movie, and it contains movie1.mkv or something?

If each movie is in a separate folder like that, you can just tell XBMC not to scan recursively. Because your trailers are in subfolders, they would be ignored. Of course, XBMC probably won't know where to find your trailers either.
You're missing <advancedsettings> at the start, and </advancedsettings> at the end.
Ah..

My structure is then to answer the above:

\\storage\action\(moviename)\moviefile in the folder

Then the trailers are

\\storage\action\(moviename)\trailer\trailer.mov

(as an example) which matches with how MBC wants it..

I ended up just saying screw it and deleted all my trailers, so that was 118Gb of space I really didn't need Wink I'm OK with that.. but I will now try the above setting to see if it removes, and I'll just set MetaBrowser to redownload new trailers of ones available if it works.
Ditto those annoying sample files.
Ned-

Your solution was the answer. Worked like a charm, cleaned itself up on a request, and now looks good.