forked from trav/lintunes
v0.12.0: the merge report stops reporting things you didn't do
"unplayed", "missed and never skipped" and "top 100 in past year" showed up in the merge window constantly, and nobody had touched their rules. A live smart playlist's membership is derived, but it was being persisted — and recompute_smart_playlist rewrites it (and bumped date_modified) every time a play count moves. Both machines did that against the same file after every song, so Syncthing conflicted on a list the next load throws away and rebuilds anyway. Membership now stays in memory: save_playlist writes track_ids: [] for a live smart playlist, and the recompute passes touch=False so it marks nothing dirty and moves no timestamp. live_update=False and unsupported criteria are unchanged — their track_ids are a snapshot, which is real content. Since _mark_playlist also dirties the metadata, library_metadata.json stops being rewritten every song too. The rest was presentation. Every summary read at the same weight, so someone resizing a column on the other machine popped and raised the same window as a 21-track reconciliation, described as "Library columns/settings taken from the most recently edited copy." Summaries now carry a level — WARNING for a merge that couldn't resolve cleanly or discarded a side, CHANGE for real content, INFO for cosmetic or derived — and the dialog has a Show: selector that filters to one level and above. It opens at the highest level in the batch, so nothing routine steals focus and a blank window can't happen; a later warning always pulls the view back up to it. The wording says what happened instead of how the merge works: a metadata merge names the keys that actually differed, and adopting the other machine's music folder grades CHANGE rather than INFO, because that one is a setting somebody chose. Claude-Session: https://claude.ai/code/session_01Y9ZEFi4qNJ39FMiBtiAxy2
This commit is contained in:
@@ -751,22 +751,27 @@ class MainWindow(QMainWindow):
|
||||
def _on_conflict_resolved(self, summaries):
|
||||
self.statusBar().showMessage(
|
||||
f"Merged changes from your other machine "
|
||||
f"({len(summaries)} item(s)) — see details", 8000)
|
||||
f"({len(summaries)} item(s))", 8000)
|
||||
self.show_conflict_summary(summaries)
|
||||
|
||||
def show_conflict_summary(self, summaries):
|
||||
"""Show (or extend) the one merge window. Syncthing can deliver conflicts
|
||||
every few minutes; each merge becomes another entry in the open window
|
||||
rather than another window."""
|
||||
rather than another window.
|
||||
|
||||
Only raise it when the new batch has something to say at the level on
|
||||
screen — otherwise the entry is folded in quietly and is there when the
|
||||
user dials the filter down."""
|
||||
from lintunes.gui.conflict_dialog import ConflictSummaryDialog
|
||||
if self._conflict_dialog is not None:
|
||||
self._conflict_dialog.add_event(summaries)
|
||||
else:
|
||||
# Modeless so a merge never blocks playback or what you're doing.
|
||||
self._conflict_dialog = ConflictSummaryDialog(
|
||||
summaries, self._manager, self)
|
||||
self._conflict_dialog.finished.connect(self._on_conflict_dialog_closed)
|
||||
self._conflict_dialog.show()
|
||||
if self._conflict_dialog.add_event(summaries):
|
||||
self._conflict_dialog.raise_()
|
||||
return
|
||||
# Modeless so a merge never blocks playback or what you're doing.
|
||||
self._conflict_dialog = ConflictSummaryDialog(
|
||||
summaries, self._manager, self)
|
||||
self._conflict_dialog.finished.connect(self._on_conflict_dialog_closed)
|
||||
self._conflict_dialog.show()
|
||||
self._conflict_dialog.raise_()
|
||||
|
||||
def _on_conflict_dialog_closed(self, _result):
|
||||
|
||||
Reference in New Issue
Block a user