Exemple #1
0
 public static void Add(this List <Directory> l, IProvider prov, Directory m, BreadCrumbs info,
                        bool noimage = false)
 {
     m.ReplaceSchemeHost(prov);
     info?.Update(m).FillInfo(prov, m, noimage, true);
     l.Add(m);
 }
Exemple #2
0
 public static void Add(this List <Video> l, IProvider prov, Video m, BreadCrumbs info, bool noimage = false,
                        bool noart = false)
 {
     m.ReplaceSchemeHost(prov);
     info?.Update(m, noart).FillInfo(prov, m, noimage, true);
     l.Add(m);
 }
Exemple #3
0
 public static BreadCrumbs FromKey(string key)
 {
     if (Cache.ContainsKey(key))
     {
         BreadCrumbs n = Cache[key].DeepClone();
         n.UpdateKey(key);
         return(n);
     }
     return(new BreadCrumbs());
 }
Exemple #4
0
 public static void EppAdd(this List <Video> l, IProvider prov, Video m, BreadCrumbs info, bool noimage = false)
 {
     m.ReplaceSchemeHost(prov);
     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 = this.DeepClone();

            Cache.Add(md5, cache);
            return(md5);
        }
        //TODO CACHE EVICTION?

        public BreadCrumbs Update(Video v, bool noart = false)
        {
            BreadCrumbs cache = this.DeepClone();

            cache.GrandParentKey   = cache.ParentKey;
            cache.GrandParentTitle = cache.ParentTitle ?? string.Empty;
            cache.ParentKey        = cache.Key;
            cache.ParentTitle      = cache.Title ?? string.Empty;
            cache.ParentIndex      = cache.Index;

            cache.Key   = v.Key;
            cache.Title = v.Title ?? string.Empty;
            cache.Index = v.Index.ToString();
            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);
        }