Show soundtrack covers and edit alternative names (#49)
Covers: statistics cards show the soundtrack's cover on the left, and the
statistics popup shows it large. Until it arrives, and without a cover, the
soundtrack's initials stand in. Covers load only for cards on or near the
screen, three at a time, and are cached in covers/ next to the settings
(CoverCache), downloaded again only when cover_modified changes. The index and
file handling are shared with CharacterCache in a new FileCache.
Alternative names: the popup shows them and has an editor (add, remove, save)
that sends PUT /soundtracks/{uuid}/alternative-names. The statistics search and
the Search popup find soundtracks by them; Search shows the matching name after
the real one. Search now loads /soundtracks, falling back to the plain list.
The API types are regenerated from the server's spec, with a SoundtrackCover
theme style in every theme.
Closes #49
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a735c515bf
commit
ef6ac8f1fd
37 files changed
+8029
-1763
No files matched your search
@@ -90,3 +90,25 @@ func test_matched_letters_in_order() -> void:
|
||||
func test_matched_letters_of_no_match() -> void:
|
||||
assert_array(SoundtrackSearch.matched_letters("Chrono Trigger", "metroid")).is_empty()
|
||||
assert_array(SoundtrackSearch.matched_letters("Super Mario 64", "sm")).is_empty()
|
||||
|
||||
|
||||
func test_alternative_names_find_the_real_name() -> void:
|
||||
_search.set_names(["Final Fantasy VII", "Chrono Trigger"],
|
||||
{"Final Fantasy VII": ["FF7", "ファイナルファンタジーVII"]})
|
||||
|
||||
assert_array(_search.find_matches("ff7")).contains_exactly(["Final Fantasy VII"])
|
||||
assert_str(_search.matched_alternative("Final Fantasy VII")).is_equal("FF7")
|
||||
assert_array(_search.find_matches("ファイナル")).contains_exactly(["Final Fantasy VII"])
|
||||
|
||||
|
||||
func test_real_name_match_shows_no_alternative() -> void:
|
||||
_search.set_names(["Final Fantasy VII"], {"Final Fantasy VII": ["FF7"]})
|
||||
|
||||
assert_array(_search.find_matches("fantasy")).contains_exactly(["Final Fantasy VII"])
|
||||
assert_str(_search.matched_alternative("Final Fantasy VII")).is_empty()
|
||||
|
||||
|
||||
func test_soundtrack_is_found_once_when_several_names_match() -> void:
|
||||
_search.set_names(["Final Fantasy VII"], {"Final Fantasy VII": ["Final Fantasy 7"]})
|
||||
|
||||
assert_array(_search.find_matches("final")).contains_exactly(["Final Fantasy VII"])
|
||||
Reference in new issue
Block a user