Merge lp:~vthompson/music-app/fix-1549557 into lp:music-app

Proposed by Victor Thompson on 2016-03-13
Status: Merged
Approved by: Andrew Hayzen on 2016-03-15
Approved revision: 994
Merged at revision: 995
Proposed branch: lp:~vthompson/music-app/fix-1549557
Merge into: lp:music-app
Diff against target: 73 lines (+17/-3)
3 files modified
app/components/CoverGrid.qml (+14/-3)
app/components/Player.qml (+2/-0)
debian/changelog (+1/-0)
To merge this branch: bzr merge lp:~vthompson/music-app/fix-1549557
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Approve on 2016-03-23
Andrew Hayzen 2016-03-13 Approve on 2016-03-15
Review via email: mp+288871@code.launchpad.net

Commit Message

* Fix fallback art when the it is linked to the Player's currentMeta

Description of the Change

* Fix fallback art when the it is linked to the Player's currentMeta

To post a comment you must log in.
lp:~vthompson/music-app/fix-1549557 updated on 2016-03-13
993. By Victor Thompson on 2016-03-13

Fix spacing

Andrew Hayzen (ahayzen) wrote :

Interesting fix, but seems to work :-)

review: Approve
Victor Thompson (vthompson) wrote :

I'll fix the placement of the curly brace--code smell from day job ;)

Andrew Hayzen (ahayzen) wrote :

Hehe, I thought so :-)

lp:~vthompson/music-app/fix-1549557 updated on 2016-03-15
994. By Victor Thompson on 2016-03-15

Update code style

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/components/CoverGrid.qml'
2--- app/components/CoverGrid.qml 2015-08-12 23:36:44 +0000
3+++ app/components/CoverGrid.qml 2016-03-15 02:09:56 +0000
4@@ -31,6 +31,9 @@
5 // Property to set the size of the cover image
6 property int size
7
8+ // Property to determine if the fallback art should be used
9+ property bool useFallbackArt: false
10+
11 property string firstSource
12
13 onCoversChanged: {
14@@ -56,7 +59,7 @@
15 fillMode: Image.PreserveAspectCrop
16 height: coverGrid.size / (coverGrid.covers.length > 1 ? 2 : 1)
17 width: coverGrid.size / (coverGrid.covers.length > 2 && !(coverGrid.covers.length === 3 && index === 2) ? 2 : 1)
18- source: coverGrid.covers.length !== 0 && coverGrid.covers[index] !== "" && coverGrid.covers[index] !== undefined
19+ source: coverGrid.covers.length !== 0 && coverGrid.covers[index] !== "" && coverGrid.covers[index] !== undefined && ((coverGrid.covers[index].useFallbackArt !== undefined && !coverGrid.covers[index].useFallbackArt) || !useFallbackArt)
20 ? (coverGrid.covers[index].art !== undefined
21 ? coverGrid.covers[index].art
22 : "image://albumart/artist=" + coverGrid.covers[index].author + "&album=" + coverGrid.covers[index].album)
23@@ -73,8 +76,16 @@
24
25 onStatusChanged: {
26 if (status === Image.Error) {
27- source = Qt.resolvedUrl("../graphics/music-app-cover@30.png")
28- } else if (status === Image.Ready && index === 0) {
29+ useFallbackArt = true
30+
31+ // If this coverGrid is set to the Player's currentMeta,
32+ // then override the player's flag to show the fallback art
33+ if (coverGrid.covers[index].useFallbackArt !== undefined) {
34+ coverGrid.covers[index].useFallbackArt = true
35+ }
36+ }
37+
38+ if (status === Image.Ready && index === 0) {
39 firstSource = source
40 }
41 }
42
43=== modified file 'app/components/Player.qml'
44--- app/components/Player.qml 2016-01-16 01:54:00 +0000
45+++ app/components/Player.qml 2016-03-15 02:09:56 +0000
46@@ -49,6 +49,7 @@
47 property string author: ""
48 property string filename: ""
49 property string title: ""
50+ property bool useFallbackArt: false
51 }
52
53 // Return the metadata for the source given from mediascanner2
54@@ -118,6 +119,7 @@
55 currentMeta.author = meta.author;
56 currentMeta.filename = meta.filename;
57 currentMeta.title = meta.title;
58+ currentMeta.useFallbackArt = false;
59
60 mediaPlayerObject._calcProgress();
61 }
62
63=== modified file 'debian/changelog'
64--- debian/changelog 2016-03-09 01:10:21 +0000
65+++ debian/changelog 2016-03-15 02:09:56 +0000
66@@ -9,6 +9,7 @@
67 * Fix regression where AddToPlaylist.qml no long supports plural track counts (LP: #1550832).
68 * Remove offset from the top of AddToPlaylist.qml (LP: #1538832).
69 * Fix topMargin of the Playlists empty state so title is not obscurred (LP: #1538829).
70+ * Fix fallback art when the it is linked to the Player's currentMeta (LP: #1549557).
71
72 [ Andrew Hayzen ]
73 * Fix so that a press and hold cannot disable selection in the ContentHubExport.qml (LP: #1538838)

Subscribers

People subscribed via source and target branches