Permalink
Browse files

GetBaseMoviePath should return the parent folder regardless of the 'u…

…se foldernames' setting for video_ts and bdmv folders as they're always stacked
  • Loading branch information...
1 parent 082152c commit c38ac68e1658249f316f3ec8af630ca438a7c7ae Jonathan Marshall committed Jan 27, 2012
Showing with 8 additions and 8 deletions.
  1. +4 −6 xbmc/FileItem.cpp
  2. +4 −2 xbmc/FileItem.h
View
10 xbmc/FileItem.cpp
@@ -2709,16 +2709,14 @@ CStdString CFileItem::GetBaseMoviePath(bool bUseFolderNames) const
if (IsMultiPath())
strMovieName = CMultiPathDirectory::GetFirstPath(m_strPath);
- int pos;
- if ((pos=strMovieName.Find("BDMV/")) != -1 ||
- (pos=strMovieName.Find("BDMV\\")) != -1)
- strMovieName = strMovieName.Mid(0,pos+5);
+ if (IsOpticalMediaFile())
+ return GetLocalMetadataPath();
- if ((!m_bIsFolder || IsOpticalMediaFile() || URIUtils::IsInArchive(m_strPath)) && bUseFolderNames)
+ if ((!m_bIsFolder || URIUtils::IsInArchive(m_strPath)) && bUseFolderNames)
{
CStdString name2(strMovieName);
URIUtils::GetParentPath(name2,strMovieName);
- if (URIUtils::IsInArchive(m_strPath) || strMovieName.Find( "VIDEO_TS" ) != -1)
+ if (URIUtils::IsInArchive(m_strPath))
{
CStdString strArchivePath;
URIUtils::GetParentPath(strMovieName, strArchivePath);
View
6 xbmc/FileItem.h
@@ -239,8 +239,10 @@ class CFileItem :
// Gets the correct movie title
CStdString GetMovieName(bool bUseFolderNames = false) const;
- /*! \brief Find the base movie path (eg the folder if using "use foldernames for lookups")
- Takes care of VIDEO_TS, BDMV, and rar:// listings
+ /*! \brief Find the base movie path (i.e. the item the user expects us to use to lookup the movie)
+ For folder items, with "use foldernames for lookups" it returns the folder.
+ Regardless of settings, for VIDEO_TS/BDMV it returns the parent of the VIDEO_TS/BDMV folder (if present)
+
\param useFolderNames whether we're using foldernames for lookups
\return the base movie folder
*/

0 comments on commit c38ac68

Please sign in to comment.