forked from trav/lintunes
v0.25.0: New Tracks, a soft emboss, date added pinned
Groundwork for Cassette (friend library sharing) that stands on its own: - A brand-new library (fresh data dir, or a fresh iTunes import) starts with a "New Tracks" smart playlist: added in the last 3 months, newest first. Fixed persistent id, so two machines seeding one unsynced share merge into a single playlist. - Every non-flat button, the sidebar Library button and the transport boxes get a very slight top-lit gradient computed from the live palette, with the chosen color kept exactly at its midpoint. - Tests pin that individual imports stamp date added = now even for an old file, and that the iTunes migration keeps the XML's dates.
This commit is contained in:
@@ -145,6 +145,16 @@ class LibraryManager(QObject):
|
||||
redo=lambda: self._insert_playlists([folder])))
|
||||
return folder
|
||||
|
||||
def seed_new_library(self):
|
||||
"""Add the playlists a brand-new library starts with (not undoable —
|
||||
there is nothing before them to go back to)."""
|
||||
from lintunes.seed_playlists import seed_new_library
|
||||
added = seed_new_library(dict(self.library.playlists))
|
||||
if added:
|
||||
self._insert_playlists(added)
|
||||
for playlist in added:
|
||||
self.recompute_smart_playlist(playlist.persistent_id, force=True)
|
||||
|
||||
def create_smart_playlist(self, name: str, criteria, parent_pid: str = "") -> Playlist:
|
||||
playlist = Playlist(
|
||||
name=name,
|
||||
|
||||
Reference in New Issue
Block a user