This commit is contained in:
nose
2025-12-01 01:10:16 -08:00
parent 2b93edac10
commit 6b9ed7d4ab
17 changed files with 1644 additions and 470 deletions

View File

@@ -331,6 +331,7 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
self.media_kind = media_kind
self.tags = tags or []
self.known_urls = known_urls or []
self.origin = "local" # Ensure origin is set for add-file
PipelineItem = SimpleItem
merged_item = PipelineItem(
@@ -340,6 +341,8 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
tags=merged_tags, # Include merged tags
known_urls=source_urls # Include known URLs
)
# Clear previous results to ensure only the merged file is passed down
ctx.clear_last_result()
ctx.emit(merged_item)
except Exception as e:
log(f"Warning: Could not emit pipeline item: {e}", file=sys.stderr)
@@ -347,7 +350,9 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
ctx.emit(f"Merged: {output_path}")
# Delete source files if requested
if delete_after:
# Always delete source files if they were downloaded playlist items (temp files)
# We can detect this if they are in the temp download directory or if we tracked them
if delete_after or True: # Force delete for now as merge consumes them
# First delete all .tags files
for tags_file in source_tags_files:
try: