aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlasdair Campbell <alcoheca@gmail.com>2012-11-20 11:13:30 +0000
committerAlasdair Campbell <alcoheca@gmail.com>2012-11-28 13:44:53 +0000
commit6ca3534b1ecffb78869506fd1b213f7548321d14 (patch)
tree3c271c5b5cd244cbcb982a891022c7cca7d9d408
parent99fa6fbf336078b910a1d8a6e63f11b41c761c28 (diff)
library: add method to determine season num from episode id
-rw-r--r--xbmc/video/VideoDatabase.cpp10
-rw-r--r--xbmc/video/VideoDatabase.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp
index cec4876494..17aaddefef 100644
--- a/xbmc/video/VideoDatabase.cpp
+++ b/xbmc/video/VideoDatabase.cpp
@@ -6433,6 +6433,16 @@ int CVideoDatabase::GetTvShowForEpisode(int idEpisode)
return false;
}
+int CVideoDatabase::GetSeasonForEpisode(int idEpisode)
+{
+ char column[5];
+ sprintf(column, "c%0d", VIDEODB_ID_EPISODE_SEASON);
+ CStdString id = GetSingleValue("episode", column, PrepareSQL("idEpisode=%i", idEpisode));
+ if (id.IsEmpty())
+ return -1;
+ return atoi(id.c_str());
+}
+
bool CVideoDatabase::HasContent()
{
return (HasContent(VIDEODB_CONTENT_MOVIES) ||
diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h
index b49942bda3..26e05f90fa 100644
--- a/xbmc/video/VideoDatabase.h
+++ b/xbmc/video/VideoDatabase.h
@@ -426,6 +426,7 @@ public:
CStdString GetTvShowTitleById(int id);
CStdString GetMusicVideoAlbumById(int id);
int GetTvShowForEpisode(int idEpisode);
+ int GetSeasonForEpisode(int idEpisode);
bool LoadVideoInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details);
bool GetMovieInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details, int idMovie = -1);