Show = require('../models/show').Show,
    _ = require('underscore');


exports.list = function(req, res) {
    Show.all('_id name', function(err, shows) {
        res.render('show/list', { shows: shows});
    });
};

exports.get = function(req, res) {
    var showId = req.params.show;
    Show.findById(showId, function(err, show) {
        if (err) { next(err); }
        show.episodes = _.sortBy(show.episodes, function(i) {
            return i.season + ',' + i.number;
        });
        res.render('show/main', { show: show});
    });
};
@@ -441,16 +441,17 @@
  return 
+(
 i.season
@@ -455,13 +455,15 @@
 son 
-+ ','
+* 1000)
  + i
@@ -470,16 +470,67 @@
 .number;
+ // hack to do a sorting by multiple numerical keys
 %0A       

fix sorting when listing episodes for a particular show