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
1=== modified file 'src/mymusic/music-scope.cpp'
2--- src/mymusic/music-scope.cpp 2015-11-03 10:26:42 +0000
3+++ src/mymusic/music-scope.cpp 2016-01-13 04:27:43 +0000
4@@ -62,7 +62,6 @@
5 "art": {
6 "field": "art",
7 "conciergeMode": true,
8- "fallback": "@FALLBACK@"
9 },
10 "summary" : "summary"
11 }
12@@ -200,7 +199,10 @@
13 },
14 "components": {
15 "title": "title",
16- "art": "art",
17+ "art": {
18+ "field": "art",
19+ "fallback": "@FALLBACK@"
20+ },
21 "subtitle": "artist"
22 }
23 }
24@@ -309,7 +311,7 @@
25
26 if (!scope.store->hasMedia(AudioMedia))
27 {
28- const CategoryRenderer renderer = make_renderer(GET_STARTED_CATEGORY_DEFINITION, MISSING_ALBUM_ART);
29+ const CategoryRenderer renderer(GET_STARTED_CATEGORY_DEFINITION);
30 auto cat = reply->register_category("mymusic-getstarted", "", "", renderer);
31 CategorisedResult res(cat);
32 res.set_uri(query().to_uri());
33@@ -648,8 +650,8 @@
34
35 void MusicQuery::query_albums_by_artist(unity::scopes::SearchReplyProxy const &reply, const std::string& artist) const
36 {
37- CategoryRenderer bio_renderer(ARTIST_BIO_CATEGORY_DEFINITION);
38- CategoryRenderer renderer(ALBUMS_CATEGORY_DEFINITION);
39+ CategoryRenderer bio_renderer = make_renderer(ARTIST_BIO_CATEGORY_DEFINITION, MISSING_ALBUM_ART);
40+ CategoryRenderer renderer = make_renderer(ALBUMS_CATEGORY_DEFINITION, MISSING_ALBUM_ART);
41
42 auto biocat = reply->register_category("bio", "", "", bio_renderer);
43 auto albumcat = reply->register_category("albums", _("Albums"), SONGS_CATEGORY_ICON, renderer);
44@@ -699,7 +701,7 @@
45 auto cat = override_category;
46 if (!cat)
47 {
48- CategoryRenderer renderer(query().query_string() == "" ? ALBUMS_CATEGORY_DEFINITION : SEARCH_CATEGORY_DEFINITION);
49+ CategoryRenderer renderer = make_renderer(query().query_string() == "" ? ALBUMS_CATEGORY_DEFINITION : SEARCH_CATEGORY_DEFINITION, MISSING_ALBUM_ART);
50 cat = reply->register_category("albums", show_title ? _("Albums") : "", SONGS_CATEGORY_ICON, renderer);
51 }
52
53@@ -753,6 +755,8 @@
54
55 PreviewWidget artwork("art", "image");
56 artwork.add_attribute_mapping("source", "art");
57+ artwork.add_attribute_value("fallback", Variant(
58+ scope.scope_directory() + "/" + MISSING_ALBUM_ART));
59
60 PreviewWidget tracks("tracks", "audio");
61 {
62@@ -798,6 +802,8 @@
63
64 PreviewWidget artwork("art", "image");
65 artwork.add_attribute_mapping("source", "art");
66+ artwork.add_attribute_value("fallback", Variant(
67+ scope.scope_directory() + "/" + MISSING_ALBUM_ART));
68
69 PreviewWidget header("header", "header");
70 header.add_attribute_mapping("title", "title");

Subscribers

People subscribed via source and target branches

to all changes: