INTERACT FORUM
More => Old Versions => JRiver Media Center 27 for Windows => Topic started by: Gedeon on November 16, 2020, 11:30:19 am
-
I'm using MC25 in client and server.
In the server (MC25 Linux) I'm using some calculated fields. One is a regex expression which I use for audio files.
When I show/enabled that Field in a server view It's showed with no issues (just the usual response time). I can go up and down in the listand view all the elements
But whe I connect from the Windows client and open a Zone in which that column is shown the client just locks-up.
I have to kill the client, open a remote desktop over the Linux server and hide that calculated column expression from the view.
Then I can open MC25 Windows client with no issues.
-
Have at least this issue been solved in MC26 or MC27 ?
-
What is the expression?
-
Thanks.
It's this :
Regex([NameOrig],/#(.+)*( (-|\().*(ono|ive|lbum|ingle|adio|dit|emaster|ersion|ake|ix|eat).*)#/,-1,0)[R1]
I use It to clean track names in order to search for lyrics.
I firstly copy the original track name to a basic custom field (NameOrig) then, for those tracks with non empty value in the expression I copy the result to the Name field.
When lyrics are got I copy again the backup name field over the name field.
I hope my explanation is clear enough.
-
The (.+)* is problematic and can lead to unbound runtime, depending on the input. Try this:
Regex([NameOrig],/#(.*) [\-\(].*(pono|live|album|single|radio|edit|remaster|version|take|mix|beat)#/,-1,0)[R1]
Check if the words are ok, I added the first letter to them.
This is untested as I'm on mobile.
-
But I have zero issues in Linux views. And I don't add the first letter due to caps. In fact I'm sure I could simplify it even more, since I guess I could discard all after '-' or '('.
I'm on mobile too so I can't test anything in next 10 hours or so.
-
The third parameter of Regex() determines if you want case-sensitive or not. It's set to zero, which means it ignores case.
Your current expression will capture until the last dash/parenthesis, not the first. For instance, if you have "my song (demo) - some text - new version", the expression returns "my song (demo) - some text".
Here are the 2 alternatives - using mode 1 which already outputs [R1], and default 3rd parameter (zero):
Regex([NameOrig],/#(.+?) [\-\(]#/,1) // non-greedy: gets everything before the FIRST - or (
Regex([NameOrig],/#(.+) [\-\(]#/,1) // greedy: gets everything until the LAST - or (
-
Thanks for the simplified version and the suggestion about the wildcard (I got the first one non-greedy expression)
It seems to work well. Even now the Windows MC client doesn't freeze. I guess the way regex is implemented in Windows is slightly different from Linux.
Thanks again.