Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create recyclebin_recovery.py #648

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

ineednewpajamas
Copy link
Contributor

@ineednewpajamas ineednewpajamas commented Sep 6, 2024

Description

Initial concept for recovery from the recyclebin

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the docstring for new or existing methods
  • I have modified this PR to merge to the develop branch

subdir_path = joiner(dir_path, subdir)
for tdir in ls(subdir_path): # the action torrent files
tdir_path = joiner(subdir_path, tdir)
move_files(tdir_path, tdir_path.replace(base_dir, ""), debug)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing replace('/.RecycleBin', '') to replace(base_dir, '') means it wipes the whole path before the category instead of just moving up a level from the RecycleBin. To maintain the logic as I had it before we could use f'/{os.path.basename(base_dir)}'. I haven't thought through how to works if split_by_category is true though.

for subdir in ls(dir_path):
subdir_path = joiner(dir_path, subdir)
move_files(subdir_path, btbackup_dir, debug)
elif dir == "links": # will have a subfolder
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this assumes cross-seed linkdir is base_dir + "links" and the logic within assumes flatLinking is false on v6, I don't know if these are safe assumptions to make

@ineednewpajamas
Copy link
Contributor Author

I'm working to rewrite this to support more config options since the original was really specific to my setup

@bakerboy448
Copy link
Collaborator

Bump for the rewrite ?

@ineednewpajamas
Copy link
Contributor Author

I fizzled out with life. I might be able to pick it back up in November.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants