kv-music/fix-gen.py
a f2135cc455
fix: visualizer bugs and better mobile support (#509)
* Refine fullscreen player to look more like apple music

* fix: buttons when in visualizer only mode

* fix: mobile sizing

* Update styles.css

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update js/ui.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* feat: refine fullscreen apple player

* fix: add lyrics toggle for mobile

* add lyrics toggle for mobile

* wrong branch oops 😭

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-05 23:46:50 -04:00

21 lines
954 B
Python

import re
with open("gen-editors-picks.py", "r") as f: content = f.read()
content = re.sub(r"IMAGES_DIR = \"public/editors-picks-images\"\n+", "", content)
# Remove clear_images_dir definition
content = re.sub(r"def clear_images_dir\(\):[\s\S]*?os\.makedirs[^\n]*\n+", "", content)
content = re.sub(r"clear_images_dir\(\)\n+", "", content)
# Remove the import line for subprocess, shutil if present
content = re.sub(r"import subprocess\n", "", content)
content = re.sub(r"import shutil\n", "", content)
# Replace download_and_process_cover
new_func = """def download_and_process_cover(cover_uuid):
url = f"https://resources.tidal.com/images/{uuid_to_path_segments(cover_uuid)}/320x320.jpg"
return f"https://wsrv.nl/?url={url}&w=250&h=250&output=webp"
"""
content = re.sub(r"def download_and_process_cover\(cover_uuid\):[\s\S]*?(?=def process_cover)", new_func + "\n\n", content)
with open("gen-editors-picks.py", "w") as f: f.write(content)