From 012be0e75bf24ed49294e2d54ae941d383b48df5 Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 10 Dec 2014 07:40:41 +0100 Subject: Let database handle dadded Add a default value in db schema instead of doing it in the logic. --- newmoviewizard.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'newmoviewizard.cpp') diff --git a/newmoviewizard.cpp b/newmoviewizard.cpp index f6f5cc0..1c84f5f 100644 --- a/newmoviewizard.cpp +++ b/newmoviewizard.cpp @@ -257,7 +257,7 @@ void NewMovieWizard::accept(){ //genres done! //now handle metadata QSqlQuery insertMetadataQ(db); - insertMetadataQ.prepare("INSERT INTO metadata (iseriespart_id, sireleaseyear, tsourcemedium, tsubject, treleasegroup, tencoderopts, tcomment, sipasses, dadded) VALUES(:pid, :rely, :source, :sub, :group, :encopts, :comment, :passes, :added)"); + insertMetadataQ.prepare("INSERT INTO metadata (iseriespart_id, sireleaseyear, tsourcemedium, tsubject, treleasegroup, tencoderopts, tcomment, sipasses) VALUES(:pid, :rely, :source, :sub, :group, :encopts, :comment, :passes)"); MovieMetadataPage *metadataPage = qobject_cast(page(3)); QList metadata = metadataPage->widget()->metadata(); insertMetadataQ.bindValue(":pid", seriesPartId); @@ -268,7 +268,6 @@ void NewMovieWizard::accept(){ insertMetadataQ.bindValue(":encopts", metadata.at(ArchiveModel::EncoderOpts)); insertMetadataQ.bindValue(":comment", metadata.at(ArchiveModel::Comment)); insertMetadataQ.bindValue(":passes", metadata.at(ArchiveModel::Passes)); - insertMetadataQ.bindValue(":added", QDate::currentDate()); if(!insertMetadataQ.exec()){ db.rollback(); return; -- cgit v1.2.3-70-g09d2