From e3a716d06a8f20e662a1e7b777cfc4a227db7b2b Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Fri, 17 Jun 2022 19:10:29 +0200 Subject: [PATCH 1/2] (Qt) Use new URL for scraping thumbnails --- tasks/task_pl_thumbnail_download.c | 3 +++ ui/drivers/qt/qt_downloads.cpp | 19 +++++-------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/tasks/task_pl_thumbnail_download.c b/tasks/task_pl_thumbnail_download.c index efb97139c5..b6c3c5dddf 100644 --- a/tasks/task_pl_thumbnail_download.c +++ b/tasks/task_pl_thumbnail_download.c @@ -271,6 +271,9 @@ static void download_pl_thumbnail(pl_thumb_handle_t *pl_thumb) transf->user_data = (void*)pl_thumb; strlcpy(transf->path, path, sizeof(transf->path)); + RARCH_LOG("url: %s\n", url); + RARCH_LOG("transf path: %s\n", transf->path); + /* Note: We don't actually care if this fails since that * just means the file is missing from the server, so it's * not something we can handle here... */ diff --git a/ui/drivers/qt/qt_downloads.cpp b/ui/drivers/qt/qt_downloads.cpp index 27eafc060b..cb878f4bb0 100644 --- a/ui/drivers/qt/qt_downloads.cpp +++ b/ui/drivers/qt/qt_downloads.cpp @@ -34,11 +34,8 @@ extern "C" { #define TEMP_EXTENSION ".tmp" #define THUMBNAILPACK_URL_HEADER "http://thumbnailpacks.libretro.com/" #define THUMBNAILPACK_EXTENSION ".zip" -#define THUMBNAIL_URL_HEADER "https://github.com/libretro-thumbnails/" -#define THUMBNAIL_URL_BRANCH "/blob/master/" +#define THUMBNAIL_URL_HEADER "https://thumbnails.libretro.com/" #define THUMBNAIL_IMAGE_EXTENSION ".png" -#define THUMBNAIL_URL_FOOTER THUMBNAIL_IMAGE_EXTENSION "?raw=true" - static void extractThumbnailPackCB(retro_task_t *task, void *task_data, void *user_data, const char *err) @@ -567,7 +564,6 @@ void MainWindow::downloadThumbnail(QString system, QString title, QUrl url) QNetworkRequest request; QByteArray urlArray; QString downloadType; - QString systemUnderscore = system; QNetworkReply *reply = NULL; const char *urlData = NULL; settings_t *settings = config_get_ptr(); @@ -577,13 +573,11 @@ void MainWindow::downloadThumbnail(QString system, QString title, QUrl url) title = getScrubbedString(title); downloadType = m_pendingThumbnailDownloadTypes.takeFirst(); - systemUnderscore = systemUnderscore.replace(" ", "_"); urlString = QString(THUMBNAIL_URL_HEADER) - + systemUnderscore - + THUMBNAIL_URL_BRANCH + + system + "/" + downloadType + "/" + title - + THUMBNAIL_URL_FOOTER; + + THUMBNAIL_IMAGE_EXTENSION; if (url.isEmpty()) url = urlString; @@ -855,7 +849,6 @@ void MainWindow::onPlaylistThumbnailDownloadReadyRead() void MainWindow::downloadNextPlaylistThumbnail( QString system, QString title, QString type, QUrl url) { - QString systemUnderscore = system; QString urlString; QNetworkRequest request; QNetworkReply *reply = NULL; @@ -865,16 +858,14 @@ void MainWindow::downloadNextPlaylistThumbnail( return; title = getScrubbedString(title); - systemUnderscore = systemUnderscore.replace(" ", "_"); urlString = QString(THUMBNAIL_URL_HEADER) - + systemUnderscore - + THUMBNAIL_URL_BRANCH + + system + "/" + type + "/" + title - + THUMBNAIL_URL_FOOTER; + + THUMBNAIL_IMAGE_EXTENSION; if (url.isEmpty()) url = urlString; From e9b8602c6ea7edf8c867b8177ddfc0e6363f13eb Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Fri, 17 Jun 2022 19:14:18 +0200 Subject: [PATCH 2/2] Get rid of debug logs --- tasks/task_pl_thumbnail_download.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tasks/task_pl_thumbnail_download.c b/tasks/task_pl_thumbnail_download.c index b6c3c5dddf..efb97139c5 100644 --- a/tasks/task_pl_thumbnail_download.c +++ b/tasks/task_pl_thumbnail_download.c @@ -271,9 +271,6 @@ static void download_pl_thumbnail(pl_thumb_handle_t *pl_thumb) transf->user_data = (void*)pl_thumb; strlcpy(transf->path, path, sizeof(transf->path)); - RARCH_LOG("url: %s\n", url); - RARCH_LOG("transf path: %s\n", transf->path); - /* Note: We don't actually care if this fails since that * just means the file is missing from the server, so it's * not something we can handle here... */