Go to the documentation of this file.
24 const QString &playCommand = QString(
"Internal"),
25 bool ignored =
false,
bool useDefault =
false)
28 query.
prepare(
"SELECT * FROM videotypes WHERE "
29 "LOWER(extension) = LOWER(:EXTENSION) LIMIT 1");
33 query.
prepare(
"INSERT INTO videotypes (extension, playcommand, "
34 "f_ignore, use_default) VALUES (:EXTENSION, :PLAYCOMMAND, "
35 ":IGNORE, :USEDEFAULT)");
37 query.
bindValue(
":PLAYCOMMAND", playCommand);
39 query.
bindValue(
":USEDEFAULT", useDefault);
42 "type '%1'").arg(extension), query);
49 query.
prepare(
"SELECT `filename`, `host` FROM videometadata WHERE "
56 QString host = query.
value(1).toString();
74 updatequery.
prepare(
"UPDATE videometadata set `hash` = :HASH "
75 "WHERE `filename` = :FILENAME AND "
80 if (!updatequery.
exec())
87 LOG(VB_GENERAL, LOG_INFO,
88 QString(
"Hash (%1) generated for file (%2)")
98 LOG(VB_GENERAL, LOG_NOTICE,
99 "Inserting initial video database information.");
102 "CREATE TABLE dvdinput ("
103 " intid int(10) unsigned NOT NULL,"
104 " hsize int(10) unsigned DEFAULT NULL,"
105 " vsize int(10) unsigned DEFAULT NULL,"
106 " ar_num int(10) unsigned DEFAULT NULL,"
107 " ar_denom int(10) unsigned DEFAULT NULL,"
108 " fr_code int(10) unsigned DEFAULT NULL,"
109 " letterbox tinyint(1) DEFAULT NULL,"
110 " v_format varchar(16) DEFAULT NULL,"
111 " PRIMARY KEY (intid)"
112 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
113 "CREATE TABLE dvdtranscode ("
114 " intid int(11) NOT NULL AUTO_INCREMENT,"
115 " input int(10) unsigned DEFAULT NULL,"
116 " `name` varchar(128) NOT NULL,"
117 " sync_mode int(10) unsigned DEFAULT NULL,"
118 " use_yv12 tinyint(1) DEFAULT NULL,"
119 " cliptop int(11) DEFAULT NULL,"
120 " clipbottom int(11) DEFAULT NULL,"
121 " clipleft int(11) DEFAULT NULL,"
122 " clipright int(11) DEFAULT NULL,"
123 " f_resize_h int(11) DEFAULT NULL,"
124 " f_resize_w int(11) DEFAULT NULL,"
125 " hq_resize_h int(11) DEFAULT NULL,"
126 " hq_resize_w int(11) DEFAULT NULL,"
127 " grow_h int(11) DEFAULT NULL,"
128 " grow_w int(11) DEFAULT NULL,"
129 " clip2top int(11) DEFAULT NULL,"
130 " clip2bottom int(11) DEFAULT NULL,"
131 " clip2left int(11) DEFAULT NULL,"
132 " clip2right int(11) DEFAULT NULL,"
133 " codec varchar(128) NOT NULL,"
134 " codec_param varchar(128) DEFAULT NULL,"
135 " bitrate int(11) DEFAULT NULL,"
136 " a_sample_r int(11) DEFAULT NULL,"
137 " a_bitrate int(11) DEFAULT NULL,"
138 " two_pass tinyint(1) DEFAULT NULL,"
139 " tc_param varchar(128) DEFAULT NULL,"
140 " PRIMARY KEY (intid)"
141 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
142 "CREATE TABLE filemarkup ("
143 " filename text NOT NULL,"
144 " mark mediumint(8) unsigned NOT NULL DEFAULT '0',"
145 " `offset` bigint(20) unsigned DEFAULT NULL,"
146 " `type` tinyint(4) NOT NULL DEFAULT '0',"
147 " KEY filename (filename(255))"
148 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
149 "CREATE TABLE videocast ("
150 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
151 " cast varchar(128) NOT NULL,"
152 " PRIMARY KEY (intid)"
153 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
154 "CREATE TABLE videocategory ("
155 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
156 " category varchar(128) NOT NULL,"
157 " PRIMARY KEY (intid)"
158 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
159 "CREATE TABLE videocountry ("
160 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
161 " country varchar(128) NOT NULL,"
162 " PRIMARY KEY (intid)"
163 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
164 "CREATE TABLE videogenre ("
165 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
166 " genre varchar(128) NOT NULL,"
167 " PRIMARY KEY (intid)"
168 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
169 "CREATE TABLE videometadata ("
170 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
171 " title varchar(128) NOT NULL,"
172 " subtitle text NOT NULL,"
173 " tagline varchar(255) DEFAULT NULL,"
174 " director varchar(128) NOT NULL,"
175 " studio varchar(128) DEFAULT NULL,"
177 " rating varchar(128) NOT NULL,"
178 " inetref varchar(255) NOT NULL,"
179 " homepage text NOT NULL,"
180 " `year` int(10) unsigned NOT NULL,"
181 " releasedate date NOT NULL,"
182 " userrating float NOT NULL,"
183 " length int(10) unsigned NOT NULL,"
184 " season smallint(5) unsigned NOT NULL DEFAULT '0',"
185 " episode smallint(5) unsigned NOT NULL DEFAULT '0',"
186 " showlevel int(10) unsigned NOT NULL,"
187 " filename text NOT NULL,"
188 " `hash` varchar(128) NOT NULL,"
189 " coverfile text NOT NULL,"
190 " childid int(11) NOT NULL DEFAULT '-1',"
191 " browse tinyint(1) NOT NULL DEFAULT '1',"
192 " watched tinyint(1) NOT NULL DEFAULT '0',"
193 " processed tinyint(1) NOT NULL DEFAULT '0',"
194 " playcommand varchar(255) DEFAULT NULL,"
195 " category int(10) unsigned NOT NULL DEFAULT '0',"
197 " `host` text NOT NULL,"
201 " insertdate timestamp NULL DEFAULT CURRENT_TIMESTAMP,"
202 " PRIMARY KEY (intid),"
203 " KEY director (director),"
205 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
206 "CREATE TABLE videometadatacast ("
207 " idvideo int(10) unsigned NOT NULL,"
208 " idcast int(10) unsigned NOT NULL,"
209 " UNIQUE KEY idvideo (idvideo,idcast)"
210 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
211 "CREATE TABLE videometadatacountry ("
212 " idvideo int(10) unsigned NOT NULL,"
213 " idcountry int(10) unsigned NOT NULL,"
214 " UNIQUE KEY idvideo_2 (idvideo,idcountry),"
215 " KEY idvideo (idvideo),"
216 " KEY idcountry (idcountry)"
217 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
218 "CREATE TABLE videometadatagenre ("
219 " idvideo int(10) unsigned NOT NULL,"
220 " idgenre int(10) unsigned NOT NULL,"
221 " UNIQUE KEY idvideo_2 (idvideo,idgenre),"
222 " KEY idvideo (idvideo),"
223 " KEY idgenre (idgenre)"
224 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
225 "CREATE TABLE videotypes ("
226 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
227 " extension varchar(128) NOT NULL,"
228 " playcommand varchar(255) NOT NULL,"
229 " f_ignore tinyint(1) DEFAULT NULL,"
230 " use_default tinyint(1) DEFAULT NULL,"
231 " PRIMARY KEY (intid)"
232 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
233 "INSERT INTO dvdinput VALUES (1,720,480,16,9,1,1,'ntsc');",
234 "INSERT INTO dvdinput VALUES (2,720,480,16,9,1,0,'ntsc');",
235 "INSERT INTO dvdinput VALUES (3,720,480,4,3,1,1,'ntsc');",
236 "INSERT INTO dvdinput VALUES (4,720,480,4,3,1,0,'ntsc');",
237 "INSERT INTO dvdinput VALUES (5,720,576,16,9,3,1,'pal');",
238 "INSERT INTO dvdinput VALUES (6,720,576,16,9,3,0,'pal');",
239 "INSERT INTO dvdinput VALUES (7,720,576,4,3,3,1,'pal');",
240 "INSERT INTO dvdinput VALUES (8,720,576,4,3,3,0,'pal');",
241 "INSERT INTO dvdtranscode VALUES (1,1,'Good',2,1,16,16,0,0,2,0,0,0,0,0,32,32,8,8,'divx5',NULL,1618,NULL,NULL,0,NULL);",
242 "INSERT INTO dvdtranscode VALUES (2,2,'Excellent',2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'divx5',NULL,0,NULL,NULL,1,NULL);",
243 "INSERT INTO dvdtranscode VALUES (3,2,'Good',2,1,0,0,8,8,0,0,0,0,0,0,0,0,0,0,'divx5',NULL,1618,NULL,NULL,0,NULL);",
244 "INSERT INTO dvdtranscode VALUES (4,2,'Medium',2,1,0,0,8,8,5,5,0,0,0,0,0,0,0,0,'divx5',NULL,1200,NULL,NULL,0,NULL);",
245 "INSERT INTO dvdtranscode VALUES (5,3,'Good',2,1,0,0,0,0,0,0,0,0,2,0,80,80,8,8,'divx5',NULL,0,NULL,NULL,0,NULL);",
246 "INSERT INTO dvdtranscode VALUES (6,4,'Excellent',2,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,'divx5',NULL,0,NULL,NULL,1,NULL);",
247 "INSERT INTO dvdtranscode VALUES (7,4,'Good',2,1,0,0,8,8,0,2,0,0,0,0,0,0,0,0,'divx5',NULL,1618,NULL,NULL,0,NULL);",
248 "INSERT INTO dvdtranscode VALUES (8,5,'Good',1,1,16,16,0,0,5,0,0,0,0,0,40,40,8,8,'divx5',NULL,1618,NULL,NULL,0,NULL);",
249 "INSERT INTO dvdtranscode VALUES (9,6,'Good',1,1,0,0,16,16,5,0,0,0,0,0,0,0,0,0,'divx5',NULL,1618,NULL,NULL,0,NULL);",
250 "INSERT INTO dvdtranscode VALUES (10,7,'Good',1,1,0,0,0,0,1,0,0,0,0,0,76,76,8,8,'divx5',NULL,1618,NULL,NULL,0,NULL);",
251 "INSERT INTO dvdtranscode VALUES (11,8,'Good',1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,'divx5',NULL,1618,NULL,NULL,0,NULL);",
252 "INSERT INTO videotypes VALUES (1,'txt','',1,0);",
253 "INSERT INTO videotypes VALUES (2,'log','',1,0);",
254 "INSERT INTO videotypes VALUES (3,'mpg','Internal',0,0);",
255 "INSERT INTO videotypes VALUES (4,'avi','',0,1);",
256 "INSERT INTO videotypes VALUES (5,'vob','Internal',0,0);",
257 "INSERT INTO videotypes VALUES (6,'mpeg','Internal',0,0);",
258 "INSERT INTO videotypes VALUES (8,'iso','Internal',0,0);",
259 "INSERT INTO videotypes VALUES (9,'img','Internal',0,0);",
260 "INSERT INTO videotypes VALUES (10,'mkv','Internal',0,0);",
261 "INSERT INTO videotypes VALUES (11,'mp4','Internal',0,0);",
262 "INSERT INTO videotypes VALUES (12,'m2ts','Internal',0,0);",
263 "INSERT INTO videotypes VALUES (13,'evo','Internal',0,0);",
264 "INSERT INTO videotypes VALUES (14,'divx','Internal',0,0);",
265 "INSERT INTO videotypes VALUES (15,'mov','Internal',0,0);",
266 "INSERT INTO videotypes VALUES (16,'qt','Internal',0,0);",
267 "INSERT INTO videotypes VALUES (17,'wmv','Internal',0,0);",
268 "INSERT INTO videotypes VALUES (18,'3gp','Internal',0,0);",
269 "INSERT INTO videotypes VALUES (19,'asf','Internal',0,0);",
270 "INSERT INTO videotypes VALUES (20,'ogg','Internal',0,0);",
271 "INSERT INTO videotypes VALUES (21,'ogm','Internal',0,0);",
272 "INSERT INTO videotypes VALUES (22,'flv','Internal',0,0);",
273 "INSERT INTO videotypes VALUES (23,'ogv','Internal',0,0);",
274 "INSERT INTO videotypes VALUES (25,'nut','Internal',0,0);",
275 "INSERT INTO videotypes VALUES (26,'mxf','Internal',0,0);",
276 "INSERT INTO videotypes VALUES (27,'m4v','Internal',0,0);",
277 "INSERT INTO videotypes VALUES (28,'rm','Internal',0,0);",
278 "INSERT INTO videotypes VALUES (29,'ts','Internal',0,0);",
279 "INSERT INTO videotypes VALUES (30,'swf','Internal',0,0);",
280 "INSERT INTO videotypes VALUES (31,'f4v','Internal',0,0);",
281 "INSERT INTO videotypes VALUES (32,'nuv','Internal',0,0);"
299 if (dbver.isEmpty() && olddbver.isEmpty() && dvddbver.isEmpty())
308 LOG(VB_GENERAL, LOG_ERR,
309 "Unrecognized video database schema version. "
310 "Unable to upgrade database.");
311 LOG(VB_GENERAL, LOG_ERR, QString(
"mythvideo.DBSchemaVer: '%1', "
312 "VideoDBSchemaVer: '%2', DVDDBSchemaVer: '%3'")
313 .arg(dbver, olddbver, dvddbver));
321 "ALTER TABLE dvdbookmark"
322 " MODIFY serialid varbinary(16) NOT NULL default '',"
323 " MODIFY name varbinary(32) default NULL;",
324 "ALTER TABLE dvdinput"
325 " MODIFY v_format varbinary(16) default NULL;",
326 "ALTER TABLE dvdtranscode"
327 " MODIFY name varbinary(128) NOT NULL,"
328 " MODIFY codec varbinary(128) NOT NULL,"
329 " MODIFY codec_param varbinary(128) default NULL,"
330 " MODIFY tc_param varbinary(128) default NULL;",
331 "ALTER TABLE filemarkup"
332 " MODIFY filename blob NOT NULL;",
333 "ALTER TABLE videocast"
334 " MODIFY cast varbinary(128) NOT NULL;",
335 "ALTER TABLE videocategory"
336 " MODIFY category varbinary(128) NOT NULL;",
337 "ALTER TABLE videocountry"
338 " MODIFY country varbinary(128) NOT NULL;",
339 "ALTER TABLE videogenre"
340 " MODIFY genre varbinary(128) NOT NULL;",
341 "ALTER TABLE videometadata"
342 " MODIFY title varbinary(128) NOT NULL,"
343 " MODIFY director varbinary(128) NOT NULL,"
345 " MODIFY rating varbinary(128) NOT NULL,"
346 " MODIFY inetref varbinary(255) NOT NULL,"
347 " MODIFY filename blob NOT NULL,"
348 " MODIFY coverfile blob NOT NULL,"
349 " MODIFY playcommand varbinary(255) default NULL;",
350 "ALTER TABLE videotypes"
351 " MODIFY extension varbinary(128) NOT NULL,"
352 " MODIFY playcommand varbinary(255) NOT NULL;"
356 updates,
"1017", dbver))
365 "ALTER TABLE dvdbookmark"
366 " DEFAULT CHARACTER SET default,"
367 " MODIFY serialid varchar(16) CHARACTER SET utf8 NOT NULL default '',"
368 " MODIFY name varchar(32) CHARACTER SET utf8 default NULL;",
369 "ALTER TABLE dvdinput"
370 " DEFAULT CHARACTER SET default,"
371 " MODIFY v_format varchar(16) CHARACTER SET utf8 default NULL;",
372 "ALTER TABLE dvdtranscode"
373 " DEFAULT CHARACTER SET default,"
374 " MODIFY name varchar(128) CHARACTER SET utf8 NOT NULL,"
375 " MODIFY codec varchar(128) CHARACTER SET utf8 NOT NULL,"
376 " MODIFY codec_param varchar(128) CHARACTER SET utf8 default NULL,"
377 " MODIFY tc_param varchar(128) CHARACTER SET utf8 default NULL;",
378 "ALTER TABLE filemarkup"
379 " DEFAULT CHARACTER SET default,"
380 " MODIFY filename text CHARACTER SET utf8 NOT NULL;",
381 "ALTER TABLE videocast"
382 " DEFAULT CHARACTER SET default,"
383 " MODIFY cast varchar(128) CHARACTER SET utf8 NOT NULL;",
384 "ALTER TABLE videocategory"
385 " DEFAULT CHARACTER SET default,"
386 " MODIFY category varchar(128) CHARACTER SET utf8 NOT NULL;",
387 "ALTER TABLE videocountry"
388 " DEFAULT CHARACTER SET default,"
389 " MODIFY country varchar(128) CHARACTER SET utf8 NOT NULL;",
390 "ALTER TABLE videogenre"
391 " DEFAULT CHARACTER SET default,"
392 " MODIFY genre varchar(128) CHARACTER SET utf8 NOT NULL;",
393 "ALTER TABLE videometadata"
394 " DEFAULT CHARACTER SET default,"
395 " MODIFY title varchar(128) CHARACTER SET utf8 NOT NULL,"
396 " MODIFY director varchar(128) CHARACTER SET utf8 NOT NULL,"
397 " MODIFY plot text CHARACTER SET utf8,"
398 " MODIFY rating varchar(128) CHARACTER SET utf8 NOT NULL,"
399 " MODIFY inetref varchar(255) CHARACTER SET utf8 NOT NULL,"
400 " MODIFY filename text CHARACTER SET utf8 NOT NULL,"
401 " MODIFY coverfile text CHARACTER SET utf8 NOT NULL,"
402 " MODIFY playcommand varchar(255) CHARACTER SET utf8 default NULL;",
403 "ALTER TABLE videometadatacast"
404 " DEFAULT CHARACTER SET default;",
405 "ALTER TABLE videometadatacountry"
406 " DEFAULT CHARACTER SET default;",
407 "ALTER TABLE videometadatagenre"
408 " DEFAULT CHARACTER SET default;",
409 "ALTER TABLE videotypes"
410 " DEFAULT CHARACTER SET default,"
411 " MODIFY extension varchar(128) CHARACTER SET utf8 NOT NULL,"
412 " MODIFY playcommand varchar(255) CHARACTER SET utf8 NOT NULL;"
416 updates,
"1018", dbver))
423 "DELETE FROM settings WHERE value="
424 "'MovieListCommandLine' AND data LIKE '%imdb%';",
425 "DELETE FROM settings WHERE value="
426 "'MovieDataCommandLine' AND data LIKE '%imdb%';",
427 "DELETE FROM settings WHERE value="
428 "'MoviePosterCommandLine' AND data LIKE '%imdb%';"
431 updates,
"1019", dbver))
438 "ALTER TABLE videometadata ADD `trailer` TEXT;"
441 updates,
"1020", dbver))
447 LOG(VB_GENERAL, LOG_NOTICE,
448 "Upgrading to MythVideo schema version 1021");
471 "ALTER TABLE videometadata ADD host text CHARACTER SET utf8 NOT NULL;"
475 updates,
"1022", dbver))
482 "ALTER TABLE videometadata ADD `screenshot` TEXT;",
483 "ALTER TABLE videometadata ADD `banner` TEXT;",
484 "ALTER TABLE videometadata ADD `fanart` TEXT;"
487 updates,
"1023", dbver))
494 "ALTER TABLE videometadata ADD `subtitle` TEXT "
495 "NOT NULL AFTER `title`;",
496 "ALTER TABLE videometadata ADD `season` SMALLINT "
497 "UNSIGNED NOT NULL DEFAULT '0' AFTER `length`;",
498 "ALTER TABLE videometadata ADD `episode` SMALLINT "
499 "UNSIGNED NOT NULL DEFAULT '0' AFTER `season`;"
502 updates,
"1024", dbver))
509 "ALTER TABLE videometadata ADD watched BOOL "
510 "NOT NULL DEFAULT 0 AFTER browse;"
513 updates,
"1025", dbver))
520 "ALTER TABLE videometadata ADD `insertdate` TIMESTAMP "
521 "NULL DEFAULT CURRENT_TIMESTAMP AFTER `fanart`;"
524 updates,
"1026", dbver))
531 "DELETE FROM keybindings "
532 " WHERE action = 'DELETE' AND context = 'Video';"
535 updates,
"1027", dbver))
541 LOG(VB_GENERAL, LOG_NOTICE,
542 "Upgrading to MythVideo schema version 1028");
543 LOG(VB_GENERAL, LOG_INFO,
544 "Converting filenames in filemarkup table "
545 "from absolute to relative paths. This may take a long "
546 "time if you have a large number of MythVideo seektables.");
552 query.
prepare(
"SELECT DISTINCT filename FROM filemarkup;");
553 update.
prepare(
"UPDATE filemarkup SET filename = :RELPATH "
554 " WHERE filename = :FULLPATH;");
561 origPath = query.
value(0).toString();
562 if (origPath.startsWith(
"dvd:"))
566 if ((!relPath.isEmpty()) &&
567 (relPath != origPath))
573 LOG(VB_GENERAL, LOG_ERR,
574 QString(
"ERROR converting '%1' to '%2' in "
576 .arg(origPath, relPath));
597 "ALTER TABLE videometadata ADD `releasedate` DATE "
598 "NOT NULL AFTER `year`;",
599 "ALTER TABLE videometadata ADD `homepage` TEXT "
600 "NOT NULL AFTER `inetref`;"
603 updates,
"1029", dbver))
610 "ALTER TABLE videometadata ADD `hash` VARCHAR(128) "
611 "NOT NULL AFTER `filename`;"
614 updates,
"1030", dbver))
628 query.
prepare(
"SHOW INDEX FROM videometadata");
633 "videometadata.", query);
639 QString index_name = query.
value(2).toString();
641 if (
"title_2" == index_name)
644 update.
prepare(
"ALTER TABLE videometadata "
645 " DROP INDEX title_2");
650 "on videometadata. Ignoring.",
666 "CREATE TEMPORARY TABLE bad_videometadatacast"
667 " AS SELECT * FROM videometadatacast,",
668 "CREATE TEMPORARY TABLE bad_videometadatagenre"
669 " AS SELECT * FROM videometadatagenre,",
670 "CREATE TEMPORARY TABLE bad_videometadatacountry"
671 " AS SELECT * FROM videometadatacountry,",
672 "TRUNCATE TABLE videometadatacast,",
673 "TRUNCATE TABLE videometadatagenre,",
674 "TRUNCATE TABLE videometadatacountry,",
675 "INSERT videometadatacast SELECT idvideo,idcast"
676 " FROM bad_videometadatacast GROUP BY idvideo,idcast,",
677 "INSERT videometadatagenre SELECT idvideo,idgenre"
678 " FROM bad_videometadatagenre GROUP BY idvideo,idgenre,",
679 "INSERT videometadatacountry SELECT idvideo,idcountry"
680 " FROM bad_videometadatacountry GROUP BY idvideo,idcountry,",
681 "DROP TEMPORARY TABLE bad_videometadatacast,",
682 "DROP TEMPORARY TABLE bad_videometadatagenre,",
683 "DROP TEMPORARY TABLE bad_videometadatacountry,",
684 "ALTER TABLE videometadatacast ADD UNIQUE INDEX (`idvideo`,`idcast`),",
685 "ALTER TABLE videometadatagenre ADD UNIQUE INDEX (`idvideo`,`idgenre`),",
686 "ALTER TABLE videometadatacountry ADD UNIQUE INDEX (`idvideo`,`idcountry`);"
689 updates,
"1033", dbver))
715 "ALTER TABLE videometadata ADD `tagline` VARCHAR (255) "
720 updates,
"1035", dbver))
727 "ALTER TABLE videometadata ADD processed BOOL "
728 "NOT NULL DEFAULT 0 AFTER watched;"
731 updates,
"1036", dbver))
738 "ALTER TABLE videometadata ADD `studio` VARCHAR( 128 ) "
742 updates,
"1037", dbver))
749 "DELETE FROM videotypes WHERE extension = 'VIDEO_TS';",
750 "DELETE FROM videotypes WHERE extension = 'BDMV';"
753 updates,
"1038", dbver))
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
QSqlQuery wrapper that fetches a DB connection from the connection pool.
QString generate_file_url(const QString &storage_group, const QString &host, const QString &path)
static bool InitializeVideoSchema(void)
QVariant value(int i) const
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
static void UpdateHashes(void)
static void AddFileType(const QString &extension, const QString &playCommand=QString("Internal"), bool ignored=false, bool useDefault=false)
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
static void DBError(const QString &where, const MSqlQuery &query)
const QString minimumVideoDatabaseVersion
static QString GetFileHash(const QString &url)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
static QString GetRelativePathname(const QString &filename)
Returns the relative pathname of a file by comparing the filename against all Storage Group directori...
bool UpdateDBVersionNumber(const QString &component, const QString &versionkey, const QString &newnumber, QString &dbver)
Updates the schema version stored in the database.
bool performActualUpdate(const QString &component, const QString &versionkey, const DBUpdates &updates, const QString &version, QString &dbver)
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
const QString finalVideoDatabaseVersion
bool doUpgradeVideoDatabaseSchema(void)
std::vector< std::string > DBUpdates
QString FileHash(const QString &filename)
const QString MythVideoVersionName
QString GetSetting(const QString &key, const QString &defaultval="")
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.