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 561978 - Banshee Deleted the Wrong Data!
Banshee Deleted the Wrong Data!
Status: RESOLVED DUPLICATE of bug 540597
Product: banshee
Classification: Other
Component: general
1.4.1
Other Linux
: Normal critical
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
: 572541 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-11-23 03:38 UTC by Nathaniel Sherry
Modified: 2012-03-04 10:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allows import of duplicate File Names (1.87 KB, patch)
2009-07-06 21:24 UTC, William Witt
none Details | Review

Description Nathaniel Sherry 2008-11-23 03:38:00 UTC
I Imported some videos into Banshee from a folder outside of Banshee's library folder. After changing the properties of some of the videos (album/artist/title), I decided to delete them from the library. I selected the videos that I wanted to delete, and selected 'delete from drive'. Banshee properly deleted the video files from its library folder, but then also deleted some of the files from the original location from where I had imported them! It only seemed to delete the originals for the videos whos properties I had edited.

So...

Import(file1, file2, file3) => newFile1, newFile2, newFile3
modify(newFile2)
delete(newFile1, newFile2, newFile3)

results in newFile(1|2|3) being properly deleted, but also deletes file2
Comment 1 Bertrand Lorentz 2008-11-23 18:27:50 UTC
What is the status of the following options in your preferences, checked or unchecked ?
- Copy files to media folders when importing
- Update file and folder names
Comment 2 Nathaniel Sherry 2008-11-23 18:32:01 UTC
- Copy files to media folders when importing
    Checked

- Update file and folder names
    Checked
Comment 3 Bertrand Lorentz 2008-11-24 10:02:33 UTC
I wasn't able to reproduce this.

Could you try to reproduce this with only one file, maybe with one mp3 ?

Please give also the full file paths, and check the track properties during each step, to see if the path indicated by banshee is the one you expect.
Comment 4 Nathaniel Sherry 2008-11-24 19:35:45 UTC
Notes:
 * This is only recreatalbe with specific video files. Using randomly selected others will not always work.
   * I can provide details about these files upon request.
 * Requires more than one file

===========================

Original Files:
 /media/Media/TV/Babylon 5/Season 1/Babylon 5 - 1x01 - Midnight on the Firing Line.avi
 /media/Media/TV/Babylon 5/Season 1/Babylon 5 - 1x07 - The War Prayer.avi

Import both to video library from nautilus (drag & drop).

Find newly imported files.

Examine their properties:
 The first one (1x01 Midnight) shows it as being under the <Library Folder>/Unknown Artist/Unknown Album/00. AMC.avi
 The seconnd one (1x07 War Prayer) shows it as being at the original location: /media/Media/TV/Babylon 5/Season 1/Babylon 5 - 1x07 - The War Prayer.avi

Indeed an inspection of the "<Library Folder>/Unknown Artist/Unknown Album" folder reveals that only one file was copied.

Select both, right click and select "Delete From Drive"

The original "/media/Media/TV/Babylon 5/Season 1/Babylon 5 - 1x07 - The War Prayer.avi" is deleted, but the original "/media/Media/TV/Babylon 5/Season 1/Babylon 5 - 1x01 - Midnight on the Firing Line.avi" is not

When reversing the order in which nautilus passes the file names (by changing their alphabetical order of appearance/selection so that 1x07 is first) the reverse happens (1x01 is not copied, but 1x07 is)
Comment 5 Bertrand Lorentz 2008-11-24 20:55:02 UTC
I think I know what's going on :
When banshee imports the second file, before copying it, it determines what its path and filename would be and check if a file already exists at that place. If yes, it doesn't copy the file and just adds it to the library.
I guess in your case the two files would end up having the same name because of identical or missing metadata.

This behavior is not a problem, until you delete the file, thinking you're only deleting a copy... :(

Banshee should probably copy the file anyway, giving it another name.
Comment 6 Johannes Mockenhaupt 2009-06-27 12:44:00 UTC
I just ran into this nasty problem as well. Are there any news on this? Bertrand, you have already found the cause of the problem, could you write a patch for it? I'd be more relaxed using Banshee knowing I don't have to keep in mind that there's a bug that potentially eats files. Sorry about being pushy about this, I'm grateful for your work and don't expect anyone to be told what to do. But I'd be thankful if this critical bug, which is 6 months old and appears to have been forgotten, could be fixed. Thanks.

P.S. The circumstances under which the bug appeared for me where slightly different: I imported a directory with mp3s of which there was on that was already in the library, but the duplicate to be added didn't have an album tag set yet, unlike the one in the library. The preferences (update folder names, copy on import) are the same on my system.
Comment 7 William Witt 2009-07-06 21:24:47 UTC
Created attachment 137941 [details] [review]
Allows import of duplicate File Names

adds a "-#" to the end of the of imported files that have duplicate names in the library.  This will allow double importing of the same file, but this is better than adding the file to the database without copying or informing the user.
Comment 8 Alexander Kojevnikov 2009-07-07 08:01:39 UTC
*** Bug 572541 has been marked as a duplicate of this bug. ***
Comment 9 Bertrand Lorentz 2009-07-18 18:17:18 UTC
William, thanks for the patch !
There are some issues with it, I'll post an improved version.

This is in fact the same issue as in bug 540597 : banshee is supposed to copy the file, but it does not, because the destination already exists.

*** This bug has been marked as a duplicate of 540597 ***
Comment 10 wweerrbbuunngg 2012-03-04 10:37:05 UTC
Hello, 

i also had contact with this problem. I tried a bit around and to me it seems as if this bug only appears if you choose the "Import Directory" function. Using "Import File" seems to be ok.
Maybe this gives a hint for the problem.
My banshee version is 2.2.0 runnin on LMDE.