mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-01 06:16:30 +01:00
Enable nullable for UserItemData
MetadataResult.GetOrAddUserData doesn't ever get used and is probably broken since the migration to .NET Core as it still expects a Guid for userId
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -19,17 +17,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// </summary>
|
||||
private double? _rating;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user id.
|
||||
/// </summary>
|
||||
/// <value>The user id.</value>
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the key.
|
||||
/// </summary>
|
||||
/// <value>The key.</value>
|
||||
public string Key { get; set; }
|
||||
public required string Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the users 0-10 rating.
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
|
||||
#pragma warning disable CA1002, CA2227, CS1591
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
@@ -33,8 +31,6 @@ namespace MediaBrowser.Controller.Providers
|
||||
set => _remoteImages = value;
|
||||
}
|
||||
|
||||
public List<UserItemData> UserDataList { get; set; }
|
||||
|
||||
public List<PersonInfo> People { get; set; }
|
||||
|
||||
public bool HasMetadata { get; set; }
|
||||
@@ -68,32 +64,5 @@ namespace MediaBrowser.Controller.Providers
|
||||
People.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public UserItemData GetOrAddUserData(string userId)
|
||||
{
|
||||
UserDataList ??= new List<UserItemData>();
|
||||
|
||||
UserItemData userData = null;
|
||||
|
||||
foreach (var i in UserDataList)
|
||||
{
|
||||
if (string.Equals(userId, i.UserId.ToString("N", CultureInfo.InvariantCulture), StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
userData = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (userData is null)
|
||||
{
|
||||
userData = new UserItemData()
|
||||
{
|
||||
UserId = new Guid(userId)
|
||||
};
|
||||
|
||||
UserDataList.Add(userData);
|
||||
}
|
||||
|
||||
return userData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user