forked from trav/lintunes
v0.31.0: Cassette followed playlists — a friend's playlist in your sidebar
- A followed playlist (the UFO in friend mode) appears in my sidebar with a purple UFO: mixed in with my playlists alphabetically, or inside a folder named after the friend (per-friend, in Sync Settings). It's never a Playlist of mine, so it stays out of the library and its merges. - It plays from the cache. Player's queue accepts friend-track keys, resolved through Cassette: they scrobble to Last.fm but don't count in my play journal. Songs still on their way are grey and skipped. - The cassette column there is hidden by default (right-click the header); pressing one takes the song into my library — straight from the cache if it's there, otherwise by asking for it. - Sync Settings per friend: keep followed songs separate (default) or add them to my library. Unfollowing (right-click) frees their cache. - The bottom bar says when the friend's folder last synced.
This commit is contained in:
@@ -279,12 +279,15 @@ class MainWindow(QMainWindow):
|
||||
def _update_totals(self):
|
||||
view = self._content.currentWidget()
|
||||
count, total_ms = view.table.total_stats()
|
||||
text = ""
|
||||
if count:
|
||||
noun = "track" if count == 1 else "tracks"
|
||||
self._totals_label.setText(
|
||||
f"{count:,} {noun} · {format_total_time(total_ms)}")
|
||||
else:
|
||||
self._totals_label.setText("")
|
||||
text = f"{count:,} {noun} · {format_total_time(total_ms)}"
|
||||
# A friend's followed playlist also says when their folder last synced.
|
||||
suffix = getattr(view, "status_suffix", None)
|
||||
if suffix is not None and suffix():
|
||||
text = f"{text} · {suffix()}" if text else suffix()
|
||||
self._totals_label.setText(text)
|
||||
|
||||
# ---- preferences / theming ----
|
||||
|
||||
@@ -403,6 +406,18 @@ class MainWindow(QMainWindow):
|
||||
def sidebar(self):
|
||||
return self._sidebar
|
||||
|
||||
def play_keys(self, keys, start, context):
|
||||
"""Play a followed friend playlist (queue of friend-track keys)."""
|
||||
self._now_playing_context = context
|
||||
self.player.play_queue(keys, start)
|
||||
|
||||
@property
|
||||
def now_playing_context(self) -> str:
|
||||
return self._now_playing_context
|
||||
|
||||
def update_totals(self):
|
||||
self._update_totals()
|
||||
|
||||
def refresh_library_view(self, _track_ids=None):
|
||||
"""Songs arrived from somewhere other than an import dialog (a friend's
|
||||
delivery): show them."""
|
||||
|
||||
Reference in New Issue
Block a user