2022-08-13 19:17:51 +02:00
|
|
|
from flask_caching import Cache
|
2019-12-08 22:43:49 +01:00
|
|
|
|
2021-08-20 06:43:59 +02:00
|
|
|
from bemani.data import Config, Data
|
2019-12-08 22:43:49 +01:00
|
|
|
from bemani.frontend.app import app
|
|
|
|
from bemani.frontend.museca.museca import MusecaFrontend
|
|
|
|
|
|
|
|
|
|
|
|
class MusecaCache:
|
|
|
|
|
|
|
|
@classmethod
|
2021-08-20 06:43:59 +02:00
|
|
|
def preload(cls, data: Data, config: Config) -> None:
|
2019-12-08 22:43:49 +01:00
|
|
|
cache = Cache(app, config={
|
|
|
|
'CACHE_TYPE': 'filesystem',
|
2021-08-20 06:43:59 +02:00
|
|
|
'CACHE_DIR': config.cache_dir,
|
2019-12-08 22:43:49 +01:00
|
|
|
})
|
|
|
|
frontend = MusecaFrontend(data, config, cache)
|
|
|
|
frontend.get_all_songs(force_db_load=True)
|