Permalink
Browse files

fix sorting of special episodes (fixes #13166)

  • Loading branch information...
1 parent dfac77e commit 07ae1d683c10deac429101030621b6017ae133ab @Montellese Montellese committed Jul 27, 2012
Showing with 3 additions and 1 deletion.
  1. +1 −1 xbmc/utils/SortUtils.cpp
  2. +2 −0 xbmc/video/VideoInfoTag.cpp
View
@@ -278,7 +278,7 @@ string ByEpisodeNumber(SortAttribute attributes, const SortItem &values)
const CVariant &episodeSpecial = values.at(FieldEpisodeNumberSpecialSort);
const CVariant &seasonSpecial = values.at(FieldSeasonSpecialSort);
if (!episodeSpecial.isNull() && !seasonSpecial.isNull() &&
- episodeSpecial.asInteger() > 0)
+ (episodeSpecial.asInteger() > 0 || seasonSpecial.asInteger() > 0))
num = ((uint64_t)seasonSpecial.asInteger() << 32) + (episodeSpecial.asInteger() << 16) - ((2 << 15) - values.at(FieldEpisodeNumber).asInteger());
else
num = ((uint64_t)values.at(FieldSeason).asInteger() << 32) + (values.at(FieldEpisodeNumber).asInteger() << 16);
@@ -518,6 +518,8 @@ void CVideoInfoTag::ToSortable(SortItem& sortable)
sortable[FieldYear] = m_iYear;
sortable[FieldSeason] = m_iSeason;
sortable[FieldEpisodeNumber] = m_iEpisode;
+ sortable[FieldEpisodeNumberSpecialSort] = m_iSpecialSortEpisode;
+ sortable[FieldSeasonSpecialSort] = m_iSpecialSortSeason;
sortable[FieldRating] = m_fRating;
sortable[FieldId] = m_iDbId;
sortable[FieldTrackNumber] = m_iTrack;

0 comments on commit 07ae1d6

Please sign in to comment.