mirror of
https://github.com/darkzoul5/YoutubePlaylistSync.git
synced 2026-09-22 06:12:21 +03:00
Add pruning option to PlaylistDownloader and update CLI arguments
This commit is contained in:
@@ -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