diff --git a/mainwindow.cpp b/mainwindow.cpp index 7a3d6ae..4b97e85 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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); } diff --git a/pineapple-music.desktop b/pineapple-music.desktop index f4db60f..9d687be 100644 --- a/pineapple-music.desktop +++ b/pineapple-music.desktop @@ -1,5 +1,5 @@ [Desktop Entry] -Categories=Player;Audio; +Categories=Audio;Player; Comment=Pineapple Music Audio Player. Exec=pmusic %F GenericName=Music