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
1=== modified file 'MusicStart.qml'
2--- MusicStart.qml 2014-10-28 03:49:01 +0000
3+++ MusicStart.qml 2014-10-29 00:59:25 +0000
4@@ -33,6 +33,21 @@
5 id: mainpage
6 title: i18n.tr("Recent")
7
8+ property bool changed: false
9+
10+ onVisibleChanged: {
11+ if (changed) {
12+ changed = false
13+ refreshWaitTimer.start()
14+ }
15+ }
16+
17+ Timer { // FIXME: workaround for when the playlist is deleted and the delegate being deleting causes freezing
18+ id: refreshWaitTimer
19+ interval: 250
20+ onTriggered: recentModel.filterRecent()
21+ }
22+
23 head {
24 actions: [
25 Action {
26@@ -75,6 +90,7 @@
27 "covers": coverSources,
28 "isAlbum": (model.type === "album"),
29 "genre": undefined,
30+ "page": mainpage,
31 "title": (model.type === "album") ? i18n.tr("Album") : i18n.tr("Playlist"),
32 "line1": secondaryText,
33 "line2": primaryText,
34
35=== modified file 'common/SongsPage.qml'
36--- common/SongsPage.qml 2014-10-28 17:49:48 +0000
37+++ common/SongsPage.qml 2014-10-29 00:59:25 +0000
38@@ -470,13 +470,26 @@
39 console.debug("Debug: User changed name from "+playlistName.placeholderText+" to "+playlistName.text)
40
41 if (Playlists.renamePlaylist(playlistName.placeholderText, playlistName.text) === true) {
42- if (songStackPage.page !== undefined) {
43- songStackPage.page.changed = true
44+ // if parent Playlists then set changed otherwise refilter
45+ if (songStackPage.page.title === i18n.tr("Playlists")) {
46+ if (songStackPage.page !== undefined) {
47+ songStackPage.page.changed = true
48+ }
49+ } else {
50+ playlistModel.filterPlaylists()
51 }
52
53 if (Library.recentContainsPlaylist(playlistName.placeholderText)) {
54 Library.recentRenamePlaylist(playlistName.placeholderText, playlistName.text)
55- recentModel.filterRecent()
56+
57+ // if parent Recent then set changed otherwise refilter
58+ if (songStackPage.page.title === i18n.tr("Recent")) {
59+ if (songStackPage.page !== undefined) {
60+ songStackPage.page.changed = true
61+ }
62+ } else {
63+ recentModel.filterRecent()
64+ }
65 }
66
67 PopupUtils.close(dialogEditPlaylist)
68@@ -520,14 +533,27 @@
69
70 if (Library.recentContainsPlaylist(dialogRemovePlaylist.oldPlaylistName)) {
71 Library.recentRemovePlaylist(dialogRemovePlaylist.oldPlaylistName)
72- recentModel.filterRecent()
73- }
74-
75- if (songStackPage.page !== undefined) {
76- songStackPage.page.changed = true
77- songStackPage.page = undefined
78- }
79-
80+
81+ // if parent Recent then set changed otherwise refilter
82+ if (songStackPage.page.title === i18n.tr("Recent")) {
83+ if (songStackPage.page !== undefined) {
84+ songStackPage.page.changed = true
85+ }
86+ } else {
87+ recentModel.filterRecent()
88+ }
89+ }
90+
91+ // if parent Playlists then set changed otherwise refilter
92+ if (songStackPage.page.title === i18n.tr("Playlists")) {
93+ if (songStackPage.page !== undefined) {
94+ songStackPage.page.changed = true
95+ }
96+ } else {
97+ playlistModel.filterPlaylists()
98+ }
99+
100+ songStackPage.page = undefined
101 PopupUtils.close(dialogRemovePlaylist)
102
103 musicToolbar.goBack()
104
105=== modified file 'meta-database.js'
106--- meta-database.js 2014-10-28 03:32:01 +0000
107+++ meta-database.js 2014-10-29 00:59:25 +0000
108@@ -247,7 +247,7 @@
109 var db = getDatabase();
110
111 db.transaction( function(tx) {
112- tx.executeSql("UPDATE recent SET data=?, WHERE type=? AND data=?",
113+ tx.executeSql("UPDATE recent SET data=? WHERE type=? AND data=?",
114 [newKey, "playlist", oldKey]);
115
116 });

Subscribers

People subscribed via source and target branches