INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: [Solved] Custom Field (Calculated Expression) in view locks client  (Read 498 times)

Gedeon

  • World Citizen
  • ***
  • Posts: 105

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.


Logged

Gedeon

  • World Citizen
  • ***
  • Posts: 105
Re: Custom Field (Calculated Expression) in view locks client
« Reply #1 on: November 16, 2020, 03:31:57 pm »

Have at least this issue been solved in MC26 or MC27 ?
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Custom Field (Calculated Expression) in view locks client
« Reply #2 on: November 16, 2020, 03:43:03 pm »

What is the expression?
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Gedeon

  • World Citizen
  • ***
  • Posts: 105
Re: Custom Field (Calculated Expression) in view locks client
« Reply #3 on: November 16, 2020, 03:51:42 pm »

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.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2390
Re: Custom Field (Calculated Expression) in view locks client
« Reply #4 on: November 16, 2020, 04:34:52 pm »

The (.+)* is problematic and can lead to unbound runtime, depending on the input. Try this:

Code: [Select]
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.
Logged

Gedeon

  • World Citizen
  • ***
  • Posts: 105
Re: Custom Field (Calculated Expression) in view locks client
« Reply #5 on: November 17, 2020, 01:16:35 am »

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.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2390
Re: Custom Field (Calculated Expression) in view locks client
« Reply #6 on: November 17, 2020, 05:24:58 am »

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):
Code: [Select]
Regex([NameOrig],/#(.+?) [\-\(]#/,1)       // non-greedy: gets everything before the FIRST - or (
Regex([NameOrig],/#(.+) [\-\(]#/,1)        // greedy: gets everything until the LAST - or (
Logged

Gedeon

  • World Citizen
  • ***
  • Posts: 105
Re: Custom Field (Calculated Expression) in view locks client
« Reply #7 on: November 17, 2020, 09:39:57 am »

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.

Logged
Pages: [1]   Go Up