Ejemplo n.º 1
0
    def post(self, *args, **kwargs):
        use_kodi = self.get_argument('use_kodi', None)
        kodi_always_on = self.get_argument('kodi_always_on', None)
        kodi_notify_onsnatch = self.get_argument('kodi_notify_onsnatch', None)
        kodi_notify_ondownload = self.get_argument('kodi_notify_ondownload', None)
        kodi_notify_onsubtitledownload = self.get_argument('kodi_notify_onsubtitledownload', None)
        kodi_update_onlyfirst = self.get_argument('kodi_update_onlyfirst', None)
        kodi_update_library = self.get_argument('kodi_update_library', None)
        kodi_update_full = self.get_argument('kodi_update_full', None)
        kodi_host = self.get_argument('kodi_host', None)
        kodi_username = self.get_argument('kodi_username', None)
        kodi_password = self.get_argument('kodi_password', None)
        use_plex = self.get_argument('use_plex', None)
        plex_notify_onsnatch = self.get_argument('plex_notify_onsnatch', None)
        plex_notify_ondownload = self.get_argument('plex_notify_ondownload', None)
        plex_notify_onsubtitledownload = self.get_argument('plex_notify_onsubtitledownload', None)
        plex_update_library = self.get_argument('plex_update_library', None)
        plex_server_host = self.get_argument('plex_server_host', None)
        plex_server_token = self.get_argument('plex_server_token', None)
        plex_host = self.get_argument('plex_host', None)
        plex_username = self.get_argument('plex_username', None)
        plex_password = self.get_argument('plex_password', None)
        use_emby = self.get_argument('use_emby', None)
        emby_notify_onsnatch = self.get_argument('emby_notify_onsnatch', None)
        emby_notify_ondownload = self.get_argument('emby_notify_ondownload', None)
        emby_notify_onsubtitledownload = self.get_argument('emby_notify_onsubtitledownload', None)
        emby_host = self.get_argument('emby_host', None)
        emby_apikey = self.get_argument('emby_apikey', None)
        use_growl = self.get_argument('use_growl', None)
        growl_notify_onsnatch = self.get_argument('growl_notify_onsnatch', None)
        growl_notify_ondownload = self.get_argument('growl_notify_ondownload', None)
        growl_notify_onsubtitledownload = self.get_argument('growl_notify_onsubtitledownload', None)
        growl_host = self.get_argument('growl_host', None)
        growl_password = self.get_argument('growl_password', None)
        use_freemobile = self.get_argument('use_freemobile', None)
        freemobile_notify_onsnatch = self.get_argument('freemobile_notify_onsnatch', None)
        freemobile_notify_ondownload = self.get_argument('freemobile_notify_ondownload', None)
        freemobile_notify_onsubtitledownload = self.get_argument('freemobile_notify_onsubtitledownload', None)
        freemobile_id = self.get_argument('freemobile_id', None)
        freemobile_apikey = self.get_argument('freemobile_apikey', None)
        use_telegram = self.get_argument('use_telegram', None)
        telegram_notify_onsnatch = self.get_argument('telegram_notify_onsnatch', None)
        telegram_notify_ondownload = self.get_argument('telegram_notify_ondownload', None)
        telegram_notify_onsubtitledownload = self.get_argument('telegram_notify_onsubtitledownload', None)
        telegram_id = self.get_argument('telegram_id', None)
        telegram_apikey = self.get_argument('telegram_apikey', None)
        use_join = self.get_argument('use_join', None)
        join_notify_onsnatch = self.get_argument('join_notify_onsnatch', None)
        join_notify_ondownload = self.get_argument('join_notify_ondownload', None)
        join_notify_onsubtitledownload = self.get_argument('join_notify_onsubtitledownload', None)
        join_id = self.get_argument('join_id', None)
        join_apikey = self.get_argument('join_apikey', None)
        use_prowl = self.get_argument('use_prowl', None)
        prowl_notify_onsnatch = self.get_argument('prowl_notify_onsnatch', None)
        prowl_notify_ondownload = self.get_argument('prowl_notify_ondownload', None)
        prowl_notify_onsubtitledownload = self.get_argument('prowl_notify_onsubtitledownload', None)
        prowl_api = self.get_argument('prowl_api', None)
        prowl_priority = self.get_argument('prowl_priority', 0)
        use_twitter = self.get_argument('use_twitter', None)
        twitter_notify_onsnatch = self.get_argument('twitter_notify_onsnatch', None)
        twitter_notify_ondownload = self.get_argument('twitter_notify_ondownload', None)
        twitter_notify_onsubtitledownload = self.get_argument('twitter_notify_onsubtitledownload', None)
        twitter_usedm = self.get_argument('twitter_usedm', None)
        twitter_dmto = self.get_argument('twitter_dmto', None)
        use_twilio = self.get_argument('use_twilio', None)
        twilio_notify_onsnatch = self.get_argument('twilio_notify_onsnatch', None)
        twilio_notify_ondownload = self.get_argument('twilio_notify_ondownload', None)
        twilio_notify_onsubtitledownload = self.get_argument('twilio_notify_onsubtitledownload', None)
        twilio_phone_sid = self.get_argument('twilio_phone_sid', None)
        twilio_account_sid = self.get_argument('twilio_account_sid', None)
        twilio_auth_token = self.get_argument('twilio_auth_token', None)
        twilio_to_number = self.get_argument('twilio_to_number', None)
        use_boxcar2 = self.get_argument('use_boxcar2', None)
        boxcar2_notify_onsnatch = self.get_argument('boxcar2_notify_onsnatch', None)
        boxcar2_notify_ondownload = self.get_argument('boxcar2_notify_ondownload', None)
        boxcar2_notify_onsubtitledownload = self.get_argument('boxcar2_notify_onsubtitledownload', None)
        boxcar2_accesstoken = self.get_argument('boxcar2_accesstoken', None)
        use_pushover = self.get_argument('use_pushover', None)
        pushover_notify_onsnatch = self.get_argument('pushover_notify_onsnatch', None)
        pushover_notify_ondownload = self.get_argument('pushover_notify_ondownload', None)
        pushover_notify_onsubtitledownload = self.get_argument('pushover_notify_onsubtitledownload', None)
        pushover_userkey = self.get_argument('pushover_userkey', None)
        pushover_apikey = self.get_argument('pushover_apikey', None)
        pushover_device = self.get_argument('pushover_device', None)
        pushover_sound = self.get_argument('pushover_sound', None)
        use_libnotify = self.get_argument('use_libnotify', None)
        libnotify_notify_onsnatch = self.get_argument('libnotify_notify_onsnatch', None)
        libnotify_notify_ondownload = self.get_argument('libnotify_notify_ondownload', None)
        libnotify_notify_onsubtitledownload = self.get_argument('libnotify_notify_onsubtitledownload', None)
        use_nmj = self.get_argument('use_nmj', None)
        nmj_host = self.get_argument('nmj_host', None)
        nmj_database = self.get_argument('nmj_database', None)
        nmj_mount = self.get_argument('nmj_mount', None)
        use_synoindex = self.get_argument('use_synoindex', None)
        use_nmjv2 = self.get_argument('use_nmjv2', None)
        nmjv2_host = self.get_argument('nmjv2_host', None)
        nmjv2_dbloc = self.get_argument('nmjv2_dbloc', None)
        nmjv2_database = self.get_argument('nmjv2_database', None)
        use_trakt = self.get_argument('use_trakt', None)
        trakt_username = self.get_argument('trakt_username', None)
        trakt_remove_watchlist = self.get_argument('trakt_remove_watchlist', None)
        trakt_sync_watchlist = self.get_argument('trakt_sync_watchlist', None)
        trakt_remove_show_from_sickrage = self.get_argument('trakt_remove_show_from_sickrage', None)
        trakt_method_add = self.get_argument('trakt_method_add', None)
        trakt_start_paused = self.get_argument('trakt_start_paused', None)
        trakt_use_recommended = self.get_argument('trakt_use_recommended', None)
        trakt_sync = self.get_argument('trakt_sync', None)
        trakt_sync_remove = self.get_argument('trakt_sync_remove', None)
        trakt_default_indexer = self.get_argument('trakt_default_indexer', None)
        trakt_remove_serieslist = self.get_argument('trakt_remove_serieslist', None)
        trakt_timeout = self.get_argument('trakt_timeout', None)
        trakt_blacklist_name = self.get_argument('trakt_blacklist_name', None)
        use_synologynotifier = self.get_argument('use_synologynotifier', None)
        synologynotifier_notify_onsnatch = self.get_argument('synologynotifier_notify_onsnatch', None)
        synologynotifier_notify_ondownload = self.get_argument('synologynotifier_notify_ondownload', None)
        synologynotifier_notify_onsubtitledownload = self.get_argument('synologynotifier_notify_onsubtitledownload', None)
        use_pytivo = self.get_argument('use_pytivo', None)
        pytivo_notify_onsnatch = self.get_argument('pytivo_notify_onsnatch', None)
        pytivo_notify_ondownload = self.get_argument('pytivo_notify_ondownload', None)
        pytivo_notify_onsubtitledownload = self.get_argument('pytivo_notify_onsubtitledownload', None)
        pytivo_update_library = self.get_argument('pytivo_update_library', None)
        pytivo_host = self.get_argument('pytivo_host', None)
        pytivo_share_name = self.get_argument('pytivo_share_name', None)
        pytivo_tivo_name = self.get_argument('pytivo_tivo_name', None)
        use_nma = self.get_argument('use_nma', None)
        nma_notify_onsnatch = self.get_argument('nma_notify_onsnatch', None)
        nma_notify_ondownload = self.get_argument('nma_notify_ondownload', None)
        nma_notify_onsubtitledownload = self.get_argument('nma_notify_onsubtitledownload', None)
        nma_api = self.get_argument('nma_api', None)
        nma_priority = self.get_argument('nma_priority', 0)
        use_pushalot = self.get_argument('use_pushalot', None)
        pushalot_notify_onsnatch = self.get_argument('pushalot_notify_onsnatch', None)
        pushalot_notify_ondownload = self.get_argument('pushalot_notify_ondownload', None)
        pushalot_notify_onsubtitledownload = self.get_argument('pushalot_notify_onsubtitledownload', None)
        pushalot_authorizationtoken = self.get_argument('pushalot_authorizationtoken', None)
        use_pushbullet = self.get_argument('use_pushbullet', None)
        pushbullet_notify_onsnatch = self.get_argument('pushbullet_notify_onsnatch', None)
        pushbullet_notify_ondownload = self.get_argument('pushbullet_notify_ondownload', None)
        pushbullet_notify_onsubtitledownload = self.get_argument('pushbullet_notify_onsubtitledownload', None)
        pushbullet_api = self.get_argument('pushbullet_api', None)
        pushbullet_device_list = self.get_argument('pushbullet_device_list', None)
        use_email = self.get_argument('use_email', None)
        email_notify_onsnatch = self.get_argument('email_notify_onsnatch', None)
        email_notify_ondownload = self.get_argument('email_notify_ondownload', None)
        email_notify_onsubtitledownload = self.get_argument('email_notify_onsubtitledownload', None)
        email_host = self.get_argument('email_host', None)
        email_port = self.get_argument('email_port', 25)
        email_from = self.get_argument('email_from', None)
        email_tls = self.get_argument('email_tls', None)
        email_user = self.get_argument('email_user', None)
        email_password = self.get_argument('email_password', None)
        email_list = self.get_argument('email_list', None)
        use_slack = self.get_argument('use_slack', None)
        slack_notify_onsnatch = self.get_argument('slack_notify_onsnatch', None)
        slack_notify_ondownload = self.get_argument('slack_notify_ondownload', None)
        slack_notify_onsubtitledownload = self.get_argument('slack_notify_onsubtitledownload', None)
        slack_webhook = self.get_argument('slack_webhook', None)
        use_discord = self.get_argument('use_discord', False)
        discord_notify_onsnatch = self.get_argument('discord_notify_onsnatch', None)
        discord_notify_ondownload = self.get_argument('discord_notify_ondownload', None)
        discord_notify_onsubtitledownload = self.get_argument('discord_notify_onsubtitledownload', None)
        discord_webhook = self.get_argument('discord_webhook', None)
        discord_name = self.get_argument('discord_name', None)
        discord_avatar_url = self.get_argument('discord_avatar_url', None)
        discord_tts = self.get_argument('discord_tts', None)

        results = []

        sickrage.app.config.use_kodi = checkbox_to_value(use_kodi)
        sickrage.app.config.kodi_always_on = checkbox_to_value(kodi_always_on)
        sickrage.app.config.kodi_notify_onsnatch = checkbox_to_value(kodi_notify_onsnatch)
        sickrage.app.config.kodi_notify_ondownload = checkbox_to_value(kodi_notify_ondownload)
        sickrage.app.config.kodi_notify_onsubtitledownload = checkbox_to_value(kodi_notify_onsubtitledownload)
        sickrage.app.config.kodi_update_library = checkbox_to_value(kodi_update_library)
        sickrage.app.config.kodi_update_full = checkbox_to_value(kodi_update_full)
        sickrage.app.config.kodi_update_onlyfirst = checkbox_to_value(kodi_update_onlyfirst)
        sickrage.app.config.kodi_host = clean_hosts(kodi_host)
        sickrage.app.config.kodi_username = kodi_username
        sickrage.app.config.kodi_password = kodi_password

        sickrage.app.config.use_plex = checkbox_to_value(use_plex)
        sickrage.app.config.plex_notify_onsnatch = checkbox_to_value(plex_notify_onsnatch)
        sickrage.app.config.plex_notify_ondownload = checkbox_to_value(plex_notify_ondownload)
        sickrage.app.config.plex_notify_onsubtitledownload = checkbox_to_value(plex_notify_onsubtitledownload)
        sickrage.app.config.plex_update_library = checkbox_to_value(plex_update_library)
        sickrage.app.config.plex_host = clean_hosts(plex_host)
        sickrage.app.config.plex_server_host = clean_hosts(plex_server_host)
        sickrage.app.config.plex_server_token = clean_host(plex_server_token)
        sickrage.app.config.plex_username = plex_username
        sickrage.app.config.plex_password = plex_password
        sickrage.app.config.use_plex_client = checkbox_to_value(use_plex)
        sickrage.app.config.plex_client_username = plex_username
        sickrage.app.config.plex_client_password = plex_password

        sickrage.app.config.use_emby = checkbox_to_value(use_emby)
        sickrage.app.config.emby_notify_onsnatch = checkbox_to_value(emby_notify_onsnatch)
        sickrage.app.config.emby_notify_ondownload = checkbox_to_value(emby_notify_ondownload)
        sickrage.app.config.emby_notify_onsubtitledownload = checkbox_to_value(emby_notify_onsubtitledownload)
        sickrage.app.config.emby_host = clean_host(emby_host)
        sickrage.app.config.emby_apikey = emby_apikey

        sickrage.app.config.use_growl = checkbox_to_value(use_growl)
        sickrage.app.config.growl_notify_onsnatch = checkbox_to_value(growl_notify_onsnatch)
        sickrage.app.config.growl_notify_ondownload = checkbox_to_value(growl_notify_ondownload)
        sickrage.app.config.growl_notify_onsubtitledownload = checkbox_to_value(growl_notify_onsubtitledownload)
        sickrage.app.config.growl_host = clean_host(growl_host, default_port=23053)
        sickrage.app.config.growl_password = growl_password

        sickrage.app.config.use_freemobile = checkbox_to_value(use_freemobile)
        sickrage.app.config.freemobile_notify_onsnatch = checkbox_to_value(freemobile_notify_onsnatch)
        sickrage.app.config.freemobile_notify_ondownload = checkbox_to_value(freemobile_notify_ondownload)
        sickrage.app.config.freemobile_notify_onsubtitledownload = checkbox_to_value(freemobile_notify_onsubtitledownload)
        sickrage.app.config.freemobile_id = freemobile_id
        sickrage.app.config.freemobile_apikey = freemobile_apikey

        sickrage.app.config.use_telegram = checkbox_to_value(use_telegram)
        sickrage.app.config.telegram_notify_onsnatch = checkbox_to_value(telegram_notify_onsnatch)
        sickrage.app.config.telegram_notify_ondownload = checkbox_to_value(telegram_notify_ondownload)
        sickrage.app.config.telegram_notify_onsubtitledownload = checkbox_to_value(telegram_notify_onsubtitledownload)
        sickrage.app.config.telegram_id = telegram_id
        sickrage.app.config.telegram_apikey = telegram_apikey

        sickrage.app.config.use_join = checkbox_to_value(use_join)
        sickrage.app.config.join_notify_onsnatch = checkbox_to_value(join_notify_onsnatch)
        sickrage.app.config.join_notify_ondownload = checkbox_to_value(join_notify_ondownload)
        sickrage.app.config.join_notify_onsubtitledownload = checkbox_to_value(join_notify_onsubtitledownload)
        sickrage.app.config.join_id = join_id
        sickrage.app.config.join_apikey = join_apikey

        sickrage.app.config.use_prowl = checkbox_to_value(use_prowl)
        sickrage.app.config.prowl_notify_onsnatch = checkbox_to_value(prowl_notify_onsnatch)
        sickrage.app.config.prowl_notify_ondownload = checkbox_to_value(prowl_notify_ondownload)
        sickrage.app.config.prowl_notify_onsubtitledownload = checkbox_to_value(prowl_notify_onsubtitledownload)
        sickrage.app.config.prowl_api = prowl_api
        sickrage.app.config.prowl_priority = prowl_priority

        sickrage.app.config.use_twitter = checkbox_to_value(use_twitter)
        sickrage.app.config.twitter_notify_onsnatch = checkbox_to_value(twitter_notify_onsnatch)
        sickrage.app.config.twitter_notify_ondownload = checkbox_to_value(twitter_notify_ondownload)
        sickrage.app.config.twitter_notify_onsubtitledownload = checkbox_to_value(twitter_notify_onsubtitledownload)
        sickrage.app.config.twitter_usedm = checkbox_to_value(twitter_usedm)
        sickrage.app.config.twitter_dmto = twitter_dmto

        sickrage.app.config.use_twilio = checkbox_to_value(use_twilio)
        sickrage.app.config.twilio_notify_onsnatch = checkbox_to_value(twilio_notify_onsnatch)
        sickrage.app.config.twilio_notify_ondownload = checkbox_to_value(twilio_notify_ondownload)
        sickrage.app.config.twilio_notify_onsubtitledownload = checkbox_to_value(twilio_notify_onsubtitledownload)
        sickrage.app.config.twilio_phone_sid = twilio_phone_sid
        sickrage.app.config.twilio_account_sid = twilio_account_sid
        sickrage.app.config.twilio_auth_token = twilio_auth_token
        sickrage.app.config.twilio_to_number = twilio_to_number

        sickrage.app.config.use_slack = checkbox_to_value(use_slack)
        sickrage.app.config.slack_notify_onsnatch = checkbox_to_value(slack_notify_onsnatch)
        sickrage.app.config.slack_notify_ondownload = checkbox_to_value(slack_notify_ondownload)
        sickrage.app.config.slack_notify_onsubtitledownload = checkbox_to_value(slack_notify_onsubtitledownload)
        sickrage.app.config.slack_webhook = slack_webhook

        sickrage.app.config.use_discord = checkbox_to_value(use_discord)
        sickrage.app.config.discord_notify_onsnatch = checkbox_to_value(discord_notify_onsnatch)
        sickrage.app.config.discord_notify_ondownload = checkbox_to_value(discord_notify_ondownload)
        sickrage.app.config.discord_notify_onsubtitledownload = checkbox_to_value(discord_notify_onsubtitledownload)
        sickrage.app.config.discord_webhook = discord_webhook
        sickrage.app.config.discord_name = discord_name
        sickrage.app.config.discord_avatar_url = discord_avatar_url
        sickrage.app.config.discord_tts = checkbox_to_value(discord_tts)

        sickrage.app.config.use_boxcar2 = checkbox_to_value(use_boxcar2)
        sickrage.app.config.boxcar2_notify_onsnatch = checkbox_to_value(boxcar2_notify_onsnatch)
        sickrage.app.config.boxcar2_notify_ondownload = checkbox_to_value(boxcar2_notify_ondownload)
        sickrage.app.config.boxcar2_notify_onsubtitledownload = checkbox_to_value(boxcar2_notify_onsubtitledownload)
        sickrage.app.config.boxcar2_accesstoken = boxcar2_accesstoken

        sickrage.app.config.use_pushover = checkbox_to_value(use_pushover)
        sickrage.app.config.pushover_notify_onsnatch = checkbox_to_value(pushover_notify_onsnatch)
        sickrage.app.config.pushover_notify_ondownload = checkbox_to_value(pushover_notify_ondownload)
        sickrage.app.config.pushover_notify_onsubtitledownload = checkbox_to_value(pushover_notify_onsubtitledownload)
        sickrage.app.config.pushover_userkey = pushover_userkey
        sickrage.app.config.pushover_apikey = pushover_apikey
        sickrage.app.config.pushover_device = pushover_device
        sickrage.app.config.pushover_sound = pushover_sound

        sickrage.app.config.use_libnotify = checkbox_to_value(use_libnotify)
        sickrage.app.config.libnotify_notify_onsnatch = checkbox_to_value(libnotify_notify_onsnatch)
        sickrage.app.config.libnotify_notify_ondownload = checkbox_to_value(libnotify_notify_ondownload)
        sickrage.app.config.libnotify_notify_onsubtitledownload = checkbox_to_value(libnotify_notify_onsubtitledownload)

        sickrage.app.config.use_nmj = checkbox_to_value(use_nmj)
        sickrage.app.config.nmj_host = clean_host(nmj_host)
        sickrage.app.config.nmj_database = nmj_database
        sickrage.app.config.nmj_mount = nmj_mount

        sickrage.app.config.use_nmjv2 = checkbox_to_value(use_nmjv2)
        sickrage.app.config.nmjv2_host = clean_host(nmjv2_host)
        sickrage.app.config.nmjv2_database = nmjv2_database
        sickrage.app.config.nmjv2_dbloc = nmjv2_dbloc

        sickrage.app.config.use_synoindex = checkbox_to_value(use_synoindex)

        sickrage.app.config.use_synologynotifier = checkbox_to_value(use_synologynotifier)
        sickrage.app.config.synologynotifier_notify_onsnatch = checkbox_to_value(synologynotifier_notify_onsnatch)
        sickrage.app.config.synologynotifier_notify_ondownload = checkbox_to_value(synologynotifier_notify_ondownload)
        sickrage.app.config.synologynotifier_notify_onsubtitledownload = checkbox_to_value(synologynotifier_notify_onsubtitledownload)

        sickrage.app.config.use_trakt = checkbox_to_value(use_trakt)
        sickrage.app.config.trakt_username = trakt_username
        sickrage.app.config.trakt_remove_watchlist = checkbox_to_value(trakt_remove_watchlist)
        sickrage.app.config.trakt_remove_serieslist = checkbox_to_value(trakt_remove_serieslist)
        sickrage.app.config.trakt_remove_show_from_sickrage = checkbox_to_value(trakt_remove_show_from_sickrage)
        sickrage.app.config.trakt_sync_watchlist = checkbox_to_value(trakt_sync_watchlist)
        sickrage.app.config.trakt_method_add = int(trakt_method_add)
        sickrage.app.config.trakt_start_paused = checkbox_to_value(trakt_start_paused)
        sickrage.app.config.trakt_use_recommended = checkbox_to_value(trakt_use_recommended)
        sickrage.app.config.trakt_sync = checkbox_to_value(trakt_sync)
        sickrage.app.config.trakt_sync_remove = checkbox_to_value(trakt_sync_remove)
        sickrage.app.config.trakt_default_indexer = int(trakt_default_indexer)
        sickrage.app.config.trakt_timeout = int(trakt_timeout)
        sickrage.app.config.trakt_blacklist_name = trakt_blacklist_name

        sickrage.app.config.use_email = checkbox_to_value(use_email)
        sickrage.app.config.email_notify_onsnatch = checkbox_to_value(email_notify_onsnatch)
        sickrage.app.config.email_notify_ondownload = checkbox_to_value(email_notify_ondownload)
        sickrage.app.config.email_notify_onsubtitledownload = checkbox_to_value(email_notify_onsubtitledownload)
        sickrage.app.config.email_host = clean_host(email_host)
        sickrage.app.config.email_port = try_int(email_port, 25)
        sickrage.app.config.email_from = email_from
        sickrage.app.config.email_tls = checkbox_to_value(email_tls)
        sickrage.app.config.email_user = email_user
        sickrage.app.config.email_password = email_password
        sickrage.app.config.email_list = email_list

        sickrage.app.config.use_pytivo = checkbox_to_value(use_pytivo)
        sickrage.app.config.pytivo_notify_onsnatch = checkbox_to_value(pytivo_notify_onsnatch)
        sickrage.app.config.pytivo_notify_ondownload = checkbox_to_value(pytivo_notify_ondownload)
        sickrage.app.config.pytivo_notify_onsubtitledownload = checkbox_to_value(pytivo_notify_onsubtitledownload)
        sickrage.app.config.pytivo_update_library = checkbox_to_value(pytivo_update_library)
        sickrage.app.config.pytivo_host = clean_host(pytivo_host)
        sickrage.app.config.pytivo_share_name = pytivo_share_name
        sickrage.app.config.pytivo_tivo_name = pytivo_tivo_name

        sickrage.app.config.use_nma = checkbox_to_value(use_nma)
        sickrage.app.config.nma_notify_onsnatch = checkbox_to_value(nma_notify_onsnatch)
        sickrage.app.config.nma_notify_ondownload = checkbox_to_value(nma_notify_ondownload)
        sickrage.app.config.nma_notify_onsubtitledownload = checkbox_to_value(nma_notify_onsubtitledownload)
        sickrage.app.config.nma_api = nma_api
        sickrage.app.config.nma_priority = nma_priority

        sickrage.app.config.use_pushalot = checkbox_to_value(use_pushalot)
        sickrage.app.config.pushalot_notify_onsnatch = checkbox_to_value(pushalot_notify_onsnatch)
        sickrage.app.config.pushalot_notify_ondownload = checkbox_to_value(pushalot_notify_ondownload)
        sickrage.app.config.pushalot_notify_onsubtitledownload = checkbox_to_value(pushalot_notify_onsubtitledownload)
        sickrage.app.config.pushalot_authorizationtoken = pushalot_authorizationtoken

        sickrage.app.config.use_pushbullet = checkbox_to_value(use_pushbullet)
        sickrage.app.config.pushbullet_notify_onsnatch = checkbox_to_value(pushbullet_notify_onsnatch)
        sickrage.app.config.pushbullet_notify_ondownload = checkbox_to_value(pushbullet_notify_ondownload)
        sickrage.app.config.pushbullet_notify_onsubtitledownload = checkbox_to_value(pushbullet_notify_onsubtitledownload)
        sickrage.app.config.pushbullet_api = pushbullet_api
        sickrage.app.config.pushbullet_device = pushbullet_device_list

        sickrage.app.config.save()

        if len(results) > 0:
            [sickrage.app.log.error(x) for x in results]
            sickrage.app.alerts.error(_('Error(s) Saving Configuration'), '<br>\n'.join(results))
        else:
            sickrage.app.alerts.message(_('[NOTIFICATIONS] Configuration Encrypted and Saved to disk'))

        return self.redirect("/config/notifications/")
Ejemplo n.º 2
0
    def post(self, *args, **kwargs):
        use_nzbs = self.get_argument('use_nzbs', None)
        use_torrents = self.get_argument('use_torrents', None)
        nzb_dir = self.get_argument('nzb_dir', None)
        sab_username = self.get_argument('sab_username', None)
        sab_password = self.get_argument('sab_password', None)
        sab_apikey = self.get_argument('sab_apikey', None)
        sab_category = self.get_argument('sab_category', None)
        sab_category_anime = self.get_argument('sab_category_anime', None)
        sab_category_backlog = self.get_argument('sab_category_backlog', None)
        sab_category_anime_backlog = self.get_argument(
            'sab_category_anime_backlog', None)
        sab_host = self.get_argument('sab_host', None)
        nzbget_username = self.get_argument('nzbget_username', None)
        nzbget_password = self.get_argument('nzbget_password', None)
        nzbget_category = self.get_argument('nzbget_category', None)
        nzbget_category_backlog = self.get_argument('nzbget_category_backlog',
                                                    None)
        nzbget_category_anime = self.get_argument('nzbget_category_anime',
                                                  None)
        nzbget_category_anime_backlog = self.get_argument(
            'nzbget_category_anime_backlog', None)
        nzbget_priority = self.get_argument('nzbget_priority', None)
        nzbget_host = self.get_argument('nzbget_host', None)
        nzbget_use_https = self.get_argument('nzbget_use_https', None)
        backlog_frequency = self.get_argument('backlog_frequency', None)
        dailysearch_frequency = self.get_argument('dailysearch_frequency',
                                                  None)
        nzb_method = self.get_argument('nzb_method', None)
        torrent_method = self.get_argument('torrent_method', None)
        usenet_retention = self.get_argument('usenet_retention', None)
        download_propers = self.get_argument('download_propers', None)
        check_propers_interval = self.get_argument('check_propers_interval',
                                                   None)
        allow_high_priority = self.get_argument('allow_high_priority', None)
        sab_forced = self.get_argument('sab_forced', None)
        randomize_providers = self.get_argument('randomize_providers', None)
        use_failed_snatcher = self.get_argument('use_failed_snatcher', None)
        failed_snatch_age = self.get_argument('failed_snatch_age', None)
        torrent_dir = self.get_argument('torrent_dir', None)
        torrent_username = self.get_argument('torrent_username', None)
        torrent_password = self.get_argument('torrent_password', None)
        torrent_host = self.get_argument('torrent_host', None)
        torrent_label = self.get_argument('torrent_label', None)
        torrent_label_anime = self.get_argument('torrent_label_anime', None)
        torrent_path = self.get_argument('torrent_path', None)
        torrent_verify_cert = self.get_argument('torrent_verify_cert', None)
        torrent_seed_time = self.get_argument('torrent_seed_time', None)
        torrent_paused = self.get_argument('torrent_paused', None)
        torrent_high_bandwidth = self.get_argument('torrent_high_bandwidth',
                                                   None)
        torrent_rpcurl = self.get_argument('torrent_rpcurl', None)
        torrent_auth_type = self.get_argument('torrent_auth_type', None)
        ignore_words = self.get_argument('ignore_words', None)
        require_words = self.get_argument('require_words', None)
        ignored_subs_list = self.get_argument('ignored_subs_list', None)
        enable_rss_cache = self.get_argument('enable_rss_cache', None)
        torrent_file_to_magnet = self.get_argument('torrent_file_to_magnet',
                                                   None)
        download_unverified_magnet_link = self.get_argument(
            'download_unverified_magnet_link', None)

        results = []

        if not sickrage.app.config.change_nzb_dir(nzb_dir):
            results += [
                _("Unable to create directory ") + os.path.normpath(nzb_dir) +
                _(", dir not changed.")
            ]

        if not sickrage.app.config.change_torrent_dir(torrent_dir):
            results += [
                _("Unable to create directory ") +
                os.path.normpath(torrent_dir) + _(", dir not changed.")
            ]

        sickrage.app.config.change_failed_snatch_age(failed_snatch_age)
        sickrage.app.config.use_failed_snatcher = checkbox_to_value(
            use_failed_snatcher)
        sickrage.app.config.change_daily_searcher_freq(dailysearch_frequency)
        sickrage.app.config.change_backlog_searcher_freq(backlog_frequency)
        sickrage.app.config.use_nzbs = checkbox_to_value(use_nzbs)
        sickrage.app.config.use_torrents = checkbox_to_value(use_torrents)
        sickrage.app.config.nzb_method = nzb_method
        sickrage.app.config.torrent_method = torrent_method
        sickrage.app.config.usenet_retention = try_int(usenet_retention, 500)
        sickrage.app.config.ignore_words = ignore_words if ignore_words else ""
        sickrage.app.config.require_words = require_words if require_words else ""
        sickrage.app.config.ignored_subs_list = ignored_subs_list if ignored_subs_list else ""
        sickrage.app.config.randomize_providers = checkbox_to_value(
            randomize_providers)
        sickrage.app.config.enable_rss_cache = checkbox_to_value(
            enable_rss_cache)
        sickrage.app.config.torrent_file_to_magnet = checkbox_to_value(
            torrent_file_to_magnet)
        sickrage.app.config.download_unverified_magnet_link = checkbox_to_value(
            download_unverified_magnet_link)
        sickrage.app.config.download_propers = checkbox_to_value(
            download_propers)
        sickrage.app.config.proper_searcher_interval = check_propers_interval
        sickrage.app.config.allow_high_priority = checkbox_to_value(
            allow_high_priority)
        sickrage.app.config.sab_username = sab_username
        sickrage.app.config.sab_password = sab_password
        sickrage.app.config.sab_apikey = sab_apikey.strip()
        sickrage.app.config.sab_category = sab_category
        sickrage.app.config.sab_category_backlog = sab_category_backlog
        sickrage.app.config.sab_category_anime = sab_category_anime
        sickrage.app.config.sab_category_anime_backlog = sab_category_anime_backlog
        sickrage.app.config.sab_host = clean_url(sab_host)
        sickrage.app.config.sab_forced = checkbox_to_value(sab_forced)
        sickrage.app.config.nzbget_username = nzbget_username
        sickrage.app.config.nzbget_password = nzbget_password
        sickrage.app.config.nzbget_category = nzbget_category
        sickrage.app.config.nzbget_category_backlog = nzbget_category_backlog
        sickrage.app.config.nzbget_category_anime = nzbget_category_anime
        sickrage.app.config.nzbget_category_anime_backlog = nzbget_category_anime_backlog
        sickrage.app.config.nzbget_host = clean_host(nzbget_host)
        sickrage.app.config.nzbget_use_https = checkbox_to_value(
            nzbget_use_https)
        sickrage.app.config.nzbget_priority = try_int(nzbget_priority, 100)
        sickrage.app.config.torrent_username = torrent_username
        sickrage.app.config.torrent_password = torrent_password
        sickrage.app.config.torrent_label = torrent_label
        sickrage.app.config.torrent_label_anime = torrent_label_anime
        sickrage.app.config.torrent_verify_cert = checkbox_to_value(
            torrent_verify_cert)
        sickrage.app.config.torrent_path = torrent_path.rstrip('/\\')
        sickrage.app.config.torrent_seed_time = torrent_seed_time
        sickrage.app.config.torrent_paused = checkbox_to_value(torrent_paused)
        sickrage.app.config.torrent_high_bandwidth = checkbox_to_value(
            torrent_high_bandwidth)
        sickrage.app.config.torrent_host = clean_url(torrent_host)
        sickrage.app.config.torrent_rpcurl = torrent_rpcurl
        sickrage.app.config.torrent_auth_type = torrent_auth_type

        torrent_webui_url(True)

        sickrage.app.config.save()

        if len(results) > 0:
            [sickrage.app.log.error(x) for x in results]
            sickrage.app.alerts.error(_('Error(s) Saving Configuration'),
                                      '<br>\n'.join(results))
        else:
            sickrage.app.alerts.message(
                _('[SEARCH] Configuration Encrypted and Saved to disk'))

        return self.redirect("/config/search/")
Ejemplo n.º 3
0
    def post(self, *args, **kwargs):
        use_kodi = self.get_argument('use_kodi', None)
        kodi_always_on = self.get_argument('kodi_always_on', None)
        kodi_notify_on_snatch = self.get_argument('kodi_notify_on_snatch',
                                                  None)
        kodi_notify_on_download = self.get_argument('kodi_notify_on_download',
                                                    None)
        kodi_notify_on_subtitle_download = self.get_argument(
            'kodi_notify_on_subtitle_download', None)
        kodi_update_only_first = self.get_argument('kodi_update_only_first',
                                                   None)
        kodi_update_library = self.get_argument('kodi_update_library', None)
        kodi_update_full = self.get_argument('kodi_update_full', None)
        kodi_host = self.get_argument('kodi_host', None)
        kodi_username = self.get_argument('kodi_username', None)
        kodi_password = self.get_argument('kodi_password', None)
        use_plex = self.get_argument('use_plex', None)
        plex_notify_on_snatch = self.get_argument('plex_notify_on_snatch',
                                                  None)
        plex_notify_on_download = self.get_argument('plex_notify_on_download',
                                                    None)
        plex_notify_on_subtitle_download = self.get_argument(
            'plex_notify_on_subtitle_download', None)
        plex_update_library = self.get_argument('plex_update_library', None)
        plex_server_host = self.get_argument('plex_server_host', None)
        plex_server_token = self.get_argument('plex_server_token', None)
        plex_host = self.get_argument('plex_host', None)
        plex_username = self.get_argument('plex_username', None)
        plex_password = self.get_argument('plex_password', None)
        use_emby = self.get_argument('use_emby', None)
        emby_notify_on_snatch = self.get_argument('emby_notify_on_snatch',
                                                  None)
        emby_notify_on_download = self.get_argument('emby_notify_on_download',
                                                    None)
        emby_notify_on_subtitle_download = self.get_argument(
            'emby_notify_on_subtitle_download', None)
        emby_host = self.get_argument('emby_host', None)
        emby_apikey = self.get_argument('emby_apikey', None)
        use_growl = self.get_argument('use_growl', None)
        growl_notify_on_snatch = self.get_argument('growl_notify_on_snatch',
                                                   None)
        growl_notify_on_download = self.get_argument(
            'growl_notify_on_download', None)
        growl_notify_on_subtitle_download = self.get_argument(
            'growl_notify_on_subtitle_download', None)
        growl_host = self.get_argument('growl_host', None)
        growl_password = self.get_argument('growl_password', None)
        use_freemobile = self.get_argument('use_freemobile', None)
        freemobile_notify_on_snatch = self.get_argument(
            'freemobile_notify_on_snatch', None)
        freemobile_notify_on_download = self.get_argument(
            'freemobile_notify_on_download', None)
        freemobile_notify_on_subtitle_download = self.get_argument(
            'freemobile_notify_on_subtitle_download', None)
        freemobile_id = self.get_argument('freemobile_id', None)
        freemobile_apikey = self.get_argument('freemobile_apikey', None)
        use_telegram = self.get_argument('use_telegram', None)
        telegram_notify_on_snatch = self.get_argument(
            'telegram_notify_on_snatch', None)
        telegram_notify_on_download = self.get_argument(
            'telegram_notify_on_download', None)
        telegram_notify_on_subtitle_download = self.get_argument(
            'telegram_notify_on_subtitle_download', None)
        telegram_id = self.get_argument('telegram_id', None)
        telegram_apikey = self.get_argument('telegram_apikey', None)
        use_join = self.get_argument('use_join', None)
        join_notify_on_snatch = self.get_argument('join_notify_on_snatch',
                                                  None)
        join_notify_on_download = self.get_argument('join_notify_on_download',
                                                    None)
        join_notify_on_subtitle_download = self.get_argument(
            'join_notify_on_subtitle_download', None)
        join_id = self.get_argument('join_id', None)
        join_apikey = self.get_argument('join_apikey', None)
        use_prowl = self.get_argument('use_prowl', None)
        prowl_notify_on_snatch = self.get_argument('prowl_notify_on_snatch',
                                                   None)
        prowl_notify_on_download = self.get_argument(
            'prowl_notify_on_download', None)
        prowl_notify_on_subtitle_download = self.get_argument(
            'prowl_notify_on_subtitle_download', None)
        prowl_apikey = self.get_argument('prowl_apikey', None)
        prowl_priority = self.get_argument('prowl_priority', None) or 0
        use_twitter = self.get_argument('use_twitter', None)
        twitter_notify_on_snatch = self.get_argument(
            'twitter_notify_on_snatch', None)
        twitter_notify_on_download = self.get_argument(
            'twitter_notify_on_download', None)
        twitter_notify_on_subtitle_download = self.get_argument(
            'twitter_notify_on_subtitle_download', None)
        twitter_usedm = self.get_argument('twitter_usedm', None)
        twitter_dmto = self.get_argument('twitter_dmto', None)
        use_twilio = self.get_argument('use_twilio', None)
        twilio_notify_on_snatch = self.get_argument('twilio_notify_on_snatch',
                                                    None)
        twilio_notify_on_download = self.get_argument(
            'twilio_notify_on_download', None)
        twilio_notify_on_subtitle_download = self.get_argument(
            'twilio_notify_on_subtitle_download', None)
        twilio_phone_sid = self.get_argument('twilio_phone_sid', None)
        twilio_account_sid = self.get_argument('twilio_account_sid', None)
        twilio_auth_token = self.get_argument('twilio_auth_token', None)
        twilio_to_number = self.get_argument('twilio_to_number', None)
        use_boxcar2 = self.get_argument('use_boxcar2', None)
        boxcar2_notify_on_snatch = self.get_argument(
            'boxcar2_notify_on_snatch', None)
        boxcar2_notify_on_download = self.get_argument(
            'boxcar2_notify_on_download', None)
        boxcar2_notify_on_subtitle_download = self.get_argument(
            'boxcar2_notify_on_subtitle_download', None)
        boxcar2_accesstoken = self.get_argument('boxcar2_accesstoken', None)
        use_pushover = self.get_argument('use_pushover', None)
        pushover_notify_on_snatch = self.get_argument(
            'pushover_notify_on_snatch', None)
        pushover_notify_on_download = self.get_argument(
            'pushover_notify_on_download', None)
        pushover_notify_on_subtitle_download = self.get_argument(
            'pushover_notify_on_subtitle_download', None)
        pushover_userkey = self.get_argument('pushover_userkey', None)
        pushover_apikey = self.get_argument('pushover_apikey', None)
        pushover_device = self.get_argument('pushover_device', None)
        pushover_sound = self.get_argument('pushover_sound', None)
        use_libnotify = self.get_argument('use_libnotify', None)
        libnotify_notify_on_snatch = self.get_argument(
            'libnotify_notify_on_snatch', None)
        libnotify_notify_on_download = self.get_argument(
            'libnotify_notify_on_download', None)
        libnotify_notify_on_subtitle_download = self.get_argument(
            'libnotify_notify_on_subtitle_download', None)
        use_nmj = self.get_argument('use_nmj', None)
        nmj_host = self.get_argument('nmj_host', None)
        nmj_database = self.get_argument('nmj_database', None)
        nmj_mount = self.get_argument('nmj_mount', None)
        use_synoindex = self.get_argument('use_synoindex', None)
        use_nmjv2 = self.get_argument('use_nmjv2', None)
        nmjv2_host = self.get_argument('nmjv2_host', None)
        nmjv2_dbloc = self.get_argument('nmjv2_dbloc', None)
        nmjv2_database = self.get_argument('nmjv2_database', None)
        use_trakt = self.get_argument('use_trakt', None)
        trakt_username = self.get_argument('trakt_username', None)
        trakt_remove_watchlist = self.get_argument('trakt_remove_watchlist',
                                                   None)
        trakt_sync_watchlist = self.get_argument('trakt_sync_watchlist', None)
        trakt_remove_show_from_sickrage = self.get_argument(
            'trakt_remove_show_from_sickrage', None)
        trakt_method_add = self.get_argument('trakt_method_add', None)
        trakt_start_paused = self.get_argument('trakt_start_paused', None)
        trakt_use_recommended = self.get_argument('trakt_use_recommended',
                                                  None)
        trakt_sync = self.get_argument('trakt_sync', None)
        trakt_sync_remove = self.get_argument('trakt_sync_remove', None)
        trakt_default_series_provider = self.get_argument(
            'trakt_default_series_provider', None)
        trakt_remove_serieslist = self.get_argument('trakt_remove_serieslist',
                                                    None)
        trakt_timeout = self.get_argument('trakt_timeout', None)
        trakt_blacklist_name = self.get_argument('trakt_blacklist_name', None)
        use_synology_notification_provider = self.get_argument(
            'use_synology_notification_provider', None)
        synology_notification_provider_notify_on_snatch = self.get_argument(
            'synology_notification_provider_notify_on_snatch', None)
        synology_notification_provider_notify_on_download = self.get_argument(
            'synology_notification_provider_notify_on_download', None)
        synology_notification_provider_notify_on_subtitle_download = self.get_argument(
            'synology_notification_provider_notify_on_subtitle_download', None)
        use_pytivo = self.get_argument('use_pytivo', None)
        pytivo_notify_on_snatch = self.get_argument('pytivo_notify_on_snatch',
                                                    None)
        pytivo_notify_on_download = self.get_argument(
            'pytivo_notify_on_download', None)
        pytivo_notify_on_subtitle_download = self.get_argument(
            'pytivo_notify_on_subtitle_download', None)
        pytivo_update_library = self.get_argument('pytivo_update_library',
                                                  None)
        pytivo_host = self.get_argument('pytivo_host', None)
        pytivo_share_name = self.get_argument('pytivo_share_name', None)
        pytivo_tivo_name = self.get_argument('pytivo_tivo_name', None)
        use_nma = self.get_argument('use_nma', None)
        nma_notify_on_snatch = self.get_argument('nma_notify_on_snatch', None)
        nma_notify_on_download = self.get_argument('nma_notify_on_download',
                                                   None)
        nma_notify_on_subtitle_download = self.get_argument(
            'nma_notify_on_subtitle_download', None)
        nma_api = self.get_argument('nma_api', None)
        nma_priority = self.get_argument('nma_priority', None) or 0
        use_pushalot = self.get_argument('use_pushalot', None)
        pushalot_notify_on_snatch = self.get_argument(
            'pushalot_notify_on_snatch', None)
        pushalot_notify_on_download = self.get_argument(
            'pushalot_notify_on_download', None)
        pushalot_notify_on_subtitle_download = self.get_argument(
            'pushalot_notify_on_subtitle_download', None)
        pushalot_authorizationtoken = self.get_argument(
            'pushalot_authorizationtoken', None)
        use_pushbullet = self.get_argument('use_pushbullet', None)
        pushbullet_notify_on_snatch = self.get_argument(
            'pushbullet_notify_on_snatch', None)
        pushbullet_notify_on_download = self.get_argument(
            'pushbullet_notify_on_download', None)
        pushbullet_notify_on_subtitle_download = self.get_argument(
            'pushbullet_notify_on_subtitle_download', None)
        pushbullet_api = self.get_argument('pushbullet_api', None)
        pushbullet_device_list = self.get_argument('pushbullet_device_list',
                                                   None)
        use_email = self.get_argument('use_email', None)
        email_notify_on_snatch = self.get_argument('email_notify_on_snatch',
                                                   None)
        email_notify_on_download = self.get_argument(
            'email_notify_on_download', None)
        email_notify_on_subtitle_download = self.get_argument(
            'email_notify_on_subtitle_download', None)
        email_host = self.get_argument('email_host', None)
        email_port = self.get_argument('email_port', None) or 25
        email_from = self.get_argument('email_from', None)
        email_tls = self.get_argument('email_tls', None)
        email_user = self.get_argument('email_user', None)
        email_password = self.get_argument('email_password', None)
        email_list = self.get_argument('email_list', None)
        use_slack = self.get_argument('use_slack', None)
        slack_notify_on_snatch = self.get_argument('slack_notify_on_snatch',
                                                   None)
        slack_notify_on_download = self.get_argument(
            'slack_notify_on_download', None)
        slack_notify_on_subtitle_download = self.get_argument(
            'slack_notify_on_subtitle_download', None)
        slack_webhook = self.get_argument('slack_webhook', None)
        use_discord = self.get_argument('use_discord', None)
        discord_notify_on_snatch = self.get_argument(
            'discord_notify_on_snatch', None)
        discord_notify_on_download = self.get_argument(
            'discord_notify_on_download', None)
        discord_notify_on_subtitle_download = self.get_argument(
            'discord_notify_on_subtitle_download', None)
        discord_webhook = self.get_argument('discord_webhook', None)
        discord_name = self.get_argument('discord_name', None)
        discord_avatar_url = self.get_argument('discord_avatar_url', None)
        discord_tts = self.get_argument('discord_tts', None)
        use_alexa = self.get_argument('use_alexa', None)
        alexa_notify_on_snatch = self.get_argument('alexa_notify_on_snatch',
                                                   None)
        alexa_notify_on_download = self.get_argument(
            'alexa_notify_on_download', None)
        alexa_notify_on_subtitle_download = self.get_argument(
            'alexa_notify_on_subtitle_download', None)

        results = []

        sickrage.app.config.kodi.enable = checkbox_to_value(use_kodi)
        sickrage.app.config.kodi.always_on = checkbox_to_value(kodi_always_on)
        sickrage.app.config.kodi.notify_on_snatch = checkbox_to_value(
            kodi_notify_on_snatch)
        sickrage.app.config.kodi.notify_on_download = checkbox_to_value(
            kodi_notify_on_download)
        sickrage.app.config.kodi.notify_on_subtitle_download = checkbox_to_value(
            kodi_notify_on_subtitle_download)
        sickrage.app.config.kodi.update_library = checkbox_to_value(
            kodi_update_library)
        sickrage.app.config.kodi.update_full = checkbox_to_value(
            kodi_update_full)
        sickrage.app.config.kodi.update_only_first = checkbox_to_value(
            kodi_update_only_first)
        sickrage.app.config.kodi.host = clean_hosts(kodi_host)
        sickrage.app.config.kodi.username = kodi_username
        sickrage.app.config.kodi.password = kodi_password

        sickrage.app.config.plex.enable = checkbox_to_value(use_plex)
        sickrage.app.config.plex.notify_on_snatch = checkbox_to_value(
            plex_notify_on_snatch)
        sickrage.app.config.plex.notify_on_download = checkbox_to_value(
            plex_notify_on_download)
        sickrage.app.config.plex.notify_on_subtitle_download = checkbox_to_value(
            plex_notify_on_subtitle_download)
        sickrage.app.config.plex.update_library = checkbox_to_value(
            plex_update_library)
        sickrage.app.config.plex.host = clean_hosts(plex_host)
        sickrage.app.config.plex.server_host = clean_hosts(plex_server_host)
        sickrage.app.config.plex.server_token = clean_host(plex_server_token)
        sickrage.app.config.plex.username = plex_username
        sickrage.app.config.plex.password = plex_password
        sickrage.app.config.plex.enable_client = checkbox_to_value(use_plex)
        sickrage.app.config.plex.client_username = plex_username
        sickrage.app.config.plex.client_password = plex_password

        sickrage.app.config.emby.enable = checkbox_to_value(use_emby)
        sickrage.app.config.emby.notify_on_snatch = checkbox_to_value(
            emby_notify_on_snatch)
        sickrage.app.config.emby.notify_on_download = checkbox_to_value(
            emby_notify_on_download)
        sickrage.app.config.emby.notify_on_subtitle_download = checkbox_to_value(
            emby_notify_on_subtitle_download)
        sickrage.app.config.emby.host = clean_host(emby_host)
        sickrage.app.config.emby.apikey = emby_apikey

        sickrage.app.config.growl.enable = checkbox_to_value(use_growl)
        sickrage.app.config.growl.notify_on_snatch = checkbox_to_value(
            growl_notify_on_snatch)
        sickrage.app.config.growl.notify_on_download = checkbox_to_value(
            growl_notify_on_download)
        sickrage.app.config.growl.notify_on_subtitle_download = checkbox_to_value(
            growl_notify_on_subtitle_download)
        sickrage.app.config.growl.host = clean_host(growl_host,
                                                    default_port=23053)
        sickrage.app.config.growl.password = growl_password

        sickrage.app.config.freemobile.enable = checkbox_to_value(
            use_freemobile)
        sickrage.app.config.freemobile.notify_on_snatch = checkbox_to_value(
            freemobile_notify_on_snatch)
        sickrage.app.config.freemobile.notify_on_download = checkbox_to_value(
            freemobile_notify_on_download)
        sickrage.app.config.freemobile.notify_on_subtitle_download = checkbox_to_value(
            freemobile_notify_on_subtitle_download)
        sickrage.app.config.freemobile.user_id = freemobile_id
        sickrage.app.config.freemobile.apikey = freemobile_apikey

        sickrage.app.config.telegram.enable = checkbox_to_value(use_telegram)
        sickrage.app.config.telegram.notify_on_snatch = checkbox_to_value(
            telegram_notify_on_snatch)
        sickrage.app.config.telegram.notify_on_download = checkbox_to_value(
            telegram_notify_on_download)
        sickrage.app.config.telegram.notify_on_subtitle_download = checkbox_to_value(
            telegram_notify_on_subtitle_download)
        sickrage.app.config.telegram.user_id = telegram_id
        sickrage.app.config.telegram.apikey = telegram_apikey

        sickrage.app.config.join_app.enable = checkbox_to_value(use_join)
        sickrage.app.config.join_app.notify_on_snatch = checkbox_to_value(
            join_notify_on_snatch)
        sickrage.app.config.join_app.notify_on_download = checkbox_to_value(
            join_notify_on_download)
        sickrage.app.config.join_app.notify_on_subtitle_download = checkbox_to_value(
            join_notify_on_subtitle_download)
        sickrage.app.config.join_app.user_id = join_id
        sickrage.app.config.join_app.apikey = join_apikey

        sickrage.app.config.prowl.enable = checkbox_to_value(use_prowl)
        sickrage.app.config.prowl.notify_on_snatch = checkbox_to_value(
            prowl_notify_on_snatch)
        sickrage.app.config.prowl.notify_on_download = checkbox_to_value(
            prowl_notify_on_download)
        sickrage.app.config.prowl.notify_on_subtitle_download = checkbox_to_value(
            prowl_notify_on_subtitle_download)
        sickrage.app.config.prowl.apikey = prowl_apikey
        sickrage.app.config.prowl.priority = prowl_priority

        sickrage.app.config.twitter.enable = checkbox_to_value(use_twitter)
        sickrage.app.config.twitter.notify_on_snatch = checkbox_to_value(
            twitter_notify_on_snatch)
        sickrage.app.config.twitter.notify_on_download = checkbox_to_value(
            twitter_notify_on_download)
        sickrage.app.config.twitter.notify_on_subtitle_download = checkbox_to_value(
            twitter_notify_on_subtitle_download)
        sickrage.app.config.twitter.use_dm = checkbox_to_value(twitter_usedm)
        sickrage.app.config.twitter.dm_to = twitter_dmto

        sickrage.app.config.twilio.enable = checkbox_to_value(use_twilio)
        sickrage.app.config.twilio.notify_on_snatch = checkbox_to_value(
            twilio_notify_on_snatch)
        sickrage.app.config.twilio.notify_on_download = checkbox_to_value(
            twilio_notify_on_download)
        sickrage.app.config.twilio.notify_on_subtitle_download = checkbox_to_value(
            twilio_notify_on_subtitle_download)
        sickrage.app.config.twilio.phone_sid = twilio_phone_sid
        sickrage.app.config.twilio.account_sid = twilio_account_sid
        sickrage.app.config.twilio.auth_token = twilio_auth_token
        sickrage.app.config.twilio.to_number = twilio_to_number

        sickrage.app.config.alexa.enable = checkbox_to_value(use_alexa)
        sickrage.app.config.alexa.notify_on_snatch = checkbox_to_value(
            alexa_notify_on_snatch)
        sickrage.app.config.alexa.notify_on_download = checkbox_to_value(
            alexa_notify_on_download)
        sickrage.app.config.alexa.notify_on_subtitle_download = checkbox_to_value(
            alexa_notify_on_subtitle_download)

        sickrage.app.config.slack.enable = checkbox_to_value(use_slack)
        sickrage.app.config.slack.notify_on_snatch = checkbox_to_value(
            slack_notify_on_snatch)
        sickrage.app.config.slack.notify_on_download = checkbox_to_value(
            slack_notify_on_download)
        sickrage.app.config.slack.notify_on_subtitle_download = checkbox_to_value(
            slack_notify_on_subtitle_download)
        sickrage.app.config.slack.webhook = slack_webhook

        sickrage.app.config.discord.enable = checkbox_to_value(use_discord)
        sickrage.app.config.discord.notify_on_snatch = checkbox_to_value(
            discord_notify_on_snatch)
        sickrage.app.config.discord.notify_on_download = checkbox_to_value(
            discord_notify_on_download)
        sickrage.app.config.discord.notify_on_subtitle_download = checkbox_to_value(
            discord_notify_on_subtitle_download)
        sickrage.app.config.discord.webhook = discord_webhook
        sickrage.app.config.discord.name = discord_name
        sickrage.app.config.discord.avatar_url = discord_avatar_url
        sickrage.app.config.discord.tts = checkbox_to_value(discord_tts)

        sickrage.app.config.boxcar2.enable = checkbox_to_value(use_boxcar2)
        sickrage.app.config.boxcar2.notify_on_snatch = checkbox_to_value(
            boxcar2_notify_on_snatch)
        sickrage.app.config.boxcar2.notify_on_download = checkbox_to_value(
            boxcar2_notify_on_download)
        sickrage.app.config.boxcar2.notify_on_subtitle_download = checkbox_to_value(
            boxcar2_notify_on_subtitle_download)
        sickrage.app.config.boxcar2.access_token = boxcar2_accesstoken

        sickrage.app.config.pushover.enable = checkbox_to_value(use_pushover)
        sickrage.app.config.pushover.notify_on_snatch = checkbox_to_value(
            pushover_notify_on_snatch)
        sickrage.app.config.pushover.notify_on_download = checkbox_to_value(
            pushover_notify_on_download)
        sickrage.app.config.pushover.notify_on_subtitle_download = checkbox_to_value(
            pushover_notify_on_subtitle_download)
        sickrage.app.config.pushover.user_key = pushover_userkey
        sickrage.app.config.pushover.apikey = pushover_apikey
        sickrage.app.config.pushover.device = pushover_device
        sickrage.app.config.pushover.sound = pushover_sound

        sickrage.app.config.libnotify.enable = checkbox_to_value(use_libnotify)
        sickrage.app.config.libnotify.notify_on_snatch = checkbox_to_value(
            libnotify_notify_on_snatch)
        sickrage.app.config.libnotify.notify_on_download = checkbox_to_value(
            libnotify_notify_on_download)
        sickrage.app.config.libnotify.notify_on_subtitle_download = checkbox_to_value(
            libnotify_notify_on_subtitle_download)

        sickrage.app.config.nmj.enable = checkbox_to_value(use_nmj)
        sickrage.app.config.nmj.host = clean_host(nmj_host)
        sickrage.app.config.nmj.database = nmj_database
        sickrage.app.config.nmj.mount = nmj_mount

        sickrage.app.config.nmjv2.enable = checkbox_to_value(use_nmjv2)
        sickrage.app.config.nmjv2.host = clean_host(nmjv2_host)
        sickrage.app.config.nmjv2.database = nmjv2_database
        sickrage.app.config.nmjv2.db_loc = NMJv2Location[nmjv2_dbloc]

        sickrage.app.config.synology.enable_index = checkbox_to_value(
            use_synoindex)

        sickrage.app.config.synology.enable_notifications = checkbox_to_value(
            use_synology_notification_provider)
        sickrage.app.config.synology.notify_on_snatch = checkbox_to_value(
            synology_notification_provider_notify_on_snatch)
        sickrage.app.config.synology.notify_on_download = checkbox_to_value(
            synology_notification_provider_notify_on_download)
        sickrage.app.config.synology.notify_on_subtitle_download = checkbox_to_value(
            synology_notification_provider_notify_on_subtitle_download)

        sickrage.app.config.trakt.enable = checkbox_to_value(use_trakt)
        sickrage.app.config.trakt.username = trakt_username
        sickrage.app.config.trakt.remove_watchlist = checkbox_to_value(
            trakt_remove_watchlist)
        sickrage.app.config.trakt.remove_serieslist = checkbox_to_value(
            trakt_remove_serieslist)
        sickrage.app.config.trakt.remove_show_from_sickrage = checkbox_to_value(
            trakt_remove_show_from_sickrage)
        sickrage.app.config.trakt.sync_watchlist = checkbox_to_value(
            trakt_sync_watchlist)
        sickrage.app.config.trakt.method_add = TraktAddMethod[trakt_method_add]
        sickrage.app.config.trakt.start_paused = checkbox_to_value(
            trakt_start_paused)
        sickrage.app.config.trakt.use_recommended = checkbox_to_value(
            trakt_use_recommended)
        sickrage.app.config.trakt.sync = checkbox_to_value(trakt_sync)
        sickrage.app.config.trakt.sync_remove = checkbox_to_value(
            trakt_sync_remove)
        sickrage.app.config.trakt.series_provider_default = SeriesProviderID[
            trakt_default_series_provider]
        sickrage.app.config.trakt.timeout = int(trakt_timeout)
        sickrage.app.config.trakt.blacklist_name = trakt_blacklist_name

        sickrage.app.config.email.enable = checkbox_to_value(use_email)
        sickrage.app.config.email.notify_on_snatch = checkbox_to_value(
            email_notify_on_snatch)
        sickrage.app.config.email.notify_on_download = checkbox_to_value(
            email_notify_on_download)
        sickrage.app.config.email.notify_on_subtitle_download = checkbox_to_value(
            email_notify_on_subtitle_download)
        sickrage.app.config.email.host = clean_host(email_host)
        sickrage.app.config.email.port = try_int(email_port, 25)
        sickrage.app.config.email.send_from = email_from
        sickrage.app.config.email.tls = checkbox_to_value(email_tls)
        sickrage.app.config.email.username = email_user
        sickrage.app.config.email.password = email_password
        sickrage.app.config.email.send_to_list = email_list

        sickrage.app.config.pytivo.enable = checkbox_to_value(use_pytivo)
        sickrage.app.config.pytivo.notify_on_snatch = checkbox_to_value(
            pytivo_notify_on_snatch)
        sickrage.app.config.pytivo.notify_on_download = checkbox_to_value(
            pytivo_notify_on_download)
        sickrage.app.config.pytivo.notify_on_subtitle_download = checkbox_to_value(
            pytivo_notify_on_subtitle_download)
        sickrage.app.config.pytivo.update_library = checkbox_to_value(
            pytivo_update_library)
        sickrage.app.config.pytivo.host = clean_host(pytivo_host)
        sickrage.app.config.pytivo.share_name = pytivo_share_name
        sickrage.app.config.pytivo.tivo_name = pytivo_tivo_name

        sickrage.app.config.nma.enable = checkbox_to_value(use_nma)
        sickrage.app.config.nma.notify_on_snatch = checkbox_to_value(
            nma_notify_on_snatch)
        sickrage.app.config.nma.notify_on_download = checkbox_to_value(
            nma_notify_on_download)
        sickrage.app.config.nma.notify_on_subtitle_download = checkbox_to_value(
            nma_notify_on_subtitle_download)
        sickrage.app.config.nma.api_keys = nma_api
        sickrage.app.config.nma.priority = nma_priority

        sickrage.app.config.pushalot.enable = checkbox_to_value(use_pushalot)
        sickrage.app.config.pushalot.notify_on_snatch = checkbox_to_value(
            pushalot_notify_on_snatch)
        sickrage.app.config.pushalot.notify_on_download = checkbox_to_value(
            pushalot_notify_on_download)
        sickrage.app.config.pushalot.notify_on_subtitle_download = checkbox_to_value(
            pushalot_notify_on_subtitle_download)
        sickrage.app.config.pushalot.auth_token = pushalot_authorizationtoken

        sickrage.app.config.pushbullet.enable = checkbox_to_value(
            use_pushbullet)
        sickrage.app.config.pushbullet.notify_on_snatch = checkbox_to_value(
            pushbullet_notify_on_snatch)
        sickrage.app.config.pushbullet.notify_on_download = checkbox_to_value(
            pushbullet_notify_on_download)
        sickrage.app.config.pushbullet.notify_on_subtitle_download = checkbox_to_value(
            pushbullet_notify_on_subtitle_download)
        sickrage.app.config.pushbullet.api_key = pushbullet_api
        sickrage.app.config.pushbullet.device = pushbullet_device_list

        sickrage.app.config.save()

        if len(results) > 0:
            [sickrage.app.log.error(x) for x in results]
            sickrage.app.alerts.error(_('Error(s) Saving Configuration'),
                                      '<br>\n'.join(results))
        else:
            sickrage.app.alerts.message(
                _('[NOTIFICATIONS] Configuration Saved to Database'))

        return self.redirect("/config/notifications/")