mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-14 18:35:16 +01:00
Ignore playlists when loading local directories. Fixes issue #886
This commit is contained in:
parent
298137b85e
commit
14fb4ca202
@ -90,7 +90,8 @@ SongLoader::Result SongLoader::Load(const QUrl& url) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
SongLoader::Result SongLoader::LoadLocal(const QString& filename, bool block) {
|
SongLoader::Result SongLoader::LoadLocal(const QString& filename, bool block,
|
||||||
|
bool ignore_playlists) {
|
||||||
qDebug() << "Loading local file" << filename;
|
qDebug() << "Loading local file" << filename;
|
||||||
|
|
||||||
// First check to see if it's a directory - if so we can load all the songs
|
// First check to see if it's a directory - if so we can load all the songs
|
||||||
@ -120,6 +121,11 @@ SongLoader::Result SongLoader::LoadLocal(const QString& filename, bool block) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (parser) {
|
if (parser) {
|
||||||
|
if (ignore_playlists) {
|
||||||
|
qDebug() << "Skipping" << parser->name() << "playlist while loading directory";
|
||||||
|
return Success;
|
||||||
|
}
|
||||||
|
|
||||||
qDebug() << "Parsing using" << parser->name();
|
qDebug() << "Parsing using" << parser->name();
|
||||||
|
|
||||||
// It's a playlist!
|
// It's a playlist!
|
||||||
@ -182,7 +188,7 @@ void SongLoader::LoadLocalDirectory(const QString& filename) {
|
|||||||
|
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
// This is in another thread so we can do blocking calls.
|
// This is in another thread so we can do blocking calls.
|
||||||
LoadLocal(it.next(), true);
|
LoadLocal(it.next(), true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
qStableSort(songs_.begin(), songs_.end(), CompareSongs);
|
qStableSort(songs_.begin(), songs_.end(), CompareSongs);
|
||||||
|
@ -70,7 +70,7 @@ private:
|
|||||||
Finished,
|
Finished,
|
||||||
};
|
};
|
||||||
|
|
||||||
Result LoadLocal(const QString& filename, bool block = false);
|
Result LoadLocal(const QString& filename, bool block = false, bool ignore_playlists = false);
|
||||||
void LoadLocalDirectory(const QString& filename);
|
void LoadLocalDirectory(const QString& filename);
|
||||||
void LoadPlaylist(ParserBase* parser, const QString& filename);
|
void LoadPlaylist(ParserBase* parser, const QString& filename);
|
||||||
void LoadLocalDirectoryAndEmit(const QString& filename);
|
void LoadLocalDirectoryAndEmit(const QString& filename);
|
||||||
|
Loading…
Reference in New Issue
Block a user