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

Jellyseerr integration #351

Merged
merged 13 commits into from
Jul 31, 2024
Merged

Jellyseerr integration #351

merged 13 commits into from
Jul 31, 2024

Conversation

hrfee
Copy link
Owner

@hrfee hrfee commented Jul 30, 2024

Adds Jellyseerr integration on par with, or better than the current Ombi integration:

  • Profiles for user and notification settings can be added in Settings > User Profiles, similarly to Ombi

  • On invites w/ a profile w/ a Jellyseerr profile, and when creating accounts from the admin page, creating an account triggers the Jellyseerr user importer (on the created user only), resulting in a "Jellyfin User" which uses Jellyfin for auth, avoiding the need for password synchronization.

  • Email, Discord and Telegram details are synchronized, as are contact preferences for each (hopefully)

  • Existing accounts without a "Jellyseerr account" will have them automatically created.

  • "Import existing users" setting triggers daemon to auto-import Jellyfin users.

    • Doesn't apply a profile, but
    • More granular "Modify Settings" feature in accounts allows application of only the Jellyseerr component,
    • So once the bulk of old users are imported, admin can select them all and "profile" them, and will likely only need to once.
  • Look into synchronizing disabled account state. Jellyseerr correctly handles disabled accounts already.

Uses an API key found in Jellyseerr's settings page.

Basic API client available in the "jellyseer/" directory.

Also involved some cleanup of the various daemons.

hrfee added 6 commits July 29, 2024 16:46
Currently uses an API key (Seems simpler for the user than importing the
jfa-go user and granting perms). Strategy as follows:
* MustGetUser(jfID) function checks the cache for user, if not, calls
  Jellyseerr's importer passing jfID. From either, the user object is
  returned, which (in later commits) can be used to update the user's
  email (and potentially other info).

My API key is in there rn but its for a local testing instance, who
cares.
addded permissions get/set before realizing it already comes as part of
the User object. Split User attributes that will be templated into
UserTemplate struct, which User inherits. ApplyTemplateToUser takes a
UserTemplate, while ModifyUser takes a plain map with some typed fields
(display name and email, for now).
similar in style to User, with Notifications/NotificationsTemplate, and
named fields for modifying discord and telegram IDs, and two modify
methods.
added in the same way as ombi profiles. Most code is copy-pasted and
adjusted from ombi (especially on web), so maybe this can be merged in
the future. Also, profile names are url-escaped like announcement
template names were not too long ago. API client has "LogRequestBodies"
option which just dumps the request body when enabled (useful for
recreating reqs in the jellyseerr swagger UI). User.Name() helper
returns a name from all three possible values in the struct.
changed to a pointer so it can be nil-ed, and an Empty() receiver method
is used to check if it needs it in ApplyNotificationsTemplateToUser.
All-zeros in NotifTypes means the user shouldn't receive any
communication, which is a state we'd like to store in/apply from a profile.
Copy link

netlify bot commented Jul 30, 2024

Deploy Preview for jfa-go canceled.

Name Link
🔨 Latest commit d60dea6
🔍 Latest deploy log https://app.netlify.com/sites/jfa-go/deploys/66aa42225f330b0008f38188

hrfee added 3 commits July 30, 2024 20:55
hopefully all places where contact methods can be adjusted should sync
with jellyseerr.
Checkboxes added when applying from a profile.
@hrfee
Copy link
Owner Author

hrfee commented Jul 31, 2024

Merging since no real affect on other parts of the software, and I actual people to try it.

@hrfee hrfee merged commit efa113a into main Jul 31, 2024
4 checks passed
"import_existing" option in settings enables an every 5-minute daemon
which loops through users and imports them to Jellyseerr and copies
contact info, if necessary. Also sets new API client flag
AutoImportUsers, which decides whether to automatically import non-existent users in
it's various methods.

also cleaned up the various daemons in the software, most now using the
GenericDaemon struct and just providing a new constructor.

broken page loop in jellyseerr client also fixed.
hrfee added 3 commits July 31, 2024 15:31
single req() function is wrapped by methods for each http method, and
error messages are parsed and returned if given by the server.

also added note about Jellyseerr's enforcement of unique email addresses
in settings.
was 30s for testing, is now every 10 minutes.
Basically, added the ability to -not- apply the profile's policy.
@Mavyre
Copy link

Mavyre commented Oct 25, 2024

Hey! Thanks for the new feature. I'm migrating from Ombi to Jellyseerr. Which docker version of jfa-go can I use to get the Jellyseerr integration? It doesn't seem to be on the latest tag yet. Thanks again!

@hrfee
Copy link
Owner Author

hrfee commented Oct 25, 2024

Hey! Thanks for the new feature. I'm migrating from Ombi to Jellyseerr. Which docker version of jfa-go can I use to get the Jellyseerr integration? It doesn't seem to be on the latest tag yet. Thanks again!

hrfee/jfa-go:unstable.

@xiNeRoar
Copy link

Is there any plan to merge to the main?

@awb1015
Copy link

awb1015 commented Jan 19, 2025

I’m currently using this via unstable and it seems to work as expected for the normal user flow that follows an email invite. I’ve set the profile to include a template user in Jellyfin as well as JellySeerr.

However, when I create a user via the admin panel and User -> New User it doesn’t include the email address in JellySeerr but the user is created in JellySeerr.

Potentially unrelated but when I click create I also get a notification for an error that the email couldn’t be sent. However, I have manually verified that it is indeed sent.

Let me know if you’d rather I create an issue instead

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

Successfully merging this pull request may close these issues.

4 participants