AMC collapses explicit whitespace

All your suggestions, requests and ideas for future development
Post Reply
tsoet
Posts: 8
Joined: 03 Feb 2014, 09:34

AMC collapses explicit whitespace

Post by tsoet »

Description: the AMC script collapses whitespace to single spaces.
Expected Behavior: explicitly typed characters are all included in the filename with none omitted.

Note: even your forum eats white space so forgive the poor formatting below.

Code: Select all

Example:
    movieformat = foo  bar results in files named "foo bar" not "foo  bar"

Counterexample:
    movieformat = foo__bar results in files named "foo__bar" as expected

Example: 
    movieformat = foo{"".pad(10," ")}bar results in files named "foo bar" not "foo          bar"

Counterexample: 
    movieformat = foo{"".pad(10,"-")}bar results in files named "foo----------bar"  as expected
You (correctly) don't eat adjacent "_" characters or "z" characters or "." characters, why eat whitespace?
If I wanted a single space, I would've typed it that way.
If I wanted my input whitespace trimmed I'd use a groovy pattern to do exactly that.

---------

Code: Select all

FileBot 4.7.11 (r5162)
JNA Native: 5.1.0
MediaInfo: 0.7.97
Apache Commons VFS: [zip, rar]
Chromaprint: 1.4.2
Extended Attributes: java.io.IOException: UserDefinedFileAttributeView is not supported
Unicode Filesystem: OK
Script Bundle: 2017-05-15 (r500)
Groovy: 2.4.10
JRE: OpenJDK Runtime Environment 1.8.0_131
JVM: 64-bit OpenJDK 64-Bit Server VM
CPU/MEM: 2 Core / 3 GB Max Memory / 17 MB Used Memory
OS: FreeBSD (amd64)
Package: PORTABLE
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC collapses explicit whitespace

Post by rednoah »

Yes, unfortunately the format engine normalizes the destination path in various ways, including white space (spaces, tabs, newlines, special unicode spaces) normalization, trimming, etc. In this case using '_' instead of ' ' would be your only option if you want '__' because ' ' (double space) will get normalized away.
:idea: Please read the FAQ and How to Request Help.
Post Reply