fix rounding in lastfm module caused by python3 upgrade
parent
6ee5c6dae7
commit
4c64beada2
|
@ -279,20 +279,20 @@ def pretty_date(time=False):
|
||||||
if second_diff < 120:
|
if second_diff < 120:
|
||||||
return "a minute ago"
|
return "a minute ago"
|
||||||
if second_diff < 3600:
|
if second_diff < 3600:
|
||||||
return str( second_diff / 60 ) + " minutes ago"
|
return str( second_diff // 60 ) + " minutes ago"
|
||||||
if second_diff < 7200:
|
if second_diff < 7200:
|
||||||
return "an hour ago"
|
return "an hour ago"
|
||||||
if second_diff < 86400:
|
if second_diff < 86400:
|
||||||
return str( second_diff / 3600 ) + " hours ago"
|
return str( second_diff // 3600 ) + " hours ago"
|
||||||
if day_diff == 1:
|
if day_diff == 1:
|
||||||
return "Yesterday"
|
return "Yesterday"
|
||||||
if day_diff < 7:
|
if day_diff < 7:
|
||||||
return str(day_diff) + " days ago"
|
return str(day_diff) + " days ago"
|
||||||
if day_diff < 31:
|
if day_diff < 31:
|
||||||
return str(day_diff/7) + " weeks ago"
|
return str(day_diff // 7) + " weeks ago"
|
||||||
if day_diff < 365:
|
if day_diff < 365:
|
||||||
return str(day_diff/30) + " months ago"
|
return str(day_diff // 30) + " months ago"
|
||||||
return str(day_diff/365) + " years ago"
|
return str(day_diff // 365) + " years ago"
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print(__doc__.strip())
|
print(__doc__.strip())
|
||||||
|
|
Loading…
Reference in New Issue