From cfe7c134a0b49c2ed99e473698b89aedad33b27e Mon Sep 17 00:00:00 2001 From: qwewqa <198e559dbd446d973355f415bdfa34@gmail.com> Date: Sun, 17 Jan 2021 23:19:40 -0500 Subject: [PATCH] add chart mix renders to export and fix url --- export_assets.py | 3 +++ miyu_bot/commands/cogs/music.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/export_assets.py b/export_assets.py index a727bd6..2e6aa92 100644 --- a/export_assets.py +++ b/export_assets.py @@ -37,6 +37,9 @@ def main(): chart_path = chart.image_path target_path = chart_dir / f'{chart_path.stem}_{chart_hash}{chart_path.suffix}' shutil.copy(chart_path, target_path) + mix_path = chart.mix_path + target_path = chart_dir / f'{mix_path.stem}_{chart_hash}{mix_path.suffix}' + shutil.copy(mix_path, target_path) except FileNotFoundError: pass diff --git a/miyu_bot/commands/cogs/music.py b/miyu_bot/commands/cogs/music.py index ca2abbb..3d92035 100644 --- a/miyu_bot/commands/cogs/music.py +++ b/miyu_bot/commands/cogs/music.py @@ -311,10 +311,12 @@ class Music(commands.Cog): for difficulty in [ChartDifficulty.Easy, ChartDifficulty.Normal, ChartDifficulty.Hard, ChartDifficulty.Expert]: chart: ChartMaster = song.charts[difficulty] + chart_hash = hash_master(chart) + mix_path = chart.mix_path embed = discord.Embed(title=f'Mix: {song.name} [{chart.difficulty.name}]') embed.set_thumbnail(url=f'attachment://jacket.png') embed.set_image( - url=f'https://qwewqa.github.io/d4dj-dumps/{chart.mix_path.relative_to(asset_manager.path).as_posix()}' + url=f'https://qwewqa.github.io/d4dj-dumps/music/charts/{mix_path.stem}_{chart_hash}{mix_path.suffix}' ) note_counts = chart.note_counts