v0.27.0: Cassette invites — one paste connects two friends

- Connections ▸ Share Library with a Friend… makes a one-time invite code
  (device id, display name, token) and the inviter's send-only folder.
- Connections ▸ Add Friend Library… takes the pasted code: adds the
  inviter, shares our folder, and accepts theirs receive-only when it's
  offered back.
- Syncthing hides an unknown device's folders (verified on 1.30), so the
  inviter probes a new knock only while an invite is open: added with
  nothing shared, completed on the right token, otherwise removed and
  never probed again. Used and cancelled codes go nowhere.
- Sync Settings lists open invites (Cancel Invite) and gives each friend a
  page: avatar, plain-language status with a next step, last seen, last
  synced, Remove Friend. Removals are staged until OK.
- scripts/cassette_pair.py runs throwaway Syncthings on loopback;
  pytest --syncthing drives a real three-machine handshake.
This commit is contained in:
2026-09-28 21:13:07 -07:00
parent db9e5eab79
commit 5520eb333e
15 changed files with 1783 additions and 33 deletions
+8 -1
View File
@@ -95,7 +95,9 @@ class MainWindow(QMainWindow):
# Context playback started from: "library" or "playlist:<pid>". Scopes
# the now-playing speaker icon to where the song is actually playing.
self._now_playing_context = ""
# Friend sharing's menu group and dialogs.
# Friend sharing's menu group and dialogs. Its background service is
# started by run_gui (host machine only), never by constructing the
# window — tests build windows by the dozen.
self._cassette = CassetteUi(self, prefs)
self.setWindowTitle("LinTunes")
@@ -386,6 +388,10 @@ class MainWindow(QMainWindow):
# always reflects plug/unplug, the cast session and the current view.
connections_menu.aboutToShow.connect(self._refresh_connection_actions)
@property
def cassette(self) -> CassetteUi:
return self._cassette
def _add_action(self, menu, text, shortcut, slot):
action = QAction(text, self)
if shortcut:
@@ -1707,6 +1713,7 @@ class MainWindow(QMainWindow):
self._sync_inhibitor.release()
# Before the player: this stops the device and kills the HTTP server it
# is fetching from. Skipped, the Chromecast sits buffering a dead URL.
self._cassette.shutdown()
self._cast.shutdown()
self.player.shutdown()
self._manager.flush()