示例#1
0
        public CL_VideoLocal ToClient(int userID)
        {
            CL_VideoLocal cl = new CL_VideoLocal
            {
                CRC32           = CRC32,
                DateTimeUpdated = DateTimeUpdated,
                FileName        = FileName,
                FileSize        = FileSize,
                Hash            = Hash,
                HashSource      = HashSource,
                IsIgnored       = IsIgnored,
                IsVariation     = IsVariation,
                Duration        = Duration,
                MD5             = MD5,
                SHA1            = SHA1,
                VideoLocalID    = VideoLocalID,
                Places          = Places.Select(a => a.ToClient()).ToList()
            };
            VideoLocal_User userRecord = GetUserRecord(userID);

            if (userRecord?.WatchedDate == null)
            {
                cl.IsWatched   = 0;
                cl.WatchedDate = null;
            }
            else
            {
                cl.IsWatched   = 1;
                cl.WatchedDate = userRecord.WatchedDate;
            }
            if (userRecord != null)
            {
                cl.ResumePosition = userRecord.ResumePosition;
            }
            cl.Media = GetMediaFromUser(userID);
            return(cl);
        }
示例#2
0
        public CL_VideoLocal ToClient(int userID)
        {
            CL_VideoLocal cl = new CL_VideoLocal();

            cl.CRC32           = this.CRC32;
            cl.DateTimeUpdated = this.DateTimeUpdated;
            cl.FileName        = this.FileName;
            cl.FileSize        = this.FileSize;
            cl.Hash            = this.Hash;
            cl.HashSource      = this.HashSource;
            cl.IsIgnored       = this.IsIgnored;
            cl.IsVariation     = this.IsVariation;
            cl.Duration        = this.Duration;
            cl.MD5             = this.MD5;
            cl.SHA1            = this.SHA1;
            cl.VideoLocalID    = this.VideoLocalID;
            cl.Places          = Places.Select(a => a.ToClient()).ToList();
            VideoLocal_User userRecord = this.GetUserRecord(userID);

            if (userRecord?.WatchedDate == null)
            {
                cl.IsWatched   = 0;
                cl.WatchedDate = null;
            }
            else
            {
                cl.IsWatched   = 1;
                cl.WatchedDate = userRecord.WatchedDate;
            }
            if (userRecord != null)
            {
                cl.ResumePosition = userRecord.ResumePosition;
            }
            cl.Media = GetMediaFromUser(userID);
            return(cl);
        }