PDA

View Full Version : Don't scan a folder



mjb152
2008-10-20, 06:14
Is it possible to get squeezecenter not to scan a directory (or folder) ?

e.g is there a feature that if the scanner sees a certain file it will ignore that directory ?

I have all my music in a folder called Music, and there are 2 subdirectories, Lossless and Mp3.
-->Music
|
--->Lossless
|
--->Mp3

I have lots of old mp3s, but am now doing everything new in flac, and if I want to transfer this to my ipod, I convert the flacs into mp3.

So I have some albums under both Lossless, and mp3 .. and the squeezecenter scans both, and hence duplicates the entries.

How can I get around this ? (whilst keeping all my music in 1 place)

Themis
2008-10-20, 06:21
Setting > Advanced > File Types > Disabled Audio File Extensions (if you want to keep everything under the same folder)

You can also, point Squeeze Center directly to your Music/Lossless subdirectory (if your flac are in a separate directory)

mjb152
2008-10-20, 06:30
thanks for the quick reply, but I'm not sure it helps. Think my description was a bit vague.

I'd like to be able to keep all my music under 1 folder, and I'd like the squeezebox to be able to play both flacs and mp3s (which it does very well). The problem is that for where I have a flac only file, and I've created an mp3 so I can listen to it on my ipod, it has then created a duplicate entry on the squeezebox, as it has indexed both mp3 and flac seperately.

I wondered if there was a way to stop that on a folder by folder basis ?
e.g create a file called ".dontscan" or somethign similar.

peter
2008-10-20, 07:00
mjb152 wrote:
> thanks for the quick reply, but I'm not sure it helps. Think my
> description was a bit vague.
>
> I'd like to be able to keep all my music under 1 folder, and I'd like
> the squeezebox to be able to play both flacs and mp3s (which it does
> very well). The problem is that for where I have a flac only file, and
> I've created an mp3 so I can listen to it on my ipod, it has then
> created a duplicate entry on the squeezebox, as it has indexed both mp3
> and flac seperately.
>
> I wondered if there was a way to stop that on a folder by folder basis
> ?
> e.g create a file called ".dontscan" or somethign similar.
>

I'd like that too. In fact I'd like to have a way to override SC
settings for directories. What if there was a special file 'settings.sc'
that you could put certain overrides in. Like:
- Don't scan anything under this folder
- Don't scan *.mp3 files under this folder
- Force all files/folders under this folder to be a single album
- Change the 'Artist' tag for all files under this folder

Wouldn't that be handy?

Regards,
Peter

mjb152
2008-10-20, 07:18
I can definitely see a case for it, I wondered if the developers read these forums to get upgrade ideas ?

I checked the source code, and there is a module called "Scanner.pm" which would need modifying, probably the sub scanDirectory part.

For a very basic start it could simply check to see if that files exists or not, and if it does then do nothing with that subdirectory.

if I get time, I'll write the code to do it, add it here and then we can either manually add it to our configs, or ask for a feature adding ?

funkstar
2008-10-20, 07:25
This has come up several times in the past.

Not sure if there is an enhancement request in pace for it, but there should be.

Have a look on http://bugs.slimdevices.com/

Themis
2008-10-20, 07:29
thanks for the quick reply, but I'm not sure it helps. Think my description was a bit vague.

I'd like to be able to keep all my music under 1 folder, and I'd like the squeezebox to be able to play both flacs and mp3s (which it does very well). The problem is that for where I have a flac only file, and I've created an mp3 so I can listen to it on my ipod, it has then created a duplicate entry on the squeezebox, as it has indexed both mp3 and flac seperately.

I wondered if there was a way to stop that on a folder by folder basis ?
e.g create a file called ".dontscan" or somethign similar.

You need a structure of this kind:

Music
-/Lossless
-/Lossless/FLAC
-/Lossy
-/Lossy/MP3fromFLAC
-/Lossy/MP3
SC
-/SC/main


Then, you put:
>all flacs in /Lossless/FLAC
>all files converted from FLAC in /Lossy/MP3fromFLAC
>all MP3 originals (not from flacs) in /Lossy/MP3

For your iPod:
you'll have to import /Lossy directory

For your Squeeze Center:
you create two shorcuts in "/SC/main" directory:
one to "/Lossless/FLAC"
one to "/Lossy/MP3"
you change the Squeeze Center music library directory to "/SC/main"


Hope this helps. No, there's no way to "ignore" a subfolder in SqueezeCenter music library directory, afaik.

peter
2008-10-20, 11:34
mjb152 wrote:
> I can definitely see a case for it, I wondered if the developers read
> these forums to get upgrade ideas ?
>
> I checked the source code, and there is a module called "Scanner.pm"
> which would need modifying, probably the sub scanDirectory part.
>
> For a very basic start it could simply check to see if that files
> exists or not, and if it does then do nothing with that subdirectory.
>
> if I get time, I'll write the code to do it, add it here and then we
> can either manually add it to our configs, or ask for a feature adding
> ?

I wonder if the hooks are in place to do something like this as a
plugin. That would probably be best.

(It's a bit late for me, I just finished a terrible job retagging)

Regards,
Peter

mherger
2008-10-20, 11:45
> I wonder if the hooks are in place to do something like this as a
> plugin. That would probably be best.

There's a preference "ignoreDirRE" which isn't exposed in the UI. It's a regular expression which defines file/folder names which are to be ignored. A plugin could simply expose that value to the user.

See Slim/Utils/Misc.pm, around line 697:

if ((my $ignore = $prefs->get('ignoreDirRE') || '') ne '') {
return 0 if $item =~ /$ignore/;
}

--

Michael

mjb152
2008-10-21, 05:31
thanks for the info, don't suppose there are any docs on writing plugins ?
are there any general guidelines I should follow ?

aubuti
2008-10-21, 06:19
thanks for the info, don't suppose there are any docs on writing plugins ?
are there any general guidelines I should follow ?
See the wiki. This would be a good start: http://wiki.slimdevices.com/index.php/DeveloperGuide