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

Add profile image synchronization #154

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

SanseroGames
Copy link
Contributor

This PR addresses #85 and implements profile image synchronization from LDAP to Jellyfin.

The profile image is set when a user account is created and automatically synchronized in a configurable interval using a scheduled task. The attribute to retrieve the profile image can be configured and is set to jpegphoto by default. Profile image synchronization is disabled by default and can be enabled in the settings.

The profile image is only changed if it has been changed in LDAP. To detect the change a hash of the image is stored in the plugin configuration for the user and compared to the hash of the LDAP attribute when the scheduled task is run.

This PR has been tested with an LLDAP instance as LDAP-backend, but other LDAP servers should behave the same.

Copy link
Member

@crobibero crobibero left a comment

Choose a reason for hiding this comment

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

Just a quick review from my phone. Will review scheduled task and sync changes in coming days

LDAP-Auth/Config/configPage.html Outdated Show resolved Hide resolved
@SanseroGames SanseroGames force-pushed the synchronize-profile-image branch from 72d851f to 626b9f3 Compare February 8, 2024 19:18
LDAP-Auth/Config/configPage.html Outdated Show resolved Hide resolved
LDAP-Auth/Helpers/ProfileImageUpdater.cs Outdated Show resolved Hide resolved
LDAP-Auth/Helpers/ProfileImageUpdater.cs Outdated Show resolved Hide resolved
LDAP-Auth/LDAPAuthenticationProviderPlugin.cs Outdated Show resolved Hide resolved
LDAP-Auth/LdapProfileImageSyncTask.cs Outdated Show resolved Hide resolved
LDAP-Auth/LdapProfileImageSyncTask.cs Outdated Show resolved Hide resolved
LDAP-Auth/LdapProfileImageSyncTask.cs Outdated Show resolved Hide resolved
@crobibero crobibero added the feature This PR or Issue requests or introduces a new feature label Feb 13, 2024
@SanseroGames
Copy link
Contributor Author

Is there anything else you need me to do? Should I squash the commits?

@crobibero crobibero merged commit e40419f into jellyfin:master Mar 15, 2024
4 checks passed
@nerddotdad
Copy link

I'm hoping to understand what format we should have in the jpegPhoto field? should it be a url? Should it be a base64 hash? I've been testing and I can't seem to get it to populate that field in the users config section either way. Looks like a few people are struggling to understand the expectations of that field #163

@nerddotdad
Copy link

@SanseroGames were you able to get this functioning after deploying? If so are you willing to offer a bit of insight into what the contents of the jpegPhoto ldap field need to be? It seems folks are getting hung up on it and from what I can tell it seems like the plugin essentially writes the contents of the ldap field into a file named profile.jpg. I think the hope is that it could either take a URL of an image or a base64 string in that field so it could be decoded by the plugin.

Any assistance would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This PR or Issue requests or introduces a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants