From 7635572275a4bd4283589136e334a452b6a78f51 Mon Sep 17 00:00:00 2001 From: tsubus Date: Tue, 5 Jun 2012 14:48:15 +0200 Subject: [PATCH] tried to fix db issues with tv shows --- src/org/xbmc/httpapi/client/TvShowClient.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/org/xbmc/httpapi/client/TvShowClient.java b/src/org/xbmc/httpapi/client/TvShowClient.java index 9b2cad1b..29a9dc39 100644 --- a/src/org/xbmc/httpapi/client/TvShowClient.java +++ b/src/org/xbmc/httpapi/client/TvShowClient.java @@ -109,8 +109,8 @@ public ArrayList getTvShows(INotifiableManager manager, int sortBy, Stri sb.append(" LEFT OUTER join ("); sb.append(" SELECT min(tvshow.idShow) as idShow, tvshow.c00, count(1) AS totalcount, count(files.playCount) AS watchedcount"); sb.append(" FROM tvshow"); - sb.append(" JOIN tvshowlinkepisode ON tvshow.idShow = tvshowlinkepisode.idShow"); - sb.append(" JOIN episode ON episode.idEpisode = tvshowlinkepisode.idEpisode"); + sb.append(" JOIN episode ON tvshow.idShow = episode.idShow"); + // sb.append(" JOIN episode ON episode.idEpisode = episode.idEpisode"); sb.append(" JOIN files ON files.idFile = episode.idFile"); sb.append(" GROUP BY tvshow.c00"); sb.append(" ) counts ON tvshow.idShow = counts.idShow"); @@ -179,8 +179,8 @@ public ArrayList getTvShows(INotifiableManager manager, Actor actor, int sb.append(" LEFT OUTER join ("); sb.append(" SELECT min(tvshow.idShow) as idShow, tvshow.c00, count(1) AS totalcount, count(files.playCount) AS watchedcount"); sb.append(" FROM tvshow"); - sb.append(" JOIN tvshowlinkepisode ON tvshow.idShow = tvshowlinkepisode.idShow"); - sb.append(" JOIN episode ON episode.idEpisode = tvshowlinkepisode.idEpisode"); + sb.append(" JOIN episode ON tvshow.idShow = episode.idShow"); + //sb.append(" JOIN episode ON episode.idEpisode = episode.idEpisode"); sb.append(" JOIN files ON files.idFile = episode.idFile"); sb.append(" GROUP BY tvshow.c00"); sb.append(" ) counts ON tvshow.idShow = counts.idShow"); @@ -226,8 +226,8 @@ public ArrayList getTvShows(INotifiableManager manager, Genre genre, int sb.append(" LEFT OUTER join ("); sb.append(" SELECT min(tvshow.idShow) as idShow, tvshow.c00, count(1) AS totalcount, count(files.playCount) AS watchedcount"); sb.append(" FROM tvshow"); - sb.append(" JOIN tvshowlinkepisode ON tvshow.idShow = tvshowlinkepisode.idShow"); - sb.append(" JOIN episode ON episode.idEpisode = tvshowlinkepisode.idEpisode"); + sb.append(" JOIN episode ON tvshow.idShow = episode.idShow"); + //sb.append(" JOIN episode ON episode.idEpisode = episode.idEpisode"); sb.append(" JOIN files ON files.idFile = episode.idFile"); sb.append(" GROUP BY tvshow.c00"); sb.append(" ) counts ON tvshow.idShow = counts.idShow"); @@ -265,8 +265,8 @@ public ArrayList getSeasons(INotifiableManager manager, TvShow show, boo sb.append("SELECT c12 from ("); sb.append(" SELECT episode.c12 "); sb.append(" FROM tvshow "); - sb.append(" LEFT OUTER JOIN tvshowlinkepisode ON tvshowlinkepisode.idShow = tvshow.idShow "); - sb.append(" LEFT OUTER JOIN episode ON episode.idEpisode = tvshowlinkepisode.idEpisode "); + sb.append(" LEFT OUTER JOIN episode ON episode.idShow = tvshow.idShow "); + //sb.append(" LEFT OUTER JOIN episode ON episode.idEpisode = episode.idEpisode "); if (hideWatched) { sb.append(" LEFT OUTER JOIN files ON files.idFile = episode.idFile "); } @@ -298,8 +298,8 @@ public ArrayList getSeasons(INotifiableManager manager, int sortBy, Stri StringBuilder sb = new StringBuilder(); sb.append("SELECT min(tvshow.idShow) as idShow, episode.c12 "); sb.append("FROM tvshow "); - sb.append(" LEFT OUTER JOIN tvshowlinkepisode ON tvshowlinkepisode.idShow = tvshow.idShow "); - sb.append(" LEFT OUTER JOIN episode ON episode.idEpisode = tvshowlinkepisode.idEpisode "); + sb.append(" LEFT OUTER JOIN episode ON episode.idShow = tvshow.idShow "); + //sb.append(" LEFT OUTER JOIN episode ON episode.idEpisode = episode.idEpisode "); if (hideWatched) { sb.append(" LEFT OUTER JOIN files ON files.idFile = episode.idFile "); }