Merge lp:~jamesh/unity-scope-mediascanner/fallback-art-fixes into lp:unity-scope-mediascanner

Proposed by James Henstridge
Status: Merged
Approved by: Michi Henning
Approved revision: 281
Merged at revision: 281
Proposed branch: lp:~jamesh/unity-scope-mediascanner/fallback-art-fixes
Merge into: lp:unity-scope-mediascanner
Diff against target: 70 lines (+12/-6)
1 file modified
src/mymusic/music-scope.cpp (+12/-6)
To merge this branch: bzr merge lp:~jamesh/unity-scope-mediascanner/fallback-art-fixes
Reviewer Review Type Date Requested Status
Michi Henning (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+282396@code.launchpad.net

Commit message

Substitute in the fallback image file name for album category renderer templates in the My Music scope, and set the fallback image in previews.

Description of the change

Some of the category renderer definitions produced by the music scope do not correctly substitute in the fallback art file name. When we remove fallback image support within the thumbnailer, this causes display bugs for those result pages.

This seems to be a result of my fallback art changes not being completely in sync with Pawel's filters changes, so this branch fixes the last few cases.

In addition to this, I've also set the fallback image for the artwork shown in previews from the scope. There is no facility to specify a fallback for the video preview widget, so I haven't done anything there.

To post a comment you must log in.
281. By James Henstridge

Add fallback image attributes to the artwork in previews.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michi Henning (michihenning) wrote :

Looks good to me!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/mymusic/music-scope.cpp'
--- src/mymusic/music-scope.cpp 2015-11-03 10:26:42 +0000
+++ src/mymusic/music-scope.cpp 2016-01-13 04:27:43 +0000
@@ -62,7 +62,6 @@
62 "art": {62 "art": {
63 "field": "art",63 "field": "art",
64 "conciergeMode": true,64 "conciergeMode": true,
65 "fallback": "@FALLBACK@"
66 },65 },
67 "summary" : "summary"66 "summary" : "summary"
68 }67 }
@@ -200,7 +199,10 @@
200 },199 },
201 "components": {200 "components": {
202 "title": "title",201 "title": "title",
203 "art": "art",202 "art": {
203 "field": "art",
204 "fallback": "@FALLBACK@"
205 },
204 "subtitle": "artist"206 "subtitle": "artist"
205 }207 }
206}208}
@@ -309,7 +311,7 @@
309311
310 if (!scope.store->hasMedia(AudioMedia))312 if (!scope.store->hasMedia(AudioMedia))
311 {313 {
312 const CategoryRenderer renderer = make_renderer(GET_STARTED_CATEGORY_DEFINITION, MISSING_ALBUM_ART);314 const CategoryRenderer renderer(GET_STARTED_CATEGORY_DEFINITION);
313 auto cat = reply->register_category("mymusic-getstarted", "", "", renderer);315 auto cat = reply->register_category("mymusic-getstarted", "", "", renderer);
314 CategorisedResult res(cat);316 CategorisedResult res(cat);
315 res.set_uri(query().to_uri());317 res.set_uri(query().to_uri());
@@ -648,8 +650,8 @@
648650
649void MusicQuery::query_albums_by_artist(unity::scopes::SearchReplyProxy const &reply, const std::string& artist) const651void MusicQuery::query_albums_by_artist(unity::scopes::SearchReplyProxy const &reply, const std::string& artist) const
650{652{
651 CategoryRenderer bio_renderer(ARTIST_BIO_CATEGORY_DEFINITION);653 CategoryRenderer bio_renderer = make_renderer(ARTIST_BIO_CATEGORY_DEFINITION, MISSING_ALBUM_ART);
652 CategoryRenderer renderer(ALBUMS_CATEGORY_DEFINITION);654 CategoryRenderer renderer = make_renderer(ALBUMS_CATEGORY_DEFINITION, MISSING_ALBUM_ART);
653655
654 auto biocat = reply->register_category("bio", "", "", bio_renderer);656 auto biocat = reply->register_category("bio", "", "", bio_renderer);
655 auto albumcat = reply->register_category("albums", _("Albums"), SONGS_CATEGORY_ICON, renderer);657 auto albumcat = reply->register_category("albums", _("Albums"), SONGS_CATEGORY_ICON, renderer);
@@ -699,7 +701,7 @@
699 auto cat = override_category;701 auto cat = override_category;
700 if (!cat)702 if (!cat)
701 {703 {
702 CategoryRenderer renderer(query().query_string() == "" ? ALBUMS_CATEGORY_DEFINITION : SEARCH_CATEGORY_DEFINITION);704 CategoryRenderer renderer = make_renderer(query().query_string() == "" ? ALBUMS_CATEGORY_DEFINITION : SEARCH_CATEGORY_DEFINITION, MISSING_ALBUM_ART);
703 cat = reply->register_category("albums", show_title ? _("Albums") : "", SONGS_CATEGORY_ICON, renderer);705 cat = reply->register_category("albums", show_title ? _("Albums") : "", SONGS_CATEGORY_ICON, renderer);
704 }706 }
705707
@@ -753,6 +755,8 @@
753755
754 PreviewWidget artwork("art", "image");756 PreviewWidget artwork("art", "image");
755 artwork.add_attribute_mapping("source", "art");757 artwork.add_attribute_mapping("source", "art");
758 artwork.add_attribute_value("fallback", Variant(
759 scope.scope_directory() + "/" + MISSING_ALBUM_ART));
756760
757 PreviewWidget tracks("tracks", "audio");761 PreviewWidget tracks("tracks", "audio");
758 {762 {
@@ -798,6 +802,8 @@
798802
799 PreviewWidget artwork("art", "image");803 PreviewWidget artwork("art", "image");
800 artwork.add_attribute_mapping("source", "art");804 artwork.add_attribute_mapping("source", "art");
805 artwork.add_attribute_value("fallback", Variant(
806 scope.scope_directory() + "/" + MISSING_ALBUM_ART));
801807
802 PreviewWidget header("header", "header");808 PreviewWidget header("header", "header");
803 header.add_attribute_mapping("title", "title");809 header.add_attribute_mapping("title", "title");

Subscribers

People subscribed via source and target branches

to all changes: