mirror of
https://github.com/krateng/maloja.git
synced 2025-04-13 15:37:13 +03:00
Fixed scrobble number for artists
This commit is contained in:
parent
25f25866a0
commit
dd30ddec1c
@ -141,10 +141,11 @@ def print_info():
|
||||
print(col['lightblue']("Timezone: "),f"UTC{conf.malojaconfig['timezone']:+d}")
|
||||
print()
|
||||
try:
|
||||
from setuptools.dist import pkg_resources
|
||||
from importlib.metadata import distribution
|
||||
for pkg in ("sqlalchemy","waitress","bottle","doreah","jinja2"):
|
||||
print(col['cyan'] (f"{pkg}:".ljust(13)),pkg_resources.get_distribution(pkg).version)
|
||||
print(col['cyan'] (f"{pkg}:".ljust(13)),distribution(pkg).version)
|
||||
except ImportError:
|
||||
raise
|
||||
print("Could not determine dependency versions.")
|
||||
print()
|
||||
|
||||
|
@ -625,18 +625,18 @@ def artist_info(dbconn=None,**keys):
|
||||
# TODO: find better solution
|
||||
if own_track_charts:
|
||||
c = own_track_charts[0]
|
||||
scrobbles = c["scrobbles"]
|
||||
tscrobbles = c["scrobbles"]
|
||||
threshold_gold, threshold_platinum, threshold_diamond = malojaconfig["SCROBBLES_GOLD","SCROBBLES_PLATINUM","SCROBBLES_DIAMOND"]
|
||||
if scrobbles >= threshold_diamond: cert = "diamond"
|
||||
elif scrobbles >= threshold_platinum: cert = "platinum"
|
||||
elif scrobbles >= threshold_gold: cert = "gold"
|
||||
if tscrobbles >= threshold_diamond: cert = "diamond"
|
||||
elif tscrobbles >= threshold_platinum: cert = "platinum"
|
||||
elif tscrobbles >= threshold_gold: cert = "gold"
|
||||
if own_album_charts:
|
||||
c = own_album_charts[0]
|
||||
scrobbles = c["scrobbles"]
|
||||
ascrobbles = c["scrobbles"]
|
||||
threshold_gold, threshold_platinum, threshold_diamond = malojaconfig["SCROBBLES_GOLD_ALBUM","SCROBBLES_PLATINUM_ALBUM","SCROBBLES_DIAMOND_ALBUM"]
|
||||
if scrobbles >= threshold_diamond: cert = "diamond"
|
||||
elif scrobbles >= threshold_platinum and cert != "diamond": cert = "platinum"
|
||||
elif scrobbles >= threshold_gold and not cert: cert = "gold"
|
||||
if ascrobbles >= threshold_diamond: cert = "diamond"
|
||||
elif ascrobbles >= threshold_platinum and cert != "diamond": cert = "platinum"
|
||||
elif ascrobbles >= threshold_gold and not cert: cert = "gold"
|
||||
|
||||
twk = thisweek()
|
||||
tyr = thisyear()
|
||||
|
@ -3,7 +3,7 @@ name = "malojaserver"
|
||||
version = "3.1.5"
|
||||
description = "Self-hosted music scrobble database"
|
||||
readme = "./README.md"
|
||||
requires-python = ">=3.7"
|
||||
requires-python = ">=3.10"
|
||||
license = { file="./LICENSE" }
|
||||
authors = [ { name="Johannes Krattenmacher", email="maloja@dev.krateng.ch" } ]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user