Skip to content

Commit

Permalink
Remove NMA (NotifyMyAndroid) notifier
Browse files Browse the repository at this point in the history
  • Loading branch information
h3llrais3r committed Oct 29, 2018
1 parent 6b7476e commit a6a22a1
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 255 deletions.
5 changes: 1 addition & 4 deletions autosubliminal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@
PUSHOVERKEY = None
PUSHOVERAPI = None
PUSHOVERDEVICES = None
NOTIFYNMA = None
NMAAPI = None
NMAPRIORITY = None
NOTIFYGROWL = None
GROWLHOST = None
GROWLPORT = None
Expand Down Expand Up @@ -199,7 +196,7 @@ def initialize():
SKIPSHOW, SKIPMOVIE, \
NOTIFY, NOTIFYMAIL, MAILSRV, MAILFROMADDR, MAILTOADDR, MAILUSERNAME, MAILPASSWORD, MAILSUBJECT, MAILAUTH, \
MAILENCRYPTION, NOTIFYTWITTER, TWITTERKEY, TWITTERSECRET, NOTIFYPUSHALOT, PUSHALOTAPI, \
NOTIFYPUSHOVER, PUSHOVERKEY, PUSHOVERAPI, PUSHOVERDEVICES, NOTIFYNMA, NMAAPI, NMAPRIORITY, \
NOTIFYPUSHOVER, PUSHOVERKEY, PUSHOVERAPI, PUSHOVERDEVICES, \
NOTIFYGROWL, GROWLHOST, GROWLPORT, GROWLPASS, GROWLPRIORITY, NOTIFYPROWL, PROWLAPI, PROWLPRIORITY, \
NOTIFYPUSHBULLET, PUSHBULLETAPI, NOTIFYTELEGRAM, TELEGRAMBOTAPI, TELEGRAMCHATID, \
POSTPROCESS, POSTPROCESSINDIVIDUAL, POSTPROCESSUTF8ENCODING, SHOWPOSTPROCESSCMD, SHOWPOSTPROCESSCMDARGS, \
Expand Down
22 changes: 0 additions & 22 deletions autosubliminal/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,22 +559,6 @@ def read_config(check_upgrade=False):
else:
autosubliminal.PUSHOVERDEVICES = u''

# Notify My Android
if cfg.has_option('notification', 'notifynma'):
autosubliminal.NOTIFYNMA = cfg.getboolean('notification', 'notifynma')
else:
autosubliminal.NOTIFYNMA = False

if cfg.has_option('notification', 'nmaapi'):
autosubliminal.NMAAPI = cfg.get('notification', 'nmaapi')
else:
autosubliminal.NMAAPI = u'API key'

if cfg.has_option('notification', 'nmapriority'):
autosubliminal.NMAPRIORITY = cfg.getint('notification', 'nmapriority')
else:
autosubliminal.NMAPRIORITY = 0

# Growl
if cfg.has_option('notification', 'notifygrowl'):
autosubliminal.NOTIFYGROWL = cfg.getboolean('notification', 'notifygrowl')
Expand Down Expand Up @@ -665,9 +649,6 @@ def read_config(check_upgrade=False):
autosubliminal.PUSHOVERKEY = u'user key'
autosubliminal.PUSHOVERAPI = u'API key'
autosubliminal.PUSHOVERDEVICES = u''
autosubliminal.NOTIFYNMA = False
autosubliminal.NMAAPI = u'API key'
autosubliminal.NMAPRIORITY = 0
autosubliminal.NOTIFYGROWL = False
autosubliminal.GROWLHOST = u'127.0.0.1'
autosubliminal.GROWLPORT = 23053
Expand Down Expand Up @@ -1102,9 +1083,6 @@ def write_notification_section():
cfg.set(section, 'pushoverkey', autosubliminal.PUSHOVERKEY)
cfg.set(section, 'pushoverapi', autosubliminal.PUSHOVERAPI)
cfg.set(section, 'pushoverdevices', autosubliminal.PUSHOVERDEVICES)
cfg.set(section, 'notifynma', text_type(autosubliminal.NOTIFYNMA))
cfg.set(section, 'nmaapi', autosubliminal.NMAAPI)
cfg.set(section, 'nmapriority', autosubliminal.NMAPRIORITY)
cfg.set(section, 'notifygrowl', text_type(autosubliminal.NOTIFYGROWL))
cfg.set(section, 'growlhost', autosubliminal.GROWLHOST)
cfg.set(section, "growlport", text_type(autosubliminal.GROWLPORT))
Expand Down
2 changes: 1 addition & 1 deletion autosubliminal/notifiers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def _get_notifier_instance(library_name):

# Supported notifier libraries must be added here
# The name in the list must match the name of the library module
_notifier_libraries = ['growl', 'mail', 'nma', 'prowl', 'pushalot', 'pushbullet', 'pushover', 'telegram', 'twitter']
_notifier_libraries = ['growl', 'mail', 'prowl', 'pushalot', 'pushbullet', 'pushover', 'telegram', 'twitter']

# Dict of notifiers (key=name, value=notifier_instance)
_notifiers = dict((name, _get_notifier_instance(name)) for name in _notifier_libraries)
Expand Down
72 changes: 0 additions & 72 deletions autosubliminal/notifiers/nma.py

This file was deleted.

4 changes: 0 additions & 4 deletions autosubliminal/server/web/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ def save(self, notify,
notifytwitter, twitterkey, twittersecret,
notifypushalot, pushalotapi,
notifypushover, pushoverkey, pushoverapi, pushoverdevices,
notifynma, nmaapi, nmapriority,
notifygrowl, growlhost, growlport, growlpass, growlpriority,
notifyprowl, prowlapi, prowlpriority,
notifypushbullet, pushbulletapi,
Expand All @@ -345,9 +344,6 @@ def save(self, notify,
autosubliminal.PUSHOVERKEY = pushoverkey
autosubliminal.PUSHOVERAPI = pushoverapi
autosubliminal.PUSHOVERDEVICES = pushoverdevices
autosubliminal.NOTIFYNMA = get_boolean(notifynma)
autosubliminal.NMAAPI = nmaapi
autosubliminal.NMAPRIORITY = nmapriority
autosubliminal.NOTIFYGROWL = get_boolean(notifygrowl)
autosubliminal.GROWLHOST = growlhost
autosubliminal.GROWLPORT = int(growlport)
Expand Down
64 changes: 0 additions & 64 deletions tests/notifiers/test_nma.py

This file was deleted.

Binary file removed web/static/images/notifiers/nma.png
Binary file not shown.
88 changes: 0 additions & 88 deletions web/templates/config/config-notification.mako
Original file line number Diff line number Diff line change
Expand Up @@ -505,94 +505,6 @@
</span>
</div>
<div class="form-group section-title">
<div class="col-xs-12 col-md-9">
<span class="badge">Notify My Android</span>
<a href="https://www.notifymyandroid.com/" target="_blank">
<img class="img-notifier" src="${autosubliminal.WEBROOT}/images/notifiers/nma.png" alt="nma" title="nma">
</a>
</div>
</div>
<div class="form-group narrow">
<span class="col-xs-4 col-md-3">
<label for="notifynma">Notify
<span class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-info-circle" aria-hidden="true" title="Click for more info"></i>
</a>
<ul class="dropdown-menu has-tip info-list">
<li>When enabled, a Notify My Android notification will be sent when a subtitle has been downloaded.</li>
</ul>
</span>
</label>
</span>
<span class="col-xs-8 col-md-6">
<select id="notifynma" name="notifynma" class="form-control input-sm">
% if autosubliminal.NOTIFYNMA:
<option value="True" selected="selected">Enabled</option>
<option value="False">Disabled</option>
% else:
<option value="True">Enabled</option>
<option value="False" selected="selected">Disabled</option>
% endif
</select>
</span>
</div>
<div class="form-group narrow">
<span class="col-xs-4 col-md-3">
<label for="nmaapi">API key
<span class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-info-circle" aria-hidden="true" title="Click for more info"></i>
</a>
<ul class="dropdown-menu has-tip info-list">
<li>The API key for Notify My Android.</li>
</ul>
</span>
</label>
</span>
<span class="col-xs-8 col-md-6">
<input type="text" value="${autosubliminal.NMAAPI}" id="nmaapi" name="nmaapi" class="form-control input-sm">
</span>
</div>
<div class="form-group narrow">
<span class="col-xs-4 col-md-3">
<label for="nmapriority">Priority
<span class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-info-circle" aria-hidden="true" title="Click for more info"></i>
</a>
<ul class="dropdown-menu has-tip info-list">
<li>The priority for the Notify My Android notification.</li>
</ul>
</span>
</label>
</span>
<span class="col-xs-8 col-md-6">
<% priormapper = {-2 : 'Very Low', -1 : 'Moderate', 0 : 'Normal', 1 : 'High', 2 : 'Emergency'} %>
<select id="nmapriority" name="nmapriority" class="form-control input-sm">
% for prior in list(range(-2, 3, 1)):
% if prior == autosubliminal.NMAPRIORITY:
<option value="${prior}" selected="selected">${priormapper[prior]}</option>
% else:
<option value="${prior}">${priormapper[prior]}</option>
% endif
% endfor
</select>
</span>
</div>
<div class="form-group narrow">
<span class="col-xs-4 col-md-3"></span>
<span class="col-xs-8 col-md-6">
<a href="${autosubliminal.WEBROOT}/config/notification/test/nma" class="btn btn-sm btn-default btn-test">Test</a>
<a href="${saveUrl}" class="btn btn-sm btn-default btn-save">Save</a>
</span>
</div>
<div class="form-group section-title">
<div class="col-xs-12 col-md-9">
<span class="badge">Growl</span>
Expand Down

0 comments on commit a6a22a1

Please sign in to comment.