Update KDE4 version of Tellico to 2.3.10.

This includes a few patches from upstream (to be gone in the next release).
Prodded and reminded by <private person>, thanks!
This commit is contained in:
zhuk 2015-05-02 15:30:31 +00:00
parent 49170b698c
commit 222260d364
11 changed files with 348 additions and 26 deletions

View File

@ -1,11 +1,7 @@
# $OpenBSD: Makefile,v 1.3 2015/03/27 08:16:23 ajacoutot Exp $ # $OpenBSD: Makefile,v 1.4 2015/05/02 15:30:31 zhuk Exp $
# XXX remove patch-src_gui_CMakeLists_txt on the next update,
# upstream removed dependency of GUI on tellico-config.h.
COMMENT = organizer for book/music/video collections for KDE4 COMMENT = organizer for book/music/video collections for KDE4
DISTNAME = tellico-2.3.9 DISTNAME = tellico-2.3.10
REVISION = 0
CATEGORIES = productivity x11 CATEGORIES = productivity x11
HOMEPAGE = http://tellico-project.org/ HOMEPAGE = http://tellico-project.org/
@ -20,7 +16,7 @@ WANTLIB += lib/qt4/QtXml
WANTLIB += ${KDE4LIB}/kabc ${KDE4LIB}/kcal ${KDE4LIB}/kcddb WANTLIB += ${KDE4LIB}/kabc ${KDE4LIB}/kcal ${KDE4LIB}/kcddb
WANTLIB += ${KDE4LIB}/kdeui ${KDE4LIB}/khtml ${KDE4LIB}/kio ${KDE4LIB}/kjs WANTLIB += ${KDE4LIB}/kdeui ${KDE4LIB}/khtml ${KDE4LIB}/kio ${KDE4LIB}/kjs
WANTLIB += ${KDE4LIB}/knewstuff3 ${KDE4LIB}/kparts ${KDE4LIB}/kresources WANTLIB += ${KDE4LIB}/knewstuff3 ${KDE4LIB}/kparts ${KDE4LIB}/kresources
WANTLIB += ${KDE4LIB}/ksane ${KDE4LIB}/kxmlrpcclient ${KDE4LIB}/nepomuk WANTLIB += ${KDE4LIB}/ksane ${KDE4LIB}/nepomuk
WANTLIB += ${KDE4LIB}/nepomukutils ${KDE4LIB}/solid WANTLIB += ${KDE4LIB}/nepomukutils ${KDE4LIB}/solid
WANTLIB += exempi exslt gcrypt gpg-error poppler-qt4 qimageblitz qjson WANTLIB += exempi exslt gcrypt gpg-error poppler-qt4 qimageblitz qjson
WANTLIB += soprano tag xml2 xslt yaz WANTLIB += soprano tag xml2 xslt yaz

View File

@ -1,2 +1,2 @@
SHA256 (tellico-2.3.9.tar.bz2) = UYTBMOp1Yb5uclgBBfMNXxYP0v1cn/x/fhb68ieiARQ= SHA256 (tellico-2.3.10.tar.bz2) = 6RYQH4a2+EO4W+QuhUWqdEHNSWy7m4FZDi4L0DpY+qo=
SIZE (tellico-2.3.9.tar.bz2) = 4855832 SIZE (tellico-2.3.10.tar.bz2) = 4877384

View File

@ -0,0 +1,31 @@
$OpenBSD: patch-src_fetch_allocinefetcher_cpp,v 1.1 2015/05/02 15:30:31 zhuk Exp $
Be sure to download image data in fetchers before setting field
(upstream 2510d692).
--- src/fetch/allocinefetcher.cpp.orig Sun Feb 15 22:23:56 2015
+++ src/fetch/allocinefetcher.cpp Sat May 2 18:10:19 2015
@@ -25,6 +25,7 @@
#include <config.h>
#include "allocinefetcher.h"
#include "../collections/videocollection.h"
+#include "../images/imagefactory.h"
#include "../entry.h"
#include "../gui/guiproxy.h"
#include "../tellico_utils.h"
@@ -219,6 +220,17 @@ Tellico::Data::EntryPtr AbstractAllocineFetcher::fetch
}
populateEntry(entry, result);
#endif
+
+ // image might still be a URL
+ const QString image_id = entry->field(QLatin1String("cover"));
+ if(image_id.contains(QLatin1Char('/'))) {
+ const QString id = ImageFactory::addImage(image_id, true /* quiet */);
+ if(id.isEmpty()) {
+ message(i18n("The cover image could not be loaded."), MessageHandler::Warning);
+ }
+ // empty image ID is ok
+ entry->setField(QLatin1String("cover"), id);
+ }
// don't want to include id
entry->collection()->removeField(QLatin1String("allocine-code"));

View File

@ -0,0 +1,93 @@
$OpenBSD: patch-src_fetch_discogsfetcher_cpp,v 1.1 2015/05/02 15:30:31 zhuk Exp $
1. Unbreak build (upstream d4a7f2b2).
2. Unbreak fetching Discogs images (upstream 61c9b539).
3. Be sure to download image data in fetchers before setting field
(upstream 2510d692).
--- src/fetch/discogsfetcher.cpp.orig Sun Feb 15 22:23:56 2015
+++ src/fetch/discogsfetcher.cpp Sat May 2 18:16:23 2015
@@ -25,6 +25,7 @@
#include <config.h>
#include "discogsfetcher.h"
#include "../collections/musiccollection.h"
+#include "../images/imagefactory.h"
#include "../gui/guiproxy.h"
#include "../core/filehandler.h"
#include "../tellico_utils.h"
@@ -117,7 +118,6 @@ void DiscogsFetcher::search() {
case Keyword:
u.setPath(QLatin1String("/database/search"));
u.addQueryItem(QLatin1String("q"), request().value);
- //u.addQueryItem(QLatin1String("type"), QLatin1String("all"));
break;
case Raw:
@@ -187,6 +187,17 @@ Tellico::Data::EntryPtr DiscogsFetcher::fetchEntryHook
}
#endif
+ const QString image_id = entry->field(QLatin1String("cover"));
+ // if it's still a url, we need to load it
+ if(image_id.contains(QLatin1Char('/'))) {
+ const QString id = ImageFactory::addImage(image_id, true /* quiet */);
+ if(id.isEmpty()) {
+ message(i18n("The cover image could not be loaded."), MessageHandler::Warning);
+ }
+ // empty image ID is ok
+ entry->setField(QLatin1String("cover"), id);
+ }
+
// don't want to include ID field
entry->setField(QLatin1String("discogs-id"), QString());
@@ -265,9 +276,9 @@ void DiscogsFetcher::slotComplete(KJob* job_) {
}
QJson::Parser parser;
- const QVariantMap result = parser.parse(data).toMap();
+ const QVariantMap resultMap = parser.parse(data).toMap();
- if(value(result, "message").startsWith(QLatin1String("Invalid consumer token"))) {
+ if(value(resultMap, "message").startsWith(QLatin1String("Invalid consumer token"))) {
message(i18n("The Discogs.com server reports a token error."),
MessageHandler::Error);
stop();
@@ -275,7 +286,7 @@ void DiscogsFetcher::slotComplete(KJob* job_) {
}
int count = 0;
- foreach(const QVariant& result, result.value(QLatin1String("results")).toList()) {
+ foreach(const QVariant& result, resultMap.value(QLatin1String("results")).toList()) {
if(count >= DISCOGS_MAX_RETURNS_TOTAL) {
break;
}
@@ -313,6 +324,13 @@ void DiscogsFetcher::populateEntry(Data::EntryPtr entr
}
entry_->setField(QLatin1String("label"), labels.join(FieldFormat::delimiterString()));
+ // thumb images are only returned in search, not in a full request
+ // so include them now, even though they're only needed for full data
+ const QString coverUrl = value(resultMap_, "thumb");
+ if(!coverUrl.isEmpty()) {
+ entry_->setField(QLatin1String("cover"), coverUrl);
+ }
+
// if we only need cursory data, then we're done
if(!fullData_) {
return;
@@ -384,16 +402,6 @@ void DiscogsFetcher::populateEntry(Data::EntryPtr entr
}
entry_->setField(QLatin1String("comments"), value(resultMap_, "notes"));
-
-
- /* cover image authentication with personal token does not work yet
- QUrl coverUrl = value(resultMap_, "thumb");
- if(!coverUrl.isEmpty()) {
- // also need authentication
- coverUrl.addQueryItem(QLatin1String("token"), m_apiKey);
- entry_->setField(QLatin1String("cover"), coverUrl.toString());
- }
- */
}
Tellico::Fetch::ConfigWidget* DiscogsFetcher::configWidget(QWidget* parent_) const {

View File

@ -0,0 +1,72 @@
$OpenBSD: patch-src_fetch_discogsfetcher_cpp.orig,v 1.1 2015/05/02 15:30:31 zhuk Exp $
1. Unbreak build.
2. Unbreak fetching Discogs images (upstream 61c9b539).
3. Be sure to download image data in fetchers before setting field
(upstream 2510d692).
--- src/fetch/discogsfetcher.cpp.orig Sat May 2 18:08:26 2015
+++ src/fetch/discogsfetcher.cpp Sat May 2 18:10:19 2015
@@ -25,6 +25,7 @@
#include <config.h>
#include "discogsfetcher.h"
#include "../collections/musiccollection.h"
+#include "../images/imagefactory.h"
#include "../gui/guiproxy.h"
#include "../core/filehandler.h"
#include "../tellico_utils.h"
@@ -117,7 +118,6 @@ void DiscogsFetcher::search() {
case Keyword:
u.setPath(QLatin1String("/database/search"));
u.addQueryItem(QLatin1String("q"), request().value);
- //u.addQueryItem(QLatin1String("type"), QLatin1String("all"));
break;
case Raw:
@@ -187,6 +187,17 @@ Tellico::Data::EntryPtr DiscogsFetcher::fetchEntryHook
}
#endif
+ const QString image_id = entry->field(QLatin1String("cover"));
+ // if it's still a url, we need to load it
+ if(image_id.contains(QLatin1Char('/'))) {
+ const QString id = ImageFactory::addImage(image_id, true /* quiet */);
+ if(id.isEmpty()) {
+ message(i18n("The cover image could not be loaded."), MessageHandler::Warning);
+ }
+ // empty image ID is ok
+ entry->setField(QLatin1String("cover"), id);
+ }
+
// don't want to include ID field
entry->setField(QLatin1String("discogs-id"), QString());
@@ -313,6 +324,13 @@ void DiscogsFetcher::populateEntry(Data::EntryPtr entr
}
entry_->setField(QLatin1String("label"), labels.join(FieldFormat::delimiterString()));
+ // thumb images are only returned in search, not in a full request
+ // so include them now, even though they're only needed for full data
+ const QString coverUrl = value(resultMap_, "thumb");
+ if(!coverUrl.isEmpty()) {
+ entry_->setField(QLatin1String("cover"), coverUrl);
+ }
+
// if we only need cursory data, then we're done
if(!fullData_) {
return;
@@ -384,16 +402,6 @@ void DiscogsFetcher::populateEntry(Data::EntryPtr entr
}
entry_->setField(QLatin1String("comments"), value(resultMap_, "notes"));
-
-
- /* cover image authentication with personal token does not work yet
- QUrl coverUrl = value(resultMap_, "thumb");
- if(!coverUrl.isEmpty()) {
- // also need authentication
- coverUrl.addQueryItem(QLatin1String("token"), m_apiKey);
- entry_->setField(QLatin1String("cover"), coverUrl.toString());
- }
- */
}
Tellico::Fetch::ConfigWidget* DiscogsFetcher::configWidget(QWidget* parent_) const {

View File

@ -0,0 +1,31 @@
$OpenBSD: patch-src_fetch_moviemeterfetcher_cpp,v 1.1 2015/05/02 15:30:31 zhuk Exp $
Be sure to download image data in fetchers before setting field
(upstream 2510d692).
--- src/fetch/moviemeterfetcher.cpp.orig Sun Feb 15 22:23:56 2015
+++ src/fetch/moviemeterfetcher.cpp Sat May 2 18:10:19 2015
@@ -25,6 +25,7 @@
#include <config.h>
#include "moviemeterfetcher.h"
#include "../collections/videocollection.h"
+#include "../images/imagefactory.h"
#include "../gui/guiproxy.h"
#include "../core/filehandler.h"
#include "../tellico_utils.h"
@@ -160,6 +161,17 @@ Tellico::Data::EntryPtr MovieMeterFetcher::fetchEntryH
populateEntry(entry, parser.parse(data).toMap(), true);
}
#endif
+
+ // image might still be URL
+ const QString image_id = entry->field(QLatin1String("cover"));
+ if(image_id.contains(QLatin1Char('/'))) {
+ const QString id = ImageFactory::addImage(image_id, true /* quiet */);
+ if(id.isEmpty()) {
+ message(i18n("The cover image could not be loaded."), MessageHandler::Warning);
+ }
+ // empty image ID is ok
+ entry->setField(QLatin1String("cover"), id);
+ }
// don't want to include ID field
entry->setField(QLatin1String("moviemeter-id"), QString());

View File

@ -0,0 +1,31 @@
$OpenBSD: patch-src_fetch_themoviedbfetcher_cpp,v 1.1 2015/05/02 15:30:31 zhuk Exp $
Be sure to download image data in fetchers before setting field
(upstream 2510d692).
--- src/fetch/themoviedbfetcher.cpp.orig Sun Feb 15 22:23:56 2015
+++ src/fetch/themoviedbfetcher.cpp Sat May 2 18:10:19 2015
@@ -25,6 +25,7 @@
#include <config.h>
#include "themoviedbfetcher.h"
#include "../collections/videocollection.h"
+#include "../images/imagefactory.h"
#include "../gui/combobox.h"
#include "../gui/guiproxy.h"
#include "../core/filehandler.h"
@@ -200,6 +201,17 @@ Tellico::Data::EntryPtr TheMovieDBFetcher::fetchEntryH
populateEntry(entry, parser.parse(data).toMap(), true);
}
#endif
+
+ // image might still be a URL
+ const QString image_id = entry->field(QLatin1String("cover"));
+ if(image_id.contains(QLatin1Char('/'))) {
+ const QString id = ImageFactory::addImage(image_id, true /* quiet */);
+ if(id.isEmpty()) {
+ message(i18n("The cover image could not be loaded."), MessageHandler::Warning);
+ }
+ // empty image ID is ok
+ entry->setField(QLatin1String("cover"), id);
+ }
// don't want to include TMDb ID field
entry->setField(QLatin1String("tmdb-id"), QString());

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-src_fetch_vndbfetcher_cpp,v 1.1 2015/05/02 15:30:31 zhuk Exp $
Be sure to download image data in fetchers before setting field
(upstream 2510d692).
--- src/fetch/vndbfetcher.cpp.orig Sun Feb 15 22:23:56 2015
+++ src/fetch/vndbfetcher.cpp Sat May 2 18:10:19 2015
@@ -161,6 +161,17 @@ Tellico::Data::EntryPtr VNDBFetcher::fetchEntryHook(ui
return Data::EntryPtr();
}
+ // image might still be a URL
+ const QString image_id = entry->field(QLatin1String("cover"));
+ if(image_id.contains(QLatin1Char('/'))) {
+ const QString id = ImageFactory::addImage(image_id, true /* quiet */);
+ if(id.isEmpty()) {
+ message(i18n("The cover image could not be loaded."), MessageHandler::Warning);
+ }
+ // empty image ID is ok
+ entry->setField(QLatin1String("cover"), id);
+ }
+
return entry;
}

View File

@ -1,11 +0,0 @@
$OpenBSD: patch-src_gui_CMakeLists_txt,v 1.1.1.1 2014/07/13 12:30:14 zhuk Exp $
Unbreak build.
REVIEW: https://git.reviewboard.kde.org/r/119260/
--- src/gui/CMakeLists.txt.orig Sat Mar 30 12:46:34 2013
+++ src/gui/CMakeLists.txt Sat Mar 30 12:46:54 2013
@@ -40,3 +40,5 @@ IF(${KDE_VERSION} VERSION_LESS "4.6.99" AND ${KDE_VERS
ENDIF(${KDE_VERSION} VERSION_LESS "4.6.99" AND ${KDE_VERSION} VERSION_GREATER "4.5.99")
KDE4_ADD_LIBRARY(gui STATIC ${gui_STAT_SRCS})
+
+ADD_DEPENDENCIES(gui tellico_config)

View File

@ -0,0 +1,59 @@
$OpenBSD: patch-src_tests_discogsfetchertest_cpp,v 1.1 2015/05/02 15:30:31 zhuk Exp $
Unbreak fetching Discogs images (upstream 61c9b539).
--- src/tests/discogsfetchertest.cpp.orig Sun Feb 15 22:23:56 2015
+++ src/tests/discogsfetchertest.cpp Sat May 2 18:10:19 2015
@@ -86,12 +86,9 @@ void DiscogsFetcherTest::testTitle() {
QVERIFY(!entry->field(QLatin1String("year")).isEmpty());
QVERIFY(!entry->field(QLatin1String("track")).isEmpty());
- //OAuth is now required
- /*
QVERIFY(!entry->field(QLatin1String("cover")).isEmpty());
const Tellico::Data::Image& img = Tellico::ImageFactory::imageById(entry->field(QLatin1String("cover")));
QVERIFY(!img.isNull());
-*/
}
void DiscogsFetcherTest::testPerson() {
@@ -114,12 +111,10 @@ void DiscogsFetcherTest::testPerson() {
QCOMPARE(entry->field(QLatin1String("artist")), QLatin1String("Evanescence"));
QVERIFY(!entry->field(QLatin1String("title")).isEmpty());
QVERIFY(!entry->field(QLatin1String("label")).isEmpty());
- //OAuth is now required
- /*
+
QVERIFY(!entry->field(QLatin1String("cover")).isEmpty());
const Tellico::Data::Image& img = Tellico::ImageFactory::imageById(entry->field(QLatin1String("cover")));
QVERIFY(!img.isNull());
- */
}
void DiscogsFetcherTest::testKeyword() {
@@ -143,12 +138,10 @@ void DiscogsFetcherTest::testKeyword() {
QCOMPARE(entry->field(QLatin1String("artist")), QLatin1String("Evanescence"));
QVERIFY(!entry->field(QLatin1String("label")).isEmpty());
QVERIFY(!entry->field(QLatin1String("year")).isEmpty());
- // OAuth is now required
- /*
+
QVERIFY(!entry->field(QLatin1String("cover")).isEmpty());
const Tellico::Data::Image& img = Tellico::ImageFactory::imageById(entry->field(QLatin1String("cover")));
QVERIFY(!img.isNull());
- */
}
// use the Raw query type to fully test the data for a Discogs release
@@ -181,13 +174,6 @@ void DiscogsFetcherTest::testRawData() {
QStringList trackList = Tellico::FieldFormat::splitTable(entry->field("track"));
QCOMPARE(trackList.count(), 14);
QCOMPARE(trackList.at(0), QLatin1String("Haunted::Evanescence::4:04"));
-
- // OAuth is now required
- /*
- QVERIFY(!entry->field(QLatin1String("cover")).isEmpty());
- const Tellico::Data::Image& img = Tellico::ImageFactory::imageById(entry->field(QLatin1String("cover")));
- QVERIFY(!img.isNull());
-*/
}
// do another check to make sure the Vinyl format is captured

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2014/07/13 12:30:14 zhuk Exp $ @comment $OpenBSD: PLIST,v 1.2 2015/05/02 15:30:31 zhuk Exp $
@bin bin/tellico @bin bin/tellico
share/appdata/ share/appdata/
share/appdata/tellico.appdata.xml share/appdata/tellico.appdata.xml
@ -15,6 +15,7 @@ share/apps/tellico/arxiv2tellico.xsl
share/apps/tellico/biblioshare2tellico.xsl share/apps/tellico/biblioshare2tellico.xsl
share/apps/tellico/bibtex-translation.xml share/apps/tellico/bibtex-translation.xml
share/apps/tellico/bluray-logo.png share/apps/tellico/bluray-logo.png
share/apps/tellico/boardgamegeek2tellico.xsl
share/apps/tellico/cassette-logo.png share/apps/tellico/cassette-logo.png
share/apps/tellico/cd-logo.png share/apps/tellico/cd-logo.png
share/apps/tellico/crossref2tellico.xsl share/apps/tellico/crossref2tellico.xsl
@ -23,7 +24,6 @@ share/apps/tellico/data-sources/bedetheque.py
share/apps/tellico/data-sources/bedetheque.py.spec share/apps/tellico/data-sources/bedetheque.py.spec
share/apps/tellico/data-sources/bedetheque.pyc share/apps/tellico/data-sources/bedetheque.pyc
share/apps/tellico/data-sources/boardgamegeek.rb share/apps/tellico/data-sources/boardgamegeek.rb
share/apps/tellico/data-sources/boardgamegeek.rb.spec
share/apps/tellico/data-sources/dark_horse_comics.py share/apps/tellico/data-sources/dark_horse_comics.py
share/apps/tellico/data-sources/dark_horse_comics.py.spec share/apps/tellico/data-sources/dark_horse_comics.py.spec
share/apps/tellico/data-sources/dark_horse_comics.pyc share/apps/tellico/data-sources/dark_horse_comics.pyc
@ -35,7 +35,6 @@ share/apps/tellico/data-sources/ministerio_de_cultura.py.spec
share/apps/tellico/data-sources/ministerio_de_cultura.pyc share/apps/tellico/data-sources/ministerio_de_cultura.pyc
share/apps/tellico/dblp2tellico.xsl share/apps/tellico/dblp2tellico.xsl
share/apps/tellico/delicious2tellico.xsl share/apps/tellico/delicious2tellico.xsl
share/apps/tellico/discogs2tellico.xsl
share/apps/tellico/douban2tellico.xsl share/apps/tellico/douban2tellico.xsl
share/apps/tellico/dvd-logo.png share/apps/tellico/dvd-logo.png
share/apps/tellico/dvdfr2tellico.xsl share/apps/tellico/dvdfr2tellico.xsl
@ -62,6 +61,7 @@ share/apps/tellico/pics/alexandria.png
share/apps/tellico/pics/amc.png share/apps/tellico/pics/amc.png
share/apps/tellico/pics/bibtex.png share/apps/tellico/pics/bibtex.png
share/apps/tellico/pics/boardgame.png share/apps/tellico/pics/boardgame.png
share/apps/tellico/pics/boardgamegeek.png
share/apps/tellico/pics/book.png share/apps/tellico/pics/book.png
share/apps/tellico/pics/card.png share/apps/tellico/pics/card.png
share/apps/tellico/pics/checkmark.png share/apps/tellico/pics/checkmark.png
@ -403,9 +403,6 @@ share/locale/uk/LC_MESSAGES/tellico.mo
share/locale/zh_CN/LC_MESSAGES/tellico.mo share/locale/zh_CN/LC_MESSAGES/tellico.mo
share/locale/zh_TW/LC_MESSAGES/tellico.mo share/locale/zh_TW/LC_MESSAGES/tellico.mo
share/mime/packages/tellico.xml share/mime/packages/tellico.xml
share/mimelnk/
share/mimelnk/application/
share/mimelnk/application/x-tellico.desktop
@exec %D/bin/update-desktop-database @exec %D/bin/update-desktop-database
@unexec-delete %D/bin/update-desktop-database @unexec-delete %D/bin/update-desktop-database
@exec %D/bin/update-mime-database %D/share/mime @exec %D/bin/update-mime-database %D/share/mime