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

Don't check if folders are empty for move instead of copy #9950

Merged
merged 4 commits into from
Oct 15, 2021

Conversation

medariox
Copy link
Contributor

  • PR is based on the DEVELOP branch
  • Don't send big changes all at once. Split up big PRs into multiple smaller PRs that are easier to manage and review
  • Read the contribution guide

This is the only way this makes sense to me. I don't know why we should delete any files on copy? Quite confusing.

@@ -406,7 +406,7 @@ def process(self, resource_name=None, force=False, is_priority=None, delete_on=F
self.log_and_output('Missed file: {missed_file}', level=logging.WARNING, **{'missed_file': missed_file})

if all([app.USE_TORRENTS, app.TORRENT_SEED_LOCATION,
self.process_method in ('hardlink', 'symlink', 'reflink', 'copy')]):
self.process_method in ('hardlink', 'symlink', 'reflink', 'keeplink', 'copy')]):
Copy link
Contributor Author

@medariox medariox Oct 15, 2021

Choose a reason for hiding this comment

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

Just added the keeplink because it is added here, meaning it would never get removed from the list otherwise.

if not self.nzb_name and all([app.USE_TORRENTS, app.TORRENT_SEED_LOCATION,
self.process_method in ('hardlink', 'symlink', 'reflink', 'keeplink', 'copy')]):
# Store self.info_hash and self.release_name so later we can remove from client if setting is enabled
if self.info_hash:
existing_release_names = app.RECENTLY_POSTPROCESSED.get(self.info_hash, [])
existing_release_names.append(self.release_name or 'N/A')
app.RECENTLY_POSTPROCESSED[self.info_hash] = existing_release_names

check_empty = False if self.process_method == 'copy' else True
if self.delete_folder(path, check_empty=check_empty):
if not app.NO_DELETE and os.path.normpath(path) != os.path.normpath(app.TV_DOWNLOAD_DIR):
if self.delete_folder(path, check_empty=False):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess this is what is really meant here... I may be wrong, but it makes most sense to me.

@medariox medariox merged commit 1e76ecd into develop Oct 15, 2021
@medariox medariox deleted the fix/rm-folder-on-move branch October 15, 2021 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant