mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-16 02:02:53 -07:00
Refactor plex configuration to plugins.plex
This commit is contained in:
parent
1d75439441
commit
e12f2724e6
2 changed files with 22 additions and 24 deletions
19
core/plugins/plex.py
Normal file
19
core/plugins/plex.py
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue