More > JRiver Media Center 20 for Windows

Clean(string,3) Is Broken (Or Weird/Useless)

<< < (2/2)

glynor:
Any love on this?

To review:

1.  Clean replaces special characters with a -.  Renaming uses _
2.  Clean ignores (preserves) periods, but they are omitted when written to filenames (by the handheld engine, at least).

Matt:

--- Quote from: glynor on August 08, 2012, 05:13:00 pm ---1.  Clean replaces special characters with a -.  Renaming uses _
2.  Clean ignores (preserves) periods, but they are omitted when written to filenames (by the handheld engine, at least).

--- End quote ---

Using a dash is intentional in the code, but I don't know why.

As for periods, they're a special thing.  They're not allowed as the trailing part of a folder name, but I think they're allowed everywhere else.

I wonder if Clean(..., 3) should just use the same filename cleaning function that's used everywhere else?

Or there could be a new CleanFilename(...) function.

glynor:

--- Quote from: Matt on August 09, 2012, 05:41:39 pm ---I wonder if Clean(..., 3) should just use the same filename cleaning function that's used everywhere else?

Or there could be a new CleanFilename(...) function.

--- End quote ---

I'm fine with either, though I can't imagine what someone would want the current Clean(,3) mode for now.  If it did actually strip out ALL special characters (perhaps with an optional "replace with specified character" third parameter), then maybe...?  I don't know... I can't think of a use, personally.

But like I said, either way is fine.  Something that does exactly the same thing as the filename cleaning function would be super-useful.  I know in some of the other threads kicking around where this was discussed, I wasn't the only one to bring it up.

Matt:
Next build:
Changed: The Clean(...) expression in mode 3 does a standard filename clean and replaces unsupported characters with underscore.

Feedback appreciated.

Navigation

[0] Message Index

[*] Previous page

Go to full version