Skip to main content
Topic: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others (Read 875 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Before the illegal filename ? character would get replaced with nothing.

Now it's getting replaced with an underscore.

Is this permanent or a bug that's just slipped in?

It appears the something has changed with illegal characters. I haven't changed my file op formatting is ages (2 years) but it's now picking up on things it wasn't before.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #1
It's meant to be replaced with an underscore if in mid-text and removed if trailing. But point noted, it will be changed to work like old versions did for the sake of consistency.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #2
Thanks. I think the pipe character has changed to an underscore. It was changed before to a hyphen I believe. 

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #3
It's meant to be replaced with an underscore if in mid-text and removed if trailing. But point noted, it will be changed to work like old versions did for the sake of consistency.
In the recent builds you would also get an underscore for trailing illegal characters, i.e. the cases I witnessed affected the "?" character. How about making it togglable, perhaps with an option to define the replacing character?
Best regards
deus-ex

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #4
Thanks. I think the pipe character has changed to an underscore. It was changed before to a hyphen I believe.

Can confirm.  Change still present in v1.6 final.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #5
Make sure that the advanced setting is disabled accordingly (screenshot).
Best regards
deus-ex

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #6
Make sure that the advanced setting is disabled accordingly (screenshot).
 
 This is for the converter. The issue is with file ops.


Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #8
Thanks, silly me. Updated to v1.6.

Although when it's unchecked the pipe character is getting replaced with an underscore whereas before it was getting replaced with a hyphen AFAIK.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #9
Although when it's unchecked the pipe character is getting replaced with an underscore whereas before it was getting replaced with a hyphen AFAIK.

The change in pipe character replacement threw me for a loop because I thought new files weren't synching to my devices correctly, as many of my genre tags use a pipe. I tried to get around it by changing my pattern to explicitly replace | with - but it looks like the automatic replacement is done before the pattern matching. Is all of this intended and if so is there any way for a user to replace | with -?

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #10
.. is there any way for a user to replace | with -?
You're going to have to wrap your existing format and use something like so:

Code: [Select]
$replace(yourexistingformathere,|,-)

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #11
You're going to have to wrap your existing format and use something like so:

Code: [Select]
$replace(yourexistingformathere,|,-)

Unfortunately, this doesn't work - the replacement of | to _ seems to be impossible to override currently. I wonder if this is intended or not, as it seems inconsistent.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #12
It works for me in the latest beta.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #13
Ran a simplified test case in 1.6.1 beta 6, screenshot in attachment.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #14
Ran a simplified test case in 1.6.1 beta 6, screenshot in attachment.
 
 

You're right. What I actually did was: (Not ideal I know but this mimics the behaviour I had before)

Code: [Select]
$replace('a_string',_,-)

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #15
That's a damn good workaround, thank you for the suggestion. Files with artist or album tags that include a pipe are still going to be updated but that's a handful vs tens of thousands, so calling it a good solution.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #16
That's a damn good workaround, thank you for the suggestion. Files with artist or album tags that include a pipe are still going to be updated but that's a handful vs tens of thousands, so calling it a good solution.
 
 You also could do this:

Code: [Select]
$replace($replace($replace('a_string',_,mytempunderscorefix),_,-),mytempunderscorefix,_)

This way you retain any underscores.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #17
You're right. What I actually did was: (Not ideal I know but this mimics the behaviour I had before)

Code: [Select]
$replace('a_string',_,-)


Thanks for this.  Simple, but it never occurred to me this would work on illegal character replacements.

Scrambles, I just wrapped the $replace around the whole file name pattern and it addressed artist and album tags just fine.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #18
You also could do this:

Code: [Select]
$replace($replace($replace('a_string',_,mytempunderscorefix),_,-),mytempunderscorefix,_)

This way you retain any underscores.

I thought this was brilliant but it actually doesn't work, as the pipes are replaced with underscores before the pattern is even matched.

Re: beta v1.6 beta 17 - File ops - ? character is getting replaced with _ and others

Reply #19
Not much that can be done then, I didn't test that but thought it may work.

Pity there's no character set that the user could use for the replacement of each illegal character.

 
SimplePortal 1.0.0 RC1 © 2008-2020