-
Notifications
You must be signed in to change notification settings - Fork 3
/
update_assets.py
37 lines (29 loc) · 1.06 KB
/
update_assets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import argparse
import asyncio
import logging
import logging.config
import pytz
from d4dj_utils.extended.manager.revision_manager import RevisionManager
from d4dj_utils.master.asset_manager import AssetManager
async def main():
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
parser = argparse.ArgumentParser()
parser.add_argument("version", type=str)
parser.add_argument("server", type=str)
args = parser.parse_args()
if args.server == "jp":
asset_path = "assets"
base_url = f"https://resources.d4dj-groovy-mix.com/{args.version}/"
elif args.server == "en":
asset_path = "assets_en"
base_url = f"https://resources.en.d4dj-world-groovy-mix.com/{args.version}/"
else:
raise
revision_manager = RevisionManager(asset_path, base_url)
await revision_manager.repair_downloads()
await revision_manager.update_assets(lambda p: "plain" not in p)
manager = AssetManager(asset_path)
manager.render_charts_by_master()
if __name__ == "__main__":
asyncio.run(main())