Skip to content

Commit

Permalink
added conditional so only labeled files are copied on complete
Browse files Browse the repository at this point in the history
  • Loading branch information
pescobar committed Jan 12, 2018
1 parent 3645e11 commit a308d20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions copycompleted/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ def on_torrent_finished(self, torrent_id):
info = torrent.get_status([ "name", "save_path", "move_on_completed", "move_on_completed_path"])
get_label = component.get("Core").get_torrent_status(torrent_id,["label"])
label = get_label["label"]
if not label:
log.info("COPYCOMPLETED PLUGIN NOT COPYING %s BECAUSE IT HAS NO LABEL", info["name"])
return
old_path = info["move_on_completed_path"] if info["move_on_completed"] else info["save_path"]
new_path = self.config["copy_to"] + "/" + label if self.config["append_label_todir"] else self.config["copy_to"]
log.info("COPYCOMPLETED: New Path is: %s", new_path)
Expand Down

0 comments on commit a308d20

Please sign in to comment.