pinchflat icon indicating copy to clipboard operation
pinchflat copied to clipboard

[Bug] Orphaned files on 'Delete Source + Files'

Open ashw opened this issue 1 year ago • 5 comments
trafficstars

Expected behaviour: When choosing Delete Source + Files from source info page, all files are deleted and download queue is cancelled.

Current behaviour: Choosing Delete Source + Files while a playlist is being downloaded results in orphaned files in the target path that were in the queue(s).

ashw avatar Apr 05 '24 18:04 ashw

Thanks for the report! I'll look into this over the weekend

kieraneglin avatar Apr 05 '24 19:04 kieraneglin

This is turning out to be more complicated than I expected to get it to work reliably. There's a yt-dlp bug described in #139 that would allow storing temporary files in the tmp directory which would make this really easy. I'm going to put this on hold until that bug is fixed or I think of another approach

kieraneglin avatar Apr 09 '24 17:04 kieraneglin

(note to self) this is improved with #182 but still doesn't delete all files if the job is terminated before the final video pieces are assembled

kieraneglin avatar Apr 11 '24 22:04 kieraneglin

I think I might have just ran into this. I accidentally added an enormous YT channel without a limit. I updated it, but Pinchflat didn't update the pending queue so I tried deleting it. When I went to re-add it I get this cryptic error:

image

By deleting the lingering directory I was able to re-add the source. Ideally, one of two things would happen in my case:

  • Deleting/re-adding ignores the existing directory if it exists (or maybe warns w/ confirm).
  • Re-evaluating retention period during the syncing process and/or when a forced re-index happened (I tried this and it had no effect).

joestump avatar Dec 03 '24 22:12 joestump

@joestump this error is unrelated - that's what happens when you try to re-add a source while it's in the process of being deleted. Deletion happens behind-the-scenes and can take several minutes for a sufficiently large source.

This can probably be improved, but it's lower on my priority list. One day!

kieraneglin avatar Dec 04 '24 18:12 kieraneglin