Improve regex for removing Disc # from album title

This commit is contained in:
Jonas Kvinge
2018-03-13 17:48:25 +01:00
parent 0022264757
commit 74bc2e0684
2 changed files with 5 additions and 3 deletions

View File

@@ -31,6 +31,7 @@
#include <QMenu>
#include <QUrl>
#include <QMimeData>
#include <QRegExp>
#include "covermanager/albumcoverchoicecontroller.h"
@@ -171,7 +172,7 @@ QString AlbumCoverChoiceController::LoadCoverFromURL(Song *song) {
QString AlbumCoverChoiceController::SearchForCover(Song *song) {
QString album = song->effective_album();
album = album.remove(QRegExp(" ?-? ?(\\(|\\[)(Disc|CD)? ?[0-9](\\)|\\])$"));
album = album.remove(QRegExp(" ?-? ((\\(|\\[)?)(Disc|CD) ?([0-9]{1,2})((\\)|\\])?)$"));
// Get something sensible to stick in the search box
QImage image = cover_searcher_->Exec(song->effective_albumartist(), album);