Author Topic: File scanner - Find and Replace table - extension  (Read 5451 times)

0 Members and 1 Guest are viewing this topic.

Offline goddert

  • User
  • ***
  • Posts: 39
    • View Profile
File scanner - Find and Replace table - extension
« on: January 11, 2012, 11:46:36 am »
Hello,

I decided to put this request under feature suggestions as I think it could be useful for others and because I didn't find a satisfying workaround.

In the preferences for the file scanner exists the table "Find and replace". Currently, as I understood, this table replaces strings/characters in the file name before PDV it uses in the regular expressions and compares it to the various fields like origtitle, title, ecc.

A common problem is that the original title may contain special characters like '?', ':' etc., characters which are not allowed in filenames. Currently using the "Find and Replace" one must find a particular replace character for every not allowed special character. E.g. '?'<-'@' and ':'<-'%' to replace these in filenames with the corrisponding special character in the original title. E.g. "Wo is Fred@.mkv" becomes "Who is Fred?" ecc. This is a bit tedious and creates particular strange filenames. Unfortunately the presence of those special characters inside the various fields like origtitle, eptitle ecc. doesn't allow circumventing them in the usual regular expressions in the file scanner dialog.
If the table mentioned above allowed both directions of replacing we could replace special characters, e.g., in original title (obviously only in memory and not in the field itself) before comparing it to the filename. This way one could define a set of special characters which would be replaced with ONE other character or better with nothing. It would avoid curious filenames and a n->1 mapping of a replace string in a useful direction. E.g. (\?|:) would be replaced with "" (nothing). In the example above "Who is Fred?" would become "Who is Fred.mkv". I think a more elegant solution for a cumbersome problem.

If I missed something or one has a nice solution for the special character problem in original titles please tell me.

 :)

Thanks

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: File scanner - Find and Replace table - extension
« Reply #1 on: January 11, 2012, 01:23:17 pm »
Good idea. I wonder if the most practical approach would be for the program to compare the title extracted from the filename (with any specified replacements) to [Title] and [Original title] both with and without special characters. That way, special characters could either be replaced in the filename or just omitted—and either would be matched.

I think my most common special characters are ':', which I replace with ' -' to maintain readability, and '?' and '!' which I prefer to drop from the filename. In doing the latter, I'm resigned to just matching those files manually (18 of 2,200 movies, so it hasn't been much of a burden).

Offline goddert

  • User
  • ***
  • Posts: 39
    • View Profile
Re: File scanner - Find and Replace table - extension
« Reply #2 on: January 11, 2012, 03:00:59 pm »
Quote
...That way, special characters could either be replaced in the filename or just omitted—and either would be matched.
That solution is even better. It's completely transparent for the user and, to tell the truth, in the end my solution would serve only to replace special characters. Currently I don't see any further scope. I suppose, the list of special characters is limited to the file system independent from the character set.

Quote
I think my most common special characters are ':', which I replace with ' -' to maintain readability
I did this too in the beginning. Then I realized that the '-' was my separator for origtitle and title which complicated the regular expressions I used because not always I have origtitle and title in the filename (my naming schema reflects different version of the same movie - no duplicates - with origtitle and title).

Quote
In doing the latter, I'm resigned to just matching those files manually (18 of 2,200 movies, so it hasn't been much of a burden)
My problem is that my movies often change their folder and I have to rescan them and therefore I've to match them always manually ... there only a few but those few I have to touch often :)