Exemplo n.º 1
0
        public void CacheMusicCatalogue(Catalogue cata)
        {
            WinterWrapUp cw = new WinterWrapUp()
            {
                createDate = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"),
                deletable  = false,
                markName   = CacheUtils.GenerateMarkName("CATALOGUE"),
                uid        = Guid.NewGuid().ToString()
            };

            byte[] cstring = Encoding.UTF8.GetBytes(caches.CacheTo(cata, cw));
            Compressed.writeCompressed(cstring, "{0}//{1}".FormateEx(CacheDir, CacheUtils.GenerateName(cw)), UseLZ78Compress);
        }
Exemplo n.º 2
0
        public List <Catalogue> RestoreCatalogues(List <WinterWrapUp> cws)
        {
            List <Catalogue> catas = new List <Catalogue>();

            foreach (WinterWrapUp cw in cws)
            {
                catas.Add(
                    RestoreMusicCataloge(
                        JObject.Parse(
                            Compressed.readCompressed("{0}//{1}".FormateEx(CacheDir, CacheUtils.GenerateName(cw)), UseLZ78Compress)
                            )["ctx"]
                        )
                    );
            }
            return(catas);
        }