forked from rDrama/rDrama
only filter if its not 'all'
parent
3985254d9d
commit
7f87343d7f
|
@ -9,6 +9,7 @@ from files.classes.saves import *
|
||||||
|
|
||||||
def apply_time_filter(t, objects, cls):
|
def apply_time_filter(t, objects, cls):
|
||||||
now = int(time.time())
|
now = int(time.time())
|
||||||
|
|
||||||
if t == 'hour':
|
if t == 'hour':
|
||||||
cutoff = now - 3600
|
cutoff = now - 3600
|
||||||
elif t == 'day':
|
elif t == 'day':
|
||||||
|
@ -20,9 +21,10 @@ def apply_time_filter(t, objects, cls):
|
||||||
elif t == 'year':
|
elif t == 'year':
|
||||||
cutoff = now - 31536000
|
cutoff = now - 31536000
|
||||||
else:
|
else:
|
||||||
cutoff = 0
|
return objects
|
||||||
|
|
||||||
return objects.filter(cls.created_utc >= cutoff)
|
return objects.filter(cls.created_utc >= cutoff)
|
||||||
|
|
||||||
|
|
||||||
def sort_objects(sort, objects, cls):
|
def sort_objects(sort, objects, cls):
|
||||||
if sort == 'hot':
|
if sort == 'hot':
|
||||||
|
|
Loading…
Reference in New Issue