Sort episodes in calendar by ep nr if airdate is the same.

This commit is contained in:
Taloth Saldono 2016-03-11 16:54:20 +01:00
parent e6ab4196de
commit 03e2adc332
2 changed files with 4 additions and 2 deletions

View File

@ -160,7 +160,8 @@ module.exports = Marionette.ItemView.extend({
allDay : false,
statusLevel : self._getStatusLevel(model, end),
downloading : QueueCollection.findEpisode(model.get('id')),
model : model
model : model,
sortOrder : (model.get('seasonNumber') == 0 ? 1000000 : model.get('seasonNumber') * 10000) + model.get('episodeNumber')
};
events.push(event);

View File

@ -4439,7 +4439,8 @@ function compareSegs(seg1, seg2) {
return seg1.eventStartMS - seg2.eventStartMS || // earlier events go first
seg2.eventDurationMS - seg1.eventDurationMS || // tie? longer events go first
seg2.event.allDay - seg1.event.allDay || // tie? put all-day events first (booleans cast to 0/1)
(seg1.event.title || '').localeCompare(seg2.event.title); // tie? alphabetically by title
(seg1.event.title || '').localeCompare(seg2.event.title) || // tie? alphabetically by title
seg1.event.sortOrder - seg2.event.sortOrder; // tie? use sortOrder
}
fc.compareSegs = compareSegs; // export