mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-27 02:56:54 +01:00
Added some resolver improvements
This commit is contained in:
parent
b50f78e5da
commit
4c9f77eead
@@ -1,32 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Controller.Library
|
||||
{
|
||||
public class ItemDataCache
|
||||
{
|
||||
private Dictionary<string, object> Data = new Dictionary<string, object>();
|
||||
|
||||
public void SetValue<T>(BaseItem item, string propertyName, T value)
|
||||
{
|
||||
Data[GetKey(item, propertyName)] = value;
|
||||
}
|
||||
|
||||
public T GetValue<T>(BaseItem item, string propertyName)
|
||||
{
|
||||
string key = GetKey(item, propertyName);
|
||||
|
||||
if (Data.ContainsKey(key))
|
||||
{
|
||||
return (T)Data[key];
|
||||
}
|
||||
|
||||
return default(T);
|
||||
}
|
||||
|
||||
private string GetKey(BaseItem item, string propertyName)
|
||||
{
|
||||
return item.Id.ToString() + "-" + propertyName;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user