Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1818 from alcoheca/fix-updates

Fix upnp season updates
  • Loading branch information...
commit cd5a8c317b8577ea0336ec2498f13f45835c4c7d 2 parents b6c393b + 4a12fc3
jmarshallnz jmarshallnz authored
2  xbmc/network/upnp/UPnPServer.cpp
View
@@ -405,7 +405,9 @@ CUPnPServer::Announce(AnnouncementFlag flag, const char *sender, const char *mes
CVideoDatabase db;
if (!db.Open()) return;
int show_id = db.GetTvShowForEpisode(item_id);
+ int season_id = db.GetSeasonForEpisode(item_id);
UpdateContainer(StringUtils::Format("videodb://2/2/%d/", show_id));
+ UpdateContainer(StringUtils::Format("videodb://2/2/%d/%d/?tvshowid=%d", show_id, season_id, show_id));
UpdateContainer("videodb://5/");
}
else if(item_type == "tvshow") {
10 xbmc/video/VideoDatabase.cpp
View
@@ -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) ||
1  xbmc/video/VideoDatabase.h
View
@@ -426,6 +426,7 @@ class CVideoDatabase : public CDatabase
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);
Please sign in to comment.
Something went wrong with that request. Please try again.