diff options
author | jmarshallnz <jcmarsha@gmail.com> | 2014-02-06 15:11:10 +1300 |
---|---|---|
committer | jmarshallnz <jcmarsha@gmail.com> | 2014-02-06 15:11:10 +1300 |
commit | 58b327c30e5ec813c4e4822bf5c7f0856727d751 (patch) | |
tree | c461b862585277e19e69894fef629e93a68ec582 | |
parent | 10fb2058d920c0b318d18965ff6e567868000870 (diff) | |
parent | e3a1b5e91dde90eb68c894d43af89f88c862a836 (diff) |
Merge pull request #4159 from Montellese/videolibrary_sort_fixes
videolibrary: align available sort methods
-rw-r--r-- | xbmc/video/GUIViewStateVideo.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/xbmc/video/GUIViewStateVideo.cpp b/xbmc/video/GUIViewStateVideo.cpp index 06a1805146..54cbdfcbc6 100644 --- a/xbmc/video/GUIViewStateVideo.cpp +++ b/xbmc/video/GUIViewStateVideo.cpp @@ -474,9 +474,14 @@ CGUIViewStateVideoMovies::CGUIViewStateVideoMovies(const CFileItemList& items) : { AddSortMethod(SortBySortTitle, 556, LABEL_MASKS("%T", "%R", "%T", "%R"), // Title, Rating | Title, Rating CSettings::Get().GetBool("filelists.ignorethewhensorting") ? SortAttributeIgnoreArticle : SortAttributeNone); + AddSortMethod(SortByYear, 562, LABEL_MASKS("%T", "%Y", "%T", "%Y")); // Title, Year | Title, Year AddSortMethod(SortByRating, 563, LABEL_MASKS("%T", "%R", "%T", "%R")); // Title, Rating | Title, Rating AddSortMethod(SortByMPAA, 20074, LABEL_MASKS("%T", "%O")); // Title, MPAA | empty, empty - AddSortMethod(SortByYear, 562, LABEL_MASKS("%T", "%Y", "%T", "%Y")); // Title, Year | Title, Year + AddSortMethod(SortByTime, 180, LABEL_MASKS("%T", "%D")); // Title, Duration | empty, empty + AddSortMethod(SortByDateAdded, 570, LABEL_MASKS("%T", "%a", "%T", "%a")); // Title, DateAdded | Title, DateAdded + + if (CMediaSettings::Get().GetWatchedMode(items.GetContent()) == WatchedModeAll) + AddSortMethod(SortByPlaycount, 567, LABEL_MASKS("%T", "%V", "%T", "%V")); // Title, Playcount | Title, Playcount const CViewState *viewState = CViewStateSettings::Get().Get("videonavtitles"); if (items.IsSmartPlayList() || items.IsLibraryFolder()) @@ -509,7 +514,8 @@ CGUIViewStateVideoMusicVideos::CGUIViewStateVideoMusicVideos(const CFileItemList AddSortMethod(SortByArtist, sortAttributes, 557, LABEL_MASKS("%A - %T", "%Y")); // Artist - Title, Year | empty, empty AddSortMethod(SortByAlbum, sortAttributes, 558, LABEL_MASKS("%B - %T", "%Y")); // Album - Title, Year | empty, empty - AddSortMethod(SortByPlaycount, 567, LABEL_MASKS("%T", "%V")); // Title, Playcount | empty, empty + if (CMediaSettings::Get().GetWatchedMode(items.GetContent()) == WatchedModeAll) + AddSortMethod(SortByPlaycount, 567, LABEL_MASKS("%T", "%V")); // Title, Playcount | empty, empty CStdString strTrackLeft=CSettings::Get().GetString("musicfiles.trackformat"); CStdString strTrackRight=CSettings::Get().GetString("musicfiles.trackformatright"); @@ -538,6 +544,9 @@ 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(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 const CViewState *viewState = CViewStateSettings::Get().Get("videonavtvshows"); @@ -561,25 +570,32 @@ void CGUIViewStateVideoTVShows::SaveViewState() CGUIViewStateVideoEpisodes::CGUIViewStateVideoEpisodes(const CFileItemList& items) : CGUIViewStateWindowVideo(items) { - AddSortMethod(SortByLabel, 551, LABEL_MASKS("%Z - %H. %T","%R"), // TvShow - Order. Title, Rating | empty, empty - CSettings::Get().GetBool("filelists.ignorethewhensorting") ? SortAttributeIgnoreArticle : SortAttributeNone); if (0)//params.GetSeason() > -1) { + AddSortMethod(SortByEpisodeNumber, 20359, LABEL_MASKS("%E. %T","%R")); // Episode. Title, Rating | empty, empty AddSortMethod(SortByRating, 563, LABEL_MASKS("%E. %T", "%R")); // Episode. Title, Rating | empty, empty AddSortMethod(SortByMPAA, 20074, LABEL_MASKS("%E. %T", "%O")); // Episode. Title, MPAA | empty, empty - AddSortMethod(SortByEpisodeNumber, 20359, LABEL_MASKS("%E. %T","%R")); // Episode. Title, Rating | empty, empty AddSortMethod(SortByProductionCode, 20368, LABEL_MASKS("%E. %T","%P", "%E. %T","%P")); // Episode. Title, Production Code | Episode. Title, Production Code AddSortMethod(SortByDate, 552, LABEL_MASKS("%E. %T","%J","E. %T","%J")); // Episode. Title, Date | Episode. Title, Date + + if (CMediaSettings::Get().GetWatchedMode(items.GetContent()) == WatchedModeAll) + AddSortMethod(SortByPlaycount, 567, LABEL_MASKS("%E. %T", "%V")); // Episode. Title, Playcount | empty, empty } else { // format here is tvshowtitle - season/episode number. episode title + AddSortMethod(SortByEpisodeNumber, 20359, LABEL_MASKS("%Z - %H. %T","%R")); // TvShow - Order. Title, Rating | empty, empty AddSortMethod(SortByRating, 563, LABEL_MASKS("%Z - %H. %T", "%R")); // TvShow - Order. Title, Rating | empty, empty AddSortMethod(SortByMPAA, 20074, LABEL_MASKS("%Z - %H. %T", "%O")); // TvShow - Order. Title, MPAA | empty, empty - AddSortMethod(SortByEpisodeNumber, 20359, LABEL_MASKS("%Z - %H. %T","%R")); // TvShow - Order. Title, Rating | empty, empty AddSortMethod(SortByProductionCode, 20368, LABEL_MASKS("%Z - %H. %T","%P")); // TvShow - Order. Title, Production Code | empty, empty AddSortMethod(SortByDate, 552, LABEL_MASKS("%Z - %H. %T","%J")); // TvShow - Order. Title, Date | empty, empty + + if (CMediaSettings::Get().GetWatchedMode(items.GetContent()) == WatchedModeAll) + AddSortMethod(SortByPlaycount, 567, LABEL_MASKS("%H. %T", "%V")); // Order. Title, Playcount | empty, empty } + AddSortMethod(SortByLabel, 551, LABEL_MASKS("%Z - %H. %T","%R"), // TvShow - Order. Title, Rating | empty, empty + CSettings::Get().GetBool("filelists.ignorethewhensorting") ? SortAttributeIgnoreArticle : SortAttributeNone); + const CViewState *viewState = CViewStateSettings::Get().Get("videonavepisodes"); if (items.IsSmartPlayList() || items.IsLibraryFolder()) AddPlaylistOrder(items, LABEL_MASKS("%Z - %H. %T", "%R")); // TvShow - Order. Title, Rating | empty, empty |