aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Borges de Freitas <enen92@users.noreply.github.com>2022-04-11 18:18:55 +0100
committerGitHub <noreply@github.com>2022-04-11 18:18:55 +0100
commita942f15f4550d5005bd4dd7b3658c0784f6d96cc (patch)
tree826d8f460c5764dcc0671266bfa9e9197a61b34b
parentf6c6a66274d9e2aeb14c11a7b7589cc138854167 (diff)
parent45a7449519522b294cf43bfa37d4ffd698aecf75 (diff)
Merge pull request #21254 from enen92/tvshowsortmethods
[GUI] Always respect sortattributes in tvshow sort methods
-rw-r--r--xbmc/video/GUIViewStateVideo.cpp42
1 files changed, 29 insertions, 13 deletions
diff --git a/xbmc/video/GUIViewStateVideo.cpp b/xbmc/video/GUIViewStateVideo.cpp
index 0124e2a4b6..13a67b7484 100644
--- a/xbmc/video/GUIViewStateVideo.cpp
+++ b/xbmc/video/GUIViewStateVideo.cpp
@@ -130,12 +130,19 @@ CGUIViewStateWindowVideoNav::CGUIViewStateWindowVideoNav(const CFileItemList& it
AddSortMethod(SortByOriginalTitle, sortAttributes, 20376,
LABEL_MASKS("%T", "%M", "%T", "%M")); // Title, #Episodes | Title, #Episodes
- AddSortMethod(SortByNumberOfEpisodes, 20360, LABEL_MASKS("%L", "%M", "%L", "%M")); // Label, #Episodes | Label, #Episodes
- AddSortMethod(SortByLastPlayed, 568, LABEL_MASKS("%T", "%p", "%T", "%p")); // Title, #Last played | Title, #Last played
- AddSortMethod(SortByDateAdded, 570, LABEL_MASKS("%T", "%a", "%T", "%a")); // Title, DateAdded | Title, DateAdded
- AddSortMethod(SortByYear, 562, LABEL_MASKS("%L","%Y","%L","%Y")); // Label, Year | Label, Year
- AddSortMethod(SortByRating, 563, LABEL_MASKS("%T", "%R", "%T", "%R")); // Title, Rating | Title, Rating
- AddSortMethod(SortByUserRating, 38018, LABEL_MASKS("%T", "%r", "%T", "%r")); // Title, Userrating | Title, Userrating
+ AddSortMethod(SortByNumberOfEpisodes, sortAttributes, 20360,
+ LABEL_MASKS("%L", "%M", "%L", "%M")); // Label, #Episodes | Label, #Episodes
+ AddSortMethod(
+ SortByLastPlayed, sortAttributes, 568,
+ LABEL_MASKS("%T", "%p", "%T", "%p")); // Title, #Last played | Title, #Last played
+ AddSortMethod(SortByDateAdded, sortAttributes, 570,
+ LABEL_MASKS("%T", "%a", "%T", "%a")); // Title, DateAdded | Title, DateAdded
+ AddSortMethod(SortByYear, sortAttributes, 562,
+ LABEL_MASKS("%L", "%Y", "%L", "%Y")); // Label, Year | Label, Year
+ AddSortMethod(SortByRating, sortAttributes, 563,
+ LABEL_MASKS("%T", "%R", "%T", "%R")); // Title, Rating | Title, Rating
+ AddSortMethod(SortByUserRating, sortAttributes, 38018,
+ LABEL_MASKS("%T", "%r", "%T", "%r")); // Title, Userrating | Title, Userrating
SetSortMethod(SortByLabel);
const CViewState *viewState = CViewStateSettings::GetInstance().Get("videonavtvshows");
@@ -523,14 +530,23 @@ void CGUIViewStateVideoMusicVideos::SaveViewState()
CGUIViewStateVideoTVShows::CGUIViewStateVideoTVShows(const CFileItemList& items) : CGUIViewStateWindowVideo(items)
{
- AddSortMethod(SortBySortTitle, 556, LABEL_MASKS("%T", "%M", "%T", "%M"), // Title, #Episodes | Title, #Episodes
- CServiceBroker::GetSettingsComponent()->GetSettings()->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone);
+ SortAttribute sortAttributes = SortAttributeNone;
+ const std::shared_ptr<CSettings> settings = CServiceBroker::GetSettingsComponent()->GetSettings();
+ if (settings->GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
+ sortAttributes = SortAttributeIgnoreArticle;
- AddSortMethod(SortByNumberOfEpisodes, 20360, LABEL_MASKS("%L", "%M", "%L", "%M")); // Label, #Episodes | Label, #Episodes
- AddSortMethod(SortByLastPlayed, 568, LABEL_MASKS("%T", "%p", "%T", "%p")); // Title, #Last played | Title, #Last played
- AddSortMethod(SortByDateAdded, 570, LABEL_MASKS("%T", "%a", "%T", "%a")); // Title, DateAdded | Title, DateAdded
- AddSortMethod(SortByYear, 562, LABEL_MASKS("%T", "%Y", "%T", "%Y")); // Title, Year | Title, Year
- AddSortMethod(SortByUserRating, 38018, LABEL_MASKS("%T", "%r", "%T", "%r")); // Title, Userrating | Title, Userrating
+ AddSortMethod(SortBySortTitle, sortAttributes, 556,
+ LABEL_MASKS("%T", "%M", "%T", "%M")); // Title, #Episodes | Title, #Episodes
+ AddSortMethod(SortByNumberOfEpisodes, sortAttributes, 20360,
+ LABEL_MASKS("%L", "%M", "%L", "%M")); // Label, #Episodes | Label, #Episodes
+ AddSortMethod(SortByLastPlayed, sortAttributes, 568,
+ LABEL_MASKS("%T", "%p", "%T", "%p")); // Title, #Last played | Title, #Last played
+ AddSortMethod(SortByDateAdded, sortAttributes, 570,
+ LABEL_MASKS("%T", "%a", "%T", "%a")); // Title, DateAdded | Title, DateAdded
+ AddSortMethod(SortByYear, sortAttributes, 562,
+ LABEL_MASKS("%T", "%Y", "%T", "%Y")); // Title, Year | Title, Year
+ AddSortMethod(SortByUserRating, sortAttributes, 38018,
+ LABEL_MASKS("%T", "%r", "%T", "%r")); // Title, Userrating | Title, Userrating
const CViewState *viewState = CViewStateSettings::GetInstance().Get("videonavtvshows");
if (items.IsSmartPlayList() || items.IsLibraryFolder())