Skip to content
This repository
Browse code

Merge pull request #1818 from alcoheca/fix-updates

Fix upnp season updates
  • Loading branch information...
commit cd5a8c317b8577ea0336ec2498f13f45835c4c7d 2 parents b6c393b + 4a12fc3
jmarshallnz authored November 29, 2012
2  xbmc/network/upnp/UPnPServer.cpp
@@ -405,7 +405,9 @@ CUPnPServer::Announce(AnnouncementFlag flag, const char *sender, const char *mes
405 405
                 CVideoDatabase db;
406 406
                 if (!db.Open()) return;
407 407
                 int show_id = db.GetTvShowForEpisode(item_id);
  408
+                int season_id = db.GetSeasonForEpisode(item_id);
408 409
                 UpdateContainer(StringUtils::Format("videodb://2/2/%d/", show_id));
  410
+                UpdateContainer(StringUtils::Format("videodb://2/2/%d/%d/?tvshowid=%d", show_id, season_id, show_id));
409 411
                 UpdateContainer("videodb://5/");
410 412
             }
411 413
             else if(item_type == "tvshow") {
10  xbmc/video/VideoDatabase.cpp
@@ -6433,6 +6433,16 @@ int CVideoDatabase::GetTvShowForEpisode(int idEpisode)
6433 6433
   return false;
6434 6434
 }
6435 6435
 
  6436
+int CVideoDatabase::GetSeasonForEpisode(int idEpisode)
  6437
+{
  6438
+  char column[5];
  6439
+  sprintf(column, "c%0d", VIDEODB_ID_EPISODE_SEASON);
  6440
+  CStdString id = GetSingleValue("episode", column, PrepareSQL("idEpisode=%i", idEpisode));
  6441
+  if (id.IsEmpty())
  6442
+    return -1;
  6443
+  return atoi(id.c_str());
  6444
+}
  6445
+
6436 6446
 bool CVideoDatabase::HasContent()
6437 6447
 {
6438 6448
   return (HasContent(VIDEODB_CONTENT_MOVIES) ||
1  xbmc/video/VideoDatabase.h
@@ -426,6 +426,7 @@ class CVideoDatabase : public CDatabase
426 426
   CStdString GetTvShowTitleById(int id);
427 427
   CStdString GetMusicVideoAlbumById(int id);
428 428
   int GetTvShowForEpisode(int idEpisode);
  429
+  int GetSeasonForEpisode(int idEpisode);
429 430
 
430 431
   bool LoadVideoInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details);
431 432
   bool GetMovieInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details, int idMovie = -1);

0 notes on commit cd5a8c3

Please sign in to comment.
Something went wrong with that request. Please try again.