2012-05-24, 05:59
Hello,
I have been having a few problems with the latest version of video database for xbmc when updating to the latest git yesterday, but I managed to solve everything, so I think this thread might help a few people.
My video database was previously in version 60 and when updating to version 64 I had a lot of errors in the logs, some things went wrong but not everything.
For what I've seen, the changes for the video database in version 64 are as follows :
- new art and seasons tables (in my case they were created fine)
- "dateAdded (text)" column added in files and path tables
- "idShow (int(11))" column added in episode table (+ 2 keys)
- the table tvshowlinkepisode is not needed anymore
- the views changed due to these modifications
First, we need to add the missing tables, columns and keys if the update didn't work :
Then we need to fill "idShow" with the correct data in the episode table :
If needed, use these queries to update/insert missing episode thumbs :
To be continued below... (too much characters in my post)
I have been having a few problems with the latest version of video database for xbmc when updating to the latest git yesterday, but I managed to solve everything, so I think this thread might help a few people.
My video database was previously in version 60 and when updating to version 64 I had a lot of errors in the logs, some things went wrong but not everything.
For what I've seen, the changes for the video database in version 64 are as follows :
- new art and seasons tables (in my case they were created fine)
- "dateAdded (text)" column added in files and path tables
- "idShow (int(11))" column added in episode table (+ 2 keys)
- the table tvshowlinkepisode is not needed anymore
- the views changed due to these modifications
First, we need to add the missing tables, columns and keys if the update didn't work :
Code:
CREATE TABLE `art` (
`art_id` int(11) NOT NULL AUTO_INCREMENT,
`media_id` int(11) DEFAULT NULL,
`media_type` text,
`type` text,
`url` text,
PRIMARY KEY (`art_id`),
KEY `ix_art` (`media_id`,`media_type`(20),`type`(20))
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `seasons` (
`idSeason` int(11) NOT NULL AUTO_INCREMENT,
`idShow` int(11) DEFAULT NULL,
`season` int(11) DEFAULT NULL,
PRIMARY KEY (`idSeason`),
KEY `ix_seasons` (`idShow`,`season`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
ALTER TABLE `episode` ADD `idShow` int(11) DEFAULT NULL;
ALTER TABLE `episode` ADD KEY `ix_episode_show1` (`idEpisode`,`idShow`);
ALTER TABLE `episode` ADD KEY `ix_episode_show2` (`idShow`,`idEpisode`);
ALTER TABLE `path` ADD `dateAdded` text;
ALTER TABLE `files` ADD `dateAdded` text;
Then we need to fill "idShow" with the correct data in the episode table :
Code:
UPDATE `episode`, `tvshowlinkepisode` SET `episode`.`idShow` = `tvshowlinkepisode`.`idShow` WHERE `episode`.`idEpisode` = `tvshowlinkepisode`.`idEpisode`;
If needed, use these queries to update/insert missing episode thumbs :
Code:
UPDATE `art` a, `episode` e SET a.`url` = REPLACE(REPLACE(e.`c06`,"<thumb>",""),"</thumb>","") WHERE a.`media_id` = e.`idEpisode` AND a.`url` = '';
INSERT INTO `art`(`media_id`,`media_type`,`type`,`url`) (SELECT idEpisode, "episode", "thumb", REPLACE(REPLACE(`c06`,"<thumb>",""),"</thumb>","") FROM `episode` WHERE c06 LIKE "<thumb%" AND idEpisode NOT IN (SELECT `media_id` FROM `art` WHERE `media_type`="episode" AND `type`="thumb"));
To be continued below... (too much characters in my post)