I just noticed a rather unique bug that was introduced in 4.9.3 that did not exist in 4.9.2. I'm not sure if this is intentional behaviour or a new safety feature but I just used the latest version to test a change to my format expression on the show Person of Interest. The reason I say unique is because the name of episode S05E12 is .exe.
In 4.9.2 it has no problem naming the file .exe as the format's extension still comes after this:
But in 4.9.3 it removes the period before the exe:
Character removal bug in 4.9.3
Re: Character removal bug in 4.9.3
What is your custom format?
Please read the FAQ and How to Request Help.
Re: Character removal bug in 4.9.3
Code: Select all
S:/{n.sortName('$2, $1').replaceAll(/[:|]/, " - ")}/{episode.special ? 'Specials' : 'Season '+s}/{ext =~ /(?i)idx|sub|srt/ ? '/Subs/' : ''}/{n.colon(" - ")}{episode.regular ? {' '+s.pad(2)+'x'+episodes.collect{[it.episode]*.pad(2).join('x') }.join('-')} : ' 00x'+special.pad(2)} - {t.colon(" - ").removeIllegalCharacters().replacePart(' (Part $1)')}{fn =~ /(?i)extended/ ? ' (Extended Version)' : ''}{fn =~ /(?i)-thumb/ ? '-thumb' : ''}{'.'+lang.ISO2}
Re: Character removal bug in 4.9.3
{t} yields .exe as expected:
After removing illegal characters the result is exe which is expected too (file names must not start with . because that denotes hidden files) but perhaps isn't exactly what you want in this particular use case:
You may prefer to explicitly specify exactly what you want to remove via custom regex:
Code: Select all
{t}
Code: Select all
{t.removeIllegalCharacters()}
You may prefer to explicitly specify exactly what you want to remove via custom regex:
Code: Select all
{t.removeAll(/[!?]/)}
Please read the FAQ and How to Request Help.
Re: Character removal bug in 4.9.3
Okay, so it was t.removeIllegalCharacters() causing this which I noticed also removes the trailing (or extra) periods from the filename because it changes B.S.O.D. to B.S.O.Drednoah wrote: ↑25 Feb 2021, 06:33 {t} yields .exe as expected:After removing illegal characters the result is exe which is expected too (file names must not start with . because that denotes hidden files) but perhaps isn't exactly what you want in this particular use case:Code: Select all
{t}
Code: Select all
{t.removeIllegalCharacters()}
As for the filename beginning with a period there seems to be logic in the code for 4.9.2 that realises {t} is not the start of the file so it doesn't remove the leading period. Nevertheless...
I was actually using this custom regex previously, well an incorrect version of it which I have now replaced with n.colon(" - ") I think I was just experimenting with removeIllegalCharacters() to see what it does, but since I don't like what it does I will change my format back to custom regex.rednoah wrote: ↑25 Feb 2021, 06:33 You may prefer to explicitly specify exactly what you want to remove via custom regex:Code: Select all
{t.removeAll(/[!?]/)}
As always thanks for your rapid response.
Re: Character removal bug in 4.9.3
Previous revisions just didn't account for leading . at all, allowing Linux and Mac users to accidentally create hidden files and folders (e.g. if the series name starts with . then series folder disappears) which is now fixed.
String.removeIllegalCharacters() can't know the context in which it is used. Internally, it's used for validating file names as best as possible, which now includes stripping leading . as well.
Please read the FAQ and How to Request Help.