mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-20 03:39:26 +00:00
Boxcar removed
This commit is contained in:
@@ -992,20 +992,6 @@
|
||||
<table class="configtable" summary="Notifications">
|
||||
<tr>
|
||||
<td>
|
||||
<fieldset>
|
||||
<div class="row checkbox left">
|
||||
<input type="checkbox" class="bigcheck" name="boxcar_enabled" id="boxcar" value="1" ${config['boxcar_enabled']} /><label for="boxcar"><span class="option">Boxcar 2</span></label>
|
||||
</div>
|
||||
<div id="boxcar_options">
|
||||
<div class="row">
|
||||
<label>Access Token</label><input type="text" name="boxcar_token" value="${config['boxcar_token']}" size="35">
|
||||
</div>
|
||||
<div class="row checkbox">
|
||||
<input type="checkbox" name="boxcar_onsnatch" value="1" ${config['boxcar_onsnatch']} /><label>Notify on snatch?</label>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<div class="row checkbox left">
|
||||
<input type="checkbox" class="bigcheck" name="email_enabled" id="email" value="1" ${config['email_enabled']} /><label for="email"><span class="option">Email</span></label>
|
||||
@@ -2274,25 +2260,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
if ($("#boxcar").is(":checked"))
|
||||
{
|
||||
$("#boxcar_options").show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#boxcar_options").hide();
|
||||
}
|
||||
|
||||
$("#boxcar").click(function(){
|
||||
if ($("#boxcar").is(":checked"))
|
||||
{
|
||||
$("#boxcar_options").slideDown();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#boxcar_options").slideUp();
|
||||
}
|
||||
});
|
||||
|
||||
if ($("#subsonic").is(":checked"))
|
||||
{
|
||||
@@ -2603,11 +2570,6 @@
|
||||
$('#ajaxMsg').addClass('success').fadeIn().delay(3000).fadeOut();
|
||||
});
|
||||
|
||||
$('#osxnotifyregister').click(function () {
|
||||
var osx_notify_app = $("#osx_notify_reg").val();
|
||||
$.get("/osxnotifyregister", {'app': osx_notify_app}, function (data) { $('#ajaxMsg').html("<div class='msg'><span class='ui-icon ui-icon-check'></span>"+data+"</div>"); });
|
||||
$('#ajaxMsg').addClass('success').fadeIn().delay(3000).fadeOut()
|
||||
})
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -54,9 +54,6 @@ _CONFIG_DEFINITIONS = {
|
||||
'BITRATE': (int, 'General', 192),
|
||||
'BLACKHOLE': (int, 'General', 0),
|
||||
'BLACKHOLE_DIR': (path, 'General', ''),
|
||||
'BOXCAR_ENABLED': (int, 'Boxcar', 0),
|
||||
'BOXCAR_ONSNATCH': (int, 'Boxcar', 0),
|
||||
'BOXCAR_TOKEN': (str, 'Boxcar', ''),
|
||||
'CACHE_DIR': (path, 'General', ''),
|
||||
'CACHE_SIZEMB': (int, 'Advanced', 32),
|
||||
'CHECK_GITHUB': (int, 'General', 1),
|
||||
|
||||
@@ -849,35 +849,6 @@ class OSX_NOTIFY(object):
|
||||
return False
|
||||
|
||||
|
||||
class BOXCAR(object):
|
||||
def __init__(self):
|
||||
self.url = 'https://new.boxcar.io/api/notifications'
|
||||
|
||||
def notify(self, title, message, rgid=None):
|
||||
try:
|
||||
if rgid:
|
||||
message += '<br></br><a href="https://musicbrainz.org/' \
|
||||
'release-group/%s">MusicBrainz</a>' % rgid
|
||||
|
||||
data = urllib.parse.urlencode({
|
||||
'user_credentials': headphones.CONFIG.BOXCAR_TOKEN,
|
||||
'notification[title]': title.encode('utf-8'),
|
||||
'notification[long_message]': message.encode('utf-8'),
|
||||
'notification[sound]': "done",
|
||||
'notification[icon_url]': "https://raw.githubusercontent.com/rembo10/headphones/master/data/images"
|
||||
"/headphoneslogo.png"
|
||||
})
|
||||
|
||||
req = urllib.request.Request(self.url)
|
||||
handle = urllib.request.urlopen(req, data)
|
||||
handle.close()
|
||||
return True
|
||||
|
||||
except urllib.error.URLError as e:
|
||||
logger.warn('Error sending Boxcar2 Notification: %s' % e)
|
||||
return False
|
||||
|
||||
|
||||
class SubSonicNotifier(object):
|
||||
def __init__(self):
|
||||
self.host = headphones.CONFIG.SUBSONIC_HOST
|
||||
|
||||
@@ -627,12 +627,6 @@ def doPostProcessing(albumid, albumpath, release, tracks, downloaded_track_list,
|
||||
osx = notifiers.OSX_NOTIFY()
|
||||
osx.notify(f"Headphones Processed", f"{pushmessage}\n{statusmessage}")
|
||||
|
||||
if headphones.CONFIG.BOXCAR_ENABLED:
|
||||
logger.info("Sending Boxcar2 notification")
|
||||
boxcar = notifiers.BOXCAR()
|
||||
boxcar.notify('Headphones processed: ' + pushmessage,
|
||||
statusmessage, release['AlbumID'])
|
||||
|
||||
if headphones.CONFIG.SUBSONIC_ENABLED:
|
||||
logger.info("Sending Subsonic update")
|
||||
subsonic = notifiers.SubSonicNotifier()
|
||||
|
||||
@@ -1234,11 +1234,6 @@ def send_to_downloader(data, result, album):
|
||||
osx = notifiers.OSX_NOTIFY()
|
||||
osx.notify(f"Headphones Snatched", f"{artist} - {albumname}\nFrom {provider}, {name}")
|
||||
|
||||
if headphones.CONFIG.BOXCAR_ENABLED and headphones.CONFIG.BOXCAR_ONSNATCH:
|
||||
logger.info("Sending Boxcar2 notification")
|
||||
b2msg = 'From ' + provider + '<br></br>' + name
|
||||
boxcar = notifiers.BOXCAR()
|
||||
boxcar.notify('Headphones snatched: ' + title, b2msg, rgid)
|
||||
if headphones.CONFIG.EMAIL_ENABLED and headphones.CONFIG.EMAIL_ONSNATCH:
|
||||
logger.info("Sending Email notification")
|
||||
email = notifiers.Email()
|
||||
|
||||
@@ -1369,9 +1369,6 @@ class WebInterface(object):
|
||||
"twitter_onsnatch": checked(headphones.CONFIG.TWITTER_ONSNATCH),
|
||||
"osx_notify_enabled": checked(headphones.CONFIG.OSX_NOTIFY_ENABLED),
|
||||
"osx_notify_onsnatch": checked(headphones.CONFIG.OSX_NOTIFY_ONSNATCH),
|
||||
"boxcar_enabled": checked(headphones.CONFIG.BOXCAR_ENABLED),
|
||||
"boxcar_onsnatch": checked(headphones.CONFIG.BOXCAR_ONSNATCH),
|
||||
"boxcar_token": headphones.CONFIG.BOXCAR_TOKEN,
|
||||
"mirrorlist": headphones.MIRRORLIST,
|
||||
"mirror": headphones.CONFIG.MIRROR,
|
||||
"customhost": headphones.CONFIG.CUSTOMHOST,
|
||||
@@ -1479,7 +1476,7 @@ class WebInterface(object):
|
||||
"pushover_onsnatch", "pushbullet_enabled", "pushbullet_onsnatch", "subsonic_enabled",
|
||||
"twitter_enabled", "twitter_onsnatch",
|
||||
"telegram_enabled", "telegram_onsnatch",
|
||||
"osx_notify_enabled", "osx_notify_onsnatch", "boxcar_enabled", "boxcar_onsnatch",
|
||||
"osx_notify_enabled", "osx_notify_onsnatch",
|
||||
"songkick_enabled", "songkick_filter_enabled",
|
||||
"mpc_enabled", "email_enabled", "email_ssl", "email_tls", "email_onsnatch",
|
||||
"customauth", "idtag", "deluge_paused",
|
||||
|
||||
Reference in New Issue
Block a user