Skip to content

RFE: Add API to override Platform #706

Description

@glensc

Describe the issue

There's currently no programmatic way to override Platform and Client name.

Hacks like overwriting X_PLEX_PLATFORM / X_PLEX_DEVICE_NAME do not work without more internal symbols hacking, because those values are copied elsewhere:

Setting environment variables also does not work, as that needs to be done before the import plexapi is called.

Code snippets

from os import getenv, environ
import plexapi

        plex_config = {
            'PLEXAPI_HEADER_PLATFORM': 'PlexTraktSync',
            'PLEXAPI_HEADER_DEVICE_NAME': 'PlexTraktSync',
        }
        plexapi.X_PLEX_DEVICE_NAME = 'PlexTraktSync'
        for k, v in plex_config.items():
            environ[k] = v

Expected behavior

    plex = PlexServer(url, token, device_platform='PlexTraktSync')

Additional context

Trying to make changes identifiable to be able to skip own changes. I.e skip changes identified by named device:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions