aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author78andyp <drandypowell@live.co.uk>2024-10-14 15:17:24 +0100
committer78andyp <drandypowell@live.co.uk>2024-10-14 15:17:24 +0100
commit77e6d10c83a804b1152953a182464cf5ebf20581 (patch)
tree626c370ef39387e14162139942027b6e75d75149
parenteb29391d79578fd2e022f1bdcbf7ce4efdb02d5a (diff)
[Art] Fix #25601 - Refresh art after update in information dialog.
-rw-r--r--xbmc/video/VideoDatabase.cpp2
-rw-r--r--xbmc/video/dialogs/GUIDialogVideoInfo.cpp30
-rw-r--r--xbmc/video/windows/GUIWindowVideoBase.cpp1
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 7d93996ba5..efe837a0e3 100644
--- a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp
+++ b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp
@@ -863,8 +863,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;
@@ -882,8 +883,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);
@@ -895,8 +897,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))
{
@@ -929,6 +932,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;
@@ -937,6 +941,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 =
@@ -1831,7 +1844,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>