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
=== modified file 'meta-database.js'
--- meta-database.js 2014-11-14 09:18:24 +0000
+++ meta-database.js 2014-11-15 22:49:05 +0000
@@ -56,12 +56,12 @@
56 );56 );
57}57}
5858
59function addQueueList(items) {59function addQueueList(ind, items) {
60 var db = getDatabase();60 var db = getDatabase();
6161
62 db.transaction(function(tx) {62 db.transaction(function(tx) {
63 for (var i = 0; i < items.length; i++) {63 for (var i = 0; i < items.length; i++) {
64 tx.executeSql('INSERT OR REPLACE INTO queue (ind, filename) VALUES (?,?);', [i, items[i].filename]);64 tx.executeSql('INSERT OR REPLACE INTO queue (ind, filename) VALUES (?,?);', [i + ind, items[i].filename]);
65 }65 }
66 }66 }
67 );67 );
6868
=== modified file 'music-app.qml'
--- music-app.qml 2014-11-15 21:56:15 +0000
+++ music-app.qml 2014-11-15 22:49:05 +0000
@@ -611,6 +611,7 @@
611 }611 }
612612
613 var items = []613 var items = []
614 var previousQueueSize = trackQueue.model.count
614615
615 for (var i=0; i < model.rowCount; i++) {616 for (var i=0; i < model.rowCount; i++) {
616 items.push(model.get(i, model.RoleModelData))617 items.push(model.get(i, model.RoleModelData))
@@ -619,7 +620,7 @@
619 }620 }
620621
621 // Add model to queue storage622 // Add model to queue storage
622 Library.addQueueList(items);623 Library.addQueueList(previousQueueSize, items);
623 }624 }
624625
625 // Converts an duration in ms to a formated string ("minutes:seconds")626 // Converts an duration in ms to a formated string ("minutes:seconds")

Subscribers

People subscribed via source and target branches