SongLoader: Use Song::kRejectedExtensions

Fixes #1525
This commit is contained in:
Jonas Kvinge 2024-08-24 21:12:19 +02:00
parent ee5bc16e47
commit 9d22e4ec07
1 changed files with 6 additions and 2 deletions

View File

@ -175,7 +175,9 @@ SongLoader::Result SongLoader::LoadLocalPartial(const QString &filename) {
}
// Assume it's just a normal file
if (TagReaderClient::Instance()->IsMediaFileBlocking(filename) || Song::kAcceptedExtensions.contains(fileinfo.suffix(), Qt::CaseInsensitive)) {
if (!Song::kRejectedExtensions.contains(fileinfo.suffix(), Qt::CaseInsensitive) &&
(TagReaderClient::Instance()->IsMediaFileBlocking(filename) ||
Song::kAcceptedExtensions.contains(fileinfo.suffix(), Qt::CaseInsensitive))) {
Song song(Song::Source::LocalFile);
song.InitFromFilePartial(filename, fileinfo);
if (song.is_valid()) {
@ -319,7 +321,9 @@ SongLoader::Result SongLoader::LoadLocalAsync(const QString &filename) {
}
// Assume it's just a normal file
if (TagReaderClient::Instance()->IsMediaFileBlocking(filename) || Song::kAcceptedExtensions.contains(fileinfo.suffix(), Qt::CaseInsensitive)) {
if (!Song::kRejectedExtensions.contains(fileinfo.suffix(), Qt::CaseInsensitive) &&
(TagReaderClient::Instance()->IsMediaFileBlocking(filename) ||
Song::kAcceptedExtensions.contains(fileinfo.suffix(), Qt::CaseInsensitive))) {
Song song(Song::Source::LocalFile);
song.InitFromFilePartial(filename, fileinfo);
if (song.is_valid()) {