1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-15 02:46:57 +01:00

Ignore playlists when loading local directories. Fixes issue #886

This commit is contained in:
David Sansome 2010-10-16 12:37:33 +00:00
parent 298137b85e
commit 14fb4ca202
2 changed files with 9 additions and 3 deletions

View File

@ -90,7 +90,8 @@ SongLoader::Result SongLoader::Load(const QUrl& url) {
#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;
// 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 (ignore_playlists) {
qDebug() << "Skipping" << parser->name() << "playlist while loading directory";
return Success;
}
qDebug() << "Parsing using" << parser->name();
// It's a playlist!
@ -182,7 +188,7 @@ void SongLoader::LoadLocalDirectory(const QString& filename) {
while (it.hasNext()) {
// 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);

View File

@ -70,7 +70,7 @@ private:
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 LoadPlaylist(ParserBase* parser, const QString& filename);
void LoadLocalDirectoryAndEmit(const QString& filename);