aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Kortstiege <mkortstiege@kodi.tv>2015-07-03 16:23:40 +0200
committerMatthias Kortstiege <mkortstiege@kodi.tv>2015-07-05 10:18:57 +0200
commit4b339058ad21169fd2ce8d165a1c75126add8c83 (patch)
tree15a1885c5008cf23cc5b27132b8ff7f5efa5f0cc
parent2497ea2da01655613c63990bf06e3e7867393ef7 (diff)
[videolibrary] fix sort by episodes (closes #15945)
-rw-r--r--xbmc/FileItem.cpp10
-rw-r--r--xbmc/video/GUIViewStateVideo.cpp7
-rw-r--r--xbmc/video/VideoInfoTag.cpp2
3 files changed, 5 insertions, 14 deletions
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp
index 58bd42e75b..f8266a3e9c 100644
--- a/xbmc/FileItem.cpp
+++ b/xbmc/FileItem.cpp
@@ -614,18 +614,8 @@ void CFileItem::ToSortable(SortItem &sortable, Field field) const
GetMusicInfoTag()->ToSortable(sortable, field);
if (HasVideoInfoTag())
- {
GetVideoInfoTag()->ToSortable(sortable, field);
- if (GetVideoInfoTag()->m_type == MediaTypeTvShow)
- {
- if (field == FieldNumberOfEpisodes && HasProperty("totalepisodes"))
- sortable[FieldNumberOfEpisodes] = GetProperty("totalepisodes");
- if (field == FieldNumberOfWatchedEpisodes && HasProperty("unwatchedepisodes"))
- sortable[FieldNumberOfWatchedEpisodes] = GetProperty("unwatchedepisodes");
- }
- }
-
if (HasPictureInfoTag())
GetPictureInfoTag()->ToSortable(sortable, field);
diff --git a/xbmc/video/GUIViewStateVideo.cpp b/xbmc/video/GUIViewStateVideo.cpp
index 35e7940965..e6c4c9adb3 100644
--- a/xbmc/video/GUIViewStateVideo.cpp
+++ b/xbmc/video/GUIViewStateVideo.cpp
@@ -167,8 +167,7 @@ CGUIViewStateWindowVideoNav::CGUIViewStateWindowVideoNav(const CFileItemList& it
{
AddSortMethod(SortBySortTitle, sortAttributes, 556, LABEL_MASKS("%T", "%M", "%T", "%M")); // Title, #Episodes | Title, #Episodes
- // NOTE: This uses SortByEpisodeNumber to mean "sort shows by the number of episodes" and uses the label "Episodes"
- AddSortMethod(SortByEpisodeNumber, 20360, LABEL_MASKS("%L", "%M", "%L", "%M")); // Label, #Episodes | Label, #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
@@ -547,8 +546,8 @@ CGUIViewStateVideoTVShows::CGUIViewStateVideoTVShows(const CFileItemList& items)
{
AddSortMethod(SortBySortTitle, 556, LABEL_MASKS("%T", "%M", "%T", "%M"), // Title, #Episodes | Title, #Episodes
CSettings::Get().GetBool("filelists.ignorethewhensorting") ? SortAttributeIgnoreArticle : SortAttributeNone);
- // NOTE: This uses SortByEpisodeNumber to mean "sort shows by the number of episodes" and uses the label "Episodes"
- AddSortMethod(SortByEpisodeNumber, 20360, LABEL_MASKS("%L", "%M", "%L", "%M")); // Label, #Episodes | Label, #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(SortByYear, 562, LABEL_MASKS("%T", "%Y", "%T", "%Y")); // Title, Year | Title, Year
diff --git a/xbmc/video/VideoInfoTag.cpp b/xbmc/video/VideoInfoTag.cpp
index 57f8bd43be..aa06ccd3a1 100644
--- a/xbmc/video/VideoInfoTag.cpp
+++ b/xbmc/video/VideoInfoTag.cpp
@@ -525,6 +525,8 @@ void CVideoInfoTag::ToSortable(SortItem& sortable, Field field) const
case FieldYear: sortable[FieldYear] = m_iYear; break;
case FieldSeason: sortable[FieldSeason] = m_iSeason; break;
case FieldEpisodeNumber: sortable[FieldEpisodeNumber] = m_iEpisode; break;
+ case FieldNumberOfEpisodes: sortable[FieldNumberOfEpisodes] = m_iEpisode; break;
+ case FieldNumberOfWatchedEpisodes: sortable[FieldNumberOfWatchedEpisodes] = m_iEpisode; break;
case FieldEpisodeNumberSpecialSort: sortable[FieldEpisodeNumberSpecialSort] = m_iSpecialSortEpisode; break;
case FieldSeasonSpecialSort: sortable[FieldSeasonSpecialSort] = m_iSpecialSortSeason; break;
case FieldRating: sortable[FieldRating] = m_fRating; break;