When sorting by episode number, perform 2nd level sorting on label rather than filename.
authorVoyager1 <Voyager@xbmc.org>
Sun, 7 Oct 2012 19:14:59 +0000 (21:14 +0200)
committerVoyager1 <Voyager@xbmc.org>
Sun, 7 Oct 2012 19:17:48 +0000 (21:17 +0200)
At tv show level, the episode number is the amount of total or unwatched episodes, and filename is empty. Therefore, shows with equal episode numbers didn't always sort in the same order.

xbmc/utils/SortUtils.cpp

index 1b88cfd..5fece27 100644 (file)
@@ -285,7 +285,7 @@ string ByEpisodeNumber(SortAttribute attributes, const SortItem &values)
     num = ((uint64_t)values.at(FieldSeason).asInteger() << 32) + (values.at(FieldEpisodeNumber).asInteger() << 16);
 
   CStdString label;
-  label.Format("%"PRIu64" %s", num, values.at(FieldFilename).asString().c_str());
+  label.Format("%"PRIu64" %s", num, ByLabel(attributes, values).c_str());
   return label;
 }