Merge lp:~vthompson/music-app/use-model-art-property into lp:music-app/trusty

Proposed by Victor Thompson
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 617
Merged at revision: 630
Proposed branch: lp:~vthompson/music-app/use-model-art-property
Merge into: lp:music-app/trusty
Diff against target: 252 lines (+25/-22)
13 files modified
MusicAlbums.qml (+2/-2)
MusicArtists.qml (+2/-3)
MusicNowPlaying.qml (+1/-1)
MusicSearch.qml (+1/-1)
MusicStart.qml (+4/-5)
MusicTracks.qml (+1/-1)
Player.qml (+2/-0)
common/AlbumsPage.qml (+1/-1)
common/BlurredBackground.qml (+1/-1)
common/CoverRow.qml (+4/-2)
common/SongsPage.qml (+2/-2)
meta-database.js (+2/-1)
music-app.qml (+2/-2)
To merge this branch: bzr merge lp:~vthompson/music-app/use-model-art-property
Reviewer Review Type Date Requested Status
Andrew Hayzen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+233300@code.launchpad.net

Commit message

Use art property to allow mediascanner2 to determine if embedded art exists

Description of the change

Use art property to allow mediascanner2 to determine if embedded art exists.

Recent changes in the landing silo 14 PPA for mediascanner2 introduce the capability of having mediascanner2 determine if embedded art exists [1]. This change simplifies the code such that the app is not building the image provider URI and allows this determination by mediascanner2 to be made.

[1] https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/landing-014/+packages

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: Needs Fixing (continuous-integration)
614. By Victor Thompson

A few updates

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

Merge of trunk

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 :

Could you add support for playlists and upgrade support to playlists/recent?

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

I was attempting to add support for recent (and was going to do so for playlists as well), however, I wasn't able to get recent to work using the model's art property when an album is being selected from the Music scope. I might try to get everything working in the next few days.

I reduced the urgency of doing this because the current support thumbnailing via the web seems to have greatly improved. Perhaps something changed on the server to remedy the issues of poor cover art?

Revision history for this message
James Henstridge (jamesh) wrote :

We don't currently have an API for looking up the additional info for an album in the media scanner (only providing it when you get a list of albums with queryAlbum() or listAlbums()). I guess I can look at adding it in future, but I won't have time to do it right away.

616. By Victor Thompson

More backwards commpatibility in recent

617. By Victor Thompson

merge trunk

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

I added more compatibility to retain the old recent items as well as support for still adding an album played from the scopes using the old method of specifying the cover art.

For the time being I'm going to opt not to convert the current playlists, as w may simply want to rework this schema for the redesign of the app.

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 :

Agree with the playlists, looks good to me. I'll report a bug about using Folder.jpg etc

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MusicAlbums.qml'
2--- MusicAlbums.qml 2014-08-28 23:33:29 +0000
3+++ MusicAlbums.qml 2014-09-12 03:03:34 +0000
4@@ -69,7 +69,7 @@
5 Item {
6 property string artist: model.artist
7 property string album: model.title
8- property var covers: [{author: model.artist, album: model.title}]
9+ property var covers: [{art: model.art}]
10
11 id: albumItem
12 height: albumlist.cellHeight - units.gu(1)
13@@ -144,7 +144,7 @@
14 anchors.fill: parent
15 onClicked: {
16 songsPage.album = model.title;
17- songsPage.covers = [{author: model.artist, album: model.title}]
18+ songsPage.covers = [{art: model.art}]
19 songsPage.genre = undefined
20 songsPage.isAlbum = true
21 songsPage.line1 = model.artist
22
23=== modified file 'MusicArtists.qml'
24--- MusicArtists.qml 2014-08-28 23:33:29 +0000
25+++ MusicArtists.qml 2014-09-12 03:03:34 +0000
26@@ -66,8 +66,7 @@
27 id: albumArtistModelRepeater
28 model: albumArtistModel
29 delegate: Item {
30- property string author: model.artist
31- property string album: model.title
32+ property string art: model.art
33 }
34 property var covers: []
35 signal finished()
36@@ -76,7 +75,7 @@
37 musicRow.covers = covers
38 }
39 onItemAdded: {
40- covers.push({author: item.author, album: item.album});
41+ covers.push({art: item.art});
42
43 if (index === count - 1) {
44 finished();
45
46=== modified file 'MusicNowPlaying.qml'
47--- MusicNowPlaying.qml 2014-09-04 22:59:21 +0000
48+++ MusicNowPlaying.qml 2014-09-12 03:03:34 +0000
49@@ -218,7 +218,7 @@
50 ? queuelist.currentHeight
51 : mainView.width - (trackImage.anchors.leftMargin * 2))
52 : queuelist.normalHeight) - units.gu(2)
53- covers: [{author: model.author, album: model.album}]
54+ covers: [{art: model.art}]
55
56 spacing: units.gu(2)
57
58
59=== modified file 'MusicSearch.qml'
60--- MusicSearch.qml 2014-08-21 19:32:12 +0000
61+++ MusicSearch.qml 2014-09-12 03:03:34 +0000
62@@ -179,7 +179,7 @@
63 }
64
65 MusicRow {
66- covers: [{author: model.author, album: model.title}]
67+ covers: [{art: model.art}]
68 column: Column {
69 spacing: units.gu(1)
70 Label {
71
72=== modified file 'MusicStart.qml'
73--- MusicStart.qml 2014-09-05 12:20:01 +0000
74+++ MusicStart.qml 2014-09-12 03:03:34 +0000
75@@ -116,7 +116,7 @@
76 Item {
77 property string title: model.title
78 property string title2: model.title2 !== "Playlist" ? model.title2 : i18n.tr("Playlist")
79- property var covers: type === "playlist" ? Playlists.getPlaylistCovers(title) : [{author: model.title2, album: model.title}]
80+ property var covers: type === "playlist" ? Playlists.getPlaylistCovers(title) : (model.art !== undefined ? [{art: model.art}] : [{author: model.title2, album: model.title}])
81 property string type: model.type
82 property string time: model.time
83 property string key: model.key
84@@ -270,8 +270,7 @@
85 }
86
87 delegate: Item {
88- property string author: model.artist
89- property string album: model.title
90+ property string art: model.art
91 }
92 property var covers: []
93 signal finished()
94@@ -281,7 +280,7 @@
95 genreShape.covers = covers
96 }
97 onItemAdded: {
98- covers.push({author: item.author, album: item.album});
99+ covers.push({art: item.art});
100
101 if (index === count - 1) {
102 finished();
103@@ -425,7 +424,7 @@
104 Item {
105 property string artist: model.artist
106 property string album: model.title
107- property var covers: [{author: model.artist, album: model.title}]
108+ property var covers: [{art: model.art}]
109
110 id: albumItem
111 objectName: "albumItemObject"
112
113=== modified file 'MusicTracks.qml'
114--- MusicTracks.qml 2014-08-28 23:33:29 +0000
115+++ MusicTracks.qml 2014-09-12 03:03:34 +0000
116@@ -77,7 +77,7 @@
117
118 MusicRow {
119 id: musicRow
120- covers: [{author: model.author, album: model.album}]
121+ covers: [{art: model.art}]
122 column: Column {
123 spacing: units.gu(1)
124 Label {
125
126=== modified file 'Player.qml'
127--- Player.qml 2014-08-22 00:26:30 +0000
128+++ Player.qml 2014-09-12 03:03:34 +0000
129@@ -33,6 +33,7 @@
130 objectName: "player"
131
132 property string currentMetaAlbum: ""
133+ property string currentMetaArt: ""
134 property string currentMetaArtist: ""
135 property string currentMetaFile: ""
136 property string currentMetaTitle: ""
137@@ -186,6 +187,7 @@
138 else {
139 var obj = trackQueue.model.get(player.currentIndex);
140 currentMetaAlbum = obj.album;
141+ currentMetaArt = obj.art;
142 currentMetaArtist = obj.author;
143 currentMetaFile = obj.filename;
144 currentMetaTitle = obj.title;
145
146=== modified file 'common/AlbumsPage.qml'
147--- common/AlbumsPage.qml 2014-09-04 00:13:59 +0000
148+++ common/AlbumsPage.qml 2014-09-12 03:03:34 +0000
149@@ -280,7 +280,7 @@
150 }
151 count: 1
152 size: parent.height
153- covers: [{author: model.artist, album: model.title}]
154+ covers: [{art: model.art}]
155 spacing: units.gu(2)
156 }
157
158
159=== modified file 'common/BlurredBackground.qml'
160--- common/BlurredBackground.qml 2014-08-20 17:35:52 +0000
161+++ common/BlurredBackground.qml 2014-09-12 03:03:34 +0000
162@@ -24,7 +24,7 @@
163 // Blurred background
164 Rectangle {
165 anchors.fill: parent
166- property string art: player.currentMetaFile === "" ? Qt.resolvedUrl("../images/music-app-cover@30.png") : "image://albumart/artist=" + player.currentMetaArtist + "&album=" + player.currentMetaAlbum
167+ property string art: player.currentMetaFile === "" ? Qt.resolvedUrl("../images/music-app-cover@30.png") : player.currentMetaArt
168
169 // the album art
170 Image {
171
172=== modified file 'common/CoverRow.qml'
173--- common/CoverRow.qml 2014-08-20 17:35:52 +0000
174+++ common/CoverRow.qml 2014-09-12 03:03:34 +0000
175@@ -59,8 +59,10 @@
176 width: coverRow.size
177 height: width
178 source: coverRow.count !== 0 && coverRow.covers[index] !== "" && coverRow.covers[index] !== undefined
179- ? "image://albumart/artist=" + coverRow.covers[index].author + "&album=" + coverRow.covers[index].album
180- : Qt.resolvedUrl("../images/music-app-cover@30.png")
181+ ? (coverRow.covers[index].art !== undefined
182+ ? coverRow.covers[index].art
183+ : "image://albumart/artist=" + coverRow.covers[index].author + "&album=" + coverRow.covers[index].album)
184+ : Qt.resolvedUrl("../images/music-app-cover@30.png")
185 onStatusChanged: {
186 if (status === Image.Error) {
187 source = Qt.resolvedUrl("../images/music-app-cover@30.png")
188
189=== modified file 'common/SongsPage.qml'
190--- common/SongsPage.qml 2014-08-28 00:22:13 +0000
191+++ common/SongsPage.qml 2014-09-12 03:03:34 +0000
192@@ -238,7 +238,7 @@
193 trackClicked(albumtrackslist.model, index) // play track
194
195 if (isAlbum && songStackPage.line1 !== i18n.tr("Genre")) {
196- Library.addRecent(songStackPage.line2, songStackPage.line1, songStackPage.covers[0], songStackPage.line2, "album")
197+ Library.addRecent(songStackPage.line2, songStackPage.line1, model.art, songStackPage.line2, "album")
198 mainView.hasRecent = true
199 recentModel.filterRecent()
200 } else if (songStackPage.line1 === i18n.tr("Playlist")) {
201@@ -272,7 +272,7 @@
202
203 MusicRow {
204 id: musicRow
205- covers: [{author: model.author, album: model.album}]
206+ covers: model.art !== undefined ? [{art: model.art}] : [{author: model.author, album: model.album}]
207 column: Column {
208 spacing: units.gu(1)
209 Label {
210
211=== modified file 'meta-database.js'
212--- meta-database.js 2014-05-23 15:00:21 +0000
213+++ meta-database.js 2014-09-12 03:03:34 +0000
214@@ -82,7 +82,7 @@
215 var rs = tx.executeSql("SELECT * FROM recent ORDER BY time DESC LIMIT 15");
216 for(var i = 0; i < rs.rows.length; i++) {
217 var dbItem = rs.rows.item(i);
218- console.log("Time:"+ dbItem.time + ", Key:"+dbItem.key + ", Title:"+dbItem.title + ", Title2:"+dbItem.title2 + ", Type:"+dbItem.type);
219+ console.log("Time:"+ dbItem.time + ", Key:"+dbItem.key + ", Title:"+dbItem.title + ", Title2:"+dbItem.title2 + ", Type:"+dbItem.type + ", Art:"+dbItem.cover);
220
221 if (dbItem.type === "album")
222 {
223@@ -90,6 +90,7 @@
224 title:dbItem.title || i18n.tr("Unknown Album"),
225 title2:dbItem.title2 || i18n.tr("Unknown Artist"),
226 key:dbItem.key || i18n.tr("Unknown Album"),
227+ art:dbItem.cover || undefined,
228 type:dbItem.type
229 });
230 }
231
232=== modified file 'music-app.qml'
233--- music-app.qml 2014-09-04 22:59:21 +0000
234+++ music-app.qml 2014-09-12 03:03:34 +0000
235@@ -217,7 +217,7 @@
236 songsAlbumArtistModel.album = decodeURIComponent(split[1]);
237
238 // Add album to recent list
239- Library.addRecent(songsAlbumArtistModel.album, songsAlbumArtistModel.artist, null, songsAlbumArtistModel.album, "album")
240+ Library.addRecent(songsAlbumArtistModel.album, songsAlbumArtistModel.artist, songsAlbumArtistModel.art, songsAlbumArtistModel.album, "album")
241 mainView.hasRecent = true
242 recentModel.filterRecent()
243 }
244@@ -657,7 +657,7 @@
245 function makeDict(model) {
246 return {
247 album: model.album,
248- art: "image://albumart/artist=" + model.author + "&album=" + model.album,
249+ art: model.art,
250 author: model.author,
251 filename: model.filename,
252 title: model.title

Subscribers

People subscribed via source and target branches

to status/vote changes: