Closed belikor closed 3 years ago
@lyoshenka this PR involves API changes, please review
does this add anything we don't have today, or is it just a rename of the flags that already exist?
if the latter, what's the upside of this?
does this add anything we don't have today, or is it just a rename of the flags that already exist?
With this new option, we make deleting blobs optional (True by default).
Currently file_delete
always deletes the blobs. There are instances where the user would like to delete the media files (mp4, mkv, mp3, etc.) to free space on disk but keep the blobs to continue seeding the content. This is desired for a seedbox, for example.
# Current and new; delete only blobs
lbrynet file delete --claim_name=<name>
lbrynet file delete --claim_name=<name> --what=blobs # Also without this option
# Current and new; delete blobs and file
lbrynet file delete --claim_name=<name> --delete_from_download_dir
lbrynet file delete --claim_name=<name> --what=both
# New; delete only the file
lbrynet file delete --claim_name=<name> --what=file
So, it is not a rename, it's about giving the user more flexibility. The old option --delete_from_download_dir
is kept, and it's just made equal to --what=both
.
The SDK should not be responsible for deleting files that users download. They can be deleted directly using normal commands such as rm
.
I'm going to close this. We can continue to discuss if you think I missed something.
The
--what
parameter can be used to specify what to delete: the media file only, the blobs only, or both, deleting completely the downloaded stream.If no argument is used, this is equivalent to
--what=blobs
, which is the original behavior.The old argument,
--delete_from_download_dir
, works as--what=both
.Personally, I think we could deprecate completely this
--delete_from_download_dir
parameter.In general, we extend the
delete
method ofFileManager
with the parameterdelete_blobs
to make the deletion of the blobs optional. This requires adding the argumentdelete_source
toStreamManager.delete
.However, the
pylint
configuration complains and tells us that there is a mismatch in the arguments of the parent and children classes, so we also need to add the correspondingdelete_source
argument toSourceManager.delete
andTorrentManager.delete
.