using System.Collections.Generic; using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Library { public class ItemDataCache { private Dictionary Data = new Dictionary(); public void SetValue(BaseItem item, string propertyName, T value) { Data[GetKey(item, propertyName)] = value; } public T GetValue(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; } } }