(2015-01-17, 11:42)Nogler Wrote: Hi
I have a problem when i set kodi to database b. The movies view is working, but when i go to the tvshow i get following error:
09:29:45 T:3042725888 ERROR: GetTvShowsByWhere failed
09:29:45 T:3042725888 ERROR: GetDirectory - Error getting videodb://tvshows/titles/
09:29:45 T:3042725888 ERROR: CGUIMediaWindow::GetDirectory(videodb://tvshows/titles/) failed
09:29:45 T:3042725888 DEBUG: CGUIMediaWindow::GetDirectory ()
09:29:45 T:3042725888 DEBUG: ParentPath = [videodb://tvshows/titles/]
@Speed make a backup of the db in xbmc and re import after you switch to kodi
G'Day Nogler,
I had the same problem and this is my fix, in the "tvshowview" I added this line "`path`.`idParentPath` AS `idParentPath`," to each one as below
Code:
CREATE VIEW `b90`.`tvshowview`
AS SELECT
`tvshow`.`idShow` AS `idShow`,
`tvshow`.`c00` AS `c00`,
`tvshow`.`c01` AS `c01`,
`tvshow`.`c02` AS `c02`,
`tvshow`.`c03` AS `c03`,
`tvshow`.`c04` AS `c04`,
`tvshow`.`c05` AS `c05`,
`tvshow`.`c06` AS `c06`,
`tvshow`.`c07` AS `c07`,
`tvshow`.`c08` AS `c08`,
`tvshow`.`c09` AS `c09`,
`tvshow`.`c10` AS `c10`,
`tvshow`.`c11` AS `c11`,
`tvshow`.`c12` AS `c12`,
`tvshow`.`c13` AS `c13`,
`tvshow`.`c14` AS `c14`,
`tvshow`.`c15` AS `c15`,
`tvshow`.`c16` AS `c16`,
`tvshow`.`c17` AS `c17`,
`tvshow`.`c18` AS `c18`,
`tvshow`.`c19` AS `c19`,
`tvshow`.`c20` AS `c20`,
`tvshow`.`c21` AS `c21`,
`tvshow`.`c22` AS `c22`,
`tvshow`.`c23` AS `c23`,
`path`.`idParentPath` AS `idParentPath`,
`path`.`strPath` AS `strPath`,
`path`.`dateAdded` AS `dateAdded`,max(`files`.`lastPlayed`) AS `lastPlayed`,nullif(count(`episode`.`c12`),0) AS `totalCount`,count(`files`.`playCount`) AS `watchedcount`,nullif(count(distinct `episode`.`c12`),0) AS `totalSeasons`
FROM ((((`b90`.`tvshow` left join `b90`.`tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) left join `b90`.`path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) left join `b90`.`episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `b90`.`files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;
Then I started to get;
01:37:26 T:2779583552 ERROR: SQL: The table does not exist
Query: SELECT * FROM seasonview WHERE seasonview.idShow = 152
01:37:26 T:2779583552 ERROR: GetSeasonsByWhere failed
01:37:26 T:3038285824 ERROR: GetDirectory - Error getting videodb://tvshows/titles/152/
01:37:26 T:3038285824 ERROR: CGUIMediaWindow::GetDirectory(videodb://tvshows/titles/152/) failed
To fix this I created this for each table;
Code:
CREATE VIEW `seasonview`
AS SELECT
`seasons`.`idSeason` AS `idSeason`,
`seasons`.`idShow` AS `idShow`,
`seasons`.`season` AS `season`,
`tvshowview`.`strPath` AS `strPath`,
`tvshowview`.`c00` AS `showTitle`,
`tvshowview`.`c01` AS `plot`,
`tvshowview`.`c05` AS `premiered`,
`tvshowview`.`c08` AS `genre`,
`tvshowview`.`c14` AS `strStudio`,
`tvshowview`.`c13` AS `mpaa`,
count(distinct `episodeview`.`idEpisode`) AS `episodes`,count(`files`.`playCount`) AS `playCount` from (((`seasons` join `tvshowview` on((`tvshowview`.`idShow` = `seasons`.`idShow`))) join `episodeview` on(((`episodeview`.`idShow` = `seasons`.`idShow`) and (`episodeview`.`c12` = `seasons`.`season`)))) join `files` on((`files`.`idFile` = `episodeview`.`idFile`))) group by `seasons`.`idSeason`;
Working so far with little testing.
EDIT:
Also I see each table is missing the "tvshowcounts" view I will look into this after if this is needed
EDIT:
Added this to each table just in case (its only a summery table)
Code:
CREATE VIEW `tvshowcounts`
AS SELECT
`tvshow`.`idShow` AS `idShow`,
max(`files`.`lastPlayed`) AS `lastPlayed`,
nullif(count(`episode`.`c12`),0) AS `totalCount`,
count(`files`.`playCount`) AS `watchedcount`,
nullif(count(distinct `episode`.`c12`),0) AS `totalSeasons`,
max(`files`.`dateAdded`) AS `dateAdded` from ((`tvshow` left join `episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;