fix: add to playlist even if it's not using a common suffix
This commit is contained in:
parent
e4cf159010
commit
636122c8c6
|
@ -64,7 +64,7 @@ void MainWindow::loadPlaylistBySingleLocalFile(const QString &path)
|
|||
QFileInfo info(path);
|
||||
QDir dir(info.path());
|
||||
QString currentFileName = info.fileName();
|
||||
QStringList entryList = dir.entryList({"*.mp3", "*.wav", "*.aiff", "*.ape", "*.flac", "*.ogg", "*.oga"},
|
||||
QStringList entryList = dir.entryList({"*.mp3", "*.wav", "*.aiff", "*.ape", "*.flac", "*.ogg", "*.oga", "*.mpga"},
|
||||
QDir::Files | QDir::NoSymLinks, QDir::NoSort);
|
||||
|
||||
QCollator collator;
|
||||
|
@ -82,6 +82,12 @@ void MainWindow::loadPlaylistBySingleLocalFile(const QString &path)
|
|||
}
|
||||
}
|
||||
|
||||
if (currentFileIndex == -1) {
|
||||
// not in the list probably because of the suffix is not a common one, add it to the first one anyway.
|
||||
urlList.prepend(QUrl::fromLocalFile(path));
|
||||
currentFileIndex = 0;
|
||||
}
|
||||
|
||||
QMediaPlaylist * playlist = createPlaylist(urlList);
|
||||
playlist->setCurrentIndex(currentFileIndex);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[Desktop Entry]
|
||||
Categories=Player;Audio;
|
||||
Categories=Audio;Player;
|
||||
Comment=Pineapple Music Audio Player.
|
||||
Exec=pmusic %F
|
||||
GenericName=Music
|
||||
|
|
Loading…
Reference in New Issue
Block a user