ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #08819
[Merge] lp:~vthompson/music-app/fix-1549557 into lp:music-app
Victor Thompson has proposed merging lp:~vthompson/music-app/fix-1549557 into lp:music-app.
Commit message:
* Fix fallback art when the it is linked to the Player's currentMeta
Requested reviews:
Music App Developers (music-app-dev)
Related bugs:
Bug #1549557 in Ubuntu Music App: "Fallback art is displayed in the toolbar sometimes when the art is actually defined"
https://bugs.launchpad.net/music-app/+bug/1549557
For more details, see:
https://code.launchpad.net/~vthompson/music-app/fix-1549557/+merge/288871
* Fix fallback art when the it is linked to the Player's currentMeta
--
Your team Music App Developers is requested to review the proposed merge of lp:~vthompson/music-app/fix-1549557 into lp:music-app.
=== modified file 'app/components/CoverGrid.qml'
--- app/components/CoverGrid.qml 2015-08-12 23:36:44 +0000
+++ app/components/CoverGrid.qml 2016-03-13 20:13:07 +0000
@@ -31,6 +31,9 @@
// Property to set the size of the cover image
property int size
+ // Property to determine if the fallback art should be used
+ property bool useFallbackArt: false
+
property string firstSource
onCoversChanged: {
@@ -56,7 +59,7 @@
fillMode: Image.PreserveAspectCrop
height: coverGrid.size / (coverGrid.covers.length > 1 ? 2 : 1)
width: coverGrid.size / (coverGrid.covers.length > 2 && !(coverGrid.covers.length === 3 && index === 2) ? 2 : 1)
- source: coverGrid.covers.length !== 0 && coverGrid.covers[index] !== "" && coverGrid.covers[index] !== undefined
+ source: coverGrid.covers.length !== 0 && coverGrid.covers[index] !== "" && coverGrid.covers[index] !== undefined && ((coverGrid.covers[index].useFallbackArt !== undefined && !coverGrid.covers[index].useFallbackArt) || !useFallbackArt)
? (coverGrid.covers[index].art !== undefined
? coverGrid.covers[index].art
: "image://albumart/artist=" + coverGrid.covers[index].author + "&album=" + coverGrid.covers[index].album)
@@ -73,8 +76,17 @@
onStatusChanged: {
if (status === Image.Error) {
- source = Qt.resolvedUrl("../graphics/music-app-cover@xxxxxx")
- } else if (status === Image.Ready && index === 0) {
+ useFallbackArt = true
+
+ // If this coverGrid is set to the Player's currentMeta,
+ // then override the player's flag to show the fallback art
+ if (coverGrid.covers[index].useFallbackArt !== undefined)
+ {
+ coverGrid.covers[index].useFallbackArt = true
+ }
+ }
+
+ if (status === Image.Ready && index === 0) {
firstSource = source
}
}
=== modified file 'app/components/Player.qml'
--- app/components/Player.qml 2016-01-16 01:54:00 +0000
+++ app/components/Player.qml 2016-03-13 20:13:07 +0000
@@ -49,6 +49,7 @@
property string author: ""
property string filename: ""
property string title: ""
+ property bool useFallbackArt: false
}
// Return the metadata for the source given from mediascanner2
@@ -118,6 +119,7 @@
currentMeta.author = meta.author;
currentMeta.filename = meta.filename;
currentMeta.title = meta.title;
+ currentMeta.useFallbackArt = false;
mediaPlayerObject._calcProgress();
}
=== modified file 'debian/changelog'
--- debian/changelog 2016-03-09 01:10:21 +0000
+++ debian/changelog 2016-03-13 20:13:07 +0000
@@ -9,6 +9,7 @@
* Fix regression where AddToPlaylist.qml no long supports plural track counts (LP: #1550832).
* Remove offset from the top of AddToPlaylist.qml (LP: #1538832).
* Fix topMargin of the Playlists empty state so title is not obscurred (LP: #1538829).
+ * Fix fallback art when the it is linked to the Player's currentMeta (LP: #1549557).
[ Andrew Hayzen ]
* Fix so that a press and hold cannot disable selection in the ContentHubExport.qml (LP: #1538838)
Follow ups