diff options
author | 78andyp <drandypowell@live.co.uk> | 2024-04-26 14:43:37 +0100 |
---|---|---|
committer | 78andyp <drandypowell@live.co.uk> | 2024-04-26 14:43:37 +0100 |
commit | 54a63d02f1e63ebad0cd99dc06ca070c91ceb93c (patch) | |
tree | e4b0eb6225aa1cc99a8c5dcf1c721137d8047fad /xbmc/FileItem.cpp | |
parent | a5fb12b4637c62a47a59fcc50f2c88246e9d6fff (diff) | |
download | xbmc-54a63d02f1e63ebad0cd99dc06ca070c91ceb93c.tar.xz |
[Video] Improve user experience when playing movies/episodes from Bluray ISO/BDMV.
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); |