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:
@@ -93,6 +93,9 @@ def run_import(xml_path: Path, music_root: str | None, data_dir: Path):
|
||||
library.music_folder_rel = to_relative(library.music_folder, data_dir)
|
||||
library.music_folder_set_at = (
|
||||
datetime.now(timezone.utc).replace(tzinfo=None).isoformat())
|
||||
# A fresh import is a new library, so it starts with the seed playlists.
|
||||
from lintunes.seed_playlists import seed_new_library
|
||||
seed_new_library(library.playlists)
|
||||
|
||||
if report.missing_files:
|
||||
missing_log = data_dir / "import_missing_files.txt"
|
||||
@@ -134,6 +137,9 @@ def run_gui(data_dir: Path, files: list[Path],
|
||||
from lintunes.sync_watcher import LibrarySyncWatcher
|
||||
|
||||
startup_conflicts = resolve_conflicts(data_dir)
|
||||
# No library.json means a library is being born here (not merely an empty
|
||||
# one), which is the one moment the seed playlists are added.
|
||||
new_library = not (data_dir / "library.json").exists()
|
||||
library = load_library(data_dir)
|
||||
|
||||
app = QApplication([sys.argv[0]] + (qt_args or []))
|
||||
@@ -147,6 +153,8 @@ def run_gui(data_dir: Path, files: list[Path],
|
||||
prefs = Preferences(data_dir)
|
||||
theme.apply_theme(app, prefs)
|
||||
manager = LibraryManager(library, data_dir)
|
||||
if new_library:
|
||||
manager.seed_new_library()
|
||||
lastfm = LastFm(prefs, data_dir)
|
||||
window = MainWindow(manager, prefs, lastfm)
|
||||
app.installEventFilter(window)
|
||||
|
||||
Reference in New Issue
Block a user