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

pull/1174/head
Taloth Saldono 9 years ago
parent e6ab4196de
commit 03e2adc332

@ -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);

@ -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

Loading…
Cancel
Save