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 533177 - Files are not copied into Music directory when "copy on import" selected
Files are not copied into Music directory when "copy on import" selected
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: Importing
0.99.1
Other All
: Normal normal
: 1.2
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-05-14 19:46 UTC by John Calcote
Modified: 2008-07-27 22:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Properly check if the file is in the library directory (846 bytes, patch)
2008-06-12 20:44 UTC, Bertrand Lorentz
needs-work Details | Review
Take into account Gabriel's comment (2.01 KB, patch)
2008-07-23 19:26 UTC, Bertrand Lorentz
committed Details | Review

Description John Calcote 2008-05-14 19:46:18 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:
Comment 1 John Calcote 2008-05-14 20:07:13 UTC
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.
Comment 2 John Calcote 2008-05-23 16:36:56 UTC
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.
Comment 3 Luke Hoersten 2008-06-10 04:14:51 UTC
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.
Comment 4 Bertrand Lorentz 2008-06-12 20:41:58 UTC
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.
Comment 5 Bertrand Lorentz 2008-06-12 20:44:26 UTC
Created attachment 112640 [details] [review]
Properly check if the file is in the library directory
Comment 6 John Calcote 2008-06-13 15:51:49 UTC
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
Comment 7 Bertrand Lorentz 2008-06-13 20:30:08 UTC
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 !
Comment 8 Pedro Castro 2008-06-14 01:11:03 UTC
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.
Comment 9 Bertrand Lorentz 2008-07-17 16:35:15 UTC
Changing status because the patch seems to fix the original issue (see above comment).
Comment 10 Gabriel Burt 2008-07-22 03:52:35 UTC
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. :)
Comment 11 Bertrand Lorentz 2008-07-23 19:26:48 UTC
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 !
Comment 12 Gabriel Burt 2008-07-27 22:46:23 UTC
Committed (with slight change so it will get new values when the library location is changed); thanks!