summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-05-25 18:44:17 +0200
committerArno <arno@disconnect.de>2018-05-25 18:44:17 +0200
commitde662d930786bdebdb61526b538517ee9043a44a (patch)
treec472802cce948f1e0c1f7650df4e05ca133f47ef
parenta08ee7150c5752e3f7f31db2f8081337269793dd (diff)
downloadSheMov-de662d930786bdebdb61526b538517ee9043a44a.tar.gz
SheMov-de662d930786bdebdb61526b538517ee9043a44a.tar.bz2
SheMov-de662d930786bdebdb61526b538517ee9043a44a.zip
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... :(
-rw-r--r--newmoviewizard.cpp4
1 files 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<QVariant> 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");