mirror of
https://github.com/darkzoul5/YoutubePlaylistSync.git
synced 2026-11-07 08:15:12 +02:00
feat(backend): scaffold state-based sync foundation (no GUI)
Add core scanner, diff engine, SQLite DB, queue, events, scheduler, utils Wire settings + bootstrap to compute actions;
This commit is contained in:
1 parent
6d8649ac2d
commit
abd3c2ed62
9 files changed
+160
-10
No files matched your search
+11
-1
@@ -10,12 +10,22 @@ from pathlib import Path
|
||||
|
||||
from .config.settings import Settings
|
||||
from .core.database.db import Database
|
||||
from .core.sync.service import SyncService
|
||||
|
||||
|
||||
def bootstrap(db_path: Path | None = None) -> None:
|
||||
settings = Settings()
|
||||
db = Database((db_path or Path("app/data/app.db")).resolve())
|
||||
_ = settings, db # silence linters for now
|
||||
service = SyncService(db)
|
||||
|
||||
# Iterate configured playlists and compute actions (no execution yet)
|
||||
for pl in settings.playlists:
|
||||
try:
|
||||
actions = service.sync_from_config(pl)
|
||||
# For now, just print summary for visibility during development
|
||||
print(f"Computed {len(actions)} actions for playlist: {pl.get('url')}")
|
||||
except Exception as exc: # keep bootstrap resilient during early dev
|
||||
print(f"Failed to sync playlist {pl.get('url')}: {exc}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in new issue
Block a user