Kodi Community Forum
I need some help with advancedsettings.xml - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: I need some help with advancedsettings.xml (/showthread.php?tid=374367)



I need some help with advancedsettings.xml - SubNoodle - 2023-09-07

I have a general questions, and also a specific issue that I'm having. First of all what is the difference between excludefromscan and excludefromlisting ? Wouldn't it make sense that if something was excluded from a scan that it would automatically not be able to be listed?

I have the following as part of my advancedsettings.xml file, and for some reason files named "sample" are still getting through.

Code:
<video>
      <excludefromscan>
         <regexp>[-\._ ](extrafanart|trailer|extrathumbs|sample|Sample|Introduction|Solutions)[-\._ ]</regexp>
     </excludefromscan>
     <excludefromlisting>
         <regexp>[-._ \\/](extrafanart|trailer|extrathumbs|sample|Sample|Introduction|Solutions)[-._ \\/]</regexp>
     </excludefromlisting>



RE: I need some help with advancedsettings.xml - scott967 - 2023-09-08

Please provide an example filename.

scott s.
.


RE: I need some help with advancedsettings.xml - SubNoodle - 2023-09-08

I'm trying to exclude sample.avi


RE: I need some help with advancedsettings.xml - izprtxqkft - 2023-09-08

(2023-09-08, 02:15)SubNoodle Wrote: I'm trying to exclude sample.avi

your regex patterns are wrong then

the [-._ \\/] is not arbitrary, it is looking for dashes, dots, underscores, spaces

so you are excluding ".sample.", "-sample-","_sample_"," sample " where your file has none of those, if you renamed your file to .sample.avi it would hide it

this will work for "sample.*"

(.*?)(extrafanart|trailer|extrathumbs|sample|Sample|Introduction|Solutions)(\.[^.]+)


when you need to test regular expressions use https://regexr.com


RE: I need some help with advancedsettings.xml - SubNoodle - 2023-09-08

THANK YOU! This works and makes sense. I'm a bit green when it comes to regex, so I appreciate the link to regexr.com also.

Could you please explain when to use excludefromscan and when to use excludefromlisting?


RE: I need some help with advancedsettings.xml - scott967 - 2023-09-08

(2023-09-08, 02:58)jepsizofye Wrote:
(2023-09-08, 02:15)SubNoodle Wrote: I'm trying to exclude sample.avi

your regex patterns are wrong then

the [-._ \\/] is not arbitrary, it is looking for dashes, dots, underscores, spaces

so you are excluding ".sample.", "-sample-","_sample_"," sample " where your file has none of those, if you renamed your file to .sample.avi it would hide it

this will work for "sample.*"

(.*?)(extrafanart|trailer|extrathumbs|sample|Sample|Introduction|Solutions)(\.[^.]+)


when you need to test regular expressions use https://regexr.com

FWIW I like that tester as well, though I also use https://regex101.com/r/9y9n85/1

I admit I am being lazy at the moment and not testing (I don't use those regex exclusions myself) but excludefromscan should prevent an item from attempting to add to the library but still be visible in the media file listing (assuming extension is a whitelisted media file) . While excludefromlisting it won't even show up in file view (but I think it will in the file manager).

scott s.
.


RE: I need some help with advancedsettings.xml - SubNoodle - 2023-09-09

That makes sense. Following the first excludefromscan I have this (just from copying patterns I've found in documentation and the forum):

Code:
     <excludefromscan action="append">
         <regexp>/Extras/</regexp>
         <regexp>[\\/]Extras[\\/]</regexp>
     </excludefromscan>

What is the reason for both lines? And could I just add this to the first excludefromscan instead of having an individual line item for it?