logging.debug('BAZARR Subtitles file downloaded for this file:'+path)
pdownload_result=False
forsubtitleinsubtitles_list:
download_result=p.download_subtitle(subtitle)
ifdownload_result==True:
logging.debug('BAZARR Subtitles file downloaded from '+str(subtitle.provider_name)+' for this file: '+path)
break
else:
logging.warning('BAZARR Subtitles file skipped from '+str(subtitle.provider_name)+' for this file: '+path+' because no content was returned by the provider (probably throttled).')
continue
ifdownload_result==False:
logging.error('BAZARR Tried to download a subtitles for file: '+path+" but we weren't able to do it this time (probably being throttled). Going to retry on next search.")
returnNone
exceptExceptionase:
logging.exception('BAZARR Error downloading subtitles for this file '+path)
logging.debug('BAZARR Subtitles file saved to disk: '+downloaded_path)
ifused_sceneName==True:
message=downloaded_language+" subtitles downloaded from "+downloaded_provider+" with a score of "+unicode(calculated_score)+"% using this scene name: "+sceneName
else:
message=downloaded_language+" subtitles downloaded from "+downloaded_provider+" with a score of "+unicode(calculated_score)+"% using filename guessing."
logging.debug('BAZARR Subtitles file saved to disk: '+downloaded_path)
ifused_sceneName==True:
message=downloaded_language+" subtitles downloaded from "+downloaded_provider+" with a score of "+unicode(calculated_score)+"% using this scene name: "+sceneName
else:
message=downloaded_language+" subtitles downloaded from "+downloaded_provider+" with a score of "+unicode(calculated_score)+"% using filename guessing."
logging.error('BAZARR Tried to manually download a subtitles for file: '+path+' but it had no content. Going to retry on next search.')
logging.error('BAZARR Tried to manually download a subtitles for file: '+path+" but we weren't able to do (probably throttled by ' + str(subtitle.provider_name) + '. Please retry later or select a subtitles from another provider.")
returnNone
logging.debug('BAZARR Ended manually downloading subtitles for file: '+path)
c.execute("SELECT tmdbId, title, path_substitution(path), languages, hearing_impaired, radarrId, poster, audio_language, monitored FROM table_movies ORDER BY title ASC LIMIT ? OFFSET ?",(page_size,offset,))
c.execute("SELECT tmdbId, title, path_substitution(path), languages, hearing_impaired, radarrId, poster, audio_language, monitored FROM table_movies ORDER BY sortTitle ASC LIMIT ? OFFSET ?",(page_size,offset,))
data=c.fetchall()
c.execute("SELECT code2, name FROM table_settings_languages WHERE enabled = 1")
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Boxcar'",(settings_notifier_Boxcar_enabled,settings_notifier_Boxcar_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Faast'",(settings_notifier_Faast_enabled,settings_notifier_Faast_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Growl'",(settings_notifier_Growl_enabled,settings_notifier_Growl_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Mattermost'",(settings_notifier_Mattermost_enabled,settings_notifier_Mattermost_url))
settings_notifier_NMA_enabled=request.forms.get('settings_notifier_Notify My Android_enabled')
ifsettings_notifier_NMA_enabled=='on':
settings_notifier_NMA_enabled=1
else:
settings_notifier_NMA_enabled=0
settings_notifier_NMA_url=request.forms.get('settings_notifier_Notify My Android_url')
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Notify My Android'",(settings_notifier_NMA_enabled,settings_notifier_NMA_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Prowl'",(settings_notifier_Prowl_enabled,settings_notifier_Prowl_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Pushalot'",(settings_notifier_Pushalot_enabled,settings_notifier_Pushalot_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'PushBullet'",(settings_notifier_PushBullet_enabled,settings_notifier_PushBullet_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Pushjet'",(settings_notifier_Pushjet_enabled,settings_notifier_Pushjet_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Pushover'",(settings_notifier_Pushover_enabled,settings_notifier_Pushover_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Rocket.Chat'",(settings_notifier_RocketChat_enabled,settings_notifier_RocketChat_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Slack'",(settings_notifier_Slack_enabled,settings_notifier_Slack_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Super Toasty'",(settings_notifier_SuperToasty_enabled,settings_notifier_SuperToasty_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Telegram'",(settings_notifier_Telegram_enabled,settings_notifier_Telegram_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Twitter'",(settings_notifier_Twitter_enabled,settings_notifier_Twitter_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Discord'",(settings_notifier_Discord_enabled,settings_notifier_Discord_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'E-Mail'",(settings_notifier_E_Mail_enabled,settings_notifier_E_Mail_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'IFTTT'",(settings_notifier_IFTTT_enabled,settings_notifier_IFTTT_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Stride'",(settings_notifier_Stride_enabled,settings_notifier_Stride_url))
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Windows'",(settings_notifier_Windows_enabled,settings_notifier_Windows_url))
notifiers=c.execute("SELECT * FROM table_settings_notifier ORDER BY name").fetchall()
providers=['Boxcar','Faast','Growl','Join','KODI','Mattermost','Notify My Android','Prowl','Pushalot','PushBullet','Pushjet','Pushover','Rocket.Chat','Slack','Super Toasty','Telegram','Twitter','XBMC']
forproviderinproviders:
c.execute('INSERT INTO `table_settings_notifier` (name, enabled) VALUES (?, ?);',(provider,'0'))
c.execute('CREATE TABLE "table_movies" ( `tmdbId` TEXT NOT NULL UNIQUE, `title` TEXT NOT NULL, `path` TEXT NOT NULL UNIQUE, `languages` TEXT, `subtitles` TEXT, `missing_subtitles` TEXT, `hearing_impaired` TEXT, `radarrId` INTEGER NOT NULL UNIQUE, `overview` TEXT, `poster` TEXT, `fanart` TEXT, "audio_language""text", `sceneName` TEXT, PRIMARY KEY(`tmdbId`) )')
except:
pass
try:
c.execute('CREATE TABLE "table_history_movie" ( `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, `action` INTEGER NOT NULL, `radarrId` INTEGER NOT NULL, `timestamp` INTEGER NOT NULL, `description` TEXT NOT NULL )')