Housekeeping

This commit is contained in:
Krateng 2021-01-01 04:13:58 +01:00
parent 4d06a327e9
commit b53052c818
4 changed files with 15 additions and 9 deletions

View File

@ -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]

View File

@ -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:

View File

@ -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)

View File

@ -3,8 +3,14 @@ Technically, each setting can be set via environment variable or the settings fi
Settings File | Environment Variable | Type | Description
------ | --------- | --------- | ---------
**Setup**
  | `MALOJA_DATA_DIRECTORY` | String | Use this directory to store all application files. Useful for docker. Overwrites all individually specified directories below.
  | `MALOJA_DIRECTORY_CONFIG` | String | Use this directory to store configuration files.
`DIRECTORY_STATE` | `MALOJA_DIRECTORY_STATE` | String | Use this directory to store state files.
`DIRECTORY_LOGS` | `MALOJA_DIRECTORY_LOGS` | String | Use this directory to store log files.
`DIRECTORY_CACHE` | `MALOJA_DIRECTORY_CACHE` | String | Use this directory to store cache files.
`SKIP_SETUP` | `MALOJA_SKIP_SETUP` | Boolean | Whether to make server startup non-interactive. Vital for docker.
  | `MALOJA_FORCE_PASSWORD` | String | Sets password for admin login in web interface. This should normally be done via the interactive prompt.
`CLEAN_OUTPUT` | `MALOJA_CLEAN_OUTPUT` | Boolean | Avoid mutable console output. Use if console output will be redirected e.g. to a web interface.
**Debug**
`LOGGING` | `MALOJA_LOGGING` | Boolean | Enable logging
`DEV_MODE` | `MALOJA_DEV_MODE` | Boolean | Enable developer mode