diff options
author | thexai <58434170+thexai@users.noreply.github.com> | 2024-10-14 18:30:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-14 18:30:09 +0200 |
commit | 3237f679f81f82258c46df4e06c36c914267efc4 (patch) | |
tree | 269d7a5109710bf2216a77c75840c157bd0afa19 | |
parent | 5e098e7ed111df083fbf26c52f6f0bd0bc4c6c7a (diff) | |
parent | 77e6d10c83a804b1152953a182464cf5ebf20581 (diff) |
Merge pull request #25812 from 78andyp/refresh
[Art] Fix #25601 - Refresh art after update in information dialog
-rw-r--r-- | xbmc/video/VideoDatabase.cpp | 2 | ||||
-rw-r--r-- | xbmc/video/dialogs/GUIDialogVideoInfo.cpp | 30 | ||||
-rw-r--r-- | xbmc/video/windows/GUIWindowVideoBase.cpp | 1 |
3 files changed, 25 insertions, 8 deletions
diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index f333bb334b..20b8724977 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -4994,6 +4994,8 @@ void CVideoDatabase::SetArtForItem(int mediaId, const MediaType &mediaType, cons sql = PrepareSQL("INSERT INTO art(media_id, media_type, type, url) VALUES (%d, '%s', '%s', '%s')", mediaId, mediaType.c_str(), artType.c_str(), url.c_str()); m_pDS->exec(sql); } + + AnnounceUpdate(mediaType, mediaId); } catch (...) { diff --git a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp index f7c931e4b0..d297a15634 100644 --- a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp +++ b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp @@ -864,8 +864,9 @@ void AddHardCodedAndExtendedArtTypes(std::vector<std::string>& artTypes, const C } // Add art types currently assigned to the media item -void AddCurrentArtTypes(std::vector<std::string>& artTypes, const CVideoInfoTag& tag, - CVideoDatabase& db) +void AddCurrentArtTypes(std::vector<std::string>& artTypes, + const CVideoInfoTag& tag, + CVideoDatabase& db) { std::map<std::string, std::string> currentArt; @@ -883,8 +884,9 @@ void AddCurrentArtTypes(std::vector<std::string>& artTypes, const CVideoInfoTag& } // Add art types that exist for other media items of the same type -void AddMediaTypeArtTypes(std::vector<std::string>& artTypes, const CVideoInfoTag& tag, - CVideoDatabase& db) +void AddMediaTypeArtTypes(std::vector<std::string>& artTypes, + const CVideoInfoTag& tag, + CVideoDatabase& db) { std::vector<std::string> dbArtTypes; db.GetArtTypes(tag.m_type, dbArtTypes); @@ -896,8 +898,9 @@ void AddMediaTypeArtTypes(std::vector<std::string>& artTypes, const CVideoInfoTa } // Add art types from available but unassigned artwork for this media item -void AddAvailableArtTypes(std::vector<std::string>& artTypes, const CVideoInfoTag& tag, - CVideoDatabase& db) +void AddAvailableArtTypes(std::vector<std::string>& artTypes, + const CVideoInfoTag& tag, + CVideoDatabase& db) { for (const auto& artType : db.GetAvailableArtTypesForItem(tag.m_iDbId, tag.m_type)) { @@ -930,6 +933,7 @@ public: bool ChooseArtType(); const std::string& GetArtType() const { return m_artType; } + void UpdateArtType(const std::string& type, const std::string& art) const; private: std::shared_ptr<CFileItem> m_item; @@ -938,6 +942,15 @@ private: std::string m_artType; }; +void CArtTypeChooser::UpdateArtType(const std::string& type, const std::string& art) const +{ + m_item->SetArt(type, art); + if (!m_items.IsEmpty()) + for (auto& item : m_items) + if (item->GetProperty("type") == type) + item->SetArt("thumb", art); +} + bool CArtTypeChooser::ChooseArtType() { CGUIDialogSelect* dialog = @@ -1832,7 +1845,10 @@ bool CGUIDialogVideoInfo::ChooseAndManageVideoItemArtwork(const std::shared_ptr< if (!chooser.ChooseArtType()) break; - result = ManageVideoItemArtwork(item, item->GetVideoInfoTag()->m_type, chooser.GetArtType()); + const std::string chosenArtType{chooser.GetArtType()}; + result = ManageVideoItemArtwork(item, item->GetVideoInfoTag()->m_type, chosenArtType); + if (result) + chooser.UpdateArtType(chosenArtType, item->GetArt(chosenArtType)); } while (true); diff --git a/xbmc/video/windows/GUIWindowVideoBase.cpp b/xbmc/video/windows/GUIWindowVideoBase.cpp index a875ae4bfa..d231a809f7 100644 --- a/xbmc/video/windows/GUIWindowVideoBase.cpp +++ b/xbmc/video/windows/GUIWindowVideoBase.cpp @@ -65,7 +65,6 @@ #include "video/guilib/VideoGUIUtils.h" #include "video/guilib/VideoPlayActionProcessor.h" #include "video/guilib/VideoSelectActionProcessor.h" -#include "video/guilib/VideoVersionHelper.h" #include "view/GUIViewState.h" #include <memory> |