python-plexapi icon indicating copy to clipboard operation
python-plexapi copied to clipboard

onlinemediasources empty until already edited

Open mtthidoteu opened this issue 2 years ago • 0 comments

Describe the Bug

I am attempting to enable a way for new users to optout of the plex default online media sources by default. However, I am encountering a problem:

the MyPlexAccount(token).onlineMediaSources() function is empty until the user has already edited the sources from the web interface.

I am thinking this is probably a limitation with the Plex API itself and not this library. However, I might be wrong.

If so, is there a workaround you could recommend? Thanks

Code Snippets

def optOutOnlineSources(token):
    user = MyPlexAccount(token)
    for source in user.onlineMediaSources():
        source.optOut()
    return

Expected Behavior

No response

Additional Context

No response

Operating System and Version

macOS

Plex Media Server Version

Version 4.87.2

Python Version

3.11

PlexAPI Version

4.13.2

mtthidoteu avatar Feb 18 '23 13:02 mtthidoteu