PDA

View Full Version : tell LMS to ignore some dirs whilst scanning



cdmackay
2019-07-21, 16:43
quickie question, please…

Is there any quick way to get LMS to ignore directories (recursively, i.e. a dir hierarchy) whilst scanning, with some sort of sentinel file? A little like Android's ".nomedia" file, for example?

I could go in and change filename extensions, but that doesn't scale well, and will result in the "changed" files being backed up again (unnecessarily).

thanks very much.

garym
2019-07-21, 17:04
quickie question, please…

Is there any quick way to get LMS to ignore directories (recursively, i.e. a dir hierarchy) whilst scanning, with some sort of sentinel file? A little like Android's ".nomedia" file, for example?

I could go in and change filename extensions, but that doesn't scale well, and will result in the "changed" files being backed up again (unnecessarily).

thanks very much.

I can't recall where I saw this, but I have a very vague recollection that if you name the directory you don't want scanned to start with a period, that may do what you want. For example,

c:\othermusic
would be named instead
c:\.othermusic

I could be entirely misremembering, but you can test easily enough.

EDIT: Found this. It may be that the "." only works with linux.
https://forums.slimdevices.com/showthread.php?92645-How-to-exclude-folders-from-a-scan

peterw
2019-07-21, 17:23
Can you just change the directory permissions so LMS cannot see or read the files?

Roland0
2019-07-21, 18:48
edit your server.prefs while LMS is stopped:


ignoreDirRE: ''
ignoreInAudioScan: []
ignoreInImageScan:
- /data/music
ignoreInVideoScan:
- /data/music

first one takes a regular expression, others a list of file paths

cdmackay
2019-07-22, 07:12
Thanks very much indeed, all, for the suggestions; clearly I didn't search well enough, sorry.


I can't recall where I saw this, but I have a very vague recollection that if you name the directory you don't want scanned to start with a period, that may do what you want. For example,

I could be entirely misremembering, but you can test easily enough.

EDIT: Found this. It may be that the "." only works with linux.
https://forums.slimdevices.com/showthread.php?92645-How-to-exclude-folders-from-a-scan

The '.' hidden dir is an idea, since I am running LMS on Linux, but it would also hide the dirs from a regular ls (not ls -a) and that might confuse me later. But your linked post also contained exactly what I wanted, as did Roland0's, below.



Can you just change the directory permissions so LMS cannot see or read the files?

That's a nice idea, but I bet it would create Error noise in scanner.log, which I already search to find badly tagged items, so that would be a false positive I'd have to ignore.



edit your server.prefs while LMS is stopped:


ignoreDirRE: ''
ignoreInAudioScan: []
ignoreInImageScan:
- /data/music
ignoreInVideoScan:
- /data/music

first one takes a regular expression, others a list of file paths

Now that looks perfect, thanks! I can set the RE to ".*\.hidden", then append that to the dirs I want to hide.

thanks again, all, much appreciated.