Browse files

UPnP: remove remnant use of GetVolumeFromFileName

This was only used when we returned raw files over UPnP

Closes ticket #12700
  • Loading branch information...
1 parent c6b3724 commit a78db708f5ae67c5c608a407b13f3701b3f25cc6 @elupus elupus committed Oct 19, 2012
Showing with 0 additions and 91 deletions.
  1. +0 −85 xbmc/Util.cpp
  2. +0 −1 xbmc/Util.h
  3. +0 −5 xbmc/network/upnp/UPnPInternal.cpp
View
85 xbmc/Util.cpp
@@ -235,91 +235,6 @@ CStdString CUtil::GetTitleFromPath(const CStdString& strFileNameAndPath, bool bI
return strFilename;
}
-bool CUtil::GetVolumeFromFileName(const CStdString& strFileName, CStdString& strFileTitle, CStdString& strVolumeNumber)
-{
- const CStdStringArray &regexps = g_advancedSettings.m_videoStackRegExps;
-
- CStdString strFileNameTemp = strFileName;
-
- CRegExp reg(true);
-
- for (unsigned int i = 0; i < regexps.size(); i++)
- {
- CStdString strRegExp = regexps[i];
- if (!reg.RegComp(strRegExp.c_str()))
- { // invalid regexp - complain in logs
- CLog::Log(LOGERROR, "Invalid RegExp:[%s]", regexps[i].c_str());
- continue;
- }
-
- int iFoundToken = reg.RegFind(strFileName.c_str());
- if (iFoundToken >= 0)
- {
- int iRegLength = reg.GetFindLen();
- int iCount = reg.GetSubCount();
-
- /*
- reg.DumpOvector(LOGDEBUG);
- CLog::Log(LOGDEBUG, "Subcount=%i", iCount);
- for (int j = 0; j <= iCount; j++)
- {
- CStdString str = reg.GetMatch(j);
- CLog::Log(LOGDEBUG, "Sub(%i):[%s]", j, str.c_str());
- }
- */
-
- // simple regexp, only the volume is captured
- if (iCount == 1)
- {
- strVolumeNumber = reg.GetMatch(1);
- if (strVolumeNumber.IsEmpty()) return false;
-
- // Remove the extension (if any). We do this on the base filename, as the regexp
- // match may include some of the extension (eg the "." in particular).
- // The extension will then be added back on at the end - there is no reason
- // to clean it off here. It will be cleaned off during the display routine, if
- // the settings to hide extensions are turned on.
- CStdString strFileNoExt = strFileNameTemp;
- URIUtils::RemoveExtension(strFileNoExt);
- CStdString strFileExt = strFileNameTemp.Right(strFileNameTemp.length() - strFileNoExt.length());
- CStdString strFileRight = strFileNoExt.Mid(iFoundToken + iRegLength);
- strFileTitle = strFileName.Left(iFoundToken) + strFileRight + strFileExt;
-
- return true;
- }
-
- // advanced regexp with prefix (1), volume (2), and suffix (3)
- else if (iCount == 3)
- {
- // second subpatten contains the stacking volume
- strVolumeNumber = reg.GetMatch(2);
- if (strVolumeNumber.IsEmpty()) return false;
-
- // everything before the regexp match
- strFileTitle = strFileName.Left(iFoundToken);
-
- // first subpattern contains prefix
- strFileTitle += reg.GetMatch(1);
-
- // third subpattern contains suffix
- strFileTitle += reg.GetMatch(3);
-
- // everything after the regexp match
- strFileTitle += strFileNameTemp.Mid(iFoundToken + iRegLength);
-
- return true;
- }
-
- // unknown regexp format
- else
- {
- CLog::Log(LOGERROR, "Incorrect movie stacking regexp format:[%s]", regexps[i].c_str());
- }
- }
- }
- return false;
-}
-
void CUtil::CleanString(const CStdString& strFileName, CStdString& strTitle, CStdString& strTitleAndYear, CStdString& strYear, bool bRemoveExtension /* = false */, bool bCleanChars /* = true */)
{
strTitleAndYear = strFileName;
View
1 xbmc/Util.h
@@ -58,7 +58,6 @@ class CUtil
public:
CUtil(void);
virtual ~CUtil(void);
- static bool GetVolumeFromFileName(const CStdString& strFileName, CStdString& strFileTitle, CStdString& strVolumeNumber);
static void CleanString(const CStdString& strFileName, CStdString& strTitle, CStdString& strTitleAndYear, CStdString& strYear, bool bRemoveExtension = false, bool bCleanChars = true);
static CStdString GetTitleFromPath(const CStdString& strFileNameAndPath, bool bIsFolder = false);
static void GetQualifiedFilename(const CStdString &strBasePath, CStdString &strFilename);
View
5 xbmc/network/upnp/UPnPInternal.cpp
@@ -528,11 +528,6 @@ BuildObject(CFileItem& item,
CStdString title = item.GetLabel();
if (item.IsPlayList() || !item.m_bIsFolder) URIUtils::RemoveExtension(title);
object->m_Title = title;
- } else {
- CStdString title, volumeNumber;
- CUtil::GetVolumeFromFileName(item.GetPath(), title, volumeNumber);
- if (!item.m_bIsFolder) URIUtils::RemoveExtension(title);
- object->m_Title = title;
}
}

0 comments on commit a78db70

Please sign in to comment.