mirror of
https://github.com/hrfee/jellyfin-accounts.git
synced 2025-12-22 10:11:13 +00:00
10.6.0 compatability, cleanup, removed dep
Automatically fixes '*ProviderId' in user templates for versions of Jellyfin >= 10.6.0. Removed unnecessary configparser dependency, the one actually used is part of python. jf_api now has an info attribute.
This commit is contained in:
@@ -66,6 +66,8 @@ if not success:
|
||||
log.error("Could not authenticate after 3 tries.")
|
||||
exit()
|
||||
|
||||
# Temporary fixes below.
|
||||
|
||||
|
||||
def switchToIds():
|
||||
try:
|
||||
@@ -101,6 +103,22 @@ def switchToIds():
|
||||
# Temporary, switches emails.json over from using Usernames to User IDs.
|
||||
switchToIds()
|
||||
|
||||
|
||||
from packaging import version
|
||||
|
||||
if (
|
||||
version.parse(jf.info["Version"]) >= version.parse("10.6.0")
|
||||
and bool(data_store.user_template) is not False
|
||||
):
|
||||
log.info("Updating user_template for Jellyfin >= 10.6.0")
|
||||
data_store.user_template[
|
||||
"AuthenticationProviderId"
|
||||
] = "Jellyfin.Server.Implementations.Users.DefaultAuthenticationProvider"
|
||||
data_store.user_template[
|
||||
"PasswordResetProviderId"
|
||||
] = "Jellyfin.Server.Implementations.Users.DefaultPasswordResetProvider"
|
||||
|
||||
|
||||
if config.getboolean("password_validation", "enabled"):
|
||||
validator = PasswordValidator(
|
||||
config["password_validation"]["min_length"],
|
||||
|
||||
Reference in New Issue
Block a user