Ejemplo n.º 1
0
        public CL_VideoLocal_ManualLink ToContractManualLink(int userID)
        {
            CL_VideoLocal_ManualLink cl = new CL_VideoLocal_ManualLink
            {
                CRC32           = CRC32,
                DateTimeUpdated = DateTimeUpdated,
                FileName        = FileName,
                FileSize        = FileSize,
                Hash            = Hash,
                HashSource      = HashSource,
                IsIgnored       = IsIgnored,
                IsVariation     = IsVariation,
                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;
                cl.ResumePosition = 0;
            }
            else
            {
                cl.IsWatched   = userRecord.WatchedDate.HasValue ? 1 : 0;
                cl.WatchedDate = userRecord.WatchedDate;
            }
            if (userRecord != null)
            {
                cl.ResumePosition = userRecord.ResumePosition;
            }
            return(cl);
        }
Ejemplo n.º 2
0
        public CL_VideoLocal_ManualLink ToContractManualLink(int userID)
        {
            CL_VideoLocal_ManualLink cl = new CL_VideoLocal_ManualLink();

            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.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;
                cl.ResumePosition = 0;
            }
            else
            {
                cl.IsWatched   = userRecord.WatchedDate.HasValue ? 1 : 0;
                cl.WatchedDate = userRecord.WatchedDate;
            }
            if (userRecord != null)
            {
                cl.ResumePosition = userRecord.ResumePosition;
            }
            return(cl);
        }