Exclude from listing and trailer matching doesn't work in advancedsettings.xml
#1
Information 
I am trying to exclude trailer files from showing up as duplicate movies. I tried a bunch of regexp options that I checked for validity via one of the regexp checkers online. At this point I added a bunch of regexp variation to try to match but I still get duplicates after even removing the source, cleaning the library and re-adding it. My filesystem is as follows:

Movies/{name} {year}/{original_filename}.{ext}
Movies/{name} {year}/Trailer.mov

Many of my movies are not matched but I will solve that later by adding nfo's or adding brackets around the year. The movies that are matched and have a "Trailer.mov" file appear as duplicates one playing the trailer another the actual movie.

Here's my entire advancedsettings.xml file:

Code:
<advancedsettings>
    <tvshowmatching action="prepend">
        <regexp>Season[\._ ]([0-9]+)[\\/]([0-9]+)([^\\/]*)$</regexp>
        <regexp defaultseason="0">Specials[\\/]()([0-9]+)([^\\/]*)$</regexp>
    </tvshowmatching>
    <tvmultipartmatching>^[-_EeXx&]+([0-9]+)</tvmultipartmatching>
    
    <trailermatching>
        <!-- This regexp will match trailer.avi -->
    </trailermatching>
    
    <video>
        <excludefromlisting>
            <regexp>Trailer.mov</regexp>
            <regexp>/trailer\.[a-z]{2,4}/i</regexp>
            <regexp>(sample|trailer)</regexp>
            <regexp>#recycle</regexp>
            <regexp>[-\._ ](sample|trailer)[-\._ ]</regexp>
        </excludefromlisting>
        
        <excludefromscan>
            <regexp>#recycle</regexp>
        </excludefromscan>
        
        <excludetvshowsfromscan>
            <regexp>#recycle</regexp>
        </excludetvshowsfromscan>
        
        <pictureexcludes>
            <regexp>#recycle</regexp>
        </pictureexcludes>
    </video>
</advancedsettings>


Can anyone see any issues anywhere? I also tried adding regexp to excludefromscan and trailermatching with no success. I am out of ideas and it's been a couple of years since I've tried to get local trailers to work and now I can't even get the duplicates removed... Any ideas greatly appreciated. Huh
Reply
#2
Did you save the file as utf-8?
ASUS Chromebox M004U (LibreELEC 8.2/Aeon Nox SiLVO)--->HDMI--->Onkyo TX-NR646--->HDMI--->Panasonic P65VT30
Reply
#3
Here's my advancedsettings.xml-

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<advancedsettings>
    <video>
        <excludefromscan>
            <regexp>-trailer</regexp>    
        </excludefromscan>
        <excludetvshowsfromscan>
            <regexp>-trailer</regexp>
        </excludetvshowsfromscan>
    </video>
</advancedsettings>

This works for my file names. They're a little different from yours though. Each movie and trailer in the same folder with associated art.

Image

Not sure how much help this is. I realize it may be a lot of work to change your file structure, but this definitely works.

Also notice you don't have the xml version/encoding header. Not sure if it's required, I've just always used it. Might be worth a try. If you turn on debug logging you can restart your htpc and check the log. Near the top it'll show what's in your advancedsettings.xml file, just to be sure it's actually being read.
ASUS Chromebox M004U (LibreELEC 8.2/Aeon Nox SiLVO)--->HDMI--->Onkyo TX-NR646--->HDMI--->Panasonic P65VT30
Reply
#4
Thanks for your post. My advancedsettings.xml file was encoded as ansi before. Saving it as utf8 did not fix the issue however. After a LOT of testing I got the excludelisting to work but only with literal term "Trailer.mov". More advanced term did not work: "/trailer\.[a-z]{2,4}/i". In this case it seems that case insensitive parameter causes an issue. I guess will just have to list several possibilities manually...

I also discovered that trailermatching is completely broken and ignores any regexp no matter how simple. Even the wiki example does not work. I bet your advancedsettings.xml doesn't work either, the only reason you don't get duplicates is because "moviename-trailer.ext" naming convention is hard coded and will work without the advancedsettings.xml file. It would be good to confirm this to rule out the possibility that this issue is only present in a certain versions of XBMC. Can you delete your advancedsettings.xml file, restart XBMC, rescan and clean library to confirm? There should be no changes at all.
Reply
#5
Tested as you requested. Added a new file-

Image

Here's what I got after changing advancedsettings.xml-

Image

I don't believe that the regexp is hardcoded. Kodi failed to recognize the trailer.


Also, did you check your debug log as I suggested just to be sure that the app is actually reading your advancedsettings file? Maybe still some encoding problem.
ASUS Chromebox M004U (LibreELEC 8.2/Aeon Nox SiLVO)--->HDMI--->Onkyo TX-NR646--->HDMI--->Panasonic P65VT30
Reply
#6
The log does show the contents of advancedsettings.xml file now and even before utf8 encoding. My XBMC version was actually 12.2 now I updated to 13.2 but still same issue. I also tried on windows 8 pc with no change. What version are you using? Also when I said it's hard coded I meant the trailer matching part. You don't have that in your file and it still works or so I assumed. When you click trailer does it play your locally stored trailer or a youtube stream? Did that change when you removed advancedsettings.xml file?

Can you try using my advancedsettings.xml file?

Here it is:

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<advancedsettings>
    <video>
        <trailermatching>
            <!-- This regexp will match trailer.avi -->
            <trailermatching>
                <!-- This regexp will match moviename_Trailer.avi -->
                <regexp>Trailer.mov</regexp>
                <!--<regexp>(.*?)(_Trailer)(\.[^.]+)$</regexp>
                <regexp>(Trailer|trailer)\.[a-z]{2,4}</regexp>-->
            </trailermatching>
        </trailermatching>
        <excludefromscan>
            <regexp>(Trailer|trailer)\.[a-z]{2,4}</regexp>
            <!--<regexp>Trailer.mov</regexp>-->
        </excludefromscan>
        <excludefromlisting>
            <!-- Regular expressions that if evaluated to true won't be displayed in Files View -->
            <regexp>[-\._ ](sample|trailer)[-\._ ]</regexp>
        </excludefromlisting>
        <excludetvshowsfromscan>
            <regexp>[!-._ \\/]sample[-._ \\/]</regexp>
        </excludetvshowsfromscan>
        <excludefromlisting>
            <!-- Regular expressions that if evaluated to true won't be displayed in Files View -->
            <regexp>[-\._ ](sample|trailer)[-\._ ]</regexp>
        </excludefromlisting>
    </video>
    
    <videolibrary>
        <cleanonupdate>true</cleanonupdate>
    </videolibrary>
    <showexitbutton>true</showexitbutton>
    <splash>false</splash>
</advancedsettings>

If it causes issues try leaving just the trailermatching part. If it still causes issue then it must be an issue with the file... Also XBMC seems to cache stuff pretty persistently, at least with v12.2, the only way to completely refresh was to remove the source, clean, reboot, re-add and then re-scan...
Reply
#7
(2014-10-12, 04:11)DominicM Wrote: The log does show the contents of advancedsettings.xml file now and even before utf8 encoding. My XBMC version was actually 12.2 now I updated to 13.2 but still same issue. I also tried on windows 8 pc with no change. What version are you using? Also when I said it's hard coded I meant the trailer matching part. You don't have that in your file and it still works or so I assumed. When you click trailer does it play your locally stored trailer or a youtube stream? Did that change when you removed advancedsettings.xml file?

You are correct that you don't need this for trailer matching. I'm using a Mac Mini and a MacPro and have never had a problem with trailers. Never had to use any special code for file matching as long as I followed the file naming convention shown in the screenshot above. In file view my trailers are listed (as a trailer) but not checked. So I guess if you don't want to see them at all you should use <excludefromlisting></excludefromlisting>. The rest of the regexp's are completely unnecessary. <cleanonupdate> should also be unnecessary with vs 13.2. It is now hardcoded I think.

Have you tried trailer matching without the regexp's in your advancedsettings.xml file? You do have to restart xbmc any time you make changes to the file, and you have to clean and rescan your library when trying to detect a trailer (or refresh the listing). If you haven't already, you should setup a small testing source with just one or two videos. Scanning and refreshing will be much faster.

I created a basic advancedsettings file- https://www.dropbox.com/s/gqeb8utcfr04ob...s.xml?dl=0
It just contains the exclusions for trailers. Why don't you download it and give it a try just to be sure this problem isn't being caused by encoding errors with the file you're using now.
ASUS Chromebox M004U (LibreELEC 8.2/Aeon Nox SiLVO)--->HDMI--->Onkyo TX-NR646--->HDMI--->Panasonic P65VT30
Reply
#8
When you say trailers are listed but not checked do you mean you get local trailer playback when you click "trailer" on movie info page? The listing of duplicated due to trailers is actually working for me now. I no longer get duplicates with my advancedsettings.xml above. I wouldn't say the rest of the settings are unnecessary as it will unlist samples and other stuff but it is not essential.

To clarify the only thing that doesn't work with the above advancedsettings.xml is the trailer matching. When I play a trailer it streams from youtube instead of a local video. trailermatching doesn't seem to work at all. If i have "Trailer.mov" trailer file and the same regexp literal string it should work. The only way it works if it is named moviename-trailer.ext. In this case it works without trailermatching tag at all.
Reply
#9
(2014-10-12, 18:56)DominicM Wrote: When you say trailers are listed but not checked do you mean you get local trailer playback when you click "trailer" on movie info page? The listing of duplicated due to trailers is actually working for me now. I no longer get duplicates with my advancedsettings.xml above. I wouldn't say the rest of the settings are unnecessary as it will unlist samples and other stuff but it is not essential.

To clarify the only thing that doesn't work with the above advancedsettings.xml is the trailer matching. When I play a trailer it streams from youtube instead of a local video. trailermatching doesn't seem to work at all. If i have "Trailer.mov" trailer file and the same regexp literal string it should work. The only way it works if it is named moviename-trailer.ext. In this case it works without trailermatching tag at all.

When I said "not checked" I meant there is no check mark next to the trailers in file view. I believe that means they haven't been added to the library as movies. When I push the trailer button they do get played. All my trailers are named as moviename-trailer.ext since that is the format that was recommended to me and I have never had any problems with it. Had to rename about a thousand trailers to get it setup but that may be your best option as well.

The only other idea I have (wild guess) would be to set your video source to use the folder names rather than file names with the same trailer matching. I'm doubtful that this will make a difference but haven't tested it. Might cause more problems than it cures.
ASUS Chromebox M004U (LibreELEC 8.2/Aeon Nox SiLVO)--->HDMI--->Onkyo TX-NR646--->HDMI--->Panasonic P65VT30
Reply
#10
My video source is already using forder names. My file names have their original download filename and folders have a proper movie name and year so I have to use folder names. I always done it this way with no issues. It didn't matter if trailer name matched filename or fodername, it looks like it checks both no matter what.

It's a real shame that users have to change their way of doing things instead of software adapting to users... Trailer matching must have been broken for years since I couldn't get it to work 2 years ago either...

As a last check to make sure it's not just my set up could you rename one of your trailers to "Trailer.mov" and add trailer matching to the advancedsettings.xml?

Code:
<trailermatching>
<regexp>Trailer.mov</regexp> <!-- or whatever extension your trailer is in -->
</trailermatching>
Reply
#11
I'll give it a shot later but I doubt it will work. The wiki is little vague regarding trailer matching but the way I read it, you can only change the append- moviename_trailer or moviename.trailer or moviename-trl etc. I could be wrong though, it's happened before. Big Grin once or twice Big Grin
ASUS Chromebox M004U (LibreELEC 8.2/Aeon Nox SiLVO)--->HDMI--->Onkyo TX-NR646--->HDMI--->Panasonic P65VT30
Reply
#12
I might be looking at different wiki, can you post a link?
Reply
#13
Gave it a test. The exclusion works-
Code:
<regexp>trailer</regexp>

Couldn't get trailer matching to work though. Tried trailer.mkv and just trailer. Even tried using the regexp shown in the wiki. Just kept getting youtube. Sorry.

Here's the wiki link, doesn't give much info though- http://wiki.xbmc.org/?title=advancedsett...ermatching
ASUS Chromebox M004U (LibreELEC 8.2/Aeon Nox SiLVO)--->HDMI--->Onkyo TX-NR646--->HDMI--->Panasonic P65VT30
Reply
#14
Yeah, I didn't think it would work, thanks for checking. The wiki is the same I was looking at, not sure why you think "you can only change the append- moviename_trailer or moviename.trailer or moviename-trl etc." since there's no explanation regarding trailer matching there.

I guess I will have to use an add-on for this or rename all my trailers...
Reply
#15
Like I said, it's pretty vague and I could be wrong. I looked at the example and it shows _trailer will result in a match for moviename_trailer, that's why I think it only adjusts the appended section and moviename remains constant. Lot of assuming in my logic though.
ASUS Chromebox M004U (LibreELEC 8.2/Aeon Nox SiLVO)--->HDMI--->Onkyo TX-NR646--->HDMI--->Panasonic P65VT30
Reply

Logout Mark Read Team Forum Stats Members Help
Exclude from listing and trailer matching doesn't work in advancedsettings.xml0