Skip to content

Commit

Permalink
Merge pull request xbmc#24176 from 78andyp/refresh_changed_art
Browse files Browse the repository at this point in the history
[GUIWindowVideoBase] Library thumbnail not updated
  • Loading branch information
CrystalP authored Jan 3, 2024
2 parents 71cb21a + 0a02ef8 commit 76ecbb0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
20 changes: 14 additions & 6 deletions xbmc/video/windows/GUIWindowVideoBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ bool CGUIWindowVideoBase::OnItemInfo(const CFileItem& fileItem)
if (fileItem.m_bIsFolder && fileItem.IsVideoDb() &&
fileItem.GetPath() != "videodb://movies/sets/" &&
StringUtils::StartsWith(fileItem.GetPath(), "videodb://movies/sets/"))
return ShowInfo(std::make_shared<CFileItem>(fileItem), nullptr);
return ShowInfoAndRefresh(std::make_shared<CFileItem>(fileItem), nullptr);

// Music video. Match visibility test of CMusicInfo::IsVisible
if (fileItem.IsVideoDb() && fileItem.HasVideoInfoTag() &&
Expand Down Expand Up @@ -323,7 +323,7 @@ bool CGUIWindowVideoBase::OnItemInfo(const CFileItem& fileItem)
if (fileItem.m_bIsFolder)
item.SetProperty("set_folder_thumb", fileItem.GetPath());

return ShowInfo(std::make_shared<CFileItem>(item), scraper);
return ShowInfoAndRefresh(std::make_shared<CFileItem>(item), scraper);
}

// ShowInfo is called as follows:
Expand Down Expand Up @@ -486,14 +486,22 @@ bool CGUIWindowVideoBase::ShowInfo(const CFileItemPtr& item2, const ScraperPtr&
listNeedsUpdating = true;
} while (needsRefresh);

if (listNeedsUpdating &&
IsActive()) // since we can be called from other windows (music, home) we need this check
return listNeedsUpdating;
}

bool CGUIWindowVideoBase::ShowInfoAndRefresh(const CFileItemPtr& item, const ScraperPtr& info)
{
const int ret{ShowInfo(item, info)};

// Test IsActive() since we can be called from other windows (music, home) we need this check
if (ret && IsActive())
{
int itemNumber = m_viewControl.GetSelectedItem();
const int itemNumber{m_viewControl.GetSelectedItem()};
Refresh();
m_viewControl.SetSelectedItem(itemNumber);
}
return true;

return ret;
}

void CGUIWindowVideoBase::OnQueueItem(int iItem, bool first)
Expand Down
18 changes: 17 additions & 1 deletion xbmc/video/windows/GUIWindowVideoBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ class CGUIWindowVideoBase : public CGUIMediaWindow, public IBackgroundLoaderObse
void LoadPlayList(const std::string& strPlayList, PLAYLIST::Id playlistId = PLAYLIST::TYPE_VIDEO);
bool PlayItem(const std::shared_ptr<CFileItem>& item, const std::string& player);

bool ShowInfo(const CFileItemPtr& item, const ADDON::ScraperPtr& content);
/*!
\brief Lookup the information of an item and display an Info dialog
If item has changed then refresh the active underlying list
\param item the item to lookup
\param content
\return true: the information of the item was modified. false: no change.
*/
bool ShowInfoAndRefresh(const CFileItemPtr& item, const ADDON::ScraperPtr& content);

void OnSearch();
void OnSearchItemFound(const CFileItem* pSelItem);
Expand All @@ -127,4 +134,13 @@ class CGUIWindowVideoBase : public CGUIMediaWindow, public IBackgroundLoaderObse

CVideoThumbLoader m_thumbLoader;
bool m_stackingAvailable;

private:
/*!
\brief Lookup the information of an item and display an Info dialog
\param item the item to lookup
\param content
\return true: the information of the item was modified. false: no change.
*/
bool ShowInfo(const CFileItemPtr& item, const ADDON::ScraperPtr& content);
};

0 comments on commit 76ecbb0

Please sign in to comment.