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

refactor(jellyfin): abstract jellyfin hostname, updated ui to reflect it, better validation #773

Merged
merged 23 commits into from
Jun 13, 2024

Conversation

fallenbagel
Copy link
Owner

@fallenbagel fallenbagel commented May 25, 2024

Warning

BREAKING CHANGE: Jellyfin settings now does not include a hostname. Instead it abstracted it to ip, port, useSsl, and urlBase. However, migration of old settings to new settings should work automatically.

Description

This PR refactors and abstracts jellyfin hostname into, jellyfin ip, jellyfin port, jellyfin useSsl, and jellyfin urlBase. This makes it more consistent with how plex settings are stored as well. In addition, this improves validation as validation can be applied seperately to them instead of as one whole regex doing the work to validate the url.
UI was updated to reflect this.

Screenshot (if UI-related)

image

To-Dos

  • Successful build yarn build
  • Translation keys yarn i18n:extract
    - [ ] Database migration (if required)
  • Abstract settings migration logic
  • Figure out why cypress tests are failing

Issues Fixed or Closed

  • Fixes #XXXX

… reflect it, better validation

This PR refactors and abstracts jellyfin hostname into, jellyfin ip, jellyfin port, jellyfin useSsl,
and jellyfin urlBase. This makes it more consistent with how plex settings are stored as well. In
addition, this improves validation as validation can be applied seperately to them instead of as one
whole regex doing the work to validate the url.
UI was updated to reflect this.

BREAKING CHANGE: Jellyfin settings now does not include a hostname. Instead it abstracted it to ip,
port, useSsl, and urlBase. However, migration of old settings to new settings should work
automatically.
Copy link

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

@github-actions github-actions bot added the merge conflict Cannot merge due to merge conflicts label May 25, 2024
@github-actions github-actions bot removed the merge conflict Cannot merge due to merge conflicts label May 26, 2024
…alid

This should fix the issue where settings are saved even if the url
was invalid. Now the settings will only be saved if the url is
valid. Sort of like a test connection.
@fallenbagel fallenbagel requested a review from gauthier-th May 26, 2024 14:27
@fallenbagel fallenbagel force-pushed the refactor-jellyfin-settings branch from e84d5f2 to 43e0a29 Compare May 26, 2024 14:42
gauthier-th
gauthier-th previously approved these changes May 27, 2024
Copy link
Collaborator

@gauthier-th gauthier-th left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on my config. As it is a critical breaking change, could we have more people testing and reviewing this?

@fallenbagel
Copy link
Owner Author

Works on my config. As it is a critical breaking change, could we have more people testing and reviewing this?

I will be creating a preview tag for this and try to get people to test this

@fallenbagel
Copy link
Owner Author

This pr should be available to test using the tag:
preview-pr773

@sgtcoder
Copy link

I am getting a Something went wrong while trying to sign in. When trying to login to Jellyseerr using Emby.

@fallenbagel
Copy link
Owner Author

I am getting a Something went wrong while trying to sign in. When trying to login to Jellyseerr using Emby.

Could you share logs?

@sgtcoder
Copy link

No logs get generated in the logs folder.

@sgtcoder
Copy link

In console log I get this

"Jellyfin login is disabled"
"cookie 'connect.sid' required"

@fallenbagel
Copy link
Owner Author

fallenbagel commented May 28, 2024

In console log I get this

"Jellyfin login is disabled"
"cookie 'connect.sid' required"

A new preview tag should be available in about half an hour with a fix (when all the checks in this PR turns green). You'll just need to pull it.

@sgtcoder
Copy link

Sounds good, let me know when it's updated.

Copy link
Contributor

@Gauvino Gauvino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only migration problem but, other else looks good !

@fallenbagel fallenbagel marked this pull request as draft May 31, 2024 15:18
@fallenbagel fallenbagel force-pushed the refactor-jellyfin-settings branch from 74a522d to ce04315 Compare May 31, 2024 23:08
@fallenbagel fallenbagel marked this pull request as draft May 31, 2024 23:09
@fallenbagel fallenbagel changed the title refactor(jellyfin): abstract jellyfin hostname, updated ui to eflect it, better validation refactor(jellyfin): abstract jellyfin hostname, updated ui to reflect it, better validation May 31, 2024
cypress settings were lacking some of the jobs so when the startJobs() is called when the app
starts, it was failing to schedule the jobs where their cron timings were not specified in the
cypress settings. Therefore, this commit adds those jobs back. In addition, other setting options
were added to keep cypress settings consistent with a normal user.
…error

format check locally passes on this file. However, it fails during the github actions format check.
Therefore, json language features formatter was run instead of prettier to see if that fixes the
issue.
@fallenbagel fallenbagel force-pushed the refactor-jellyfin-settings branch from 5ad99ee to 62f97b3 Compare June 1, 2024 00:46
fallenbagel added a commit that referenced this pull request Jun 1, 2024
This is to try and fix formatting issues on #773 on a file
that should be ignored.
fallenbagel added a commit that referenced this pull request Jun 1, 2024
This is to try and fix formatting issues on #773 on a file
that should be ignored.
added back the rest of the cypress settings and removed cypress settings from .prettierignore
@fallenbagel fallenbagel marked this pull request as ready for review June 1, 2024 01:35
@gauthier-th
Copy link
Collaborator

@sgtcoder could you test it one more time please?

Copy link

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

@github-actions github-actions bot added the merge conflict Cannot merge due to merge conflicts label Jun 12, 2024
@github-actions github-actions bot removed the merge conflict Cannot merge due to merge conflicts label Jun 13, 2024
@fallenbagel fallenbagel requested a review from gauthier-th June 13, 2024 12:11
@gauthier-th gauthier-th merged commit 38ad875 into develop Jun 13, 2024
8 checks passed
bonswouar pushed a commit to bonswouar/jellyseerr that referenced this pull request Jun 14, 2024
… it, better validation (fallenbagel#773)

* refactor(jellyfinsettings): abstract jellyfin hostname, updated ui to reflect it, better validation

This PR refactors and abstracts jellyfin hostname into, jellyfin ip, jellyfin port, jellyfin useSsl,
and jellyfin urlBase. This makes it more consistent with how plex settings are stored as well. In
addition, this improves validation as validation can be applied seperately to them instead of as one
whole regex doing the work to validate the url.
UI was updated to reflect this.

BREAKING CHANGE: Jellyfin settings now does not include a hostname. Instead it abstracted it to ip,
port, useSsl, and urlBase. However, migration of old settings to new settings should work
automatically.

* refactor: remove console logs and use getHostname and ApiErrorCodes

* fix: store req.body jellyfin settings temporarily and store only if valid

This should fix the issue where settings are saved even if the url
was invalid. Now the settings will only be saved if the url is
valid. Sort of like a test connection.

* refactor: clean up commented out code

* refactor(i18n): extract translation keys

* fix(auth): auth failing with jellyfin login is disabled

* fix(settings): jellyfin migrations replacing the rest of the settings

* fix(settings): jellyfin hostname should be carried out if hostname exists

* fix(settings): merging the wrong settings source

* refactor(settings): use migrator for dynamic settings migrations

* refactor(settingsmigrator): settings migration handler and the migrations

* test(cypress): fix cypress tests failing

cypress settings were lacking some of the jobs so when the startJobs() is called when the app
starts, it was failing to schedule the jobs where their cron timings were not specified in the
cypress settings. Therefore, this commit adds those jobs back. In addition, other setting options
were added to keep cypress settings consistent with a normal user.

* chore(prettierignore): ignore cypress/config/settings.cypress.json as it does not need prettier

* chore(prettier): ran formatter on cypress config to fix format check error

format check locally passes on this file. However, it fails during the github actions format check.
Therefore, json language features formatter was run instead of prettier to see if that fixes the
issue.

* test(cypress): add only missing jobs to the cypress settings

* ci: attempt at trying to get formatter to pass on cypress config json file

* refactor: revert the changes brought to try and fix formatter

added back the rest of the cypress settings and removed cypress settings from .prettierignore

* refactor(settings): better erorr logging when jellyfin connection test fails in settings page
@fallenbagel
Copy link
Owner Author

🎉 This PR is included in version 2.0.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
None yet
Development

Successfully merging this pull request may close these issues.

4 participants