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

pre-populate server info from plex.tv API #563

Merged
merged 2 commits into from
Jan 25, 2021

Conversation

chriscpritchard
Copy link
Contributor

@chriscpritchard chriscpritchard commented Jan 3, 2021

Description

Adds the ability to automatically configure plex servers from the plex.tv API.

Screenshot (if UI related)

image
image
image
image

Todos

  • Add API endpoint
  • Add form field in plex settings
  • Display available servers in form field
  • Allow selection of server retrieved via API
  • Complete API documentation for swagger
  • Check status of servers

Issues Fixed or Closed by this PR

@sct sct added this to In progress in Beta Release Roadmap via automation Jan 3, 2021
@chriscpritchard chriscpritchard changed the title feat: pre-populate server info from plex.tv API WIP: pre-populate server info from plex.tv API Jan 3, 2021
@samwiseg0
Copy link
Collaborator

We should only present the servers the admin owns. owned="1"

@chriscpritchard
Copy link
Contributor Author

Functional and should behave as expected, would welcome some testing prior to merge.

@chriscpritchard chriscpritchard marked this pull request as ready for review January 4, 2021 00:27
@sct sct changed the title WIP: pre-populate server info from plex.tv API pre-populate server info from plex.tv API Jan 4, 2021
server/api/plextv.ts Outdated Show resolved Hide resolved
server/api/plextv.ts Outdated Show resolved Hide resolved
server/api/plextv.ts Outdated Show resolved Hide resolved
src/components/Settings/SettingsPlex.tsx Outdated Show resolved Hide resolved
src/components/Settings/SettingsPlex.tsx Outdated Show resolved Hide resolved
src/components/Settings/SettingsPlex.tsx Outdated Show resolved Hide resolved
src/components/Settings/SettingsPlex.tsx Outdated Show resolved Hide resolved
src/components/Settings/SettingsPlex.tsx Outdated Show resolved Hide resolved
src/components/Settings/SettingsPlex.tsx Outdated Show resolved Hide resolved
server/lib/settings.ts Outdated Show resolved Hide resolved
overseerr-api.yml Outdated Show resolved Hide resolved
@chriscpritchard chriscpritchard force-pushed the plex-api-server-info branch 2 times, most recently from 89cb0d0 to 0889d2b Compare January 12, 2021 19:36
@sct
Copy link
Owner

sct commented Jan 14, 2021

I can't even start this at the moment: Getting this error:

{
message: "can't resolve reference #components/schemas/PlexSettings from id #"
}

Alos this promise rejection in the console

(node:27099) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:27099) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:27099) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)```

@lgtm-com
Copy link

lgtm-com bot commented Jan 19, 2021

This pull request introduces 1 alert when merging cfd2f0f into 78444a9 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@chriscpritchard chriscpritchard force-pushed the plex-api-server-info branch 2 times, most recently from 113fd5d to 52c79d2 Compare January 20, 2021 10:50
@sct
Copy link
Owner

sct commented Jan 22, 2021

Is the intention for it to always be set back to Manually Configure after coming back to the page?

@sct
Copy link
Owner

sct commented Jan 22, 2021

I think the "Timeout" feature needs more context. Maybe a small description that explains what the purpose of the option is.

@sct
Copy link
Owner

sct commented Jan 22, 2021

Maybe we should rethink the UX for this. Because of the slow load time of the dropdown, maybe we should design this in a way where it's an option to "prefill" the input fields for you. It doesn't have to constantly fetch this every time we go to the plex page (or really ever after they initially set it), right?

@chriscpritchard chriscpritchard force-pushed the plex-api-server-info branch 3 times, most recently from 1d5a681 to 62b3375 Compare January 23, 2021 11:21
chriscpritchard and others added 2 commits January 25, 2021 07:27
Retrieve server settings from plex.tv, including checking server connectivity. Includes a refactor (non-breaking) of the plex connection code to enable settings to be passed to it without saving them (e.g. to test manual configuration without saving).

fix sct#289
@sct sct merged commit 82ac76b into sct:develop Jan 25, 2021
Beta Release Roadmap automation moved this from In progress to Done Jan 25, 2021
@github-actions
Copy link

🎉 This PR is included in version 1.18.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Use the Plex API to pre-populate the server information
3 participants