From de662d930786bdebdb61526b538517ee9043a44a Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 25 May 2018 18:44:17 +0200 Subject: Workaround for recognizing some .mkv as Movies As it turns out the MIME magic recognizes some mkv files as application/ octet stream, so the file type is incorrectly set to General Cover in the new movies dialog. Very annoying. Fix it by looking at the suffix, too, even though this is exactly the thing MIME magic should prevent... :( --- newmoviewizard.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newmoviewizard.cpp b/newmoviewizard.cpp index 59eb2ec..a956e4b 100644 --- a/newmoviewizard.cpp +++ b/newmoviewizard.cpp @@ -413,10 +413,10 @@ void MovieInfoPage::addFile(const QString &file){ QList itemData; itemData << fi.fileName() << fi.size() << QVariant() << QVariant() << fi.absoluteFilePath(); QString mimeType = Helper::mimeType(fi.absoluteFilePath()); - if(mimeType.startsWith("video")){ + if(mimeType.startsWith("video") || fi.suffix() == "mkv"){ itemData[WizardTreeModel::FileType] = WizardTreeModel::Movie; }else{ - QString baseName = fi.completeBaseName(); + QString baseName = fi.completeBaseName(); QRegExp reFront = QRegExp("front"); reFront.setCaseSensitivity(Qt::CaseInsensitive); QRegExp reBack = QRegExp("back"); -- cgit v1.2.3-70-g09d2