mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Housekeeping
This commit is contained in:
@@ -3,13 +3,13 @@
|
||||
# Category headers in [brackets] are only for organization and not necessary
|
||||
|
||||
[Directories]
|
||||
# DATA_DIR determines the base directory. It should be specified as environment
|
||||
# DATA_DIRECTORY determines the base directory. It should be specified as environment
|
||||
# variable because this file itself is loaded from it.
|
||||
# Configuration is always in this base directory. Other data defaults to be here
|
||||
# too, but can be customized with the options below.
|
||||
DATA_DIR_STATE = None # This is /var/lib/maloja per XDG
|
||||
DATA_DIR_LOGS = None # this is /var/log/maloja per XDG
|
||||
DATA_DIR_CACHE = None # this is /var/cache/maloja per XDG
|
||||
DIRECTORY_STATE = None # This is /var/lib/maloja per XDG
|
||||
DIRECTORY_LOGS = None # this is /var/log/maloja per XDG
|
||||
DIRECTORY_CACHE = None # this is /var/cache/maloja per XDG
|
||||
|
||||
[HTTP]
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ ARTISTS_NORMALIZED = []
|
||||
ARTISTS_NORMALIZED_SET = set()
|
||||
TRACKS_NORMALIZED_SET = set()
|
||||
|
||||
MEDALS = {} #literally only changes once per year, no need to calculate that on the fly
|
||||
MEDALS_ARTISTS = {} #literally only changes once per year, no need to calculate that on the fly
|
||||
MEDALS_TRACKS = {}
|
||||
WEEKLY_TOPTRACKS = {}
|
||||
WEEKLY_TOPARTISTS = {}
|
||||
@@ -477,7 +477,7 @@ def artistInfo(artist):
|
||||
"scrobbles":scrobbles,
|
||||
"position":position,
|
||||
"associated":others,
|
||||
"medals":{"gold":[],"silver":[],"bronze":[],**MEDALS.get(artist,{})},
|
||||
"medals":{"gold":[],"silver":[],"bronze":[],**MEDALS_ARTISTS.get(artist,{})},
|
||||
"topweeks":WEEKLY_TOPARTISTS.get(artist,0)
|
||||
}
|
||||
except:
|
||||
|
||||
@@ -50,10 +50,10 @@ rankmedals = {
|
||||
def update_medals():
|
||||
|
||||
|
||||
from ..database import MEDALS, MEDALS_TRACKS, STAMPS, get_charts_artists, get_charts_tracks
|
||||
from ..database import MEDALS_ARTISTS, MEDALS_TRACKS, STAMPS, get_charts_artists, get_charts_tracks
|
||||
|
||||
|
||||
MEDALS.clear()
|
||||
MEDALS_ARTISTS.clear()
|
||||
MEDALS_TRACKS.clear()
|
||||
|
||||
for year in ranges(step="year"):
|
||||
@@ -62,7 +62,7 @@ def update_medals():
|
||||
charts_artists = get_charts_artists(timerange=year)
|
||||
charts_tracks = get_charts_tracks(timerange=year)
|
||||
|
||||
collect_rankings(charts_artists,get_artist,MEDALS,iteration=year,count=False)
|
||||
collect_rankings(charts_artists,get_artist,MEDALS_ARTISTS,iteration=year,count=False)
|
||||
collect_rankings(charts_tracks,get_track,MEDALS_TRACKS,iteration=year,count=False)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user