Skip to content

Commit 9c946b6

Browse files
committed
v0.5.12
2 parents 4b3b8d2 + 61ad94c commit 9c946b6

19 files changed

+708
-28
lines changed

.pep8

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[pep8]
2-
# E111 indentation is not a multiple of four
32
# E121 continuation line under-indented for hanging indent
43
# E122 continuation line missing indentation or outdented
54
# E124 closing bracket does not match visual indentation
@@ -10,8 +9,7 @@
109
# E261 at least two spaces before inline comment
1110
# E262 inline comment should start with '# '
1211
# E265 block comment should start with '# '
13-
# E302 expected 2 blank lines, found 1
1412
# E501 line too long (312 > 160 characters)
1513
# E502 the backslash is redundant between brackets
16-
ignore = E111,E121,E122,E123,E124,E125,E126,E127,E128,E261,E262,E265,E302,E501,E502
17-
max-line-length = 160
14+
ignore = E121,E122,E124,E125,E126,E127,E128,E261,E262,E265,E501,E502
15+
max-line-length = 160

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## v0.5.12
4+
Released 25 February 2016
5+
6+
This is mostly a hotfix update
7+
8+
Highlights:
9+
* Added: Experimental Deluge Support
10+
* Fixed: Some pep8 stuff
11+
* Improved: Use curly braces for pathrender optional variables
12+
13+
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.11...v0.5.12).
14+
315
## v0.5.11
416
Released 20 February 2016
517

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**Master Branch:** [![Build Status](https://travis-ci.org/rembo10/headphones.svg?branch=master)](https://travis-ci.org/rembo10/headphones)
44
**Develop Branch:** [![Build Status](https://travis-ci.org/rembo10/headphones.svg?branch=develop)](https://travis-ci.org/rembo10/headphones)
55

6-
Headphones is an automated music downloader for NZB and Torrent, written in Python. It supports SABnzbd, NZBget, Transmission, µTorrent and Blackhole.
6+
Headphones is an automated music downloader for NZB and Torrent, written in Python. It supports SABnzbd, NZBget, Transmission, µTorrent, Deluge and Blackhole.
77

88
## Support & Discuss
99
You are free to join the Headphones support community on IRC where you can ask questions, hang around and discuss anything related to HP.

data/interfaces/default/config.html

+86-10
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
311311
<input type="radio" name="torrent_downloader" id="torrent_downloader_blackhole" value="0" ${config['torrent_downloader_blackhole']}> Black Hole
312312
<input type="radio" name="torrent_downloader" id="torrent_downloader_transmission" value="1" ${config['torrent_downloader_transmission']}> Transmission
313313
<input type="radio" name="torrent_downloader" id="torrent_downloader_utorrent" value="2" ${config['torrent_downloader_utorrent']}> uTorrent (Beta)
314+
<input type="radio" name="torrent_downloader" id="torrent_downloader_deluge" value="3" ${config['torrent_downloader_deluge']}> Deluge (Beta)
314315
</fieldset>
315316
<fieldset id="torrent_blackhole_options">
316317
<div class="row">
@@ -385,6 +386,35 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
385386
<input type="text" name="utorrent_label" value="${config['utorrent_label']}" size="30">
386387
</div>
387388
</fieldset>
389+
<fieldset id="deluge_options">
390+
<div class="row">
391+
<label>Deluge WebUI Host and Port</label>
392+
<input type="text" name="deluge_host" value="${config['deluge_host']}" size="30">
393+
<small>Usually http://localhost:8112 (requires WebUI plugin)</small>
394+
</div>
395+
<div class="row">
396+
<label>Deluge Password</label>
397+
<input type="password" name="deluge_password" value="${config['deluge_password']}" size="30">
398+
</div>
399+
<div class="row">
400+
<small>Note: With Deluge, you can specify a different download directory for downloads sent from Headphones.
401+
Set it in the Music Download Directory below</small>
402+
</div>
403+
<div class="row">
404+
<label>Deluge Label</label>
405+
<input type="text" name="deluge_label" value="${config['deluge_label']}" size="30">
406+
<small>Labels shouldn't contain spaces (requires Label plugin)</small>
407+
</div>
408+
<div class="row">
409+
<label>Move When Completed</label>
410+
<input type="text" name="deluge_done_directory" value="${config['deluge_done_directory']}" size="30">
411+
<small>Directory where Deluge should move completed downloads</small>
412+
</div>
413+
<div class="row checkbox">
414+
<label>Add Torrent Paused</label>
415+
<input type="checkbox" name="deluge_paused" value="1" ${config['deluge_paused']}>
416+
</div>
417+
</fieldset>
388418
<fieldset id="general_torrent_options">
389419
<div class="row">
390420
<label>Minimum seeders</label>
@@ -858,7 +888,7 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
858888
<div class="row">
859889
as <input type="text" class="override-float" name="album_art_format" value="${config['album_art_format']}" size="10">.jpg
860890
</div>
861-
<small>Use $Artist/$artist, $Album/$album, $Year/$year</small>
891+
<small>Use $Artist/$artist, $Album/$album, $Year/$year, put optional variables in square brackets, use single-quote marks to escape square brackets literally ('[', ']').</small>
862892
</div>
863893
<div class="row checkbox left clearfix nopad">
864894
<label>
@@ -1222,6 +1252,23 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
12221252
</div>
12231253
</fieldset>
12241254

1255+
<fieldset>
1256+
<div class="row checkbox left">
1257+
<input type="checkbox" class="bigcheck" name="telegram_enabled" id="telegram" value="1" ${config['telegram_enabled']} /><label for="telegram"><span class="option">Telegram</span></label>
1258+
</div>
1259+
<div id="telegramoptions">
1260+
<div class="row">
1261+
<label>Bot Token</label><input type="text" name="telegram_token" value="${config['telegram_token']}" size="50"><small>Contact <a href="http://telegram.me/BotFather">@BotFather</a> to create a bot and get its token</small>
1262+
</div>
1263+
<div class="row">
1264+
<label>User ID</label><input type="text" name="telegram_userid" value="${config['telegram_userid']}" size="50"><small>Contact <a href="http://telegram.me/myidbot">@myidbot</a> to get your user ID</small>
1265+
</div>
1266+
<div class="row checkbox">
1267+
<input type="checkbox" name="telegram_onsnatch" value="1" ${config['telegram_onsnatch']} /><label>Notify on snatch?</label>
1268+
</div>
1269+
</div>
1270+
</fieldset>
1271+
12251272
</td>
12261273
</tr>
12271274
</table>
@@ -1236,14 +1283,13 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
12361283
<div class="row">
12371284
<label>Folder Format</label>
12381285
<input type="text" name="folder_format" value="${config['folder_format']}" size="43">
1239-
<small>Use: $Artist/$artist, $SortArtist/$sortartist, $Album/$album, $Year/$year, $Type/$type (release type) and $First/$first (first letter in artist name), $OriginalFolder/$originalfolder (downloaded directory name)
1240-
E.g.: $Type/$First/$artist/$album [$year] = Album/G/girl talk/all day [2010]</small>
1286+
<small>Use: $Artist/$artist, $SortArtist/$sortartist, $Album/$album, $Year/$year, $Type/$type (release type) and $First/$first (first letter in artist name), $OriginalFolder/$originalfolder (downloaded directory name). Put optional variables in square brackets, use single-quote marks to escape square brackets literally ('[', ']').<br>E.g.: $Type/$First/$artist/$album '['$year']' = Album/G/girl talk/all day [2010]</small>
12411287

12421288
</div>
12431289
<div class="row">
12441290
<label>File Format</label>
12451291
<input type="text" name="file_format" value="${config['file_format']}" size="43">
1246-
<small>Use: $Disc/$disc (disc #), $Track/$track (track #), $Title/$title, $Artist/$artist, $Album/$album and $Year/$year</small>
1292+
<small>Use: $Disc/$disc (disc #), $Track/$track (track #), $Title/$title, $Artist/$artist, $Album/$album and $Year/$year. Put optional variables in square brackets, use single-quote marks to escape square brackets literally ('[', ']').</small>
12471293
</div>
12481294
<div class="checkbox row clearfix">
12491295
<input type="checkbox" name="file_underscores" id="file_underscores" value="1" ${config['file_underscores']}/><label>Use underscores instead of spaces</label>
@@ -2003,6 +2049,26 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
20032049
}
20042050
});
20052051

2052+
if ($("#telegram").is(":checked"))
2053+
{
2054+
$("#telegramoptions").show();
2055+
}
2056+
else
2057+
{
2058+
$("#telegramoptions").hide();
2059+
}
2060+
2061+
$("#telegram").click(function(){
2062+
if ($("#telegram").is(":checked"))
2063+
{
2064+
$("#telegramoptions").slideDown();
2065+
}
2066+
else
2067+
{
2068+
$("#telegramoptions").slideUp();
2069+
}
2070+
});
2071+
20062072
if ($("#osx_notify").is(":checked"))
20072073
{
20082074
$("#osx_notify_options").show();
@@ -2159,19 +2225,25 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
21592225

21602226
if ($("#torrent_downloader_blackhole").is(":checked"))
21612227
{
2162-
$("#transmission_options,#utorrent_options").hide();
2228+
$("#transmission_options,#utorrent_options,#deluge_options").hide();
21632229
$("#torrent_blackhole_options").show();
21642230
}
21652231
if ($("#torrent_downloader_transmission").is(":checked"))
21662232
{
2167-
$("#torrent_blackhole_options,#utorrent_options").hide();
2233+
$("#torrent_blackhole_options,#utorrent_options,#deluge_options").hide();
21682234
$("#transmission_options").show();
21692235
}
21702236
if ($("#torrent_downloader_utorrent").is(":checked"))
21712237
{
2172-
$("#torrent_blackhole_options,#transmission_options").hide();
2238+
$("#torrent_blackhole_options,#transmission_options,#deluge_options").hide();
21732239
$("#utorrent_options").show();
21742240
}
2241+
if ($("#torrent_downloader_deluge").is(":checked"))
2242+
{
2243+
$("#torrent_blackhole_options,#transmission_options,#utorrent_options").hide();
2244+
$("#deluge_options").show();
2245+
}
2246+
21752247

21762248
$('input[type=radio]').change(function(){
21772249
if ($("#preferred_bitrate").is(":checked"))
@@ -2208,15 +2280,19 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
22082280
}
22092281
if ($("#torrent_downloader_blackhole").is(":checked"))
22102282
{
2211-
$("#transmission_options,#utorrent_options").fadeOut("fast", function() { $("#torrent_blackhole_options").fadeIn() });
2283+
$("#transmission_options,#utorrent_options,#deluge_options").fadeOut("fast", function() { $("#torrent_blackhole_options").fadeIn() });
22122284
}
22132285
if ($("#torrent_downloader_transmission").is(":checked"))
22142286
{
2215-
$("#torrent_blackhole_options,#utorrent_options").fadeOut("fast", function() { $("#transmission_options").fadeIn() });
2287+
$("#torrent_blackhole_options,#utorrent_options,#deluge_options").fadeOut("fast", function() { $("#transmission_options").fadeIn() });
22162288
}
22172289
if ($("#torrent_downloader_utorrent").is(":checked"))
22182290
{
2219-
$("#torrent_blackhole_options,#transmission_options").fadeOut("fast", function() { $("#utorrent_options").fadeIn() });
2291+
$("#torrent_blackhole_options,#transmission_options,#deluge_options").fadeOut("fast", function() { $("#utorrent_options").fadeIn() });
2292+
}
2293+
if ($("#torrent_downloader_deluge").is(":checked"))
2294+
{
2295+
$("#torrent_blackhole_options,#utorrent_options,#transmission_options").fadeOut("fast", function() { $("#deluge_options").fadeIn() });
22202296
}
22212297
});
22222298

headphones/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494

9595
UMASK = None
9696

97+
9798
def initialize(config_file):
9899
with INIT_LOCK:
99100

headphones/albumart_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import headphones.albumart
66

7+
78
# no tests...
89
class AlbumArtTest(TestCase):
910
def test_nothing(self):

headphones/config.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def bool_int(value):
1515
value = 0
1616
return int(bool(value))
1717

18+
1819
class path(str):
1920
"""Internal 'marker' type for paths in config."""
2021

@@ -66,7 +67,12 @@ def __repr__(self):
6667
'CUSTOMSLEEP': (int, 'General', 1),
6768
'CUSTOMUSER': (str, 'General', ''),
6869
'DELETE_LOSSLESS_FILES': (int, 'General', 1),
69-
'DESTINATION_DIR': (path, 'General', ''),
70+
'DELUGE_HOST': (str, 'Deluge', ''),
71+
'DELUGE_PASSWORD': (str, 'Deluge', ''),
72+
'DELUGE_LABEL': (str, 'Deluge', ''),
73+
'DELUGE_DONE_DIRECTORY': (str, 'Deluge', ''),
74+
'DELUGE_PAUSED': (int, 'Deluge', 0),
75+
'DESTINATION_DIR': (str, 'General', ''),
7076
'DETECT_BITRATE': (int, 'General', 0),
7177
'DO_NOT_PROCESS_UNMATCHED': (int, 'General', 0),
7278
'DOWNLOAD_DIR': (path, 'General', ''),
@@ -248,7 +254,11 @@ def __repr__(self):
248254
'SUBSONIC_PASSWORD': (str, 'Subsonic', ''),
249255
'SUBSONIC_USERNAME': (str, 'Subsonic', ''),
250256
'SYNOINDEX_ENABLED': (int, 'Synoindex', 0),
251-
'TORRENTBLACKHOLE_DIR': (path, 'General', ''),
257+
'TELEGRAM_TOKEN': (str, 'Telegram', ''),
258+
'TELEGRAM_USERID': (str, 'Telegram', ''),
259+
'TELEGRAM_ENABLED': (int, 'Telegram', 0),
260+
'TELEGRAM_ONSNATCH': (int, 'Telegram', 0),
261+
'TORRENTBLACKHOLE_DIR': (str, 'General', ''),
252262
'TORRENT_DOWNLOADER': (int, 'General', 0),
253263
'TORRENT_REMOVAL_INTERVAL': (int, 'General', 720),
254264
'TORZNAB': (int, 'Torznab', 0),

headphones/config_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import unittestcompat
66
from unittestcompat import TestCase, TestArgs
77

8+
89
class ConfigApiTest(TestCase):
910
""" Common tests for headphones.Config
1011

0 commit comments

Comments
 (0)