1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Merge pull request #593 from tutipeti/feature/synods_destination

Destination option for the Synology DS
This commit is contained in:
echel0n 2014-06-19 09:43:27 -07:00
commit b312c9dcda
3 changed files with 11 additions and 2 deletions

View File

@ -448,6 +448,10 @@
<span class="component-title">&nbsp;</span>
<span class="component-desc">Where should it save the downloaded files? (blank for default)</span>
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc"><b>Note:</b> For Synology DS the destination has to be a shared folder</span>
</label>
</div>
<div class="field-pair" id="Torrent_Seed_Time">

View File

@ -93,7 +93,7 @@ $(document).ready(function(){
$('#Torrent_Label').hide();
$('#Torrent_username').show();
$('#Torrent_Paused').hide();
$('#Torrent_Path').hide();
$('#Torrent_Path').show();
$('#Torrent_Ratio').hide();
$('#Torrent_Seed_Time').hide();
$('#Torrent_High_Bandwidth').hide();
@ -102,6 +102,7 @@ $(document).ready(function(){
$('#password_desc').text('Synology Password');
$('#label_desc').text('Synology Label');
$('#directory_desc').text('Synology Directory');
$('#Torrent_Path').find('.fileBrowser').hide();
} else if (selectedProvider == "rtorrent"){
$('#t_blackhole_settings').hide();
$('#torrent_settings').show();

View File

@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Public License
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
#
# Uses the Synology Download Station API: http://download.synology.com/download/other/Synology_Download_Station_Official_API_V3.pdf.
# Uses the Synology Download Station API: http://download.synology.com/download/Document/DeveloperGuide/Synology_Download_Station_Web_API.pdf
import sickbeard
from sickbeard.clients.generic import GenericClient
@ -51,6 +51,8 @@ class DownloadStationAPI(GenericClient):
'_sid':self.auth,
'uri':result.url
}
if sickbeard.TORRENT_PATH:
data['destination'] = sickbeard.TORRENT_PATH
self._request(method='post', data=data)
return self.response.json()['success']
@ -63,6 +65,8 @@ class DownloadStationAPI(GenericClient):
'session':'DownloadStation',
'_sid':self.auth
}
if sickbeard.TORRENT_PATH:
data['destination'] = sickbeard.TORRENT_PATH
files = {'file':(result.name + '.torrent', result.content)}
self._request(method='post', data=data, files=files)