Example #1
0
        //public void Dispose()
        //{
        //    db.Dispose();
        //}

        public override bool Save(PictureData data)
        {
            try
            {
                // Create new entry
                _cache.Add(data);
                var fav = new FavoritePOCO
                {
                    ScraperName = Fussy.EncryptString(data.Scraper.SiteName),
                    ThumbUrl = Fussy.EncryptString(data.ThumbUrl),
                    PageUrl = Fussy.EncryptString(data.PageUrl)
                };
                _collection.Insert(fav);
                _collection.EnsureIndex(x => x.PageUrl);
                RaiseAddedToFavorite(data);
            }
            catch (Exception ex)
            {
                ExManager.Ex(ex);
                return false;
            }
            return true;
        }
Example #2
0
 private static bool CheckValid(FavoritePOCO data) =>
     !string.IsNullOrEmpty(data.PageUrl) && !string.IsNullOrEmpty(data.ScraperName) && !string.IsNullOrEmpty(data.ThumbUrl);