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

Add support for managed hubs and collection visibility

Open meisnate12 opened this issue 4 years ago • 8 comments

Description

Added methods to get collection visibility and to be able to set the collection's visibility

Type of change

Please delete options that are not relevant.

  • [x] New feature (non-breaking change which adds functionality)
  • [x] This change requires a documentation update

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have added or updated the docstring for new or existing methods
  • [x] I have added tests when applicable

meisnate12 avatar Jun 30 '21 12:06 meisnate12

Test should be added.

JonnyWong16 avatar Jul 02 '21 17:07 JonnyWong16

Thanks for all the feedback I'll dive into this over the weekend and make all the changes you requested

meisnate12 avatar Jul 02 '21 17:07 meisnate12

@JonnyWong16 Updated with your changes and added the ability to grab/reset all managed hubs. I attempted to add some tests for collection visibility but the test is just getting a Not Found Response plexapi.exceptions.NotFound: (404) not_found; http://127.0.0.1:32400/hubs/sections/1/manage?metadataItemId=86 <html><head><title>Not Found</title></head><body><h1>404 Not Found</h1></body></html>

The only way I was able to get a 404 Not Found Response if i give the url an invalid section ID which should be acquired automatically by the module. Im not realyl sure what to do to fix the test and i was hoping you had some insight

meisnate12 avatar Jul 22 '22 15:07 meisnate12

It might be because collection visibility option require Plex Pass so it will fail for the unclaimed tests.

  1. Add another unclaimed test using one of the standard manage hubs (like Recently Added).
  2. Mark your collection test with @pytest.mark.authenticated so it will only run during the claimed tests which has Plex Pass.

JonnyWong16 avatar Jul 22 '22 15:07 JonnyWong16

It looks like unclaimed servers do not have recommendations at all, so the library test also needs to be marked as authenticated.

image

JonnyWong16 avatar Jul 31 '22 20:07 JonnyWong16

i dont mind all the comments at all. All your updates should be in and the tests have passed let me know if you need me to do anything else.

meisnate12 avatar Aug 01 '22 15:08 meisnate12

let me know if theres any more changes you need me to make

meisnate12 avatar Aug 05 '22 02:08 meisnate12

Looks good!

JonnyWong16 avatar Aug 05 '22 03:08 JonnyWong16