mirror of
https://github.com/darkzoul5/YoutubePlaylistSync.git
synced 2026-11-07 16:15:12 +02:00
Add pruning option to PlaylistDownloader and update CLI arguments
This commit is contained in:
1 parent
e1ec65094f
commit
599a0751b9
2 files changed
+9
-1
No files matched your search
@@ -20,6 +20,8 @@ class PlaylistDownloader:
|
||||
self.debug = bool(config.debug)
|
||||
# non-interactive mode for CI/automated runs
|
||||
self.non_interactive = bool(getattr(config, "non_interactive", False))
|
||||
# prune controls whether cleanup actually deletes files; default False
|
||||
self.prune = bool(getattr(config, "prune", False))
|
||||
|
||||
self.url = playlist.get("url")
|
||||
self.skip = False
|
||||
@@ -359,6 +361,10 @@ class PlaylistDownloader:
|
||||
for f in to_delete:
|
||||
self.logger.warning(" %s", f.name)
|
||||
|
||||
if not self.prune:
|
||||
self.logger.info("Prune disabled; no files will be deleted in '%s'.", folder)
|
||||
return
|
||||
|
||||
try:
|
||||
if self.non_interactive:
|
||||
confirm = "y"
|
||||
|
||||
Reference in new issue
Block a user