Merge lp:~michihenning/thumbnailer/zesty-test-suppression into lp:thumbnailer

Proposed by Michi Henning on 2016-11-08
Status: Merged
Approved by: Michi Henning on 2016-11-14
Approved revision: 377
Merged at revision: 153
Proposed branch: lp:~michihenning/thumbnailer/zesty-test-suppression
Merge into: lp:thumbnailer
Diff against target: 104 lines (+35/-3)
3 files modified
CMakeLists.txt (+1/-3)
debian/changelog (+8/-0)
src/local_album_art.cpp (+26/-0)
To merge this branch: bzr merge lp:~michihenning/thumbnailer/zesty-test-suppression
Reviewer Review Type Date Requested Status
Michi Henning (community) Approve on 2016-11-11
James Henstridge 2016-11-08 Approve on 2016-11-09
Review via email: mp+310376@code.launchpad.net

Commit message

Added zesty to list of distros for which we suppress Qt-related tests.
Fixed code to work with taglib 1.11, which breaks the behavior of the taglib 1.9 API.

Description of the change

Added zesty to list of distros for which we suppress Qt-related tests.

To post a comment you must log in.
James Henstridge (jamesh) wrote :

Looks good, although we'll need to find a real solution soon as we begin to rely more on Xenial.

review: Approve
Michi Henning (michihenning) wrote :

Re-approving. The only change since James's approval is the merged changelog and that the builders have reverted back to leveldb 1.18.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-09-26 00:50:50 +0000
3+++ CMakeLists.txt 2016-11-14 01:06:24 +0000
4@@ -88,10 +88,8 @@
5 if (${skip-dbus-tests})
6 execute_process(COMMAND lsb_release -s -c OUTPUT_VARIABLE distro OUTPUT_STRIP_TRAILING_WHITESPACE)
7 execute_process(COMMAND uname -m OUTPUT_VARIABLE arch OUTPUT_STRIP_TRAILING_WHITESPACE)
8- message("DISTRO: ${distro}")
9- message("ARCH: ${arch}")
10 if (
11- (${distro} STREQUAL "xenial" OR ${distro} STREQUAL "yakkety")
12+ (${distro} STREQUAL "xenial" OR ${distro} STREQUAL "yakkety" OR ${distro} STREQUAL "zesty")
13 AND
14 (${arch} STREQUAL "aarch64" OR ${arch} STREQUAL "ppc" OR ${arch} STREQUAL "ppc64le")
15 )
16
17=== modified file 'debian/changelog'
18--- debian/changelog 2016-11-14 00:40:33 +0000
19+++ debian/changelog 2016-11-14 01:06:24 +0000
20@@ -1,3 +1,11 @@
21+thumbnailer (2.4+16.10.20160926.2-0ubuntu3) UNRELEASED; urgency=medium
22+
23+ * Added zesty to list of distros for which we suppress Qt tests.
24+ * Fixed code to work with taglib 1.11, which breaks the behavior
25+ of the taglib 1.9 API.
26+
27+ -- Michi Henning <michi.henning@canonical.com> Mon, 14 Nov 2016 10:42:27 +1000
28+
29 thumbnailer (2.4+16.10.20160926.2-0ubuntu2) zesty; urgency=high
30
31 * No change rebuild against boost1.62.
32
33=== modified file 'src/local_album_art.cpp'
34--- src/local_album_art.cpp 2016-02-24 06:56:01 +0000
35+++ src/local_album_art.cpp 2016-11-14 01:06:24 +0000
36@@ -18,7 +18,12 @@
37
38 #include <internal/local_album_art.h>
39
40+#include <taglib/taglib.h>
41+
42+#if TAGLIB_MAJOR_VERSION == 1 && TAGLIB_MINOR_VERSION <= 9
43+#define TAGLIB_1_9 1
44 #include <QByteArray>
45+#endif
46
47 #include <taglib/attachedpictureframe.h>
48 #include <taglib/fileref.h>
49@@ -179,6 +184,11 @@
50 return dynamic_cast<TagLib::Ogg::XiphComment*>(fileref_.tag());
51 }
52
53+namespace
54+{
55+
56+#if TAGLIB_1_9
57+
58 // Decode base_64 string into a QByteArray
59
60 QByteArray decode_b64(TagLib::String const& base_64)
61@@ -210,6 +220,8 @@
62 return unique_ptr<TagLib::FLAC::Picture>(new TagLib::FLAC::Picture(byte_vector));
63 }
64
65+#endif
66+
67 // Helper function to pull cover (or other) art from a TagLib::FLAC::Picture.
68 // Returns true if an image was extracted and that image is the front cover.
69 // Otherwise, returns false and the art string is either set to some other
70@@ -246,6 +258,8 @@
71 return false;
72 }
73
74+} // namespace
75+
76 string OggExtractor::get_album_art() const
77 {
78 string art;
79@@ -253,6 +267,8 @@
80 auto const xc = get_xiph_comment();
81 if (xc)
82 {
83+#if TAGLIB_1_9
84+ // taglib 1.11 added a new API, and broke the behavior of the existing one.
85 auto const& map = xc->fieldListMap();
86 auto it = map.find("METADATA_BLOCK_PICTURE");
87 if (it != map.end())
88@@ -276,6 +292,16 @@
89 art = decode_b64(it->second.front()).toStdString();
90 }
91 }
92+#else
93+ auto piclist = xc->pictureList();
94+ for (auto const& pic : piclist)
95+ {
96+ if (extract_flac_art(pic, art))
97+ {
98+ break;
99+ }
100+ }
101+#endif
102 }
103
104 return art;

Subscribers

People subscribed via source and target branches

to all changes: