Menu

#50 Stop removal of characters like "/ " from tags

2.2
open
nobody
1
2014-09-16
2014-09-05
No

I'm aware that Windows disallows certain characters, such as the forward slash (/), in file names. However, those characters are not disallowed in Mac file name.

The problem, when using kid3, is that when a track's filename contains a slash (which can be common in movie scores), kid3 replaces the slashes with colons (:), which then prevents us from successfully using the "tag from filename" feature. That is, substitutions are made for the special characters in the file name, and those substitutions are automatically copied to the tags — without the user's consent.

I'm presently tagging the files on a movie-score album in which almost every track contains one (and many have two) slashes. Examples:

04 Vampires? / Gypsy Woman / Dracula's Castle
05 Reinfield Bleeds / Dracula's Women

Upon using "tag from filename," kid3 automatically (and, with all due respect, unnecessarily) replaces the slashes with hyphens, like so:

04 Vampires? - Gypsy Woman - Dracula's Castle
05 Reinfield Bleeds - Dracula's Women

One or two tracks wouldn't be the end of the world, but when an album contains 25-30 slashes (or more), it's frustrating to have to manually undo the unnecessary substitutions.

Even if kid3 has a search-and-replace feature of which I'm unaware, such a procedure shouldn't be necessary, because there's no reason for the slashes in tags to be replaced with hyphens in the first place. :-)

REQUEST:

When a file name contains slashes (or other "special" characters), I wish kid3 could be made to honor the actual file names and to pass them along to the destination tags intact — without making any substitutions.

Of course, in case the current behavior is preferable for certain users, the preferred behavior might ideally be specified in the preferences. As such, users like myself could disable substitutions once and never have to think about it again. :-)

Related

Feature Requests: #50

Discussion

  • soundsgoodtome

    soundsgoodtome - 2014-09-05

    (I spotted a couple of typos in my post, after the fact, but it seems there's no mechanism for editing posts, once submitted.) :-/

     

    Last edit: soundsgoodtome 2014-09-05
  • Urs Fleisch

    Urs Fleisch - 2014-09-08

    Thanks for the request. However, Kid3 does not force any character replacements in filenames on Mac OS X. You can configure filename string replacements in "Preferences/Files/Filename Format" and apply it automatically by checking "Format while editing" or manually using the menu "Tools/Apply Filename Format". If you do not use this, nothing is replaced.

    Only on Windows, Kid3 does not allow filenames containing any of the characters <>:"|?*. This is because of a probable bug in the Qt framework which results in a deleted file when renaming with such characters is the destination name. To avoid such havoc Kid3 reports an error before this happens. However, on Linux and Mac OS X, Kid3 does not disallow any characters. I have tested it on Mac OS 10.6.8 and got an error when trying to put a slash into the filename, however I did not see a forced replacement.

    First you mentioned that slashes are replaced with colons. Maybe this is made by Qt or OS X. In the era before OS X, colons were used as separators in paths on the Mac, with the UNIX fundament since OS X, the slash is used (at least in the UNIX layer). You can find some results when searching the web for "mac slash colon filename".

    Later you showed slashes replaced by hyphens. I thought that this could be Kid3 being confused by the slashes when converting tags to filenames, however, I could not reproduce this. Obviously, it should not be a problem when generating filenames from tags because the path is not used in this case (therefore there aren't any slashes in the "tag-to-filename"-formats). However, if you manage to create files with slashes, you could get problems when generating tags from filenames because the slash is used in the "filename-to-tag"-formats because the full path is used to get the information.

    I would advise you to avoid slashes and also the characters mentioned above (and probably some more) in filenames. Maybe the day will come when you would like to copy such a file to a FAT-formated USB stick, a Linux system, an Android phone or burn it to a Joliet CD.

     
  • soundsgoodtome

    soundsgoodtome - 2014-09-08

    Thanks for the reply. The files in question were created by a friend, and I suppose it's possible he had tagged the files before sending them to me. I hadn't considered that possibility, but I'll inquire.

    However, I'm still baffled by the slashes being replaced by colons, which you were unable to reproduce. But the preponderance of colons is what led me to (incorrectly) conclude that kid3 was also replacing characters in the tags.

    I have a massive to-do list, but I'll look more closely at this when I can.

    If I was mistaken about the character replacements, I do offer my apologies for that.

    Thanks again for the reply.

     
  • soundsgoodtome

    soundsgoodtome - 2014-09-15

    Thanks again for your recent feedback, as well as for kid3 in general. I use it quite a bit, and aside from this issue, it serves me quite well.

    Unfortunately, after further use, I remain confused by this character-replacement issue. But this time, rather than using conclusive language, I'm simply going to list the facts of my experience. Perhaps that way, a solution can be more effectively found. :-)

    • Today in kid3 I opened an album of aac files, two of which contain forward slashes in their (Finder) names:

    "05 "Up Ship" / Freda & The Gestapo / The Card Game"
    "09 Boerth Sets The Bomb / Preparing To Land"

    • When kid3 displays their Finder names, it replaces the slashes with colons, like so:

    "05 "Up Ship" : Freda & The Gestapo : The Card Game"
    "09 Boerth Sets The Bomb : Preparing To Land"

    • kid3 will not allow me to change the file names. Whether or not it's "best" to use forward slashes in Finder names, they are in fact allowed in Mac OSX and always have been. In the Finder, one can freely add forward slashes to file names. But kid3 prevents this change. After adding the slashes and attempting to save the track, kid3 reports the following error:

    "05 "Up Ship" / Freda & The Gestapo / The Card Game" is not writable."

    • Other apps that involve the renaming of files (like the venerable 'A Better Finder Rename,' which I've used for nearly 20 years) do not have this limitation with respect to the handling of forward slashes in Finder names. So, this is not something that the OS itself is preventing.

    • Since these tracks contain no other tags, I intended to generate the tags using:

    %{track} %{title}

    Unfortunately, however, that command results in tags with the unwanted colons, which then had to be manually replaced with the forward slashes.

    Finally, the "Apply Filename Format" feature does not work for this. It will, mechanically, replace the colons with forward slashes, but then the files cannot be saved (as reported above).

    So, that's a summary of today's experience.

    Bottom line:

    Since the Finder allows forward slashes in file names and doesn't prevent other 3rd-party apps from using them, why, in kid3, are they being changed to colons? And why do subsequent attempts to replace the colons with forward slashes result in an error message? :-)

    Thanks.

     

    Last edit: soundsgoodtome 2014-09-15
  • Urs Fleisch

    Urs Fleisch - 2014-09-16

    I am able to reproduce this. If I create a file or a folder containing a slash in the Finder, it will be displayed with a colon in Kid3. If you try to create a file with a slash in its name in Kid3, an error occurs.

    I searched a bit in the web and found the following article (http://www.cnet.com/news/managing-files-with-forward-slashes-in-their-names/):

    In the classic Mac OS, colon characters were used to separate folders in a
    file path, but in Unix-based systems the folder separator is a forward
    slash character. These characters are prevented from being used in file
    names because it would confuse the system when trying to access the
    file. When Apple developed OS X, the use of the forward slash was adopted
    because of its Unix underpinnings, so in OS X you cannot include a true
    forward slash in a file name.
    
    This may cause some confusion, since in the Finder you can rename files to
    include a forward slash; however, this is because the Finder converts
    forward slashes into colon characters when writing the names to disk. The
    colon character is fine for use in Unix file names, but the forward slash
    is not.
    
    Therefore, despite potential confusion by the Finder's character
    conversions, the real limitation in OS X is the use of forward slashes in
    the actual name of files, which makes sense because this would cause
    programs to interpret the file as being within a directory. Despite this,
    there may be rare instances where forward slashes might end up in file
    names.
    

    So I started the Terminal and looked at the folder and the file which I created with a slash in Finder - they contain a colon in the Terminal. I then created a file containing a colon in the Terminal and it showed up with a slash in the Finder. And when I try to put a colon inside a filename in Finder an error message is displayed. So my conclusion is that filenames cannot contain slash characters, the Finder displays colons in filenames as slashes, probably to behave as in times before OS X, when the colon was used as the path separator and slash was a legal filename character. The Finder is the one which converts characters, not Kid3. If you want to see slashes in the Finder, just use colons in Kid3.

     
    • soundsgoodtome

      soundsgoodtome - 2014-09-17

      Hey, Urs,

      Thanks for the reply.

      Please see the attached screen-capture movie, in which I use A Better Finder Rename to add a forward slash to an mp3 on my desktop.

      Clearly Frank, ABFR’s developer, faces the same UNIX constraints as any developer. Yet, nowhere in ABFR is the user faced with having to see colons instead of slashes or anything of the sort. I believe you, of course, that limitations do exist. But Frank has programmed ABFR in such a way that the user never sees any of those confusing substitutions.

      A file whose name contains a “/“ Is displayed in ABFR exactly as it’s displayed in the Finder. And when the user adds a “/“ to a file name (which is what I do in the movie), the character is added without any error messages or substitutions. The entire app is WYSIWYG (what you see is what you get). :-)

      So, I simply wanted to demonstrate that there’s nothing in OSX that prevents an app from being designed this way. I don’t know enough to be able to explain how Frank programmed ABFR, but it's clearly possible, and I’ve used it in this manner for almost 20 years.

      If you choose not to modify kid3, that’s your prerogative. :-) I simply wanted you to know that the confusion between colons and slashes does not have to exist in a Mac OSX app. :-)

      Thanks,

      -Merv

      On Sep 15, 2014, at 9:23 pm, Urs Fleisch ufleisch@users.sf.net wrote:

      I am able to reproduce this. If I create a file or a folder containing a slash in the Finder, it will be displayed with a colon in Kid3. If you try to create a file with a slash in its name in Kid3, an error occurs.

      I searched a bit in the web and found the following article (http://www.cnet.com/news/managing-files-with-forward-slashes-in-their-names/ http://www.cnet.com/news/managing-files-with-forward-slashes-in-their-names):

      In the classic Mac OS, colon characters were used to separate folders in a
      file path, but in Unix-based systems the folder separator is a forward
      slash character. These characters are prevented from being used in file
      names because it would confuse the system when trying to access the
      file. When Apple developed OS X, the use of the forward slash was adopted
      because of its Unix underpinnings, so in OS X you cannot include a true
      forward slash in a file name.

      This may cause some confusion, since in the Finder you can rename files to
      include a forward slash; however, this is because the Finder converts
      forward slashes into colon characters when writing the names to disk. The
      colon character is fine for use in Unix file names, but the forward slash
      is not.

      Therefore, despite potential confusion by the Finder's character
      conversions, the real limitation in OS X is the use of forward slashes in
      the actual name of files, which makes sense because this would cause
      programs to interpret the file as being within a directory. Despite this,
      there may be rare instances where forward slashes might end up in file
      names.
      So I started the Terminal and looked at the folder and the file which I created with a slash in Finder - they contain a colon in the Terminal. I then created a file containing a colon in the Terminal and it showed up with a slash in the Finder. And when I try to put a colon inside a filename in Finder an error message is displayed. So my conclusion is that filenames cannot contain slash characters, the Finder displays colons in filenames as slashes, probably to behave as in times before OS X, when the colon was used as the path separator and slash was a legal filename character. The Finder is the one which converts characters, not Kid3. If you want to see slashes in the Finder, just use colons in Kid3.

      [feature-requests:#50] http://sourceforge.net/p/kid3/feature-requests/50 Stop removal of characters like "/ " from tags

      Status: open
      Group: 2.2
      Labels: tags special characters
      Created: Fri Sep 05, 2014 10:09 PM UTC by soundsgoodtome
      Last Updated: Mon Sep 15, 2014 11:26 PM UTC
      Owner: nobody

      I'm aware that Windows disallows certain characters, such as the forward slash (/), in file names. However, those characters are not disallowed in Mac file name.

      The problem, when using kid3, is that when a track's filename contains a slash (which can be common in movie scores), kid3 replaces the slashes with colons (:), which then prevents us from successfully using the "tag from filename" feature. That is, substitutions are made for the special characters in the file name, and those substitutions are automatically copied to the tags — without the user's consent.

      I'm presently tagging the files on a movie-score album in which almost every track contains one (and many have two) slashes. Examples:

      04 Vampires? / Gypsy Woman / Dracula's Castle
      05 Reinfield Bleeds / Dracula's Women

      Upon using "tag from filename," kid3 automatically (and, with all due respect, unnecessarily) replaces the slashes with hyphens, like so:

      04 Vampires? - Gypsy Woman - Dracula's Castle
      05 Reinfield Bleeds - Dracula's Women

      One or two tracks wouldn't be the end of the world, but when an album contains 25-30 slashes (or more), it's frustrating to have to manually undo the unnecessary substitutions.

      Even if kid3 has a search-and-replace feature of which I'm unaware, such a procedure shouldn't be necessary, because there's no reason for the slashes in tags to be replaced with hyphens in the first place. :-)

      REQUEST:

      When a file name contains slashes (or other "special" characters), I wish kid3 could be made to honor the actual file names and to pass them along to the destination tags intact — without making any substitutions.

      Of course, in case the current behavior is preferable for certain users, the preferred behavior might ideally be specified in the preferences. As such, users like myself could disable substitutions once and never have to think about it again. :-)

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/kid3/feature-requests/50/ https://sourceforge.net/p/kid3/feature-requests/50
      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/ https://sourceforge.net/auth/subscriptions

       

      Related

      Feature Requests: #50

MongoDB Logo MongoDB