1
0
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:
Krateng 2019-09-20 18:53:00 +02:00
parent 852795cecd
commit 1320bf4f5b
2 changed files with 5 additions and 3 deletions

View File

@ -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
i = 0
current_end = d_start
#ranges = []
while current_end.first_stamp() <= lastincluded and (max_ is None or i < max_):
current_start = current_end.next((stepn*trail-1)*-1)
#ranges = []
while current_start.first_stamp() < lastincluded and (max_ is None or i < max_):
if current_start == current_end:
yield 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)
#ranges.append(MRange(current_start,current_end))
current_end = current_end.next(stepn)
current_start = current_end.next((stepn*trail-1)*-1)
i += 1

View File

@ -41,7 +41,7 @@ DEFAULT_RANGE_CHARTS_TRACKS = year
# can be day, week, month, year
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
[Fluff]