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 404180 - Move to Trash doesn't remove entry from Library File rhythmdb.xml
Move to Trash doesn't remove entry from Library File rhythmdb.xml
Status: RESOLVED OBSOLETE
Product: rhythmbox
Classification: Other
Component: general
0.9.6
Other All
: Normal minor
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
: 424072 575404 595013 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-02-04 05:51 UTC by Darin
Modified: 2018-05-24 12:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
I've been using rhythmbox-0.10.0 source (298 bytes, patch)
2007-05-27 10:26 UTC, Jan Niklas Hasse (Account disabled)
needs-work Details | Review

Description Darin 2007-02-04 05:51:25 UTC
Please describe the problem:
When you right click a song, and select "Remove", it removes the song from the Library listing, as well as the rhythmdb.xml Library file.

However, when you right click a song and select "Move to Trash", while it does move the song to the trash, it leaves an entry in the rhythmdb.xml Library file.

This is incredibly minor, and a little picky... so I apologize if it's being too picky, or unreasonable. In fact, I notice that it also adds a line to "hide" the file moved to the trash. So there may be some reason for not removing the entry that I'm simply not aware of.

Steps to reproduce:
1. Right click a song, click Remove. The entry in the Library file will be removed.
2. Right click a song, click Move to Trash. The entry in the Library file remains.

Actual results:
Items Moved to Trash clutted up the Library file.

Expected results:
Items Moved to Trash should also be removed from the Library file, just as items "Removed" from the Library are.

Does this happen every time?
Yes.

Other information:
Again, I apologize if this is being too picky. Rhythmbox is one of the only players I've used that actually keeps a clean Library database file (removing song entries most of the time, as well as lengthy Podcast entries), and I was actually very excited about it! I am really really impressed with it. It's something I've wanted from every Library-based player I've used, but no developers seem to take the time to make it happen. In fact, many Library based players I've used tend to inflate the Library file when items are removed or deleted.

The only reason I post this or wonder is because I enjoy how clean the Library keeps itself most of the time, and if someone were to do a huge amount of file managing and deleting through Rhythmbox, it may create a large Library file that may also lengthen load times in the long run.

Anyway, I'm really enjoying the player as a somewhat new user, and am really impressed by the whole thing! Maybe I'm weird by being impressed by a player that keeps a clean Library file... but oh well. I even enjoy and appreciate that!

Thanks for everyones work on this very much, and for any help with this bug/misunderstanding. Thanks again!

- Darin
Comment 1 Jan Niklas Hasse (Account disabled) 2007-05-27 10:26:58 UTC
Created attachment 88879 [details] [review]
I've been using rhythmbox-0.10.0 source
Comment 2 Jan Niklas Hasse (Account disabled) 2007-05-27 10:27:12 UTC
Hi,

I've recognized this problem too and found your bug report. Because nobody did reply I tried to fix it myself and it worked!
This is my first patch ever, so if I did something wrong, please tell me.
With the patch rhythmbox deletes the song before moving it to trash.
Comment 3 Peter 2007-07-09 13:56:53 UTC
Jan's patch looks like it removes the track from the database and then moves the associated file to the wastebasket/trash.

If the option to monitor the library is enabled, is it possible that in between these two actions, the library monitor could notice this track is present on the disk but missing in the database, and re-import it?

i.e. Maybe the patch should move the file to trash and then remove it from the database.

P.S. See also bug 424072 which is probably a duplicate of this.
Comment 4 Jan Niklas Hasse (Account disabled) 2007-07-09 15:16:09 UTC
>i.e. Maybe the patch should move the file to trash and then remove it from the
>database.

I tried that too, but it didn't work, don't know why.

>If the option to monitor the library is enabled, is it possible that in between
>these two actions, the library monitor could notice this track is present on
>the disk but missing in the database, and re-import it?

I'm using the patch for 2 months now it works fine. IMHO it's not possible that the library monitor re-import the file because "impl_delete" is the same like clicking on "remove" on a file's context menu. (hm... english correct?)
Comment 5 Jan Niklas Hasse (Account disabled) 2007-07-25 17:19:27 UTC
I recognized this still in 0.11. After my patch it's working though, could it be committed?
Comment 6 Jan Niklas Hasse (Account disabled) 2007-08-22 20:45:25 UTC
You know, it's very confusing when nobody is answering. Can someone review my path?
Comment 7 Jonathan Matthew 2007-08-23 12:46:58 UTC
*** Bug 424072 has been marked as a duplicate of this bug. ***
Comment 8 Jonathan Matthew 2007-08-23 13:18:19 UTC
I don't think this is the right way to do it.  Apart from anything else,
RhythmDBEntry objects can't really be used after they've been deleted.

Trashing something should be completely reversible.  Currently it is, although
it's a bit difficult.  You have to find the file in the trash, figure out its
original location, and move it back manually.  With this patch, you lose your
play count, rating, etc. with no way of getting them back.

A better approach (and one I started working on a while ago, but never found
the motivation to finish) would be to add a new entry type for trashed entries,
which would store the original location.  These entries would be displayed in a
new 'trash' source, which would still allow them to be played, along with
providing an action for restoring them to the library.  Rather than becoming
hidden when the file is not present, these entries would be deleted
immediately. 
Comment 9 Peter 2007-08-23 20:24:54 UTC
I think that applying Jan's patch (or something like it) right now would still be a noticeable improvement on the current behaviour, and that Jonathan's ideas in comment 8 would be a nice future enhancement (after all, its a non-trivial bit of work with UI changes too).

i.e. If it were up to me, I would postpone the idea in comment 8 as a separate enhancement bug, and implement the short term fix.

Comment 10 Jan Niklas Hasse (Account disabled) 2007-08-23 20:34:23 UTC
Maybe it's good to implement a message box which says something like "All library information like play count, rating, etc. will be deleted, do you really want to remove this file from your library?" for the "remove" command. What do you think?
Comment 11 Bastien Nocera 2007-08-23 21:00:09 UTC
The data loss with the patch is worse. If you want to do something quick, you could make it only remove the DB entry when library monitoring is turned off.

If library monitoring is turned on, the file should still be in the database until it's physically deleted.
Comment 12 Alex L. Mauer 2007-09-10 16:07:32 UTC
I think it would at least be good to prevent these moved-to-trash files from showing up in the library (as Missing Files) as they currently do.

Would it be feasible to have RB monitor the trash and remove from the db when the trash is emptied (when the file is no longer in the trash)?
Comment 13 Bastien Nocera 2007-10-11 13:23:22 UTC
(In reply to comment #12)
> I think it would at least be good to prevent these moved-to-trash files from
> showing up in the library (as Missing Files) as they currently do.
> 
> Would it be feasible to have RB monitor the trash and remove from the db when
> the trash is emptied (when the file is no longer in the trash)?

That's what the monitoring should do.
Comment 14 Alex L. Mauer 2008-04-04 19:13:31 UTC
Hmm, is that feasible though?  The trash is not part of the library (for most users), and trash folders can be on any mounted drive, and even on removable media which has been removed, but will reappear when the media is reinserted.
Comment 15 Jonathan Matthew 2009-04-14 08:43:11 UTC
*** Bug 575404 has been marked as a duplicate of this bug. ***
Comment 16 Jonathan Matthew 2009-09-16 11:49:50 UTC
*** Bug 595013 has been marked as a duplicate of this bug. ***
Comment 17 GNOME Infrastructure Team 2018-05-24 12:19:18 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/rhythmbox/issues/314.