Merge lp:~jamesh/thumbnailer/no-fallback-albumart into lp:thumbnailer

Proposed by James Henstridge
Status: Superseded
Proposed branch: lp:~jamesh/thumbnailer/no-fallback-albumart
Merge into: lp:thumbnailer
Diff against target: 68 lines (+11/-12)
2 files modified
plugins/Ubuntu/Thumbnailer/albumartgenerator.cpp (+3/-12)
tests/qml/tst_image_provider.qml (+8/-0)
To merge this branch: bzr merge lp:~jamesh/thumbnailer/no-fallback-albumart
Reviewer Review Type Date Requested Status
James Henstridge Needs Fixing
Jussi Pakkanen (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+219460@code.launchpad.net

This proposal has been superseded by a proposal from 2015-06-29.

Commit message

Make the album art image provider return a null QImage on error so that applications can detect the failure and handle fallback themselves.

Description of the change

Rather than providing a fallback image from the albumart ImageProvider, return a null QImage object. When used with the QML Image component, this sets the status to Image.Error which allows applications to handle the fallback themselves.

This was requested by the music-app guys, but I haven't yet verified behaviour in the dash.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:85
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~jamesh/thumbnailer/no-fallback-albumart/+merge/219460/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/thumbnailer-ci/59/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/thumbnailer-utopic-amd64-ci/1
    SUCCESS: http://jenkins.qa.ubuntu.com/job/thumbnailer-utopic-armhf-ci/1
        deb: http://jenkins.qa.ubuntu.com/job/thumbnailer-utopic-armhf-ci/1/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/thumbnailer-utopic-i386-ci/1

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/thumbnailer-ci/59/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

Looks good.

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

It looks like this does cause problems for the dash: I get an empty space in the carousel where a song without album art sits.

We'll need some kind of fix for this on the Unity8 side before this can be merged.

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

I've filed a bug 1324142 on Unity8 about getting it to handle the error state correctly.

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

This has lingered for quite a while. What shall we do with this?

86. By James Henstridge

Merge from devel

87. By James Henstridge

Update "no fallback" code to work with QQuickAsyncImageResponse.

88. By James Henstridge

Simplify image response code a bit more. Still doesn't work right due
to Qt bug:
https://bugs.launchpad.net/ubuntu/+source/qtdeclarative-opensource-src/+bug/1469611

89. By James Henstridge

Include the ID in the errors from album/artist art generators.

90. By James Henstridge

Merge from devel

91. By James Henstridge

Fix up tests for removal of fallback art.

92. By James Henstridge

Remove fallback images.

93. By James Henstridge

Remove the default image override code from tests.

94. By James Henstridge

Remove the thumbnailer-common binary package:
 * Move the apport blacklist file to thumbnailer-service (only listing
   current architecture now, since it is arch specific).
 * Remove the fallback images entirely, since they are no longer used.

95. By James Henstridge

Merge from devel, fixing massive conflicts.

96. By James Henstridge

Fix up QML tests.

97. By James Henstridge

Add direct image provider tests for error conditions.

98. By James Henstridge

Remove obsolete comment from textureFactory() method.

99. By James Henstridge

Remove error logging in requestFinished() method.

We now expose the error message via the errorString() method, which Qt
itself will log.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/Ubuntu/Thumbnailer/albumartgenerator.cpp'
--- plugins/Ubuntu/Thumbnailer/albumartgenerator.cpp 2014-03-28 04:08:24 +0000
+++ plugins/Ubuntu/Thumbnailer/albumartgenerator.cpp 2014-05-14 07:15:45 +0000
@@ -25,8 +25,6 @@
25#include <QDBusUnixFileDescriptor>25#include <QDBusUnixFileDescriptor>
26#include <QDBusReply>26#include <QDBusReply>
2727
28static const char DEFAULT_ALBUM_ART[] = "/usr/share/unity/icons/album_missing.png";
29
30static const char BUS_NAME[] = "com.canonical.Thumbnailer";28static const char BUS_NAME[] = "com.canonical.Thumbnailer";
31static const char BUS_PATH[] = "/com/canonical/Thumbnailer";29static const char BUS_PATH[] = "/com/canonical/Thumbnailer";
32static const char THUMBNAILER_IFACE[] = "com.canonical.Thumbnailer";30static const char THUMBNAILER_IFACE[] = "com.canonical.Thumbnailer";
@@ -37,19 +35,12 @@
37 iface(BUS_NAME, BUS_PATH, THUMBNAILER_IFACE) {35 iface(BUS_NAME, BUS_PATH, THUMBNAILER_IFACE) {
38}36}
3937
40static QImage fallbackImage(QSize *realSize) {
41 QImage fallback;
42 fallback.load(DEFAULT_ALBUM_ART);
43 *realSize = fallback.size();
44 return fallback;
45}
46
47QImage AlbumArtGenerator::requestImage(const QString &id, QSize *realSize,38QImage AlbumArtGenerator::requestImage(const QString &id, QSize *realSize,
48 const QSize &requestedSize) {39 const QSize &requestedSize) {
49 QUrlQuery query(id);40 QUrlQuery query(id);
50 if (!query.hasQueryItem("artist") || !query.hasQueryItem("album")) {41 if (!query.hasQueryItem("artist") || !query.hasQueryItem("album")) {
51 qWarning() << "Invalid albumart uri:" << id;42 qWarning() << "Invalid albumart uri:" << id;
52 return fallbackImage(realSize);43 return QImage();
53 }44 }
5445
55 const QString artist = query.queryItemValue("artist", QUrl::FullyDecoded);46 const QString artist = query.queryItemValue("artist", QUrl::FullyDecoded);
@@ -70,7 +61,7 @@
70 GET_ALBUM_ART, artist, album, desiredSize);61 GET_ALBUM_ART, artist, album, desiredSize);
71 if (!reply.isValid()) {62 if (!reply.isValid()) {
72 qWarning() << "D-Bus error: " << reply.error().message();63 qWarning() << "D-Bus error: " << reply.error().message();
73 return fallbackImage(realSize);64 return QImage();
74 }65 }
7566
76 try {67 try {
@@ -86,5 +77,5 @@
86 qDebug() << "Unknown error when generating image.";77 qDebug() << "Unknown error when generating image.";
87 }78 }
8879
89 return fallbackImage(realSize);80 return QImage();
90}81}
9182
=== modified file 'tests/qml/tst_image_provider.qml'
--- tests/qml/tst_image_provider.qml 2014-03-28 08:35:04 +0000
+++ tests/qml/tst_image_provider.qml 2014-05-14 07:15:45 +0000
@@ -33,6 +33,14 @@
33 comparePixel(ctx, 0, 0, 242, 228, 209, 255);33 comparePixel(ctx, 0, 0, 242, 228, 209, 255);
34 }34 }
3535
36 function test_notfound() {
37 image.source = "image://albumart/artist=notfound&album=notfound";
38 while (image.status == Image.Loading) {
39 spy.wait();
40 }
41 compare(image.status, Image.Error);
42 }
43
36 function loadImage(uri) {44 function loadImage(uri) {
37 image.source = uri45 image.source = uri
38 while (image.status == Image.Loading) {46 while (image.status == Image.Loading) {

Subscribers

People subscribed via source and target branches

to all changes: