Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1

    Help with avoiding certain folders being scanned , is "ignoreDirRE" the way to go??

    I'm in a process of moving away from MS windows to Linux. Always used shortcuts pointing to my mediafolders placed in another windows folder and then just had LMS pointed to that shortcut folder for my LMS library setup. So in that way avoiding the whole HDD being scanned.

    Now on a linux LMS I can't figure out how to use neither the "Ignore files and folders" plug-in or the "ignoreDirRE" line in server.prefs file. First I installed the plugin but I don't understand the explanation for it. Then i googled a bit and found some posts about putting "ignoreDirRE" line in the server.prefs file but I didn't manage to get it right there. For example I've a folder named "Y = OK" which I didn't want to be scanned. So I put a line like this : "ignoreDirRE: /Y = OK" but it resulted in a whole bunch of other folders also "disappearing" from library named in a similar way, e.g; H = OK, G = OK e.t.c which was not my purpose. I only wanted the "Y = OK" folder not being scanned! Then I tried some other combinations of the "ignoreDirRE: /Y = OK" theme but sadly all failing from what I want. Then gave up since I couldn't figure out the logic behind it. I actually managed to reset the whole LMS install with my sad attempts :-/

    Anyone who could point me in the right direction? I would be happy using any of the two mentioned options as long as it works. What would "Define a regular expression to match file and folder names you don't want to be scanned or visible when browsing your music folder." from the "Ignore files and folders" plug-in explanation look like if I for example would like to avoid a folder named like say "MP3" or earlier mentioned "Y = OK"?

    What really puzzles me is when using the line "ignoreDirRE: /Y = OK" ALL folders named similar (with only the letter being different) vanish from being scanned but whlie using "ignoreDirRE: /MP3" absolutely nothing happens! What am I missing here folks?

  2. #2
    Senior Member
    Join Date
    Jan 2010
    Posts
    714
    Try with a \ in front of the '/' and maybe also remove the space character after the colon, e.g.: "ignoreDirRE:\/Y = OK". Or maybe it's just "ignoreDirRE:Y = OK"?
    You can test regular expressions online, for example here: https://regex101.com/

    I never used this option. Are the folders you want to exclude on the same hierarchy level as your actual music folders? Are you aware that you can specify multiple folders to scan for music in LMS' basic settings?

  3. #3
    Quote Originally Posted by reinholdk View Post
    Try with a \ in front of the '/' and maybe also remove the space character after the colon, e.g.: "ignoreDirRE:\/Y = OK". Or maybe it's just "ignoreDirRE:Y = OK"?
    You can test regular expressions online, for example here: https://regex101.com/

    I never used this option. Are the folders you want to exclude on the same hierarchy level as your actual music folders? Are you aware that you can specify multiple folders to scan for music in LMS' basic settings?
    Hi, from yours "I never used this option", which one of my two examples do you mean you've never used?

    Yes they're on the same level and also yes I know it's possible to specify multiple follders. Problem is I've due to certain reasons so many of them and therefore I hoped these two other options would be quicker and smoother.

    My problem with the plug-in is that I haven't a clue what is a "regular expression" and what to do with it. I tried to figure it out looking at that site you mentioned (it's also mentioned in the explanatory text for the plug-in). I would really like to learn and understand things that are new to me. From reading the explanatory text > ;

    "Define a regular expression to match file and folder names you don't want to be scanned or visible when browsing your music folder. This can eg. be useful to get rid of system folders your NAS creates for internal use ("@eaDir" and the like).
    The comparison is done on the actual item only, not its full path! Please also note that the check will always be case sensitive! There are many useful regex tester online. I'd strongly recommend you check your expression against some of your items using eg. regex101.com.
    "

    Sadly that whole text basically tells me zero :-/ But if I had an working example I would figure it out I suppose. So for example if I would like the scan not to include any folder with "MP3" in the folder name, HOW would a "regular expression" that will work look like? I hope there must be certain rules? Or is it all "trial and error" in the computing world? As many of you most likely easily can tell, I'm far away from being a "dev", "coder" (or whatever it's called) as many here in the forum seem to be.

    I really appreciate your help, will try with your examples and see how it goes. I'll report back later.

  4. #4
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    19,204
    I also do not use this option but your syntax may be wrong. Looking at a forum post https://forums.slimdevices.com/showt...l=1#post680327

    Not checking the regular expression - In the pref file the line should be
    Code:
    ignoreDirRE: '/Y = OK'
    and not
    Code:
    "ignoreDirRE: /Y = OK"
    or
    Code:
    ignoreDirRE: /Y = OK

  5. #5
    Senior Member
    Join Date
    Jan 2010
    Posts
    714
    Quote Originally Posted by doggod View Post
    Hi, from yours "I never used this option", which one of my two examples do you mean you've never used?
    I was referring to the 'ignoreDirRE' option, but actually I never used any of your options.

    Quote Originally Posted by doggod View Post
    My problem with the plug-in is that I haven't a clue what is a "regular expression" and what to do with it. I tried to figure it out looking at that site you mentioned (it's also mentioned in the explanatory text for the plug-in). I would really like to learn and understand things that are new to me. From reading the explanatory text > ;
    In short, a regular expression is a string of characters of which some have special meanings and some are just used literally. It allows checking for a (partial) match in an input string. So something like the wildcards * and ? for file and folder names in Windows but much more powerful. Since they are easy to handle in a program, developers usually love them but since they are sometimes hard to get it right, users often hate them.

    Try it like bpa suggested, but I think you could do it without the slash, so
    Code:
    ignoreDirRE: 'Y = OK'
    The 'Y = OK' here is the regular expression used to find a match in the folder paths. In this case it's just used literally since it doesn't contain characters with special meaning for the regular expression.

  6. #6
    Quote Originally Posted by reinholdk View Post
    I was referring to the 'ignoreDirRE' option, but actually I never used any of your options.



    In short, a regular expression is a string of characters of which some have special meanings and some are just used literally. It allows checking for a (partial) match in an input string. So something like the wildcards * and ? for file and folder names in Windows but much more powerful. Since they are easy to handle in a program, developers usually love them but since they are sometimes hard to get it right, users often hate them.

    Try it like bpa suggested, but I think you could do it without the slash, so
    Code:
    ignoreDirRE: 'Y = OK'
    The 'Y = OK' here is the regular expression used to find a match in the folder paths. In this case it's just used literally since it doesn't contain characters with special meaning for the regular expression.
    Ah, so with the help from you two I finally getting somewhere, just put Y = OK worked! :-) :-) Wouldn't say that I've control in anyway though but at least now understand better. One thing I learned is that actually these "two options" I'm dabbling about seemingly are the same thing! I followed your example and just put Y = OK in the server.prefs file and then Y = OK showed up in the textbox of the plugin in the LMS GUI!

    But now before another question I've I need to ask something to avoid further confusion, from bpa's post and also from yours; does ' ' (Apostrophe or single quote) or " " (Quote, quotation mark ) actually mean something when put in front and end of a line refering to regular expressions? Reason I ask is I thought it's just something one do with the meaning "this text here between the quotes is just an example" when writing in text trying to explain something? I myself have always used the " " characters like that but noticed the ' ' and of course I know the characters are not the same but actually thinking that some people use ' ' others (like me) use " " ...(hope you understand what I'm trying to ask? sorry my native lanuage is not english)

    And then my real question, so ok now I understand better but what character or what would one need to do if having say some folders with WAV in folder name and MP3 in some other folders name and wanting the scanner to miss both. .Eg, not scan any folder with WAV or MP3 in folder name? ( As the best I could come up with I tried Y = OK + MP3 but naturally that didn't cut it :-/)
    Last edited by doggod; 2020-07-24 at 10:05.

  7. #7
    Senior Member kidstypike's Avatar
    Join Date
    Feb 2007
    Location
    Brindle
    Posts
    3,854
    Quote Originally Posted by doggod View Post
    Ah, so with the help from you two I finally getting somewhere, just put Y = OK worked! :-) :-) Wouldn't say that I've control in anyway though but at least now understand better. One thing I learned is that actually these "two options" I'm dabbling about seemingly are the same thing! I followed your example and just put Y = OK in the server.prefs file and then Y = OK showed up in the textbox of the plugin in the LMS GUI!

    But now before another question I've I need to ask something to avoid further confusion, from bpa's post and also from yours; does ' ' (Apostrophe or single quote) or " " (Quote, quotation mark ) actually mean something when put in front and end of a line refering to regular expressions? Reason I ask is I thought it's just something one do with the meaning "this text here between the quotes is just an example" when writing in text trying to explain something? I myself have always used the " " characters like that but noticed the ' ' and of course I know the characters are not the same but actually thinking that some people use ' ' others (like me) use " " ...(hope you understand what I'm trying to ask? sorry my native lanuage is not english)

    And then my real question, so ok now I understand better but what character or what would one need to do if having say some folders with WAV in folder name and MP3 in some other folders name and wanting the scanner to miss both. .Eg, not scan any folder with WAV or MP3 in folder name? ( As the best I could come up with I tried Y = OK + MP3 but naturally that didn't cut it :-/)
    Another option would be to let LMS scan all your music files, then using LMS "Advanced Search", you can define a "Library View" or sub-set of your library and just use that.

    Name:  AS01.jpg
Views: 34
Size:  61.5 KB

    Name:  AS02.jpg
Views: 33
Size:  25.0 KB
    Server - LMS 8.0.0 Pi4B 4GB/Flirc case/pCP 6.1.0 - 74K library, playlists & LMS cache on SSD (ntfs)
    Study - Pi3B/pCP 6.1.0/pi screen/Allo Boss DAC Ruark MR1 Mk2
    Lounge - Pi2/pCP 6.0.0 > HiFiBerry DIGI+ > AudioEngine DAC1 > AVI DM5
    Garage - Squeezebox Boom + Fostex sub
    Dining Room - Squeezebox Radio

    Spares - 2xTouch, 1xSB3, 1xRadio, 7xRPi

  8. #8
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    19,204
    Quote Originally Posted by doggod View Post
    But now before another question I've I need to ask something to avoid further confusion, from bpa's post and also from yours; does ' ' (Apostrophe or single quote) or " " (Quote, quotation mark ) actually mean something when put in front and end of a line refering to regular expressions? Reason I ask is I thought it's just something one do with the meaning "this text here between the quotes is just an example" when writing in text trying to explain something? I myself have always used the " " characters like that but noticed the ' ' and of course I know the characters are not the same but actually thinking that some people use ' ' others (like me) use " " ...(hope you understand what I'm trying to ask? sorry my native lanuage is not english)
    LMS prefs are in two parts - the name of the pref and the value. The value is usually a string with no blanks (e.g. a number or a directorypath) but if there is a space or quotes in the strings then the value must be quoted. There are rules for single vs double quotes - you have a simple requirement so stick to single quotes at beginning and end and make sure you have no other single quotes. No point making life too complicated.
    And then my real question, so ok now I understand better but what character or what would one need to do if having say some folders with WAV in folder name and MP3 in some other folders name and wanting the scanner to miss both. .Eg, not scan any folder with WAV or MP3 in folder name? ( As the best I could come up with I tried Y = OK + MP3 but naturally that didn't cut it :-/)
    For that you need either a complex "regular expression" or simplify your problem - I'd simplify your problem as REs can be difficult to debug. REs have a special syntax of their own with 12 characters / ? @ * + { } ( ) | ^ $ which do special things and some opther characters have other uses.

    If you want to use really REs - study - a single post will not answer the question - it'll just lead to more questions.
    My advice - change the problem (e.g. change permission on the folders remove 'x')
    Last edited by bpa; 2020-07-24 at 12:01.

  9. #9
    @kidstypike; Really do appreciate your help but I think you misunderstood what I'm aiming at? Doesn't matter however. I finally found what a was aiming at. Funny how easy things are when knowing what to do! :-)

    So as an example for anyone else reading this later on;

    Say if one have a lot of folders named say; 1, 2, 3, 4, 5, 6 ,7 ,8 ,9 in same location called say Music and you want the scan go through all except folder 8 & 9. Set Music as your Media Folder in Basic Settings then install the "Ignore files and folders" plug-in and simple just put 8|9 in the textbox at the plug-in settings page and folder named 8 & 9 will be excluded from library scan. And naturally if one would like other folders not being included you just carry on in the same manner, ie 8|9|4|6|2 or whatever. E.g the character I was looking for was |.That's it, case closed! Thank you all for helping. :-)

  10. #10
    And oh, it works exactly the same way in a Windows install. Just tested.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •