-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
allow sync direction to be set per user #196
Conversation
hmm not working as expected. Need to do a deeper dive into the code. |
I am fine with creating a new structure for a feature like this as long as we dont break the old one. We can create a new env like advanced_servers or something that takes a json structure like you pointed to
End result would be 1stuser will be synced between Plex and Jelly and then a one way from Plex to Plex2. The emby server is only a receiver so it will accept syncs going in but will not sync anything out so in this case Jelly will sync one way to Emby for all matching usernames. What are your thoughts on something like that? |
So my suggestion on the more complex structure was only if there are future plans for a significant re write. If we want to remain backwards compatible that is doable. Something along the lines of:
I was thinking of keeping sync settings separate from server so the user could define any direction. For example
So at the top level we could define the global sync options and then be able to override per user. The key name of the user could be the default name and we could also provide a different name for each server. I feel this way the code itself could avoid checks like "should sync server2 to sever1 etc" and instead just read everything from the config and sync it as its determined by the config. At this time i don't know how we currently manage users as user names could be different for each user in each of the systems. So in your suggestion of using Anyways my current changes are not working so I need to spend some time going through the code to see if I can figure out how I can get this to work with minimal change using the new env var :). |
Hmm i see, your structure would be better. On mine it would have to be the same usernames across all servers or it would have to use the user mapping but that would only be for a single mapping and some people want multiple user mappings like in #127. With your stucture they can map to different usernames per server. We should also make some of those parts of the structure optional so its still easy for people to setup something similar to the current structure where they want all matching users from plex to jellyfin. i wonder if it would be worth making the user mapping a list so people can match across multiple accounts. At some point it sounds like it would be needlessly complicated lol. We are probably better off without the list for now. |
Can you open a ticket requesting your structure as the configuration that way i can work on it later |
I agree on complicated, I was thinking how one would specify block and allow set of users, library mappings and it did seem to be getting too complicated lol. The reason I prefer explicitly setting the username per server is because it would make the code easier to write. Briefly from what I have read we try to find the mapped user in the keys and the values to see if it exists etc. So at a high level I think of what would make the code easier to write and then come up with the config :). Logged #198 we could iterate over that. I will close this PR out as current code is not functional. Once I have it working I will send a PR or may be Ill just wait for #198 :) |
I have not tested this yet. Just wanted to see if the approach looked feasible. This would implement #150.
User would define an optional env var:
USER_SERVER_SYNC_MAPPING=['jellyfin']
This essentially says which servers do we want to sync to.
sync_users
method then returns an updated list of users we want to sync based on this variables.If this approach looks good I will work on validating it and documenting it.
Current approach is not ideal as ideally if we are not going to sync from Plex to Jellyfin then we can avoid collecting the matched data for that user as well. But I wanted to avoid too much change.
In future if we plan on re writing this then I would suggest a more complex setting for users config where we also capture the name and servers to sync etc. Something like
Something like above could allow one to explicitly decide what servers to sync and in what direction for each user. This way one could any number and types of servers and be able to control what to sync to as well.