Correctly refresh artist and album views when filters change
This commit is contained in:
@@ -76,6 +76,7 @@ Artist::Artist(Filters& filters, PlayQueueController& controller)
|
||||
|
||||
filters.updated().connect([this]
|
||||
{
|
||||
_needForceRefresh = true;
|
||||
refreshView();
|
||||
});
|
||||
|
||||
@@ -111,12 +112,13 @@ Artist::refreshView()
|
||||
const auto artistId {extractArtistIdFromInternalPath()};
|
||||
|
||||
// consider everything is up to date is the same artist is being rendered
|
||||
if (artistId && *artistId == _artistId)
|
||||
if (!_needForceRefresh && artistId && *artistId == _artistId)
|
||||
return;
|
||||
|
||||
clear();
|
||||
_artistId = {};
|
||||
_trackContainer = nullptr;
|
||||
_needForceRefresh = false;
|
||||
|
||||
if (!artistId)
|
||||
throw ArtistNotFoundException {};
|
||||
|
||||
@@ -80,6 +80,7 @@ namespace UserInterface
|
||||
ReleaseContainer _appearsOnReleaseContainer {};
|
||||
InfiniteScrollingContainer* _trackContainer {};
|
||||
Database::ArtistId _artistId {};
|
||||
bool _needForceRefresh {};
|
||||
};
|
||||
} // namespace UserInterface
|
||||
|
||||
|
||||
@@ -184,6 +184,7 @@ Release::Release(Filters& filters, PlayQueueController& playQueueController)
|
||||
|
||||
_filters.updated().connect([this]
|
||||
{
|
||||
_needForceRefresh = true;
|
||||
refreshView();
|
||||
});
|
||||
|
||||
@@ -220,11 +221,12 @@ Release::refreshView()
|
||||
const auto releaseId {extractReleaseIdFromInternalPath()};
|
||||
|
||||
// consider everything is up to date is the same release is being rendered
|
||||
if (releaseId && *releaseId == _releaseId)
|
||||
if (!_needForceRefresh && releaseId && *releaseId == _releaseId)
|
||||
return;
|
||||
|
||||
clear();
|
||||
_releaseId = {};
|
||||
_needForceRefresh = false;
|
||||
|
||||
if (!releaseId)
|
||||
throw ReleaseNotFoundException {};
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace UserInterface
|
||||
Filters& _filters;
|
||||
PlayQueueController& _playQueueController;
|
||||
Database::ReleaseId _releaseId;
|
||||
bool _needForceRefresh {};
|
||||
};
|
||||
} // namespace UserInterface
|
||||
|
||||
|
||||
Reference in New Issue
Block a user