Permalink
Browse files

fix sorting of movies linked to a tvshow in "All seasons" list (fixes #…

  • Loading branch information...
1 parent d8664cb commit af503a57b151edf422c61dd3f458136fc0a4265e @Montellese Montellese committed Oct 14, 2012
Showing with 9 additions and 2 deletions.
  1. +9 −2 xbmc/utils/SortUtils.cpp
View
@@ -284,8 +284,14 @@ string ByEpisodeNumber(SortAttribute attributes, const SortItem &values)
else
num = ((uint64_t)values.at(FieldSeason).asInteger() << 32) + (values.at(FieldEpisodeNumber).asInteger() << 16);
+ std::string title;
+ if (values.find(FieldMediaType) != values.end() && values.at(FieldMediaType).asInteger() == MediaTypeMovie)
+ title = BySortTitle(attributes, values);
+ if (title.empty())
+ title = ByLabel(attributes, values);
+
CStdString label;
- label.Format("%"PRIu64" %s", num, ByLabel(attributes, values).c_str());
+ label.Format("%"PRIu64" %s", num, title.c_str());
return label;
}
@@ -602,7 +608,8 @@ map<SortBy, Fields> fillSortingFields()
sortingFields[SortByEpisodeNumber].insert(FieldSeason);
sortingFields[SortByEpisodeNumber].insert(FieldEpisodeNumberSpecialSort);
sortingFields[SortByEpisodeNumber].insert(FieldSeasonSpecialSort);
- sortingFields[SortByEpisodeNumber].insert(FieldFilename);
+ sortingFields[SortByEpisodeNumber].insert(FieldTitle);
+ sortingFields[SortByEpisodeNumber].insert(FieldSortTitle);
sortingFields[SortBySeason].insert(FieldSeason);
sortingFields[SortByNumberOfEpisodes].insert(FieldNumberOfEpisodes);
sortingFields[SortByNumberOfWatchedEpisodes].insert(FieldNumberOfWatchedEpisodes);

0 comments on commit af503a5

Please sign in to comment.