songs automatically update if connected to a git repo

This commit is contained in:
Yonokid
2025-07-23 20:15:51 -04:00
parent 9875220138
commit ba6106466b
5 changed files with 44 additions and 4 deletions

View File

@@ -4,6 +4,8 @@ import sys
from pathlib import Path
from typing import Optional
from git import Repo
from libs.tja import TJAParser
from libs.utils import get_config
@@ -43,6 +45,11 @@ def build_song_hashes(output_file="cache/song_hashes.json"):
for root_dir in tja_paths:
root_path = Path(root_dir)
if (root_path / '.git').exists():
repo = Repo(root_path)
origin = repo.remotes.origin
origin.pull()
print('Pulled latest from', root_path)
all_tja_files.extend(root_path.rglob("*.tja"))
updated_count = 0

View File

@@ -1,4 +1,3 @@
import hashlib
import math
import os
import tempfile