Browse Source

fix jellyfin admin id selection (#867)

pull/868/head
Jason Dove 3 years ago committed by GitHub
parent
commit
197c166789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 2
      ErsatzTV.Infrastructure/Jellyfin/JellyfinApiClient.cs
  3. 2
      ErsatzTV.Infrastructure/Jellyfin/Models/JellyfinUserPolicyResponse.cs

2
CHANGELOG.md

@ -9,6 +9,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -9,6 +9,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Check whether hardware-accelerated hevc codecs are supported by the NVIDIA card
- Software codecs will be used if they are unsupported by the NVIDIA card
- Fix sorting of channel contents in EPG
- Fix Jellyfin admin user id sync
- Ignore disabled admins and admins who do not have access to all libraries
### Changed
- Regularly delete old segments from transcode folder while content is actively transcoding

2
ErsatzTV.Infrastructure/Jellyfin/JellyfinApiClient.cs

@ -78,7 +78,7 @@ public class JellyfinApiClient : IJellyfinApiClient @@ -78,7 +78,7 @@ public class JellyfinApiClient : IJellyfinApiClient
IJellyfinApi service = RestService.For<IJellyfinApi>(address);
List<JellyfinUserResponse> users = await service.GetUsers(apiKey);
Option<string> maybeUserId = users
.Filter(user => user.Policy.IsAdministrator)
.Filter(user => user.Policy.IsAdministrator && !user.Policy.IsDisabled && user.Policy.EnableAllFolders)
.Map(user => user.Id)
.HeadOrNone();

2
ErsatzTV.Infrastructure/Jellyfin/Models/JellyfinUserPolicyResponse.cs

@ -3,4 +3,6 @@ @@ -3,4 +3,6 @@
public class JellyfinUserPolicyResponse
{
public bool IsAdministrator { get; set; }
public bool IsDisabled { get; set; }
public bool EnableAllFolders { get; set; }
}

Loading…
Cancel
Save