GNOME Bugzilla – Bug 533177
Files are not copied into Music directory when "copy on import" selected
Last modified: 2008-07-27 22:46:23 UTC
Please describe the problem: Files are not copied into the specified music directory when non-default music directory is chosen, and an import directory is chosen (in a different location). Steps to reproduce: 1. open edit/preferences 2. set library directory to some non-standard location - whatever 3. select the "copy on import" check box 4. import a folder full of songs 5. check edit preferences on an imported song 6. note that the folder is in fact the library you selected in step 2 7. note contents of library folder - imported media is non-existent Actual results: songs are apparently imported, paths are set to location they should be imported to, but songs are not actually copied Expected results: library folder would contain a copy of the imported media after import. Does this happen every time? yes Other information:
More details: I keep my media library on a USB removable hard drive (250 Gb WD Passport) in mp3 format. On the root of the drive, I have the following folders: Music Music_mp3 Music_save My library is actually the "Music" folder on that drive. When I attempt to import files from Music_mp3 into the library (in Music), the files are not copied (even though the "copy on import" flag is set in the edit/prefs dialog). Rather, the files are imported by reference, and the path is set to /media/WD Passport/Music/mp3/... On a hunch, I renamed Music_mp3 to "mp3stuff" and tried again, and it worked fine. This tells me that there's something special about the name "Music", as a prefix to any directory name from which I attempt to import songs. This makes sense, as an attempt to import from the home directory into /home/<user>/Music would want to skip the ~/Music directory during import. But it causes problems when the Music* directory from which you are importing is not a subdirectory of the Music directory into which you are importing.
More details: I've found that if the Music folder hierarchy for a given artist/album already exists, and then music is imported from another location BY FOLDER, then the files are also not copied. If the Music folder hierarchy for the arist/album is deleted from the media folder, and then the files are imported BY FILE (multiple selection), then the copy happens properly. I'm sorry, I don't know if deleting the media folder artist/album heirarchy did the trick, or if it was a difference in importing by FOLDER, or by FILE. I did too many things at once during my debugging. I'm sure I'll have more details later. Don't know if this makes a difference or not, but I'm trying to run Banshee on an x86_64 system. For this particular defect, I'm guessing it doesn't make any difference.
I have these same issues. I have /home/user/Audio/music as the library dir and it does not copy the files into the folder when it's selected in preferences to do so.
Thank you for your detailed report. I think I found the problem causing what you described in comment #1 : The check to see if a file isn't already in the library folder isn't done properly, so the file is not copied. I'll attach a patch that should fix this. I'm not sure about about the issue mentioned in comment #2.
Created attachment 112640 [details] [review] Properly check if the file is in the library directory
Bertrand, Thanks for the patch. I can't actually test it because I don't have a local build of the banshee source, but a quick examination of the source for the patch tells me that you're probably right on the money here. I was trying to copy files into a folder named "Music", from a sibling folder named "Music.mp3". With your patch, the addition of the path separator would distinguish between these names. Thanks, John
I haven't been able to reproduce the issue you described in comment #2, with or without my patch applied. Importing by folder or by file shouldn't make any difference, each file is copied one by one anyway. Could you try to reproduce the bug by importing one file with and without the artist/album hierarchy ? Please indicate the paths used. Please also make sure you're now using banshee 1.0, it's much better ! Thanks !
Hi, I was having the same issue as John Calcote (the general issue of files not getting copied while importing, not sure about the specific details reported) and the patch fixed it.
Changing status because the patch seems to fix the original issue (see above comment).
I'd rather we didn't have to concatenate two strings into a third every time we try to import an item - eg save the result somewhere so it can be reused. Except it needs to reflect changes to the LibraryLocation - so maybe LibraryLocationWithSlash or something. :)
Created attachment 115117 [details] [review] Take into account Gabriel's comment I added a new property to the Paths class and I named it CachedLibraryLocationWithSeparator, for portability reason. ;) Thank you MonoDevelop for auto-complete !
Committed (with slight change so it will get new values when the library location is changed); thanks!