Merge lp:~ahayzen/music-app/remix-recent-playlists-freeze into lp:music-app/remix

Proposed by Andrew Hayzen
Status: Merged
Approved by: Victor Thompson
Approved revision: 715
Merged at revision: 716
Proposed branch: lp:~ahayzen/music-app/remix-recent-playlists-freeze
Merge into: lp:music-app/remix
Diff against target: 116 lines (+54/-12)
3 files modified
MusicStart.qml (+16/-0)
common/SongsPage.qml (+37/-11)
meta-database.js (+1/-1)
To merge this branch: bzr merge lp:~ahayzen/music-app/remix-recent-playlists-freeze
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Victor Thompson Approve
Review via email: mp+239928@code.launchpad.net

Commit message

* Fix for editing/deleting a playlist from Recent causing freeze
* Fix for rename in Recent attempting to add

Description of the change

* Fix for editing/deleting a playlist from Recent causing freeze
* Fix for rename in Recent attempting to add

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

LGTM! The cases that previously froze the app and/or left the playlists on the recent tab when there was no playlist with that name has been fixed.

Again, we should look at removing the need for the playlist deadlock timer.

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'MusicStart.qml'
--- MusicStart.qml 2014-10-28 03:49:01 +0000
+++ MusicStart.qml 2014-10-29 00:59:25 +0000
@@ -33,6 +33,21 @@
33 id: mainpage33 id: mainpage
34 title: i18n.tr("Recent")34 title: i18n.tr("Recent")
3535
36 property bool changed: false
37
38 onVisibleChanged: {
39 if (changed) {
40 changed = false
41 refreshWaitTimer.start()
42 }
43 }
44
45 Timer { // FIXME: workaround for when the playlist is deleted and the delegate being deleting causes freezing
46 id: refreshWaitTimer
47 interval: 250
48 onTriggered: recentModel.filterRecent()
49 }
50
36 head {51 head {
37 actions: [52 actions: [
38 Action {53 Action {
@@ -75,6 +90,7 @@
75 "covers": coverSources,90 "covers": coverSources,
76 "isAlbum": (model.type === "album"),91 "isAlbum": (model.type === "album"),
77 "genre": undefined,92 "genre": undefined,
93 "page": mainpage,
78 "title": (model.type === "album") ? i18n.tr("Album") : i18n.tr("Playlist"),94 "title": (model.type === "album") ? i18n.tr("Album") : i18n.tr("Playlist"),
79 "line1": secondaryText,95 "line1": secondaryText,
80 "line2": primaryText,96 "line2": primaryText,
8197
=== modified file 'common/SongsPage.qml'
--- common/SongsPage.qml 2014-10-28 17:49:48 +0000
+++ common/SongsPage.qml 2014-10-29 00:59:25 +0000
@@ -470,13 +470,26 @@
470 console.debug("Debug: User changed name from "+playlistName.placeholderText+" to "+playlistName.text)470 console.debug("Debug: User changed name from "+playlistName.placeholderText+" to "+playlistName.text)
471471
472 if (Playlists.renamePlaylist(playlistName.placeholderText, playlistName.text) === true) {472 if (Playlists.renamePlaylist(playlistName.placeholderText, playlistName.text) === true) {
473 if (songStackPage.page !== undefined) {473 // if parent Playlists then set changed otherwise refilter
474 songStackPage.page.changed = true474 if (songStackPage.page.title === i18n.tr("Playlists")) {
475 if (songStackPage.page !== undefined) {
476 songStackPage.page.changed = true
477 }
478 } else {
479 playlistModel.filterPlaylists()
475 }480 }
476481
477 if (Library.recentContainsPlaylist(playlistName.placeholderText)) {482 if (Library.recentContainsPlaylist(playlistName.placeholderText)) {
478 Library.recentRenamePlaylist(playlistName.placeholderText, playlistName.text)483 Library.recentRenamePlaylist(playlistName.placeholderText, playlistName.text)
479 recentModel.filterRecent()484
485 // if parent Recent then set changed otherwise refilter
486 if (songStackPage.page.title === i18n.tr("Recent")) {
487 if (songStackPage.page !== undefined) {
488 songStackPage.page.changed = true
489 }
490 } else {
491 recentModel.filterRecent()
492 }
480 }493 }
481494
482 PopupUtils.close(dialogEditPlaylist)495 PopupUtils.close(dialogEditPlaylist)
@@ -520,14 +533,27 @@
520533
521 if (Library.recentContainsPlaylist(dialogRemovePlaylist.oldPlaylistName)) {534 if (Library.recentContainsPlaylist(dialogRemovePlaylist.oldPlaylistName)) {
522 Library.recentRemovePlaylist(dialogRemovePlaylist.oldPlaylistName)535 Library.recentRemovePlaylist(dialogRemovePlaylist.oldPlaylistName)
523 recentModel.filterRecent()536
524 }537 // if parent Recent then set changed otherwise refilter
525538 if (songStackPage.page.title === i18n.tr("Recent")) {
526 if (songStackPage.page !== undefined) {539 if (songStackPage.page !== undefined) {
527 songStackPage.page.changed = true540 songStackPage.page.changed = true
528 songStackPage.page = undefined541 }
529 }542 } else {
530543 recentModel.filterRecent()
544 }
545 }
546
547 // if parent Playlists then set changed otherwise refilter
548 if (songStackPage.page.title === i18n.tr("Playlists")) {
549 if (songStackPage.page !== undefined) {
550 songStackPage.page.changed = true
551 }
552 } else {
553 playlistModel.filterPlaylists()
554 }
555
556 songStackPage.page = undefined
531 PopupUtils.close(dialogRemovePlaylist)557 PopupUtils.close(dialogRemovePlaylist)
532558
533 musicToolbar.goBack()559 musicToolbar.goBack()
534560
=== modified file 'meta-database.js'
--- meta-database.js 2014-10-28 03:32:01 +0000
+++ meta-database.js 2014-10-29 00:59:25 +0000
@@ -247,7 +247,7 @@
247 var db = getDatabase();247 var db = getDatabase();
248248
249 db.transaction( function(tx) {249 db.transaction( function(tx) {
250 tx.executeSql("UPDATE recent SET data=?, WHERE type=? AND data=?",250 tx.executeSql("UPDATE recent SET data=? WHERE type=? AND data=?",
251 [newKey, "playlist", oldKey]);251 [newKey, "playlist", oldKey]);
252252
253 });253 });

Subscribers

People subscribed via source and target branches