aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2021-05-25 13:04:42 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2021-05-25 13:04:42 +0000
commit1abbe66280b0cbeb66646023df35578b99c0702c (patch)
tree7ab0e2677350a5ee630429a335ca5c69c987854d /src
parent10b95bc1fdf6ce7dcac156f1f18b469f0973ba73 (diff)
downloadqmmp-1abbe66280b0cbeb66646023df35578b99c0702c.tar.gz
qmmp-1abbe66280b0cbeb66646023df35578b99c0702c.tar.bz2
qmmp-1abbe66280b0cbeb66646023df35578b99c0702c.zip
library: remove ignored files
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@10049 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
-rw-r--r--src/plugins/General/library/library.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/General/library/library.cpp b/src/plugins/General/library/library.cpp
index 4319cf649..99eaf869f 100644
--- a/src/plugins/General/library/library.cpp
+++ b/src/plugins/General/library/library.cpp
@@ -353,7 +353,7 @@ void Library::removeMissingFiles(const QStringList &paths)
return;
QSqlQuery query(db);
- if(!query.exec("SELECT FilePath FROM track_library"))
+ if(!query.exec("SELECT FilePath,URL FROM track_library"))
{
qWarning("Library: exec error: %s", qPrintable(query.lastError().text()));
return;
@@ -364,13 +364,15 @@ void Library::removeMissingFiles(const QStringList &paths)
while(query.next())
{
QString path = query.value(0).toString();
+ QString url = query.value(1).toString();
if(previousPath == path)
continue;
previousPath = path;
if(!QFile::exists(path) || //remove missing or disabled file paths
- !std::any_of(paths.cbegin(), paths.cend(), [path](const QString &p){ return path.startsWith(p); } ))
+ !std::any_of(paths.cbegin(), paths.cend(), [path](const QString &p){ return path.startsWith(p); } ) ||
+ (!url.contains("://") && m_ignoredFiles.contains(url))) //remove ignored files
{
qDebug("Library: removing '%s' from library", qPrintable(path));
QSqlQuery rmQuery(db);