From 390b401ee2674fe9618fc79fa2c4264debd7025a Mon Sep 17 00:00:00 2001 From: Labrys Date: Sat, 18 Jun 2016 20:59:18 -0400 Subject: [PATCH] Apply dict type-casting to section[usercat] in TorrentToMedia.py * Fixes #1064 --- TorrentToMedia.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 8fb02d64..8309b178 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -90,13 +90,12 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID, (inputCategory)) return [-1, ""] + section = dict(section) # Type cast to dict() to allow effective usage of .get() + Torrent_NoLink = int(section[usercat].get("Torrent_NoLink", 0)) keep_archive = int(section[usercat].get("keep_archive", 0)) extract = int(section[usercat].get('extract', 0)) - try: - uniquePath = int(section[usercat].get("unique_path", 1)) - except TypeError: - uniquePath = 1 + uniquePath = int(section[usercat].get("unique_path", 1)) if clientAgent != 'manual': core.pause_torrent(clientAgent, inputHash, inputID, inputName)