Merge pull request #157 from JonnyWong16/miscellaneous-fixes

Fix top platforms sort by duration
This commit is contained in:
drzoidberg33 2015-09-05 10:16:28 +02:00
commit 82025457ba

View file

@ -391,7 +391,7 @@ class DataFactory(object):
'WHERE datetime(session_history.stopped, "unixepoch", "localtime") ' \
'>= datetime("now", "-%s days", "localtime") ' \
'GROUP BY session_history.platform ' \
'ORDER BY total_plays DESC LIMIT %s' % (time_range, stat_count)
'ORDER BY %s DESC LIMIT %s' % (time_range, sort_type, stat_count)
result = monitor_db.select(query)
except:
logger.warn("Unable to execute database query.")