2022-08-13 17:17:51 +00:00
|
|
|
from flask_caching import Cache
|
2019-12-08 21:43:49 +00:00
|
|
|
|
2021-08-20 04:43:59 +00:00
|
|
|
from bemani.data import Config, Data
|
2019-12-08 21:43:49 +00:00
|
|
|
from bemani.frontend.app import app
|
|
|
|
from bemani.frontend.popn.popn import PopnMusicFrontend
|
|
|
|
|
|
|
|
|
|
|
|
class PopnMusicCache:
|
|
|
|
@classmethod
|
2021-08-20 04:43:59 +00:00
|
|
|
def preload(cls, data: Data, config: Config) -> None:
|
2022-10-15 18:56:30 +00:00
|
|
|
cache = Cache(
|
|
|
|
app,
|
|
|
|
config={
|
|
|
|
"CACHE_TYPE": "filesystem",
|
|
|
|
"CACHE_DIR": config.cache_dir,
|
|
|
|
},
|
|
|
|
)
|
2019-12-08 21:43:49 +00:00
|
|
|
frontend = PopnMusicFrontend(data, config, cache)
|
|
|
|
frontend.get_all_songs(force_db_load=True)
|