Refactor plex configuration to plugins.plex

This commit is contained in:
Labrys of Knossos 2019-03-10 10:58:17 -04:00
parent 1d75439441
commit e12f2724e6
2 changed files with 22 additions and 24 deletions

19
core/plugins/plex.py Normal file
View file

@ -0,0 +1,19 @@
import core
def configure_plex(config):
core.PLEX_SSL = int(config['Plex']['plex_ssl'])
core.PLEX_HOST = config['Plex']['plex_host']
core.PLEX_PORT = config['Plex']['plex_port']
core.PLEX_TOKEN = config['Plex']['plex_token']
plex_section = config['Plex']['plex_sections'] or []
if plex_section:
if isinstance(plex_section, list):
plex_section = ','.join(plex_section) # fix in case this imported as list.
plex_section = [
tuple(item.split(','))
for item in plex_section.split('|')
]
core.PLEX_SECTION = plex_section