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 726713 - Update of songs interferes with selection mode
Update of songs interferes with selection mode
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
3.11.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-music-maint
gnome-music-maint
available
Depends on:
Blocks:
 
 
Reported: 2014-03-19 14:34 UTC by Arnel Borja
Modified: 2014-05-26 10:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Attachment for the patch (2.57 KB, patch)
2014-04-17 10:23 UTC, Sai Suman Prayaga
needs-work Details | Review
Attachment for the patch (6.63 KB, patch)
2014-05-22 14:00 UTC, Sai Suman Prayaga
needs-work Details | Review
Attachment for the patch (6.41 KB, patch)
2014-05-22 17:05 UTC, Sai Suman Prayaga
reviewed Details | Review

Description Arnel Borja 2014-03-19 14:34:38 UTC
When I go to selection mode and a song is playing, the selection that I made gets cleared up.

To reproduce:
1. Go to Songs view
2. Play a song
3. Click the Select button to enable selection mode
4. Select some songs
5. Wait for a few seconds

Expected: Selection remains the same
Results:  Selection gets cleared up

The problem seems to be from this commit:
5d16c7b - Update songs when they are being added or deleted.
Reverting it fixes the issue.

Seems like the said commit reloads the contents of the model of the TreeView, that's why the selection gets cleared up.

Also, errors are showing up in the terminal continously:
(gnome-music:21083): Gtk-CRITICAL **: gtk_list_store_set_value: assertion 'iter_is_valid (iter, list_store)' failed

I've built gnome-music in GNOME 3.10.
Comment 1 Vadim Rutkovsky 2014-03-24 10:18:54 UTC
Cannot reproduce this in 3.11.92, is this still happening to you, Arnel?
Comment 2 Arnel Borja 2014-03-24 12:05:05 UTC
No unless I add a new song. Maybe there was a bug in tracker before, so the previous errors no longer shows up. This is always happening for me before.

I think we could close this now.
Comment 3 Arnel Borja 2014-03-31 06:58:00 UTC
Seems like it's still there - I upgraded to GNOME 3.12 by using the repository in COPR for Fedora 20 and after logging in my brother's account, it keeps reloading the songs view.

To my own account, it only happens when I move around files, and add or delete songs. After that, the view gets reloaded, and sometimes the player gets stuck into one song because the current iterator is no longer valid.

Seems like the updates gets triggered even if the files that changed are not songs. And the current iterator should be updated when the view is reloaded, if it is the current playlist.
Comment 4 Vadim Rutkovsky 2014-03-31 16:25:29 UTC
We should disable song update if selection mode is on, probably
Comment 5 Sai Suman Prayaga 2014-04-17 10:23:58 UTC
Created attachment 274587 [details] [review]
Attachment for the patch

When new music is added to the music folder when app is in selection mode, wait for the selection mode to end and then update the view.
Comment 6 Vadim Rutkovsky 2014-04-17 11:04:41 UTC
Review of attachment 274587 [details] [review]:

::: gnomemusic/view.py
@@ +383,3 @@
+            return False
+        else:
+            self.check_for_selection()

A better idea would be storing data from 'changes-pending' callback and calling it in _on_view_selection function - this way we would avoid timeout_add.

Also note that there is a _on_changes_pending callback in window.py, which needs to be updated
Comment 7 Allan Day 2014-04-17 17:29:22 UTC
(In reply to comment #4)
> We should disable song update if selection mode is on, probably

Makes sense to me.
Comment 8 Sai Suman Prayaga 2014-05-22 14:00:14 UTC
Created attachment 276989 [details] [review]
Attachment for the patch

Check for pending changes when selection mode is done and call _on_changes_pending if there are any changes left.
Comment 9 Vadim Rutkovsky 2014-05-22 14:21:34 UTC
Review of attachment 276989 [details] [review]:

::: gnomemusic/grilo.py
@@ +77,3 @@
         self.changed_media_ids = []
         self.pending_event_id = 0
+        self.changes_pending = [False for x in range(0, 3)]

We should make it a named dict and load views dynamically (for playlists and search also)
Comment 10 Sai Suman Prayaga 2014-05-22 17:05:58 UTC
Created attachment 277000 [details] [review]
Attachment for the patch

Added a dictionary for changes_pending for different views instead of a list in grilo.
Comment 11 Vadim Rutkovsky 2014-05-26 09:43:31 UTC
Review of attachment 277000 [details] [review]:

Thanks, pushed