예제 #1
0
        public static USER_Videos InterfaceRecord2UserVideoEntity(this UserS3FileInterface entity, int userId)
        {
            if (entity.BcIdentifier == null)
            {
                return(null);
            }

            return(new USER_Videos
            {
                BcIdentifier = (long)entity.BcIdentifier
                , Name = Path.GetFileName(entity.FilePath)
                , ThumbUrl = ""
                , Duration = ""
                , UserId = userId
                , VideoStillUrl = ""
                , Length = 0
                , ReferenceId = entity.BcRefId
                , PlaysTotal = 0
                , Tags = entity.Tags
                , ShortDescription = Path.GetFileNameWithoutExtension(entity.FilePath)
                , Attached2Chapter = false
                , S3Url = Constants.S3_ROOT_URL + Constants.S3_VIDEO_BUCKET_NAME + entity.FilePath
                , CreationDate = DateTime.Now
                , InsertDate = DateTime.Now
            });
        }
예제 #2
0
 public static InterfaceFileDTO Entity2InterfaceFileDto(this UserS3FileInterface entity)
 {
     return(new InterfaceFileDTO
     {
         fileId = entity.FileId
         , userId = entity.UserId
         , name = entity.FilePath
         , eTag = entity.ETag
         , contentType = entity.ContentType
         , title = entity.Title
         , tags = entity.Tags
     });
 }
예제 #3
0
        public static UserVideoDto InterfacedVideo2VideoDTO(this UserS3FileInterface video, int userId, string userTag)
        {
            // var userTagList = new List<string> {userTag};

            return(new UserVideoDto
            {
                userId = userId
                , identifier = "-1"
                , fileId = video.FileId
                , title = video.Title ?? video.FilePath
                , addon = video.AddOn
                , minutes = string.Empty
                , status = ImportJobsEnums.eFileInterfaceStatus.Waiting
            });
        }
예제 #4
0
 public static void UpdateFileInterfaceEntity(this UserS3FileInterface entity, string title, ImportJobsEnums.eFileInterfaceStatus status)
 {
     entity.Title    = title;
     entity.Status   = status.ToString();
     entity.UpdateOn = DateTime.Now;
 }