mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Fixed small issue with ranges
This commit is contained in:
parent
852795cecd
commit
1320bf4f5b
@ -587,10 +587,11 @@ def ranges(since=None,to=None,within=None,timerange=None,step="month",stepn=1,tr
|
|||||||
d_start = d_start.next(stepn-1) #last part of first included range
|
d_start = d_start.next(stepn-1) #last part of first included range
|
||||||
i = 0
|
i = 0
|
||||||
current_end = d_start
|
current_end = d_start
|
||||||
|
current_start = current_end.next((stepn*trail-1)*-1)
|
||||||
#ranges = []
|
#ranges = []
|
||||||
while current_end.first_stamp() <= lastincluded and (max_ is None or i < max_):
|
while current_start.first_stamp() < lastincluded and (max_ is None or i < max_):
|
||||||
|
|
||||||
|
|
||||||
current_start = current_end.next((stepn*trail-1)*-1)
|
|
||||||
if current_start == current_end:
|
if current_start == current_end:
|
||||||
yield current_start
|
yield current_start
|
||||||
#ranges.append(current_start)
|
#ranges.append(current_start)
|
||||||
@ -598,6 +599,7 @@ def ranges(since=None,to=None,within=None,timerange=None,step="month",stepn=1,tr
|
|||||||
yield MRange(current_start,current_end)
|
yield MRange(current_start,current_end)
|
||||||
#ranges.append(MRange(current_start,current_end))
|
#ranges.append(MRange(current_start,current_end))
|
||||||
current_end = current_end.next(stepn)
|
current_end = current_end.next(stepn)
|
||||||
|
current_start = current_end.next((stepn*trail-1)*-1)
|
||||||
|
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ DEFAULT_RANGE_CHARTS_TRACKS = year
|
|||||||
# can be day, week, month, year
|
# can be day, week, month, year
|
||||||
DEFAULT_STEP_PULSE = month
|
DEFAULT_STEP_PULSE = month
|
||||||
|
|
||||||
# display top tiles on artist and chart pages
|
# display top tiles on artist and track chart pages
|
||||||
CHARTS_DISPLAY_TILES = false
|
CHARTS_DISPLAY_TILES = false
|
||||||
|
|
||||||
[Fluff]
|
[Fluff]
|
||||||
|
Loading…
Reference in New Issue
Block a user