Merge lp:~vikoadi/noise/fix-getNext into lp:~elementary-apps/noise/trunk

Proposed by Viko Adi Rahmawan
Status: Rejected
Rejected by: Cody Garver
Proposed branch: lp:~vikoadi/noise/fix-getNext
Merge into: lp:~elementary-apps/noise/trunk
Diff against target: 43 lines (+7/-5)
1 file modified
src/PlaybackManager.vala (+7/-5)
To merge this branch: bzr merge lp:~vikoadi/noise/fix-getNext
Reviewer Review Type Date Requested Status
Victor Martinez (community) Approve
Review via email: mp+252856@code.launchpad.net

Description of the change

- Fix crash on playing next media
- fix _current not getting filtered

To post a comment you must log in.
Revision history for this message
Victor Martinez (victored) wrote :

Looks good. I'm still not sure if there are any bad side effects when using get_search_result instead of get_media (gotta check with Corentin), but limiting the playback to the current search results makes sense :)

review: Approve
Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

I was wrong, using get_search_result doesn't take column view or album view into account...

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

CMIIW, but after some further research I found that its neither get_medias nor get_search_result that we want, but get_visible_media from Noise.ListView and a comparable function on GridView

Some possible options that i can think are:
1. write a fucntion which will return Collection of media with the same album as last played media on GridView and use those function to get_visible_media
2. save list of _current and restore it on start
3. revert rev1778 and reopen bug1253758 and do 1 or 2 in other commit
4. revert rev1778 and reopen bug1253758 wait for carl's code to land in trunk and work on it

i prefer option 3 or 4 as currently playing a song then press next on shuffle mode give

ERROR:linkedlist.c:1014:gee_linked_list_real_get: assertion failed: (index < this._size)
Aborted

Unmerged revisions

1782. By Viko Adi Rahmawan

clear on previous too

1781. By Viko Adi Rahmawan

fix crash on getNext and filtering

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/PlaybackManager.vala'
2--- src/PlaybackManager.vala 2015-03-10 00:20:38 +0000
3+++ src/PlaybackManager.vala 2015-03-13 04:15:54 +0000
4@@ -277,8 +277,9 @@
5 rv = poll_queue();
6 _playing_queued_song = true;
7 } else if (main_settings.shuffle_mode != Noise.Settings.Shuffle.OFF) {
8- if (_current_shuffled.is_empty ) {
9- foreach (Media s in library.get_medias ())
10+ if (_current_shuffled.is_empty) {
11+ clearCurrent ();
12+ foreach (Media s in library.get_search_result ())
13 addToCurrent (s); //first initialize the current selection the reshuffle it
14 reshuffle ();
15 }
16@@ -369,7 +370,7 @@
17
18 rv = _current.get (_current_index);
19 } else {
20- foreach (Media s in library.get_medias ()) {
21+ foreach (Media s in library.get_search_result ()) {
22 addToCurrent(s);
23 }
24
25@@ -392,7 +393,8 @@
26 var main_settings = Settings.Main.get_default ();
27 if(main_settings.shuffle_mode != Noise.Settings.Shuffle.OFF) {
28 if (_current_shuffled.is_empty)
29- foreach (Media s in library.get_medias ())
30+ _current.clear ();
31+ foreach (Media s in library.get_search_result ())
32 addToCurrent (s); //first initialize the current selection the reshuffle it
33 reshuffle ();
34 _playing_queued_song = false;
35@@ -458,7 +460,7 @@
36
37 rv = _current.get(_current_index);
38 } else {
39- foreach(Media s in library.get_medias ())
40+ foreach(Media s in library.get_search_result ())
41 addToCurrent(s);
42
43 _current_index = _current.size - 1;

Subscribers

People subscribed via source and target branches