Advertisement
Guest User

XBMC diff

a guest
Apr 25th, 2010
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.17 KB | None | 0 0
  1. Index: AdvancedSettings.cpp
  2. ===================================================================
  3. --- AdvancedSettings.cpp    (revision 28276)
  4. +++ AdvancedSettings.cpp    (working copy)
  5. @@ -782,6 +782,8 @@
  6.      if (pRegExp->FirstChild())
  7.      {
  8.        bool bByDate = false;
  9. +      int iForcedSeason = -1;
  10. +
  11.        if (pRegExp->ToElement())
  12.        {
  13.          CStdString byDate = pRegExp->ToElement()->Attribute("bydate");
  14. @@ -789,13 +791,19 @@
  15.          {
  16.            bByDate = true;
  17.          }
  18. +        CStdString forcedSeason = pRegExp->ToElement()->Attribute("forcedSeason");
  19. +        if(forcedSeason)
  20. +        {
  21. +           iForcedSeason = atoi(forcedSeason.c_str());
  22. +        }
  23.        }
  24. +
  25.        CStdString regExp = pRegExp->FirstChild()->Value();
  26.        regExp.MakeLower();
  27.        if (iAction == 2)
  28. -        settings.insert(settings.begin() + i++, 1, TVShowRegexp(bByDate,regExp));
  29. +        settings.insert(settings.begin() + i++, 1, TVShowRegexp(iForcedSeason,bByDate,regExp));
  30.        else
  31. -        settings.push_back(TVShowRegexp(bByDate,regExp));
  32. +        settings.push_back(TVShowRegexp(iForcedSeason,bByDate,regExp));
  33.      }
  34.      pRegExp = pRegExp->NextSibling("regexp");
  35.    }
  36. Index: AdvancedSettings.h
  37. ===================================================================
  38. --- AdvancedSettings.h  (revision 28276)
  39. +++ AdvancedSettings.h  (working copy)
  40. @@ -37,10 +37,18 @@
  41.  
  42.  struct TVShowRegexp
  43.  {
  44. +   int forcedSeason;
  45.    bool byDate;
  46.    CStdString regexp;
  47. +  TVShowRegexp(int s, bool d, const CStdString& r)
  48. +  {
  49. +   forcedSeason = s;
  50. +    byDate = d;
  51. +    regexp = r;
  52. +  }
  53.    TVShowRegexp(bool d, const CStdString& r)
  54.    {
  55. +   forcedSeason = -1;
  56.      byDate = d;
  57.      regexp = r;
  58.    }
  59. Index: VideoInfoScanner.cpp
  60. ===================================================================
  61. --- VideoInfoScanner.cpp    (revision 28276)
  62. +++ VideoInfoScanner.cpp    (working copy)
  63. @@ -812,7 +812,7 @@
  64.          }
  65.          else
  66.          {
  67. -          bMatched = ProcessItemNormal(items[i],episodeList,expression[j].regexp);
  68. +          bMatched = ProcessItemNormal(items[i],episodeList,expression[j].regexp,expression[j].forcedSeason);
  69.          }
  70.          if (bMatched)
  71.            break;
  72. @@ -824,7 +824,7 @@
  73.      }
  74.    }
  75.  
  76. -  bool CVideoInfoScanner::ProcessItemNormal(CFileItemPtr item, EPISODES &episodeList, CStdString regexp)
  77. +  bool CVideoInfoScanner::ProcessItemNormal(CFileItemPtr item, EPISODES &episodeList, CStdString regexp, int forcedSeason)
  78.    {
  79.      CRegExp reg;
  80.      if (!reg.RegComp(regexp))
  81. @@ -852,9 +852,13 @@
  82.      myEpisode.strPath = item->m_strPath;
  83.      if (strlen(season) == 0 && strlen(episode) > 0)
  84.      { // no season specified -> assume season 1
  85. -      myEpisode.iSeason = 1;
  86. +       if(forcedSeason >= 0)
  87. +           myEpisode.iSeason = forcedSeason;
  88. +       else
  89. +           myEpisode.iSeason = 1;
  90. +
  91.        myEpisode.iEpisode = atoi(episode);
  92. -      CLog::Log(LOGDEBUG,"found episode without season %s (e%i) [%s]",strLabel.c_str(),myEpisode.iEpisode,regexp.c_str());
  93. +      CLog::Log(LOGDEBUG,"found episode without season %s -> forcing season (s%ie%i) [%s]",strLabel.c_str(),myEpisode.iSeason,myEpisode.iEpisode,regexp.c_str());
  94.      }
  95.      else if (strlen(season) > 0 && strlen(episode) == 0)
  96.      { // no episode specification -> assume season 1
  97. Index: VideoInfoScanner.h
  98. ===================================================================
  99. --- VideoInfoScanner.h  (revision 28276)
  100. +++ VideoInfoScanner.h  (working copy)
  101. @@ -74,7 +74,7 @@
  102.      void SetObserver(IVideoInfoScannerObserver* pObserver);
  103.  
  104.      void EnumerateSeriesFolder(CFileItem* item, EPISODES& episodeList);
  105. -    bool ProcessItemNormal(CFileItemPtr item, EPISODES& episodeList, CStdString regexp);
  106. +    bool ProcessItemNormal(CFileItemPtr item, EPISODES& episodeList, CStdString regexp, int forcedSeason);
  107.      bool ProcessItemByDate(CFileItemPtr item, EPISODES& eipsodeList, CStdString regexp);
  108.      long AddMovie(CFileItem *pItem, const CStdString &content, CVideoInfoTag &movieDetails, int idShow = -1);
  109.      long AddMovieAndGetThumb(CFileItem *pItem, const CStdString &content, CVideoInfoTag &movieDetails, int idShow, bool bApplyToDir=false, bool bRefresh=false, CGUIDialogProgress* pDialog = NULL);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement