Commit f9b949c1 authored by Matthieu Gallien's avatar Matthieu Gallien 🎵
Browse files

still return a valid track even when no extractors support it

that is the case when we get an audio file not with a format not yet
supported by KFileMetaData

BUG: 433892
FIXED-IN: 21.04
parent 61ed83ca
Pipeline #53372 passed with stage
in 25 seconds
......@@ -120,6 +120,17 @@ DataTypes::TrackDataType FileScanner::scanOneFile(const QUrl &scanFile, const QF
const QList<KFileMetaData::Extractor*> &exList = d->mAllExtractors.fetchExtractors(mimetype);
if (exList.isEmpty()) {
// when no extractors exist and we have an audio file, we fallback to filling the minimal
// set of properties to let Elisa be able to recognise and play the file.
qCDebug(orgKdeElisaIndexer()) << "FileScanner::shouldScanFile" << scanFile << localFileName << "no extractors" << fileMimeType;
newTrack[DataTypes::FileModificationTime] = scanFileInfo.metadataChangeTime();
newTrack[DataTypes::ResourceRole] = scanFile;
newTrack[DataTypes::RatingRole] = 0;
newTrack[DataTypes::DurationRole] = QTime::fromMSecsSinceStartOfDay(1);
newTrack[DataTypes::ElementTypeRole] = ElisaUtils::Track;
return newTrack;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment