mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 10:04:44 +01:00
update metadata parsing
This commit is contained in:
@@ -312,7 +312,6 @@
|
||||
<Compile Include="Providers\ItemInfo.cs" />
|
||||
<Compile Include="Providers\LiveTvProgramLookupInfo.cs" />
|
||||
<Compile Include="Providers\LocalImageInfo.cs" />
|
||||
<Compile Include="Providers\LocalMetadataResult.cs" />
|
||||
<Compile Include="Providers\MetadataRefreshMode.cs" />
|
||||
<Compile Include="Providers\MetadataResult.cs" />
|
||||
<Compile Include="Providers\MovieInfo.cs" />
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
/// <param name="directoryService">The directory service.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{MetadataResult{`0}}.</returns>
|
||||
Task<LocalMetadataResult<TItemType>> GetMetadata(ItemInfo info,
|
||||
Task<MetadataResult<TItemType>> GetMetadata(ItemInfo info,
|
||||
IDirectoryService directoryService,
|
||||
CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
public class LocalMetadataResult<T> : MetadataResult<T>
|
||||
where T : IHasMetadata
|
||||
{
|
||||
public List<LocalImageInfo> Images { get; set; }
|
||||
public List<UserItemData> UserDataLIst { get; set; }
|
||||
|
||||
public LocalMetadataResult()
|
||||
{
|
||||
Images = new List<LocalImageInfo>();
|
||||
UserDataLIst = new List<UserItemData>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,20 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
public class MetadataResult<T>
|
||||
{
|
||||
public List<LocalImageInfo> Images { get; set; }
|
||||
public List<UserItemData> UserDataList { get; set; }
|
||||
|
||||
public MetadataResult()
|
||||
{
|
||||
Images = new List<LocalImageInfo>();
|
||||
}
|
||||
|
||||
public List<PersonInfo> People { get; set; }
|
||||
|
||||
public bool HasMetadata { get; set; }
|
||||
@@ -31,5 +41,27 @@ namespace MediaBrowser.Controller.Providers
|
||||
}
|
||||
People.Clear();
|
||||
}
|
||||
|
||||
public UserItemData GetOrAddUserData(string userId)
|
||||
{
|
||||
if (UserDataList == null)
|
||||
{
|
||||
UserDataList = new List<UserItemData>();
|
||||
}
|
||||
|
||||
var userData = UserDataList.FirstOrDefault(i => string.Equals(userId, i.UserId.ToString("N"), StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (userData == null)
|
||||
{
|
||||
userData = new UserItemData()
|
||||
{
|
||||
UserId = new Guid(userId)
|
||||
};
|
||||
|
||||
UserDataList.Add(userData);
|
||||
}
|
||||
|
||||
return userData;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user