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
=== modified file 'MusicAlbums.qml'
--- MusicAlbums.qml 2014-08-28 23:33:29 +0000
+++ MusicAlbums.qml 2014-09-12 03:03:34 +0000
@@ -69,7 +69,7 @@
69 Item {69 Item {
70 property string artist: model.artist70 property string artist: model.artist
71 property string album: model.title71 property string album: model.title
72 property var covers: [{author: model.artist, album: model.title}]72 property var covers: [{art: model.art}]
7373
74 id: albumItem74 id: albumItem
75 height: albumlist.cellHeight - units.gu(1)75 height: albumlist.cellHeight - units.gu(1)
@@ -144,7 +144,7 @@
144 anchors.fill: parent144 anchors.fill: parent
145 onClicked: {145 onClicked: {
146 songsPage.album = model.title;146 songsPage.album = model.title;
147 songsPage.covers = [{author: model.artist, album: model.title}]147 songsPage.covers = [{art: model.art}]
148 songsPage.genre = undefined148 songsPage.genre = undefined
149 songsPage.isAlbum = true149 songsPage.isAlbum = true
150 songsPage.line1 = model.artist150 songsPage.line1 = model.artist
151151
=== modified file 'MusicArtists.qml'
--- MusicArtists.qml 2014-08-28 23:33:29 +0000
+++ MusicArtists.qml 2014-09-12 03:03:34 +0000
@@ -66,8 +66,7 @@
66 id: albumArtistModelRepeater66 id: albumArtistModelRepeater
67 model: albumArtistModel67 model: albumArtistModel
68 delegate: Item {68 delegate: Item {
69 property string author: model.artist69 property string art: model.art
70 property string album: model.title
71 }70 }
72 property var covers: []71 property var covers: []
73 signal finished()72 signal finished()
@@ -76,7 +75,7 @@
76 musicRow.covers = covers75 musicRow.covers = covers
77 }76 }
78 onItemAdded: {77 onItemAdded: {
79 covers.push({author: item.author, album: item.album});78 covers.push({art: item.art});
8079
81 if (index === count - 1) {80 if (index === count - 1) {
82 finished();81 finished();
8382
=== modified file 'MusicNowPlaying.qml'
--- MusicNowPlaying.qml 2014-09-04 22:59:21 +0000
+++ MusicNowPlaying.qml 2014-09-12 03:03:34 +0000
@@ -218,7 +218,7 @@
218 ? queuelist.currentHeight218 ? queuelist.currentHeight
219 : mainView.width - (trackImage.anchors.leftMargin * 2))219 : mainView.width - (trackImage.anchors.leftMargin * 2))
220 : queuelist.normalHeight) - units.gu(2)220 : queuelist.normalHeight) - units.gu(2)
221 covers: [{author: model.author, album: model.album}]221 covers: [{art: model.art}]
222222
223 spacing: units.gu(2)223 spacing: units.gu(2)
224224
225225
=== modified file 'MusicSearch.qml'
--- MusicSearch.qml 2014-08-21 19:32:12 +0000
+++ MusicSearch.qml 2014-09-12 03:03:34 +0000
@@ -179,7 +179,7 @@
179 }179 }
180180
181 MusicRow {181 MusicRow {
182 covers: [{author: model.author, album: model.title}]182 covers: [{art: model.art}]
183 column: Column {183 column: Column {
184 spacing: units.gu(1)184 spacing: units.gu(1)
185 Label {185 Label {
186186
=== modified file 'MusicStart.qml'
--- MusicStart.qml 2014-09-05 12:20:01 +0000
+++ MusicStart.qml 2014-09-12 03:03:34 +0000
@@ -116,7 +116,7 @@
116 Item {116 Item {
117 property string title: model.title117 property string title: model.title
118 property string title2: model.title2 !== "Playlist" ? model.title2 : i18n.tr("Playlist")118 property string title2: model.title2 !== "Playlist" ? model.title2 : i18n.tr("Playlist")
119 property var covers: type === "playlist" ? Playlists.getPlaylistCovers(title) : [{author: model.title2, album: model.title}]119 property var covers: type === "playlist" ? Playlists.getPlaylistCovers(title) : (model.art !== undefined ? [{art: model.art}] : [{author: model.title2, album: model.title}])
120 property string type: model.type120 property string type: model.type
121 property string time: model.time121 property string time: model.time
122 property string key: model.key122 property string key: model.key
@@ -270,8 +270,7 @@
270 }270 }
271271
272 delegate: Item {272 delegate: Item {
273 property string author: model.artist273 property string art: model.art
274 property string album: model.title
275 }274 }
276 property var covers: []275 property var covers: []
277 signal finished()276 signal finished()
@@ -281,7 +280,7 @@
281 genreShape.covers = covers280 genreShape.covers = covers
282 }281 }
283 onItemAdded: {282 onItemAdded: {
284 covers.push({author: item.author, album: item.album});283 covers.push({art: item.art});
285284
286 if (index === count - 1) {285 if (index === count - 1) {
287 finished();286 finished();
@@ -425,7 +424,7 @@
425 Item {424 Item {
426 property string artist: model.artist425 property string artist: model.artist
427 property string album: model.title426 property string album: model.title
428 property var covers: [{author: model.artist, album: model.title}]427 property var covers: [{art: model.art}]
429428
430 id: albumItem429 id: albumItem
431 objectName: "albumItemObject"430 objectName: "albumItemObject"
432431
=== modified file 'MusicTracks.qml'
--- MusicTracks.qml 2014-08-28 23:33:29 +0000
+++ MusicTracks.qml 2014-09-12 03:03:34 +0000
@@ -77,7 +77,7 @@
7777
78 MusicRow {78 MusicRow {
79 id: musicRow79 id: musicRow
80 covers: [{author: model.author, album: model.album}]80 covers: [{art: model.art}]
81 column: Column {81 column: Column {
82 spacing: units.gu(1)82 spacing: units.gu(1)
83 Label {83 Label {
8484
=== modified file 'Player.qml'
--- Player.qml 2014-08-22 00:26:30 +0000
+++ Player.qml 2014-09-12 03:03:34 +0000
@@ -33,6 +33,7 @@
33 objectName: "player"33 objectName: "player"
3434
35 property string currentMetaAlbum: ""35 property string currentMetaAlbum: ""
36 property string currentMetaArt: ""
36 property string currentMetaArtist: ""37 property string currentMetaArtist: ""
37 property string currentMetaFile: ""38 property string currentMetaFile: ""
38 property string currentMetaTitle: ""39 property string currentMetaTitle: ""
@@ -186,6 +187,7 @@
186 else {187 else {
187 var obj = trackQueue.model.get(player.currentIndex);188 var obj = trackQueue.model.get(player.currentIndex);
188 currentMetaAlbum = obj.album;189 currentMetaAlbum = obj.album;
190 currentMetaArt = obj.art;
189 currentMetaArtist = obj.author;191 currentMetaArtist = obj.author;
190 currentMetaFile = obj.filename;192 currentMetaFile = obj.filename;
191 currentMetaTitle = obj.title;193 currentMetaTitle = obj.title;
192194
=== modified file 'common/AlbumsPage.qml'
--- common/AlbumsPage.qml 2014-09-04 00:13:59 +0000
+++ common/AlbumsPage.qml 2014-09-12 03:03:34 +0000
@@ -280,7 +280,7 @@
280 }280 }
281 count: 1281 count: 1
282 size: parent.height282 size: parent.height
283 covers: [{author: model.artist, album: model.title}]283 covers: [{art: model.art}]
284 spacing: units.gu(2)284 spacing: units.gu(2)
285 }285 }
286286
287287
=== modified file 'common/BlurredBackground.qml'
--- common/BlurredBackground.qml 2014-08-20 17:35:52 +0000
+++ common/BlurredBackground.qml 2014-09-12 03:03:34 +0000
@@ -24,7 +24,7 @@
24// Blurred background24// Blurred background
25Rectangle {25Rectangle {
26 anchors.fill: parent26 anchors.fill: parent
27 property string art: player.currentMetaFile === "" ? Qt.resolvedUrl("../images/music-app-cover@30.png") : "image://albumart/artist=" + player.currentMetaArtist + "&album=" + player.currentMetaAlbum27 property string art: player.currentMetaFile === "" ? Qt.resolvedUrl("../images/music-app-cover@30.png") : player.currentMetaArt
2828
29 // the album art29 // the album art
30 Image {30 Image {
3131
=== modified file 'common/CoverRow.qml'
--- common/CoverRow.qml 2014-08-20 17:35:52 +0000
+++ common/CoverRow.qml 2014-09-12 03:03:34 +0000
@@ -59,8 +59,10 @@
59 width: coverRow.size59 width: coverRow.size
60 height: width60 height: width
61 source: coverRow.count !== 0 && coverRow.covers[index] !== "" && coverRow.covers[index] !== undefined61 source: coverRow.count !== 0 && coverRow.covers[index] !== "" && coverRow.covers[index] !== undefined
62 ? "image://albumart/artist=" + coverRow.covers[index].author + "&album=" + coverRow.covers[index].album62 ? (coverRow.covers[index].art !== undefined
63 : Qt.resolvedUrl("../images/music-app-cover@30.png")63 ? coverRow.covers[index].art
64 : "image://albumart/artist=" + coverRow.covers[index].author + "&album=" + coverRow.covers[index].album)
65 : Qt.resolvedUrl("../images/music-app-cover@30.png")
64 onStatusChanged: {66 onStatusChanged: {
65 if (status === Image.Error) {67 if (status === Image.Error) {
66 source = Qt.resolvedUrl("../images/music-app-cover@30.png")68 source = Qt.resolvedUrl("../images/music-app-cover@30.png")
6769
=== modified file 'common/SongsPage.qml'
--- common/SongsPage.qml 2014-08-28 00:22:13 +0000
+++ common/SongsPage.qml 2014-09-12 03:03:34 +0000
@@ -238,7 +238,7 @@
238 trackClicked(albumtrackslist.model, index) // play track238 trackClicked(albumtrackslist.model, index) // play track
239239
240 if (isAlbum && songStackPage.line1 !== i18n.tr("Genre")) {240 if (isAlbum && songStackPage.line1 !== i18n.tr("Genre")) {
241 Library.addRecent(songStackPage.line2, songStackPage.line1, songStackPage.covers[0], songStackPage.line2, "album")241 Library.addRecent(songStackPage.line2, songStackPage.line1, model.art, songStackPage.line2, "album")
242 mainView.hasRecent = true242 mainView.hasRecent = true
243 recentModel.filterRecent()243 recentModel.filterRecent()
244 } else if (songStackPage.line1 === i18n.tr("Playlist")) {244 } else if (songStackPage.line1 === i18n.tr("Playlist")) {
@@ -272,7 +272,7 @@
272272
273 MusicRow {273 MusicRow {
274 id: musicRow274 id: musicRow
275 covers: [{author: model.author, album: model.album}]275 covers: model.art !== undefined ? [{art: model.art}] : [{author: model.author, album: model.album}]
276 column: Column {276 column: Column {
277 spacing: units.gu(1)277 spacing: units.gu(1)
278 Label {278 Label {
279279
=== modified file 'meta-database.js'
--- meta-database.js 2014-05-23 15:00:21 +0000
+++ meta-database.js 2014-09-12 03:03:34 +0000
@@ -82,7 +82,7 @@
82 var rs = tx.executeSql("SELECT * FROM recent ORDER BY time DESC LIMIT 15");82 var rs = tx.executeSql("SELECT * FROM recent ORDER BY time DESC LIMIT 15");
83 for(var i = 0; i < rs.rows.length; i++) {83 for(var i = 0; i < rs.rows.length; i++) {
84 var dbItem = rs.rows.item(i);84 var dbItem = rs.rows.item(i);
85 console.log("Time:"+ dbItem.time + ", Key:"+dbItem.key + ", Title:"+dbItem.title + ", Title2:"+dbItem.title2 + ", Type:"+dbItem.type);85 console.log("Time:"+ dbItem.time + ", Key:"+dbItem.key + ", Title:"+dbItem.title + ", Title2:"+dbItem.title2 + ", Type:"+dbItem.type + ", Art:"+dbItem.cover);
8686
87 if (dbItem.type === "album")87 if (dbItem.type === "album")
88 {88 {
@@ -90,6 +90,7 @@
90 title:dbItem.title || i18n.tr("Unknown Album"),90 title:dbItem.title || i18n.tr("Unknown Album"),
91 title2:dbItem.title2 || i18n.tr("Unknown Artist"),91 title2:dbItem.title2 || i18n.tr("Unknown Artist"),
92 key:dbItem.key || i18n.tr("Unknown Album"),92 key:dbItem.key || i18n.tr("Unknown Album"),
93 art:dbItem.cover || undefined,
93 type:dbItem.type94 type:dbItem.type
94 });95 });
95 }96 }
9697
=== modified file 'music-app.qml'
--- music-app.qml 2014-09-04 22:59:21 +0000
+++ music-app.qml 2014-09-12 03:03:34 +0000
@@ -217,7 +217,7 @@
217 songsAlbumArtistModel.album = decodeURIComponent(split[1]);217 songsAlbumArtistModel.album = decodeURIComponent(split[1]);
218218
219 // Add album to recent list219 // Add album to recent list
220 Library.addRecent(songsAlbumArtistModel.album, songsAlbumArtistModel.artist, null, songsAlbumArtistModel.album, "album")220 Library.addRecent(songsAlbumArtistModel.album, songsAlbumArtistModel.artist, songsAlbumArtistModel.art, songsAlbumArtistModel.album, "album")
221 mainView.hasRecent = true221 mainView.hasRecent = true
222 recentModel.filterRecent()222 recentModel.filterRecent()
223 }223 }
@@ -657,7 +657,7 @@
657 function makeDict(model) {657 function makeDict(model) {
658 return {658 return {
659 album: model.album,659 album: model.album,
660 art: "image://albumart/artist=" + model.author + "&album=" + model.album,660 art: model.art,
661 author: model.author,661 author: model.author,
662 filename: model.filename,662 filename: model.filename,
663 title: model.title663 title: model.title

Subscribers

People subscribed via source and target branches

to status/vote changes: