v0.86.0: Identify windows find the album art too — one song gets a cover picker beside its tags, a playlist batch a cover per album

This commit is contained in:
2026-11-02 16:07:08 -08:00
parent 4911fc425f
commit 61955ef996
8 changed files with 615 additions and 119 deletions
+14 -11
View File
@@ -14,7 +14,7 @@ from PyQt6.QtCore import Qt
from lintunes import identify_batch
from lintunes.fingerprint import IdentifyCandidate
from lintunes.gui import identify_batch_dialog as dialog_module
from lintunes.gui import art_picker as dialog_module
from lintunes.gui.identify_batch_dialog import (
IdentifyBatchDialog, format_cell, parse_cell,
)
@@ -183,7 +183,7 @@ def test_the_album_window_applies_ticked_rows(qapp, no_network):
assert [r.track.track_id for r in dialog.unchecked_rows()] == [2]
dialog._on_apply()
assert dialog.outcome == dialog.APPLY
assert dialog.selected_image is None # no art loaded
assert dialog.selected_art() == [] # no art loaded
def test_art_arrives_ticked_and_is_handed_over(qapp, no_network):
@@ -200,21 +200,23 @@ def test_art_arrives_ticked_and_is_handed_over(qapp, no_network):
analysis = _album_analysis()
dialog = IdentifyBatchDialog(analysis, ("The Breeders", "Last Splash"))
art = ArtCandidate("The Breeders", "Last Splash", "http://x/a.jpg")
dialog._on_art_search({"candidates": [art]})
dialog._on_art_image({"candidate": art, "image": bytes(data),
"mime": "image/png"})
assert dialog._embed.isChecked()
dialog._art._on_search({"candidates": [art]})
dialog._art._on_image({"candidate": art, "image": bytes(data),
"mime": "image/png"})
assert dialog._art._embed.isChecked()
dialog._on_apply()
assert dialog.selected_image == bytes(data)
assert dialog.selected_mime == "image/png"
[(rows, image, mime)] = dialog.selected_art()
assert len(rows) == 2
assert image == bytes(data) and mime == "image/png"
def test_a_playlist_window_has_no_album_panel(qapp, no_network):
analysis = analyze([(_t(1), [_c("A", "One")]),
(_t(2), [_c("B", "Two")])])
dialog = IdentifyBatchDialog(analysis, None)
assert dialog._album_edit is None and dialog._embed is None
assert no_network == []
assert dialog._album_edit is None and dialog._art is None
# A cover per album instead (Round 119), searched one at a time.
assert no_network == [("The Breeders", "One")]
dialog._on_review_all()
assert dialog.outcome == dialog.REVIEW_ALL
@@ -319,7 +321,8 @@ def test_a_batch_review_applies_then_reviews_the_unticked(window, qapp,
class _Batch:
APPLY, REVIEW_ALL = 1, 2
outcome = 1
selected_image = None
def selected_art(self):
return []
def __init__(self, analysis, query, parent):
pass
def exec(self):