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

feat: override rules #945

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open

feat: override rules #945

wants to merge 10 commits into from

Conversation

gauthier-th
Copy link
Collaborator

Description

This PR introduces override rules in Jellyseerr.
Override rules are used to define conditions for each service (i.e. for each Radarr/Sonarr server) on which parameters will be modified.
For example, it's possible to define a different quality profile for certain users, or change the root path according to the genre of a film or series, etc.

Screenshot (if UI-related)

image
image

To-Dos

  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Issues Fixed or Closed

@gauthier-th gauthier-th linked an issue Sep 15, 2024 that may be closed by this pull request
1 task
@gauthier-th gauthier-th added the preview PRs deployed for testing with tag `:preview-prxx` label Sep 16, 2024
@github-actions github-actions bot added the merge conflict Cannot merge due to merge conflicts label Oct 24, 2024
Copy link

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

@juancarlosromerogarcia
Copy link

lint & Test Build, Post Setup pnpm cache,
/bin/tar --posix -cf cache.tgz --exclude cache.tgz -P -C /__w/jellyseerr/jellyseerr --files-from manifest.txt -z
/bin/tar: unrecognized option: posix

@gauthier-th
Copy link
Collaborator Author

lint & Test Build, Post Setup pnpm cache,
/bin/tar --posix -cf cache.tgz --exclude cache.tgz -P -C /__w/jellyseerr/jellyseerr --files-from manifest.txt -z
/bin/tar: unrecognized option: posix

What is this supposed to mean?

@juancarlosromerogarcia
Copy link

lint & Test Build, Post Setup pnpm cache, /bin/tar --posix -cf cache.tgz --exclude cache.tgz -P -C /__w/jellyseerr/jellyseerr --files-from manifest.txt -z /bin/tar: unrecognized option: posix

lint & Test Build, Post Setup pnpm cache,
/bin/tar --posix -cf cache.tgz --exclude cache.tgz -P -C /__w/jellyseerr/jellyseerr --files-from manifest.txt -z
/bin/tar: unrecognized option: posix

What is this supposed to mean?

A small attempt to help someone who knows how to resolve the merge conflict. I don't have much of an idea.

@github-actions github-actions bot removed the merge conflict Cannot merge due to merge conflicts label Oct 26, 2024
@gauthier-th
Copy link
Collaborator Author

For anyone willing to test this, it's available with the preview tag: preview-override-rules
PS: remember to do backups 😉

@feerlessleadr
Copy link

@gauthier-th I just pulled this image and am doing some testing. For some reason when I try to add an override rule to either sonarr or radarr, I'm not able to create the rule. When I click on 'Creat Rule' nothing happens, and I don't see anything (either errors or anything at all) either the jellyseer log or the docker logs. Here is the rule I'm trying to create for sonarr:

image

@gauthier-th
Copy link
Collaborator Author

@gauthier-th I just pulled this image and am doing some testing. For some reason when I try to add an override rule to either sonarr or radarr, I'm not able to create the rule. When I click on 'Creat Rule' nothing happens, and I don't see anything (either errors or anything at all) either the jellyseer log or the docker logs. Here is the rule I'm trying to create for sonarr:

image

I just rebased the PR to the latest commit of develop, can you please test again with this version? (you'll need to update the Docker image)

If it's still not working, could you check Jellyseerr logs as well as your browser logs and see if there is anything there? (F12 -> Console)

@juancarlosromerogarcia
Copy link

I have tried it but nothing happens when I press the create rule button. In my browser console, every so often, it shows a 404 error: message "SQLITE_ERROR: no such table: override_rule"

@Fallenbagel
Copy link
Owner

I have tried it but nothing happens when I press the create rule button. In my browser console, every so often, it shows a 404 error: message "SQLITE_ERROR: no such table: override_rule"

That means your migrations didn't apply. Can you test with a fresh config first?

@juancarlosromerogarcia
Copy link

I have tried it but nothing happens when I press the create rule button. In my browser console, every so often, it shows a 404 error: message "SQLITE_ERROR: no such table: override_rule"

That means your migrations didn't apply. Can you test with a fresh config first?

I have tried again with a fresh configuration and the same thing happens. I have searched for the override_rule table in db.sqlite3 and it does not appear.

@starlingfire
Copy link

I just tried testing this as well, and can't get the override screen to appear. Here's how I set it up, in case I did something wrong:

  1. Cloned this repo
  2. Changed to develop branch: git branch develop
  3. Build/run with docker compose: docker compose up -d
  4. Connect to local Radarr and Jellyfin instances

My Radarr edit screen looks like this:

image

The About page shows I'm on develop:

image

Ran the following to confirm my working environment:

root@playground:~/jellyseerr# git switch develop
Already on 'develop'
Your branch is up to date with 'origin/develop'.

@Fallenbagel
Copy link
Owner

I just tried testing this as well, and can't get the override screen to appear. Here's how I set it up, in case I did something wrong:

  1. Cloned this repo
  2. Changed to develop branch: git branch develop
  3. Build/run with docker compose: docker compose up -d
  4. Connect to local Radarr and Jellyfin instances

My Radarr edit screen looks like this:

image

The About page shows I'm on develop:

image

Ran the following to confirm my working environment:

root@playground:~/jellyseerr# git switch develop
Already on 'develop'
Your branch is up to date with 'origin/develop'.

It's not in develop branch. It's in override rules. Also you don't need to build the image we already have preview-override-rules as an image...

@starlingfire
Copy link

starlingfire commented Nov 18, 2024

It's not in develop branch. It's in override rules. Also you don't need to build the image we already have preview-override-rules as an image...

Thank you!

Got the preview image running, and I get 404 errors in the browser log trying to save the override rule (and on a recurring basis simply while on that screen).

XHRGET
http://192.168.1.205:5055/api/v1/overrideRule
[HTTP/1.1 404 Not Found 8ms]

	
GET
	http://192.168.1.205:5055/api/v1/overrideRule
Status
404
Not Found
VersionHTTP/1.1
Transferred298 B (56 B size)
Referrer Policystrict-origin-when-cross-origin
DNS ResolutionSystem

    	
    Connection
    	keep-alive
    Content-Length
    	56
    Content-Type
    	application/json; charset=utf-8
    Date
    	Mon, 18 Nov 2024 18:38:16 GMT
    ETag
    	W/"38-[redacted]"
    Keep-Alive
    	timeout=5
    X-Powered-By
    	Express
    	
    Accept
    	*/*
    Accept-Encoding
    	gzip, deflate
    Accept-Language
    	en-US,en;q=0.5
    Connection
    	keep-alive
    Cookie
    	connect.sid=[redacted]
    DNT
    	1
    Host
    	192.168.1.205:5055
    Priority
    	u=4
    Referer
    	http://192.168.1.205:5055/settings/services
    Sec-GPC
    	1
    User-Agent
    	Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0

Edit: Using the local API page, I get the same error as @juancarlosromerogarcia:

{
  "message": "SQLITE_ERROR: no such table: override_rule"
}

@gauthier-th
Copy link
Collaborator Author

Oops, I may have forgotten to write the migration. I'll write them and it should work better 😅

@gauthier-th
Copy link
Collaborator Author

@starlingfire the migration script has been added. Can you please test again? (you'll need to update the Docker image)

@starlingfire
Copy link

@gauthier-th so far, so good. I added an override rule to put a user's downloads in a different root folder, and it appears to be working. I'll mess around with it more tomorrow when I get a bit more time. I'm so excited to have this feature!

@feerlessleadr
Copy link

Just tested on my system and it seems to be working as well. Thanks for this!

@juancarlosromerogarcia
Copy link

I have tested both sonarr and radarr with various rules that assign root folders depending on the user. It works without problems.
gauthier-th thanks a lot for your work.

@Yankees4life
Copy link

@Fallenbagel

I hope this gets merged. It will certainly help me set up Radarr Anime instances easily

@actuallyevan
Copy link

Would this allow routing to multiple *arr instances simultaneously? Really looking forward to this being merged!

@gauthier-th
Copy link
Collaborator Author

Would this allow routing to multiple *arr instances simultaneously?

No, this will not change the behavior of the *arr instances, just change which parameters are passed to the instance when a media is requested.

@starlingfire
Copy link

Would this allow routing to multiple *arr instances simultaneously? Really looking forward to this being merged!

This will let you route media to different root folders based on who made the request, so each user can add to their own individual library. But you can do that within the same instance of the arr stack, you don't need multiple.

@actuallyevan
Copy link

Would this allow routing to multiple *arr instances simultaneously? Really looking forward to this being merged!

This will let you route media to different root folders based on who made the request, so each user can add to their own individual library. But you can do that within the same instance of the arr stack, you don't need multiple.

Yeah, I figured. Eventually hoping for something like this to become native functionality in a *seerr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview PRs deployed for testing with tag `:preview-prxx`
Projects
None yet
7 participants