Skip to content

Commit

Permalink
v0.5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
rembo10 committed Sep 5, 2015
2 parents 24165fb + b1ec750 commit 6720575
Show file tree
Hide file tree
Showing 37 changed files with 1,602 additions and 982 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## v0.5.9
Released 05 September 2015

Highlights:
* Added: Providers Strike, Jackett, custom Torznabs
* Added: Option to stop post-processing if no good match found (#2343)
* Fixed: Blackhole -> Magnet, limit to torcache
* Fixed: Kat 403 flac error
* Fixed: Last.fm errors
* Fixed: Pushover notifications
* Improved: Rutracker logging, switched to requests lib

The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.6...v0.5.7).

## v0.5.8
Released 13 July 2015

Expand Down
126 changes: 109 additions & 17 deletions data/interfaces/default/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -533,22 +533,6 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
</div>
</fieldset>

<fieldset>
<div class="row checkbox left">
<input id="use_oldpiratebay" type="checkbox" class="bigcheck" name="use_oldpiratebay" value="1" ${config['use_oldpiratebay']} /><label for="use_oldpiratebay"><span class="option">Old Pirate Bay</span></label>
</div>
<div class="config">
<div class="row">
<label>URL</label>
<input type="text" name="oldpiratebay_url" value="${config['oldpiratebay_url']}" size="36">
</div>
<div class="row">
<label>Seed Ratio</label>
<input type="text" class="override-float" name="oldpiratebay_ratio" value="${config['oldpiratebay_ratio']}" size="10" title="Stop seeding when ratio met, 0 = unlimited. Scheduled job will remove torrent when post processed and finished seeding.">
</div>
</div>
</fieldset>

<fieldset>
<div class="row checkbox left">
<input id="use_kat" type="checkbox" class="bigcheck" name="use_kat" value="1" ${config['use_kat']} /><label for="use_kat"><span class="option">Kick Ass Torrents</span></label>
Expand Down Expand Up @@ -626,6 +610,87 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
</div>
</fieldset>

<fieldset>
<div class="row checkbox left">
<input id="use_strike" type="checkbox" class="bigcheck" name="use_strike" value="1" ${config['use_strike']} /><label for="use_strike"><span class="option">Strike Search</span></label>
</div>
<div class="config">
<div class="row">
<label>Seed Ratio</label>
<input type="text" class="override-float" name="strike_ratio" value="${config['strike_ratio']}" size="10" title="Stop seeding when ratio met, 0 = unlimited. Scheduled job will remove torrent when post processed and finished seeding.">
</div>
</div>
</fieldset>

<fieldset>
<div class="row checkbox left">
<input id="use_torznab" type="checkbox" class="bigcheck" name="use_torznab" value="1" ${config['use_torznab']} /><label for="use_torznab"><span class="option">Jackett / Torznab Providers</span></label>
</div>
<div id="torznab_providers">
<div class="config" id="torznab1">
<div class="row">
<label>Torznab Host</label>
<input type="text" name="torznab_host" value="${config['torznab_host']}" size="30">
<small>e.g. http://localhost:9117/torznab/iptorrents</small>
</div>
<div class="row">
<label>Torznab API</label>
<input type="text" name="torznab_apikey" value="${config['torznab_apikey']}" size="36">
</div>
<div class="row checkbox">
<input id="torznab_enabled" type="checkbox" name="torznab_enabled" value="1" ${config['torznab_enabled']} /><label>Enabled</label>
</div>
</div>
<%
torznab_number = 2
%>
%for torznab in config['extra_torznabs']:
<%
if torznab[2] == '1' or torznab[2] == 1:
torznab_enabled = "checked"
else:
torznab_enabled = ""
%>
<div class="config" id="torznab${torznab_number}">
<div class="row">
<label>Torznab Host</label>
<input type="text" name="torznab_host${torznab_number}" value="${torznab[0]}" size="30">
</div>
<div class="row">
<label>Torznab API</label>
<input type="text" name="torznab_api${torznab_number}" value="${torznab[1]}" size="36">
</div>
<div class="row checkbox">
<input id="torznab_enabled" type="checkbox" name="torznab_enabled${torznab_number}" value="1" ${torznab_enabled} /><label>Enabled</label>
</div>
<div class="row">
<input type="button" class="remove_torznab" id="torznab${torznab_number}" value="Remove ${torznab[0]}">
</div>
</div>
<%
torznab_number += 1
%>
%endfor
<input type="button" value="Add Torznab" class="add_torznab" id="add_torznab" />
</div>
</fieldset>

<fieldset>
<div class="row checkbox left">
<input id="use_oldpiratebay" type="checkbox" class="bigcheck" name="use_oldpiratebay" value="1" ${config['use_oldpiratebay']} /><label for="use_oldpiratebay"><span class="option">Old Pirate Bay</span></label>
</div>
<div class="config">
<div class="row">
<label>URL</label>
<input type="text" name="oldpiratebay_url" value="${config['oldpiratebay_url']}" size="36">
</div>
<div class="row">
<label>Seed Ratio</label>
<input type="text" class="override-float" name="oldpiratebay_ratio" value="${config['oldpiratebay_ratio']}" size="10" title="Stop seeding when ratio met, 0 = unlimited. Scheduled job will remove torrent when post processed and finished seeding.">
</div>
</div>
</fieldset>

<fieldset>
<div class="row checkbox left">
<input id="use_mininova" type="checkbox" class="bigcheck" name="use_mininova" value="1" ${config['use_mininova']} /><label for="use_mininova"><span class="option">Mininova</span></label>
Expand Down Expand Up @@ -683,7 +748,7 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
</div>
<div id="preferred_bitrate_options" class="suboptions">
<div class="row nopad">
Target bitrate:
Target bitrate:
<input type="text" class="override-float" name="preferred_bitrate" value="${config['preferred_bitrate']}" size="3">kbps<br>
</div>
<div class="row nopad">
Expand Down Expand Up @@ -1393,6 +1458,10 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
<input type="checkbox" name="freeze_db" id="freeze_db" value="1" ${config['freeze_db']} />
</label>
</div>
<div class="row checkbox left clearfix nopad">
<label><input type="checkbox" title="Stop post-processing if no good metadata match found"
name="do_not_process_unmatched" value="1" ${config['do_not_process_unmatched']} />Stop post-processing if no good metadata match found</label>
</div>
<div class="row checkbox left clearfix">
<label title="Use ID3v2.3 instead of ID3v2.4">
Tag using ID3v2.3 instead of ID3v2.4
Expand Down Expand Up @@ -2157,6 +2226,13 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
deletedNewznabs = deletedNewznabs + 1;
});

var deletedTorznabs = 0;

$(".remove_torznab").click(function() {
$(this).parent().parent().remove();
deletedTorznabs = deletedTorznabs + 1;
});

$("#modify_extras").click(openExtrasDialog);

$("#include_extras").click(function(){
Expand Down Expand Up @@ -2190,6 +2266,20 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
$("#add_newznab").before(formfields);
});

$("#add_torznab").click(function() {
var intId = $("#torznab_providers > div").size() + deletedTorznabs + 1;
var formfields = $("<div class=\"config\" id=\"torznab" + intId + "\"><div class=\"row\"><label>Torznab Host</label><input type=\"text\" name=\"torznab_host" + intId + "\" size=\"30\"></div><div class=\"row\"><label>Torznab API</label><input type=\"text\" name=\"torznab_api" + intId + "\" size=\"36\"></div><div class=\"row checkbox\"><input type=\"checkbox\" name=\"torznab_enabled" + intId + "\" value=\"1\" checked /><label>Enabled</label></div>");
var removeTorznabButton = $("<div class=\"row\"><input type=\"button\" class=\"remove_torznab\" value=\"Remove\" /></div>");
removeTorznabButton.click(function() {
$(this).parent().remove();
deletedTorznabs = deletedTorznabs + 1;

});
formfields.append(removeTorznabButton);
formfields.append("</div>");
$("#add_torznab").before(formfields);
});

$(".hpuser").keyup(function() {
$(".hpuser").val($(this).val());
});
Expand All @@ -2206,13 +2296,15 @@ <h1 class="clearfix"><i class="fa fa-gear"></i> Settings</h1>
initConfigCheckbox("#use_newznab");
initConfigCheckbox("#use_nzbsorg");
initConfigCheckbox("#use_omgwtfnzbs");
initConfigCheckbox("#use_torznab");
initConfigCheckbox("#use_kat");
initConfigCheckbox("#use_piratebay");
initConfigCheckbox("#use_oldpiratebay");
initConfigCheckbox("#use_mininova");
initConfigCheckbox("#use_waffles");
initConfigCheckbox("#use_rutracker");
initConfigCheckbox("#use_whatcd");
initConfigCheckbox("#use_strike");
initConfigCheckbox("#api_enabled");
initConfigCheckbox("#enable_https");
initConfigCheckbox("#customauth");
Expand Down
27 changes: 27 additions & 0 deletions headphones/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def bool_int(value):
'DELETE_LOSSLESS_FILES': (int, 'General', 1),
'DESTINATION_DIR': (str, 'General', ''),
'DETECT_BITRATE': (int, 'General', 0),
'DO_NOT_PROCESS_UNMATCHED': (int, 'General', 0),
'DOWNLOAD_DIR': (str, 'General', ''),
'DOWNLOAD_SCAN_INTERVAL': (int, 'General', 5),
'DOWNLOAD_TORRENT_DIR': (str, 'General', ''),
Expand Down Expand Up @@ -81,6 +82,7 @@ def bool_int(value):
'ENCODER_PATH': (str, 'General', ''),
'EXTRAS': (str, 'General', ''),
'EXTRA_NEWZNABS': (list, 'Newznab', ''),
'EXTRA_TORZNABS': (list, 'Torznab', ''),
'FILE_FORMAT': (str, 'General', 'Track Artist - Album [Year] - Title'),
'FILE_PERMISSIONS': (str, 'General', '0644'),
'FILE_UNDERSCORES': (int, 'General', 0),
Expand Down Expand Up @@ -219,6 +221,8 @@ def bool_int(value):
'SONGKICK_ENABLED': (int, 'Songkick', 1),
'SONGKICK_FILTER_ENABLED': (int, 'Songkick', 0),
'SONGKICK_LOCATION': (str, 'Songkick', ''),
'STRIKE': (int, 'Strike', 0),
'STRIKE_RATIO': (str, 'Strike', ''),
'SUBSONIC_ENABLED': (int, 'Subsonic', 0),
'SUBSONIC_HOST': (str, 'Subsonic', ''),
'SUBSONIC_PASSWORD': (str, 'Subsonic', ''),
Expand All @@ -227,6 +231,10 @@ def bool_int(value):
'TORRENTBLACKHOLE_DIR': (str, 'General', ''),
'TORRENT_DOWNLOADER': (int, 'General', 0),
'TORRENT_REMOVAL_INTERVAL': (int, 'General', 720),
'TORZNAB': (int, 'Torznab', 0),
'TORZNAB_APIKEY': (str, 'Torznab', ''),
'TORZNAB_ENABLED': (int, 'Torznab', 1),
'TORZNAB_HOST': (str, 'Torznab', ''),
'TRANSMISSION_HOST': (str, 'Transmission', ''),
'TRANSMISSION_PASSWORD': (str, 'Transmission', ''),
'TRANSMISSION_USERNAME': (str, 'Transmission', ''),
Expand Down Expand Up @@ -351,6 +359,25 @@ def add_extra_newznab(self, newznab):
extra_newznabs.append(item)
self.EXTRA_NEWZNABS = extra_newznabs

def get_extra_torznabs(self):
""" Return the extra torznab tuples """
extra_torznabs = list(
itertools.izip(*[itertools.islice(self.EXTRA_TORZNABS, i, None, 3)
for i in range(3)])
)
return extra_torznabs

def clear_extra_torznabs(self):
""" Forget about the configured extra torznabs """
self.EXTRA_TORZNABS = []

def add_extra_torznab(self, torznab):
""" Add a new extra torznab """
extra_torznabs = self.EXTRA_TORZNABS
for item in torznab:
extra_torznabs.append(item)
self.EXTRA_TORZNABS = extra_torznabs

def __getattr__(self, name):
"""
Returns something from the ini unless it is a real property
Expand Down
4 changes: 2 additions & 2 deletions headphones/lastfm.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def getSimilar():
try:
artist_mbid = artist["mbid"]
artist_name = artist["name"]
except TypeError:
except KeyError:
continue

if not any(artist_mbid in x for x in results):
Expand Down Expand Up @@ -116,7 +116,7 @@ def getArtists():
return

logger.info("Fetching artists from Last.FM for username: %s", headphones.CONFIG.LASTFM_USERNAME)
data = request_lastfm("library.getartists", limit=10000, user=headphones.CONFIG.LASTFM_USERNAME)
data = request_lastfm("library.getartists", limit=1000, user=headphones.CONFIG.LASTFM_USERNAME)

if data and "artists" in data:
artistlist = []
Expand Down
2 changes: 1 addition & 1 deletion headphones/librarysync.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def libraryScan(dir=None, append=False, ArtistID=None, ArtistName=None,
tracks = myDB.select('SELECT Location from alltracks WHERE Location IS NOT NULL UNION SELECT Location from tracks WHERE Location IS NOT NULL')

for track in tracks:
encoded_track_string = track['Location'].encode(headphones.SYS_ENCODING)
encoded_track_string = track['Location'].encode(headphones.SYS_ENCODING, 'replace')
if not os.path.isfile(encoded_track_string):
myDB.action('UPDATE tracks SET Location=?, BitRate=?, Format=? WHERE Location=?', [None, None, None, track['Location']])
myDB.action('UPDATE alltracks SET Location=?, BitRate=?, Format=? WHERE Location=?', [None, None, None, track['Location']])
Expand Down
4 changes: 2 additions & 2 deletions headphones/mb.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def startmb():
mbpass = headphones.CONFIG.CUSTOMPASS
sleepytime = int(headphones.CONFIG.CUSTOMSLEEP)
elif headphones.CONFIG.MIRROR == "headphones":
mbhost = "144.76.94.239"
mbhost = "codeshy.com"
mbport = 8181
mbuser = headphones.CONFIG.HPUSER
mbpass = headphones.CONFIG.HPPASS
Expand Down Expand Up @@ -362,7 +362,7 @@ def getSeries(seriesid):

if not series:
return False

if 'disambiguation' in series:
series_dict['artist_name'] = unicode(series['name'] + " (" + unicode(series['disambiguation']) + ")")
else:
Expand Down
4 changes: 2 additions & 2 deletions headphones/notifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,15 @@ def __init__(self):
self.apikey = headphones.CONFIG.PUSHBULLET_APIKEY
self.deviceid = headphones.CONFIG.PUSHBULLET_DEVICEID

def notify(self, message):
def notify(self, message, status):
if not headphones.CONFIG.PUSHBULLET_ENABLED:
return

url = "https://api.pushbullet.com/v2/pushes"

data = {'type': "note",
'title': "Headphones",
'body': message}
'body': message + ': ' + status}

if self.deviceid:
data['device_iden'] = self.deviceid
Expand Down
Loading

0 comments on commit 6720575

Please sign in to comment.