Beispiel #1
0
        internal static Gfy Create(GfycatClient client, Model model)
        {
            Gfy returnedGfy = new Gfy(client, model.Id);

            returnedGfy.Update(model);
            return(returnedGfy);
        }
Beispiel #2
0
        internal void Update(Model model)
        {
            FullGfy fullModel = model as FullGfy;

            _isFull = fullModel != null;

            Number            = model.Number;
            WebmUrl           = model.WebmUrl;
            GifUrl            = model.GifUrl;
            MobileUrl         = model.MobileUrl;
            MobilePosterUrl   = model.MobilePosterUrl;
            PosterUrl         = model.PosterUrl;
            Thumb360Url       = model.Thumb360Url;
            Thumb360PosterUrl = model.Thumb360PosterUrl;
            Thumb100PosterUrl = model.Thumb100PosterUrl;
            Max5MbGif         = model.Max5MbGif;
            Max2MbGif         = model.Max2MbGif;
            Max1MbGif         = model.Max1MbGif;
            MjpgUrl           = model.MjpgUrl;
            Width             = model.Width;
            Height            = model.Height;
            AverageColor      = model.AverageColor;
            FrameRate         = model.FrameRate;
            NumberOfFrames    = model.NumberOfFrames;
            Mp4Size           = model.Mp4Size;
            WebmSize          = model.WebmSize;
            GifSize           = model.GifSize;
            Source            = model.Source;
            CreationDate      = model.CreationDate;
            Nsfw                    = model.Nsfw;
            Mp4Url                  = model.Mp4Url;
            Likes                   = model.Likes;
            Published               = model.Published;
            Dislikes                = model.Dislikes;
            Md5                     = model.Md5;
            Views                   = model.Views;
            Tags                    = model.Tags.ToReadOnlyCollection();
            UserTags                = _isFull ? fullModel.UserTags?.ToReadOnlyCollection() : Enumerable.Empty <string>().ToReadOnlyCollection();
            Username                = model.Username;
            Name                    = model.Name;
            Title                   = model.Title;
            Description             = model.Description;
            LanguageText            = model.LanguageText;
            LanguageCategories      = model.LanguageCategories;
            Subreddit               = model.Subreddit;
            RedditId                = model.RedditId;
            RedditIdText            = model.RedditIdText;
            DomainWhitelist         = model.DomainWhitelist.ToReadOnlyCollection();
            LikedByCurrentUser      = _isFull ? fullModel.LikeState == LikeState.Liked : false;
            DislikedByCurrentUser   = _isFull ? fullModel.LikeState == LikeState.Disliked : false;
            BookmarkedByCurrentUser = _isFull ? fullModel.BookmarkState : false;
        }