diff options
Diffstat (limited to 'xbmc/FileItem.cpp')
-rw-r--r-- | xbmc/FileItem.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp index 558a5a2ad8..1029e0da61 100644 --- a/xbmc/FileItem.cpp +++ b/xbmc/FileItem.cpp @@ -1559,6 +1559,9 @@ bool CFileItem::IsSamePath(const CFileItem *item) const { if (item->HasProperty("item_start") || HasProperty("item_start")) return (item->GetProperty("item_start") == GetProperty("item_start")); + // See if we have associated a bluray playlist + if (IsBlurayPlaylist(*this) || IsBlurayPlaylist(*item)) + return (GetDynPath() == item->GetDynPath()); return true; } if (HasMusicInfoTag() && item->HasMusicInfoTag()) @@ -1958,6 +1961,22 @@ void CFileItem::SetDynPath(const std::string &path) m_strDynPath = path; } +std::string CFileItem::GetBlurayPath() const +{ + if (IsBlurayPlaylist(*this)) + { + CURL url(GetDynPath()); + CURL url2(url.GetHostName()); // strip bluray:// + if (url2.IsProtocol("udf")) + // ISO + return url2.GetHostName(); // strip udf:// + else if (url.IsProtocol("bluray")) + // BDMV + return url2.Get() + "BDMV/index.bdmv"; + } + return GetDynPath(); +} + void CFileItem::SetCueDocument(const CCueDocumentPtr& cuePtr) { m_cueDocument = cuePtr; @@ -2472,7 +2491,11 @@ std::string CFileItem::GetLocalMetadataPath() const if (m_bIsFolder && !IsFileFolder()) return m_strPath; - std::string parent(URIUtils::GetParentPath(m_strPath)); + std::string parent{}; + if (IsBlurayPlaylist(*this)) + parent = URIUtils::GetParentPath(GetBlurayPath()); + else + parent = URIUtils::GetParentPath(m_strPath); std::string parentFolder(parent); URIUtils::RemoveSlashAtEnd(parentFolder); parentFolder = URIUtils::GetFileName(parentFolder); |