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

Sychronize app settings through Jellyfin server #859

Open
Sp4rky001 opened this issue Sep 1, 2024 · 9 comments
Open

Sychronize app settings through Jellyfin server #859

Sp4rky001 opened this issue Sep 1, 2024 · 9 comments

Comments

@Sp4rky001
Copy link

Is there a mechanism within Jellyfin to store custom information such as Finamp settings?

It would be a nice feature to have a toggle that downloads the Finamp settings from the Jellyfin server. I have the app installed in multiple places and I need to manually set up my preferences on ever device.

Settings such as storage location would have to be ignored, of course, but UI preferences should be synchronized.

@Chaphasilor
Copy link
Collaborator

Hey, Jellyfin sadly doesn't have such a feature. Only regular Jellyfin user settings can be used for this, but most of these don't apply to Finamp at all.

However, sharing settings (e.g. via a file) would be a nice additon, also for bug reports. I was planning to include the settings when sharing logs, but sharing just the settings of course makes sense as well!

@Sp4rky001
Copy link
Author

So this has been knocking around in my head and I thought that there might be an easy way to make it work. I whipped up a quick and dirty Jellyfin plugin that creates an API endpoint in the Jellyfin API. My thinking is that settings, along with the modification date can be serialized into JSON and posted to the endpoint. The plugin would save the json to a file somewhere (in the Jellyfin config folder, for instance) instead of trying to find some place in the database to store it. Beyond that, it would need to be worked out when and how often to check for settings changes.

In the screenshot, I created a /Finamp/Settings endpoint with a post and get method:

image

@Chaphasilor
Copy link
Collaborator

Chaphasilor commented Sep 6, 2024

Oh sweet! I don't have enough disk space to set up a Jellyfin dev environment, but I did mean to look into plugin development eventually, since that would be useful for Jellyfin Rewind. So I'm really excited that you're going this route!

As for the settings, some kind of serialization has been panned for a while now, since that would enable us to include the current settings when sharing logs. JSON would be fine for that I guess. A DB file like SQLite or Hive should also work, and would be nicer for querying logs though. Uploading that file to the server shouldn't be an issue either, I guess.

As for synchronizing settings, we could just do that on startup. If there's mismatch, we could prompt the user, since some settings require a restart to apply, so doing it in the background is not an option.
We can also use websockets for real-time synchronization, this is the works anyway as part of the remote control functionality (#850)

We should have a way to opt in or out of sync though. I was thinking of a "profile" feature, where you can have different settings profile channels on the server, and keep in sync with any one of them, or none (a local profile).

Having a server plugin specifically for Finamp would of course enable some additional functionality, like synchronizing the queue state.

@Sp4rky001
Copy link
Author

wow, it sounds ambitious. I guess it needs some direction and planning rather than just jumping in and making a feature that may not fit into the roadmap. I just wanted to give my ideas here and if you have something specific, and if I can handle it, I'd be happy to help.

@Chaphasilor
Copy link
Collaborator

Hey don't get me wrong, I think your attempt so far is amazing! Please keep on playing around with it, maybe create some proof of concept? 😁

The details aren't terribly important, just make sure to not put in too much work ^^
Feel free to focus on just the settings for now, ignoring what I said about logs :P

@Sp4rky001
Copy link
Author

ha ha, will do.

@Chaphasilor
Copy link
Collaborator

@Sp4rky001 any updates on this? 😁

@Sp4rky001
Copy link
Author

I actually got very busy at work, but before I stopped working on it, I looked into Jellyfin's websocket events plugin. Unfortunately, that did not have a way for other plugins to fire events. I thought it might be a good way to allow all clients to get notified of a settings change and update accordingly.

Otherwise, I didn't get into the weeds of setting up the endpoint to receive the settings file and put it on a local disk.

@Chaphasilor
Copy link
Collaborator

Okay. I mean, Websocket push updates could be added later on. With the new 6 month release cadence the Jellyfin server should be much more agile when it comes to introducing new features, so it's not unthinkable.

If you get around to saving and restoring files to/from the server through a plugin, do let me know. I could whip up a draft PR for you to test with Finamp; the settings system is due for some refactoring anyway.

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

No branches or pull requests

2 participants