After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 347744 - Library transfer needs to determine 'unsafe' file characters
Library transfer needs to determine 'unsafe' file characters
Status: RESOLVED DUPLICATE of bug 374078
Product: rhythmbox
Classification: Other
Component: general
HEAD
Other Linux
: Normal major
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-07-17 07:08 UTC by James "Doc" Livingston
Modified: 2008-09-20 07:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description James "Doc" Livingston 2006-07-17 07:08:21 UTC
When creating the filename for transferred files filepath_parse_pattern() uses sanitize_path() to remove problematic characters.

Currently colons are not removed unless the CONF_LIBRARY_STRIP_CHARS gconf key is set to true, however colons are forbidden on fat32 paritions. We really need some way of figuring out what the "unsafe" characters are, as people often want the colons present if they are using a partition format that supports them, and other formats may have different "unsafe" characters.
Comment 1 Steve Fosdick 2007-01-12 14:42:59 UTC
One possibility would be to make the list of characters to remove user configurable.

Another possibility would be to have "levels" of sanitisation so we try the lowest level first and if the OS rejects the filename we try a higher level of sanitisation, i.e. move possible problem characaters removed.  Keep going up levels, i.e. removing more characters until the name is accepted.
Comment 2 Nicolò Chieffo 2007-06-12 13:24:38 UTC
Also remember this:
in a ntfs filesystem, writing with ntfs3g you can use windows forbidden characters. here's some that I found:

: < >

In my opinion all these characters should be stripped or converted to "_" (as itunes does)
This also happens when saving covers (they are saved as Artist - Album.jpg) and also when saving lyrics: remember that the configuration directory where lyrics and covers are stored might also be in a non-linux partition!
Comment 3 Aymen 2007-12-01 11:47:22 UTC
Hello,

Can anyone tell me how to reproduce this bug?

Thanks

Aymeric
Comment 4 Nicolò Chieffo 2007-12-01 12:00:11 UTC
try to transfer a music file that has ":" in its filename to your fat32 portable mp3 player
Comment 5 Aymen 2007-12-01 12:22:49 UTC
Our problem is that I don't know how to transfer the file to fat32 portable mp3 player.

Would you mind telling us how to do so step by step?
 
Indeed, We are a french student group working on this bug trying to find a solution. 

Thank you very much

Aymeric
Comment 6 Nicolò Chieffo 2007-12-01 14:26:15 UTC
step 1: add a file to rhythmbox library called file1:.mp3
step 2: plug a mp3 player in the usb port
step 3: wait until it appears in rhythmbox, under the playlists in the menu at the left
step 4: if it does not appear you should add the plugin Portable Players - MTP
step 5: drag the music file from the library to the music player (in the menu)

Is it enough for you? The key is that the music player should appear in rhythmbox. for sure ipod does this.
Comment 7 Bastien Nocera 2007-12-01 14:40:20 UTC
(In reply to comment #6)
<snip>
> Is it enough for you? The key is that the music player should appear in
> rhythmbox. for sure ipod does this.

media files are renamed before being put on the iPod, and it doesn't matter because the files are referenced in the iPod DB. It's harder for generic players, as they don't have such a database.
Comment 8 Nicolò Chieffo 2007-12-01 18:07:08 UTC
I'm afraid you are wrong... the filename is not changed, at least in rhythmbox version in ubuntu Gutsy
Comment 9 Christophe Fergeau 2007-12-01 18:22:21 UTC
Some characters are replaced with more appropriate ones, but not all. The filename is changed as little as possible since that's better when you dnd a file from the ipod source to your gnome desktop. However, I was considering renaming the files and trying to improve dnd to assign a good-looking name to the file as part of the dnd operation
Comment 10 Aymen 2007-12-02 15:33:28 UTC
we were looking at the code source. We did note understand the exact role of the macro "CONF_LIBRARY_STRIP_CHARS"

if (eel_gconf_get_boolean (CONF_LIBRARY_STRIP_CHARS)) {

   //Replacing problematic characters
   ...
   ...
}
 
We are wondering why we have to do the following test "if (eel_gconf_get_boolean (CONF_LIBRARY_STRIP_CHARS))"? We think that we can replace those characters systematicly(in all cases whaterver the value "CONF_LIBRARY_STRIP_CHARS" is).Is that possible? Otherwise why?
Comment 11 Nicolò Chieffo 2007-12-02 15:54:13 UTC
I think that this option strips forbidden characters always, when when it is possible to have them (for example ntfs and ext partitions).
I think that what you should do might be to

if (eel_gconf_get_boolean (CONF_LIBRARY_STRIP_CHARS)) {

with

if (eel_gconf_get_boolean (CONF_LIBRARY_STRIP_CHARS) || forbidden_character_supported(destination)) {

of course you have to write the function forbidden_character_supported(destination) and to get the partition type somehow and pass it to the function
Comment 12 Jonathan Matthew 2008-09-20 07:21:06 UTC

*** This bug has been marked as a duplicate of 374078 ***