From 5926a52a30428a2fa10ff8f367e4cb4355f62c2d Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 29 Jul 2010 20:41:07 +0200 Subject: Don't add quality to covers Fix adding quality to cover files in database by binding a NULL value when type != Movie in FilesTreeModel. While fixing this I discovered a typo in the database schema. The sequence for genres was named genres_igrenres_id__seq. Removed the superfluous 'r' in the name and fixed migdb.py on the way. Now SheMov doesn't crash any more when adding a new series part, but the new item still doesn't get selected... --- filestreemodel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'filestreemodel.cpp') diff --git a/filestreemodel.cpp b/filestreemodel.cpp index b02c8ac..1f224fd 100644 --- a/filestreemodel.cpp +++ b/filestreemodel.cpp @@ -254,7 +254,11 @@ bool FilesTreeModel::addFile(const QString &fullPath, int type, int quality, int mInsertFileQuery->bindValue(":dvd", dvd); mInsertFileQuery->bindValue(":type", type); mInsertFileQuery->bindValue(":fileno", filePart); - mInsertFileQuery->bindValue(":quality", quality); + if(type == Movie){ + mInsertFileQuery->bindValue(":quality", quality); + }else{ + mInsertFileQuery->bindValue(":quality", QVariant(QVariant::Int)); + } //insert item if(mInsertFileQuery->exec()){ -- cgit v1.2.3-70-g09d2