alex-phillips / plex-autocollections

GNU General Public License v3.0
147 stars 31 forks source link

Add support for plex library env variable #49

Open jwmoss opened 3 years ago

alex-phillips commented 3 years ago

This is great! Instead of your changes in get_server_section, I think you need to add a check for the CLI argument vs the environment variable before we initialize the plex instance. See line 120 of your PR. Do something like:

    if args.library or PLEX_LIBRARY:
        plex = Plex(args.library or PLEX_LIBRARY)
    else:
        plex = Plex()

(untested) but I think that would work.