Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working anymore with KODI v14 #2

Open
treynaer opened this issue Dec 29, 2014 · 3 comments
Open

Not working anymore with KODI v14 #2

treynaer opened this issue Dec 29, 2014 · 3 comments

Comments

@treynaer
Copy link
Contributor

After exporting my lib, removing the databases, updating to KODI, adding the changes to the database and importing my lib again I found out TVShows wasn't working anymore.

I changed two things in movie.sql and rebuild the db from scratch:

/* View für Episoden(Serien) anpassen, um den watched state zu verteilen EDIT: Removed tvshow.c16 AS strShowPath,
 */     
DROP VIEW IF EXISTS `episodeview`;      
CREATE VIEW `episodeview` AS
    SELECT 
        episode.*, files.strFileName AS strFileName, path.strPath AS strPath, 
        filestate.playCount AS playCount, filestate.lastPlayed AS lastPlayed, files.dateAdded AS dateAdded, 
        tvshow.c00 AS strTitle, tvshow.c14 AS strStudio, tvshow.c05 AS premiered, tvshow.c13 AS mpaa, 
        bookmark_orig.timeInSeconds AS resumeTimeInSeconds,
        bookmark_orig.totalTimeInSeconds AS totalTimeInSeconds, seasons.idSeason AS idSeason
    FROM episode
    JOIN files ON files.idFile=episode.idFile
    JOIN tvshow ON tvshow.idShow=episode.idShow
    LEFT JOIN seasons ON seasons.idShow=episode.idShow AND seasons.season=episode.c12
    JOIN path ON files.idPath=path.idPath
    LEFT JOIN bookmark_orig ON bookmark_orig.idFile=episode.idFile AND bookmark_orig.type=1 AND bookmark_orig.sqlUser = SUBSTRING_INDEX(USER(),'@',1)
    LEFT JOIN filestate ON filestate.idFile = files.idFile AND filestate.sqlUser = SUBSTRING_INDEX(USER(),'@',1);


/* View für Serien anpassen, um den watched state zu verteilen EDIT: Added path.idParentPath AS idParentPath
 */     
DROP VIEW IF EXISTS `tvshowview`;
CREATE VIEW `tvshowview` AS
    SELECT 
        tvshow.*, path.idParentPath AS idParentPath, path.strPath AS strPath, path.dateAdded AS dateAdded, 
        MAX(filestate.lastPlayed) AS lastPlayed, NULLIF(COUNT(episode.c12), 0) AS totalCount, 
        COUNT(filestate.playCount) AS watchedcount, NULLIF(COUNT(DISTINCT(episode.c12)), 0) AS totalSeasons
    FROM tvshow
    LEFT JOIN tvshowlinkpath ON tvshowlinkpath.idShow=tvshow.idShow
    LEFT JOIN path ON path.idPath=tvshowlinkpath.idPath
    LEFT JOIN episode ON episode.idShow=tvshow.idShow
    LEFT JOIN files ON files.idFile=episode.idFile
    LEFT JOIN filestate on filestate.idFile = episode.idFile AND filestate.sqlUser = SUBSTRING_INDEX(USER(),'@',1)
    GROUP BY tvshow.idShow

Now TVShows is working again, but there is still something wrong with the Watched markers. I have no idea how to fixe this.

@treynaer
Copy link
Contributor Author

Movies Watched markers are also not working. The way the markers are stored is probably changed.

@treynaer
Copy link
Contributor Author

Looks like there is changed a lot with TVShows.
tvshowview is split up to tvshowcounts and tvshowview. There is a new view seasonview.

screenshot 2014-12-29 19 39 09

The bu_files trigger wasn't created, thats probably the reason why the watched markers where gone.

@treynaer
Copy link
Contributor Author

See pull request, it should work again.
I found out how you fixed the users is tvshowview and added it to the newly created views.

tvshowview shouldn't be changed. Only tvshowcounts and seasonview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant