Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: AdvancedSettings.cpp
- ===================================================================
- --- AdvancedSettings.cpp (revision 28276)
- +++ AdvancedSettings.cpp (working copy)
- @@ -782,6 +782,8 @@
- if (pRegExp->FirstChild())
- {
- bool bByDate = false;
- + int iForcedSeason = -1;
- +
- if (pRegExp->ToElement())
- {
- CStdString byDate = pRegExp->ToElement()->Attribute("bydate");
- @@ -789,13 +791,19 @@
- {
- bByDate = true;
- }
- + CStdString forcedSeason = pRegExp->ToElement()->Attribute("forcedSeason");
- + if(forcedSeason)
- + {
- + iForcedSeason = atoi(forcedSeason.c_str());
- + }
- }
- +
- CStdString regExp = pRegExp->FirstChild()->Value();
- regExp.MakeLower();
- if (iAction == 2)
- - settings.insert(settings.begin() + i++, 1, TVShowRegexp(bByDate,regExp));
- + settings.insert(settings.begin() + i++, 1, TVShowRegexp(iForcedSeason,bByDate,regExp));
- else
- - settings.push_back(TVShowRegexp(bByDate,regExp));
- + settings.push_back(TVShowRegexp(iForcedSeason,bByDate,regExp));
- }
- pRegExp = pRegExp->NextSibling("regexp");
- }
- Index: AdvancedSettings.h
- ===================================================================
- --- AdvancedSettings.h (revision 28276)
- +++ AdvancedSettings.h (working copy)
- @@ -37,10 +37,18 @@
- struct TVShowRegexp
- {
- + int forcedSeason;
- bool byDate;
- CStdString regexp;
- + TVShowRegexp(int s, bool d, const CStdString& r)
- + {
- + forcedSeason = s;
- + byDate = d;
- + regexp = r;
- + }
- TVShowRegexp(bool d, const CStdString& r)
- {
- + forcedSeason = -1;
- byDate = d;
- regexp = r;
- }
- Index: VideoInfoScanner.cpp
- ===================================================================
- --- VideoInfoScanner.cpp (revision 28276)
- +++ VideoInfoScanner.cpp (working copy)
- @@ -812,7 +812,7 @@
- }
- else
- {
- - bMatched = ProcessItemNormal(items[i],episodeList,expression[j].regexp);
- + bMatched = ProcessItemNormal(items[i],episodeList,expression[j].regexp,expression[j].forcedSeason);
- }
- if (bMatched)
- break;
- @@ -824,7 +824,7 @@
- }
- }
- - bool CVideoInfoScanner::ProcessItemNormal(CFileItemPtr item, EPISODES &episodeList, CStdString regexp)
- + bool CVideoInfoScanner::ProcessItemNormal(CFileItemPtr item, EPISODES &episodeList, CStdString regexp, int forcedSeason)
- {
- CRegExp reg;
- if (!reg.RegComp(regexp))
- @@ -852,9 +852,13 @@
- myEpisode.strPath = item->m_strPath;
- if (strlen(season) == 0 && strlen(episode) > 0)
- { // no season specified -> assume season 1
- - myEpisode.iSeason = 1;
- + if(forcedSeason >= 0)
- + myEpisode.iSeason = forcedSeason;
- + else
- + myEpisode.iSeason = 1;
- +
- myEpisode.iEpisode = atoi(episode);
- - CLog::Log(LOGDEBUG,"found episode without season %s (e%i) [%s]",strLabel.c_str(),myEpisode.iEpisode,regexp.c_str());
- + CLog::Log(LOGDEBUG,"found episode without season %s -> forcing season (s%ie%i) [%s]",strLabel.c_str(),myEpisode.iSeason,myEpisode.iEpisode,regexp.c_str());
- }
- else if (strlen(season) > 0 && strlen(episode) == 0)
- { // no episode specification -> assume season 1
- Index: VideoInfoScanner.h
- ===================================================================
- --- VideoInfoScanner.h (revision 28276)
- +++ VideoInfoScanner.h (working copy)
- @@ -74,7 +74,7 @@
- void SetObserver(IVideoInfoScannerObserver* pObserver);
- void EnumerateSeriesFolder(CFileItem* item, EPISODES& episodeList);
- - bool ProcessItemNormal(CFileItemPtr item, EPISODES& episodeList, CStdString regexp);
- + bool ProcessItemNormal(CFileItemPtr item, EPISODES& episodeList, CStdString regexp, int forcedSeason);
- bool ProcessItemByDate(CFileItemPtr item, EPISODES& eipsodeList, CStdString regexp);
- long AddMovie(CFileItem *pItem, const CStdString &content, CVideoInfoTag &movieDetails, int idShow = -1);
- 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