Merge lp:~vthompson/music-app/fix-1393065 into lp:music-app/remix

Proposed by Victor Thompson
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 741
Merged at revision: 742
Proposed branch: lp:~vthompson/music-app/fix-1393065
Merge into: lp:music-app/remix
Diff against target: 39 lines (+4/-3)
2 files modified
meta-database.js (+2/-2)
music-app.qml (+2/-1)
To merge this branch: bzr merge lp:~vthompson/music-app/fix-1393065
Reviewer Review Type Date Requested Status
Andrew Hayzen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+241880@code.launchpad.net

Commit message

* Use queue's previous size to append a model to the queue

Description of the change

* Use queue's previous size to append a model to the queue

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

1) Play All on the SongsPage
2) Queue all a different album
3) Check the queue is as expected
4) Restart the app
5) Notice that the album that was queue'd does not appear in the queue?

review: Needs Fixing
lp:~vthompson/music-app/fix-1393065 updated
741. By Victor Thompson

Fix index into items

Revision history for this message
Victor Thompson (vthompson) wrote :

Ok, oddly enough the fix seemed to work on the desktop just fine. But, the fix had an error in the for loop. This has been fixed.

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Looks good now thanks for the fix, now I won't be confused in my morning walk :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'meta-database.js'
2--- meta-database.js 2014-11-14 09:18:24 +0000
3+++ meta-database.js 2014-11-15 22:49:05 +0000
4@@ -56,12 +56,12 @@
5 );
6 }
7
8-function addQueueList(items) {
9+function addQueueList(ind, items) {
10 var db = getDatabase();
11
12 db.transaction(function(tx) {
13 for (var i = 0; i < items.length; i++) {
14- tx.executeSql('INSERT OR REPLACE INTO queue (ind, filename) VALUES (?,?);', [i, items[i].filename]);
15+ tx.executeSql('INSERT OR REPLACE INTO queue (ind, filename) VALUES (?,?);', [i + ind, items[i].filename]);
16 }
17 }
18 );
19
20=== modified file 'music-app.qml'
21--- music-app.qml 2014-11-15 21:56:15 +0000
22+++ music-app.qml 2014-11-15 22:49:05 +0000
23@@ -611,6 +611,7 @@
24 }
25
26 var items = []
27+ var previousQueueSize = trackQueue.model.count
28
29 for (var i=0; i < model.rowCount; i++) {
30 items.push(model.get(i, model.RoleModelData))
31@@ -619,7 +620,7 @@
32 }
33
34 // Add model to queue storage
35- Library.addQueueList(items);
36+ Library.addQueueList(previousQueueSize, items);
37 }
38
39 // Converts an duration in ms to a formated string ("minutes:seconds")

Subscribers

People subscribed via source and target branches