diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 1b4bacd1..2e5b585f 100755 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -502,6 +502,11 @@ +
+ +
+ Folder path where torrent download will be assigned +
diff --git a/mylar/__init__.py b/mylar/__init__.py index 755bd989..2ec41075 100755 --- a/mylar/__init__.py +++ b/mylar/__init__.py @@ -407,6 +407,7 @@ USE_TRANSMISSION = False TRANSMISSION_HOST = None TRANSMISSION_USERNAME = None TRANSMISSION_PASSWORD = None +TRANSMISSION_DIRECTORY = None def CheckSection(sec): """ Check if INI section exists, if not create it """ @@ -467,7 +468,7 @@ def initialize(): NEWZNAB, NEWZNAB_NAME, NEWZNAB_HOST, NEWZNAB_APIKEY, NEWZNAB_VERIFY, NEWZNAB_UID, NEWZNAB_ENABLED, EXTRA_NEWZNABS, NEWZNAB_EXTRA, \ ENABLE_TORZNAB, TORZNAB_NAME, TORZNAB_HOST, TORZNAB_APIKEY, TORZNAB_CATEGORY, TORZNAB_VERIFY, \ EXPERIMENTAL, ALTEXPERIMENTAL, USE_RTORRENT, RTORRENT_HOST, RTORRENT_USERNAME, RTORRENT_PASSWORD, RTORRENT_STARTONLOAD, RTORRENT_LABEL, RTORRENT_DIRECTORY, \ - USE_UTORRENT, UTORRENT_HOST, UTORRENT_USERNAME, UTORRENT_PASSWORD, UTORRENT_LABEL, USE_TRANSMISSION, TRANSMISSION_HOST, TRANSMISSION_USERNAME, TRANSMISSION_PASSWORD, \ + USE_UTORRENT, UTORRENT_HOST, UTORRENT_USERNAME, UTORRENT_PASSWORD, UTORRENT_LABEL, USE_TRANSMISSION, TRANSMISSION_HOST, TRANSMISSION_USERNAME, TRANSMISSION_PASSWORD, TRANSMISSION_DIRECTORY, \ ENABLE_META, CMTAGGER_PATH, CBR2CBZ_ONLY, CT_TAG_CR, CT_TAG_CBL, CT_CBZ_OVERWRITE, UNRAR_CMD, CT_SETTINGSPATH, CMTAG_START_YEAR_AS_VOLUME, UPDATE_ENDED, INDIE_PUB, BIGGIE_PUB, IGNORE_HAVETOTAL, SNATCHED_HAVETOTAL, PROVIDER_ORDER, TMP_PROV, \ dbUpdateScheduler, searchScheduler, RSSScheduler, WeeklyScheduler, VersionScheduler, FolderMonitorScheduler, \ ALLOW_PACKS, ENABLE_TORRENTS, TORRENT_DOWNLOADER, MINSEEDS, USE_WATCHDIR, TORRENT_LOCAL, LOCAL_WATCHDIR, TORRENT_SEEDBOX, SEEDBOX_HOST, SEEDBOX_PORT, SEEDBOX_USER, SEEDBOX_PASS, SEEDBOX_WATCHDIR, \ @@ -801,7 +802,8 @@ def initialize(): TRANSMISSION_HOST = check_setting_str(CFG, 'Transmission', 'transmission_host', '') TRANSMISSION_USERNAME = check_setting_str(CFG, 'Transmission', 'transmission_username', '') TRANSMISSION_PASSWORD = check_setting_str(CFG, 'Transmission', 'transmission_password', '') - + TRANSMISSION_DIRECTORY = check_setting_str(CFG, 'Transmission', 'transmission_directory', '') + #add torrents to provider counter. if ENABLE_TORRENT_SEARCH: if ENABLE_32P: @@ -1537,6 +1539,7 @@ def config_write(): new_config['Transmission']['transmission_host'] = TRANSMISSION_HOST new_config['Transmission']['transmission_username'] = TRANSMISSION_USERNAME new_config['Transmission']['transmission_password'] = TRANSMISSION_PASSWORD + new_config['Transmission']['transmission_directory'] = TRANSMISSION_DIRECTORY # Need to unpack the extra newznabs for saving in config.ini flattened_newznabs = [] diff --git a/mylar/torrent/clients/transmission.py b/mylar/torrent/clients/transmission.py index ee754fd4..ee3871ce 100755 --- a/mylar/torrent/clients/transmission.py +++ b/mylar/torrent/clients/transmission.py @@ -72,8 +72,12 @@ class TorrentClient(object): return torrent.stop() def load_torrent(self, filepath): + if any([mylar.TRANSMISSION_DIRECTORY is None, mylar.TRANSMISSION_DIRECTORY == '', mylar.TRANSMISSION_DIRECTORY == 'None']): + down_dir = mylar.CHECK_FOLDER + else: + down_dir = mylar.TRANSMISSION_DIRECTORY torrent = self.conn.add_torrent(filepath, - download_dir=mylar.CHECK_FOLDER) + download_dir=down_dir) torrent.start() return self.get_torrent(torrent) diff --git a/mylar/webserve.py b/mylar/webserve.py index 90dd1bf6..f5f6dd1f 100755 --- a/mylar/webserve.py +++ b/mylar/webserve.py @@ -3867,6 +3867,7 @@ class WebInterface(object): "transmission_host": mylar.TRANSMISSION_HOST, "transmission_username": mylar.TRANSMISSION_USERNAME, "transmission_password": mylar.TRANSMISSION_PASSWORD, + "transmission_directory": mylar.TRANSMISSION_DIRECTORY, "blackhole_dir": mylar.BLACKHOLE_DIR, "usenet_retention": mylar.USENET_RETENTION, "use_nzbsu": helpers.checked(mylar.NZBSU), @@ -4197,7 +4198,7 @@ class WebInterface(object): enable_torrents=0, minseeds=0, local_watchdir=None, seedbox_watchdir=None, seedbox_user=None, seedbox_pass=None, seedbox_host=None, seedbox_port=None, prowl_enabled=0, prowl_onsnatch=0, prowl_keys=None, prowl_priority=None, nma_enabled=0, nma_apikey=None, nma_priority=0, nma_onsnatch=0, pushover_enabled=0, pushover_onsnatch=0, pushover_apikey=None, pushover_userkey=None, pushover_priority=None, boxcar_enabled=0, boxcar_onsnatch=0, boxcar_token=None, pushbullet_enabled=0, pushbullet_apikey=None, pushbullet_deviceid=None, pushbullet_onsnatch=0, torrent_downloader=0, torrent_local=0, torrent_seedbox=0, utorrent_host=None, utorrent_username=None, utorrent_password=None, utorrent_label=None, - rtorrent_host=None, rtorrent_username=None, rtorrent_password=None, rtorrent_directory=None, rtorrent_label=None, rtorrent_startonload=0, transmission_host=None, transmission_username=None, transmission_password=None, + rtorrent_host=None, rtorrent_username=None, rtorrent_password=None, rtorrent_directory=None, rtorrent_label=None, rtorrent_startonload=0, transmission_host=None, transmission_username=None, transmission_password=None, transmission_directory=None, preferred_quality=0, move_files=0, rename_files=0, add_to_csv=1, cvinfo=0, lowercase_filenames=0, folder_format=None, file_format=None, enable_extra_scripts=0, extra_scripts=None, enable_pre_scripts=0, pre_scripts=None, post_processing=0, file_opts=None, syno_fix=0, search_delay=None, chmod_dir=0777, chmod_file=0660, chowner=None, chgroup=None, tsab=None, destination_dir=None, create_folders=1, replace_spaces=0, replace_char=None, use_minsize=0, minsize=None, use_maxsize=0, maxsize=None, autowant_all=0, autowant_upcoming=0, comic_cover_local=0, zero_level=0, zero_level_n=None, interface=None, dupeconstraint=None, ddump=0, duplicate_dump=None, **kwargs): mylar.COMICVINE_API = comicvine_api @@ -4284,6 +4285,7 @@ class WebInterface(object): mylar.TRANSMISSION_HOST = transmission_host mylar.TRANSMISSION_USERNAME = transmission_username mylar.TRANSMISSION_PASSWORD = transmission_password + mylar.TRANSMISSION_DIRECTORY = transmission_directory mylar.ENABLE_TORRENT_SEARCH = int(enable_torrent_search) mylar.ENABLE_TPSE = int(enable_tpse) mylar.ENABLE_32P = int(enable_32p)