diff options
author | Kai Sommerfeld <3226626+ksooo@users.noreply.github.com> | 2023-09-04 08:13:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-04 08:13:11 +0200 |
commit | ad82a1cf0b166e2e3e253c44db341e22762421f7 (patch) | |
tree | 63aca614519415646f0640bb0c6187c46e0d717d | |
parent | a4e19af4d8f88d4b5ef9f02d4110a1268fc96e2b (diff) | |
parent | b06f51f3b962f9254a8fcc880d460cf2084c9603 (diff) | |
download | xbmc-ad82a1cf0b166e2e3e253c44db341e22762421f7.tar.xz |
Merge pull request #23717 from ksooo/video-fix-choose-art
[video] Fix 'Local art' missing in art selection dialog.
-rw-r--r-- | xbmc/FileItem.cpp | 20 | ||||
-rw-r--r-- | xbmc/video/dialogs/GUIDialogVideoInfo.cpp | 22 |
2 files changed, 34 insertions, 8 deletions
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp index 77ad297a7a..2d033eea87 100644 --- a/xbmc/FileItem.cpp +++ b/xbmc/FileItem.cpp @@ -3382,20 +3382,22 @@ std::string CFileItem::GetLocalArtBaseFilename() const std::string CFileItem::GetLocalArtBaseFilename(bool& useFolder) const { - std::string strFile = m_strPath; + std::string strFile; if (IsStack()) { std::string strPath; URIUtils::GetParentPath(m_strPath,strPath); - strFile = URIUtils::AddFileToFolder(strPath, URIUtils::GetFileName(CStackDirectory::GetStackedTitlePath(strFile))); + strFile = URIUtils::AddFileToFolder( + strPath, URIUtils::GetFileName(CStackDirectory::GetStackedTitlePath(m_strPath))); } - if (URIUtils::IsInRAR(strFile) || URIUtils::IsInZIP(strFile)) + std::string file = strFile.empty() ? m_strPath : strFile; + if (URIUtils::IsInRAR(file) || URIUtils::IsInZIP(file)) { - std::string strPath = URIUtils::GetDirectory(strFile); + std::string strPath = URIUtils::GetDirectory(file); std::string strParent; URIUtils::GetParentPath(strPath,strParent); - strFile = URIUtils::AddFileToFolder(strParent, URIUtils::GetFileName(strFile)); + strFile = URIUtils::AddFileToFolder(strParent, URIUtils::GetFileName(file)); } if (IsMultiPath()) @@ -3407,7 +3409,13 @@ std::string CFileItem::GetLocalArtBaseFilename(bool& useFolder) const strFile = GetLocalMetadataPath(); } else if (useFolder && !(m_bIsFolder && !IsFileFolder())) - strFile = URIUtils::GetDirectory(strFile); + { + file = strFile.empty() ? m_strPath : strFile; + strFile = URIUtils::GetDirectory(file); + } + + if (strFile.empty()) + strFile = GetDynPath(); return strFile; } diff --git a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp index 2d662994d4..f33515a2bc 100644 --- a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp +++ b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp @@ -1996,6 +1996,8 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const std::shared_ptr<CFileItem } } + std::string localThumb; + bool local = false; std::vector<std::string> thumbs; if (type != MediaTypeArtist) @@ -2056,8 +2058,7 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const std::shared_ptr<CFileItem else noneitem->SetArt("icon", "DefaultActor.png"); } - - if (type == MediaTypeVideoCollection) + else if (type == MediaTypeVideoCollection) { std::string localFile = FindLocalMovieSetArtworkFile(item, artType); if (!localFile.empty()) @@ -2071,6 +2072,20 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const std::shared_ptr<CFileItem else noneitem->SetArt("icon", "DefaultVideo.png"); } + else + { + localThumb = CVideoThumbLoader::GetLocalArt(*item, artType); + if (!localThumb.empty()) + { + const auto localitem = std::make_shared<CFileItem>("thumb://Local", false); + localitem->SetArt("thumb", localThumb); + localitem->SetArt("icon", "DefaultPicture.png"); + localitem->SetLabel(g_localizeStrings.Get(13514)); + items.Add(localitem); + } + else + noneitem->SetArt("icon", "DefaultPicture.png"); + } } else { @@ -2126,6 +2141,9 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const std::shared_ptr<CFileItem if (result == "thumb://Current") result = currentThumb; // user chose the one they have + if (result == "thumb://Local") + result = localThumb; + if (result == "thumb://Embedded") result = embeddedArt; |