Made DB cache non-persistent for now to avoid long startup times

This commit is contained in:
Krateng
2019-05-05 13:52:13 +02:00
parent 80d65963e5
commit 54bef3e8c2
4 changed files with 9 additions and 12 deletions
+4 -8
View File
@@ -2,6 +2,8 @@
Simple self-hosted music scrobble database to create personal listening statistics. No recommendations, no social network, no nonsense.
You can check [my own Maloja page](https://maloja.krateng.ch) to see what it looks like.
## Never Asked Questions
### Why not Last.fm / Libre.fm / GNU FM?
@@ -14,19 +16,13 @@ Maloja's database has one big advantage: It supports **multiple artists per trac
Also neat: You can use your **custom artist or track images**.
## Current status
You can check [my own Maloja page](https://maloja.krateng.ch) to see what it currently looks like.
There are only two scrobblers (YouTube Music and Plex, both for Chromium), but a very simple API to create your own scrobbler.
## Requirements
* [python3](https://www.python.org/) - [GitHub](https://github.com/python/cpython)
* [bottle.py](https://bottlepy.org/) - [GitHub](https://github.com/bottlepy/bottle)
* [waitress](https://docs.pylonsproject.org/projects/waitress/) - [GitHub](https://github.com/Pylons/waitress)
* [doreah](https://pypi.org/project/doreah/) - [GitHub](https://github.com/krateng/doreah) (at least Version 0.6.1)
* If you'd like to display images, you will need API keys for Last.fm and Fanart.tv. These are free of charge!
* If you'd like to display images, you will need API keys for [Last.fm](https://www.last.fm/api/account/create) and [Fanart.tv](https://fanart.tv/get-an-api-key/). These are free of charge!
## How to install
@@ -55,7 +51,7 @@ There are only two scrobblers (YouTube Music and Plex, both for Chromium), but a
If you didn't install Maloja from the package (and therefore don't have it in `/opt/maloja`), every command needs to be executed from the Maloja directory and led with `./`. Otherwise, all commands work in any location and without the prefix.
1) In order to scrobble your music from Plex Web or YouTube Music, install the included Chrome extension. Make sure to enter the random key Maloja generates on first startup in the extension.
1) In order to scrobble your music from Plex Web or YouTube Music, install the included Chrome extension. Make sure to enter the random key Maloja generates on first startup in the extension. If you use another music player, Maloja has a very simple API to create your own scrobbler.
2) If you would like to import all your previous last.fm scrobbles, use [benfoxall's website](https://benjaminbenben.com/lastfm-to-csv/) ([GitHub page](https://github.com/benfoxall/lastfm-to-csv)). Use the command
+2 -2
View File
@@ -895,7 +895,7 @@ def sync():
import copy
cache_query = {}
cache_query_permanent = Cache(maxmemory=1024*1024*settings.get_settings("DB_CACHE_SIZE"),persistent=True,name="dbcache_query")
cache_query_permanent = Cache(maxmemory=1024*1024*settings.get_settings("DB_CACHE_SIZE"))
cacheday = (0,0,0)
def db_query(**kwargs):
check_cache_age()
@@ -918,7 +918,7 @@ def db_query(**kwargs):
return result
cache_aggregate = {}
cache_aggregate_permanent = Cache(maxmemory=1024*1024*settings.get_settings("DB_CACHE_SIZE"),persistent=True,name="dbcache_aggregate")
cache_aggregate_permanent = Cache(maxmemory=1024*1024*settings.get_settings("DB_CACHE_SIZE"))
def db_aggregate(**kwargs):
check_cache_age()
global cache_aggregate, cache_aggregate_permanent
+2 -2
View File
@@ -7,7 +7,7 @@ from doreah.logging import log
apis_artists = [
{
"name":"LastFM + Fanart.tv",
"check":get_settings("LASTFM_API_KEY") is not None and get_settings("FANARTTV_API_KEY") is not None,
"check":get_settings("LASTFM_API_KEY") not in [None,"ASK"] and get_settings("FANARTTV_API_KEY") not in [None,"ASK"],
"steps":[
("url","http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist={artiststring}&api_key=" + get_settings("LASTFM_API_KEY") + "&format=json"),
("parse",["artist","mbid"]),
@@ -20,7 +20,7 @@ apis_artists = [
apis_tracks = [
{
"name":"LastFM",
"check":get_settings("LASTFM_API_KEY") is not None,
"check":get_settings("LASTFM_API_KEY") not in [None,"ASK"],
"steps":[
("url","https://ws.audioscrobbler.com/2.0/?method=track.getinfo&track={titlestring}&artist={artiststring}&api_key=" + get_settings("LASTFM_API_KEY") + "&format=json"),
("parse",["track","album","image",3,"#text"])
@@ -135,3 +135,4 @@ replaceartist A pink Apink
# IOI
replaceartist CHUNG HA Chungha
countas Chungha I.O.I
replacetitle 벌써 12시 Gotta Go Gotta Go
1 # NAME: K-Pop Girl Groups
135
136
137
138