Purge external-format terminology from code, tests and docs

Reword comments/docstrings/strings and rename identifiers that referenced
the external game and its file formats:

- format-id "psarc" -> "archive"; local vars psarc_path -> song_path,
  psarc_base -> tone_base
- lyrics provenance value "sng" -> "notechart" (legacy "sng" still accepted)
- highway_3d fret-ghost scope value "rocksmith" -> "chords" (invalid/legacy
  values fall back to the default, preserving behaviour)
- neutralise references in prose, test names/data, .gitattributes and docs

No functional change beyond the renamed identifiers; all Python compiles.
This commit is contained in:
Sin
2026-06-16 19:36:53 +01:00
parent bc0e83c345
commit 4148b0e72e
49 changed files with 397 additions and 392 deletions
+21 -21
View File
@@ -46,28 +46,28 @@ def test_create_requires_name(client):
def test_add_remove_reorder_persists(client, server):
for fn in ("a.psarc", "b.psarc", "c.psarc"):
for fn in ("a.archive", "b.archive", "c.archive"):
server.meta_db.put(fn, 0, 0, {})
pid = client.post("/api/playlists", json={"name": "Set"}).json()["id"]
client.post(f"/api/playlists/{pid}/songs", json={"filename": "a.psarc"})
client.post(f"/api/playlists/{pid}/songs", json={"filename": "b.psarc"})
client.post(f"/api/playlists/{pid}/songs", json={"filename": "c.psarc"})
client.post(f"/api/playlists/{pid}/songs", json={"filename": "a.archive"})
client.post(f"/api/playlists/{pid}/songs", json={"filename": "b.archive"})
client.post(f"/api/playlists/{pid}/songs", json={"filename": "c.archive"})
songs = client.get(f"/api/playlists/{pid}").json()["songs"]
assert [s["filename"] for s in songs] == ["a.psarc", "b.psarc", "c.psarc"]
assert [s["filename"] for s in songs] == ["a.archive", "b.archive", "c.archive"]
# reorder
client.post(f"/api/playlists/{pid}/reorder", json={"order": ["c.psarc", "a.psarc", "b.psarc"]})
client.post(f"/api/playlists/{pid}/reorder", json={"order": ["c.archive", "a.archive", "b.archive"]})
songs2 = client.get(f"/api/playlists/{pid}").json()["songs"]
assert [s["filename"] for s in songs2] == ["c.psarc", "a.psarc", "b.psarc"]
assert [s["filename"] for s in songs2] == ["c.archive", "a.archive", "b.archive"]
# remove
client.request("DELETE", f"/api/playlists/{pid}/songs/b.psarc")
client.request("DELETE", f"/api/playlists/{pid}/songs/b.archive")
songs3 = client.get(f"/api/playlists/{pid}").json()["songs"]
assert [s["filename"] for s in songs3] == ["c.psarc", "a.psarc"]
assert [s["filename"] for s in songs3] == ["c.archive", "a.archive"]
def test_saved_for_later_toggle_and_protection(client):
# Toggle creates the system playlist on first use.
assert client.post("/api/saved/toggle", json={"filename": "x.psarc"}).json() == {"saved": True}
assert client.post("/api/saved/toggle", json={"filename": "x.psarc"}).json() == {"saved": False}
assert client.post("/api/saved/toggle", json={"filename": "x.archive"}).json() == {"saved": True}
assert client.post("/api/saved/toggle", json={"filename": "x.archive"}).json() == {"saved": False}
saved = next(p for p in client.get("/api/playlists").json() if p["system_key"] == "saved_for_later")
# Cannot delete or rename the system playlist.
assert client.delete(f"/api/playlists/{saved['id']}").status_code == 400
@@ -76,12 +76,12 @@ def test_saved_for_later_toggle_and_protection(client):
def test_continue_session(client, server):
assert client.get("/api/session/continue").json() is None
for fn in ("one.psarc", "two.psarc"):
for fn in ("one.archive", "two.archive"):
server.meta_db.put(fn, 0, 0, {})
client.post("/api/stats", json={"filename": "one.psarc", "score": 100, "accuracy": 0.5, "lastPlayPosition": 12.0})
client.post("/api/stats", json={"filename": "two.psarc", "score": 200, "accuracy": 0.7, "lastPlayPosition": 30.0})
client.post("/api/stats", json={"filename": "one.archive", "score": 100, "accuracy": 0.5, "lastPlayPosition": 12.0})
client.post("/api/stats", json={"filename": "two.archive", "score": 200, "accuracy": 0.7, "lastPlayPosition": 30.0})
cont = client.get("/api/session/continue").json()
assert cont["filename"] == "two.psarc"
assert cont["filename"] == "two.archive"
assert cont["last_position"] == 30.0
assert "art_url" in cont and "title" in cont
@@ -89,8 +89,8 @@ def test_continue_session(client, server):
def test_add_song_to_missing_playlist_is_404(client, server):
# add_playlist_song() must not insert an orphan row for a non-existent
# playlist (the concurrent-delete TOCTOU); it returns None → handler 404s.
assert server.meta_db.add_playlist_song(999999, "x.psarc") is None
r = client.post("/api/playlists/999999/songs", json={"filename": "x.psarc"})
assert server.meta_db.add_playlist_song(999999, "x.archive") is None
r = client.post("/api/playlists/999999/songs", json={"filename": "x.archive"})
assert r.status_code == 404
@@ -98,11 +98,11 @@ def test_playlist_hides_dead_songs_when_library_populated(client, server):
# A playlist song whose file no longer exists is hidden from contents + count
# (mirrors the stats read-filter), but only while the library is populated.
db = server.meta_db
db.put("live.psarc", 0, 0, {"title": "Live"})
db.put("live.archive", 0, 0, {"title": "Live"})
pid = client.post("/api/playlists", json={"name": "P"}).json()["id"]
client.post(f"/api/playlists/{pid}/songs", json={"filename": "live.psarc"})
client.post(f"/api/playlists/{pid}/songs", json={"filename": "ghost.psarc"}) # never in songs
client.post(f"/api/playlists/{pid}/songs", json={"filename": "live.archive"})
client.post(f"/api/playlists/{pid}/songs", json={"filename": "ghost.archive"}) # never in songs
pl = client.get(f"/api/playlists/{pid}").json()
names = [s["filename"] for s in pl["songs"]]
assert "live.psarc" in names and "ghost.psarc" not in names
assert "live.archive" in names and "ghost.archive" not in names
assert [p for p in client.get("/api/playlists").json() if p["id"] == pid][0]["count"] == 1