public static void Add(this List <Directory> l, IProvider prov, Directory m, BreadCrumbs info, bool noimage = false) { m.ReplaceSchemeHost(); info?.Update(m).FillInfo(prov, m, noimage, true); l.Add(m); }
public static void Add(this List <Video> l, IProvider prov, Video m, BreadCrumbs info, bool noimage = false, bool noart = false) { m.ReplaceSchemeHost(); info?.Update(m, noart).FillInfo(prov, m, noimage, true); l.Add(m); }
public static BreadCrumbs FromKey(string key) { if (Cache.ContainsKey(key)) { BreadCrumbs n = (BreadCrumbs)Cache[key].DeepCopy(); n.UpdateKey(key); return(n); } return(new BreadCrumbs()); }
public static void EppAdd(this List <Video> l, IProvider prov, Video m, BreadCrumbs info, bool noimage = false) { m.ReplaceSchemeHost(); if (info != null) { info.FillInfo(prov, m, noimage, true); m.Thumb = info.Thumb; m.Art = info.Art; m.Title = info.Title; } l.Add(m); }
public string ToKey() { string md5 = GenMd5(); if (Cache.ContainsKey(md5)) { return(md5); } BreadCrumbs cache = (BreadCrumbs)this.DeepCopy(); Cache.Add(md5, cache); return(md5); }
//TODO CACHE EVICTION? public BreadCrumbs Update(Video v, bool noart = false) { BreadCrumbs cache = (BreadCrumbs)this.DeepCopy(); cache.GrandParentKey = cache.ParentKey; cache.GrandParentTitle = cache.ParentTitle ?? ""; cache.ParentKey = cache.Key; cache.ParentTitle = cache.Title ?? ""; cache.ParentIndex = cache.Index; cache.Key = v.Key; cache.Title = v.Title ?? ""; cache.Index = v.Index; if (!noart) { cache.GrandParentThumb = cache.ParentThumb; cache.GrandParentArt = cache.ParentArt; cache.ParentArt = cache.Art; cache.ParentThumb = cache.Thumb; cache.Art = v.Art; cache.Thumb = v.Thumb; } return(cache); }