Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting object returns none for enumValues attribute of agent settings. #863

Closed
ReenigneArcher opened this issue Jan 1, 2022 · 0 comments · Fixed by #864
Closed

Setting object returns none for enumValues attribute of agent settings. #863

ReenigneArcher opened this issue Jan 1, 2022 · 0 comments · Fixed by #864

Comments

@ReenigneArcher
Copy link
Contributor

Describe the Bug

Setting object returns none for enumValues attribute of agent settings.

I can however get the list of values from http://<ip>:<port>/:/plugins/<agent_identifier>/prefs?X-Plex-Token=<token> separated by |

Example of xml output from URL above:

<Setting secure="false" default="2" value="1" label="LOGGING|Log level" values="NONE|DEBUG|INFO|WARNING|ERROR|CRITICAL" type="enum" id="enum_LogLevel"/>

Example Output of Code Snippet below:

{'_server': <PlexServer:http://ipaddress:>, '_data': <Element 'Setting' at 0x0000020E4F1F5C70>, '_initpath': '/system/agents', '_parent': <weakref at 0x0000020E4F25D310; to 'Agent' at 0x0000020E4F306400>, '_details_key': None, '_set
Value': None, 'id': 'enum_LogLevel', 'label': 'LOGGING|Log level', 'summary': None, 'type': 'enum', 'default': '2', 'value': '1', 'hidden': None, 'advanced': None, 'group': None, 'enumValues': None, '_autoReload': False}

Code Snippets

url = 'url'
token = 'token'
agent_identifier = 'agent_identifier'

from plexapi.server import PlexServer
PlexObject = PlexServer

PlexServer = PlexObject(url, token)

for agent in PlexServer.agents(mediaType='movie'):
    if agent.__dict__['identifier'] == agent_identifier:
        agent_settings = agent._settings()
        for setting in agent_settings:
            if setting.id == 'enum_LogLevel':
                print(setting.__dict__)

Expected Behavior

enumValues should be list of available choices instead of None

Additional Context

No response

Operating System and Version

Windows 10 Pro

Plex Media Server Version

1.25.2.5319

Python Version

3.9.6

PlexAPI Version

4.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant