diff --git a/ui/drivers/qt/playlistthumbnaildownload.cpp b/ui/drivers/qt/playlistthumbnaildownload.cpp index e7348c0eae..52e4b86677 100644 --- a/ui/drivers/qt/playlistthumbnaildownload.cpp +++ b/ui/drivers/qt/playlistthumbnaildownload.cpp @@ -201,6 +201,7 @@ void MainWindow::downloadNextPlaylistThumbnail(QString system, QString title, QS if (!settings) return; + title = getScrubbedString(title); systemUnderscore = systemUnderscore.replace(" ", "_"); urlString = QString(THUMBNAIL_URL_HEADER) + systemUnderscore + THUMBNAIL_URL_BRANCH + type + "/" + title + THUMBNAIL_URL_FOOTER; diff --git a/ui/drivers/qt/thumbnaildownload.cpp b/ui/drivers/qt/thumbnaildownload.cpp index c5e5282ea5..c54d9b85aa 100644 --- a/ui/drivers/qt/thumbnaildownload.cpp +++ b/ui/drivers/qt/thumbnaildownload.cpp @@ -221,6 +221,7 @@ void MainWindow::downloadThumbnail(QString system, QString title, QUrl url) if (!settings || m_pendingThumbnailDownloadTypes.isEmpty()) return; + title = getScrubbedString(title); downloadType = m_pendingThumbnailDownloadTypes.takeFirst(); systemUnderscore = systemUnderscore.replace(" ", "_"); diff --git a/ui/drivers/qt/ui_qt_window.cpp b/ui/drivers/qt/ui_qt_window.cpp index 223df5ffcc..1699c9a36c 100644 --- a/ui/drivers/qt/ui_qt_window.cpp +++ b/ui/drivers/qt/ui_qt_window.cpp @@ -3152,6 +3152,18 @@ int MainWindow::onExtractArchive(QString path, QString extractionDir, QString te return returnerr; } +QString MainWindow::getScrubbedString(QString str) +{ + const QLatin1Literal chars("&*/:`\"<>?\\|"); + + foreach (QChar ch, chars) + { + str.replace(ch, "_"); + } + + return str; +} + static void* ui_window_qt_init(void) { ui_window.qtWindow = new MainWindow(); diff --git a/ui/drivers/ui_qt.h b/ui/drivers/ui_qt.h index 9baf33547d..323c25b039 100644 --- a/ui/drivers/ui_qt.h +++ b/ui/drivers/ui_qt.h @@ -287,6 +287,7 @@ public: static double lerp(double x, double y, double a, double b, double d); QString getSpecialPlaylistPath(SpecialPlaylist playlist); QVector > getPlaylists(); + QString getScrubbedString(QString str); signals: void thumbnailChanged(const QPixmap &pixmap);