/// <summary>
        /// Rotates the specified username.
        /// </summary>
        /// <param name="media">The media.</param>
        /// <param name="resizeMethod">The resize method.</param>
        /// <returns></returns>
        private int Rotate(IMediaFiles media, Action <List <MediaFile>, Domain.Model.User> resizeMethod)
        {
            resizeMethod(media.MediaFiles, Owner);
            const int status = 1;

            return(status);
        }
 /// <summary>
 /// Gets the comment.
 /// </summary>
 /// <param name="user">The user.</param>
 /// <param name="saveView">The save view.</param>
 /// <param name="media">The media.</param>
 /// <returns></returns>
 private Comment GetComment(IId <int> user, CommentSaveView saveView, IMediaFiles media)
 {
     return(new Comment
     {
         Text = saveView.Comments,
         MediaId = media.MediaId,
         CommentStatus = CommentStatus.Approved,
         Email = saveView.Email,
         Name = saveView.Name,
         SiteUrl = saveView.Website ?? string.Empty,
         CommentDate = DateTime.Now,
         Ip = HttpContext.Request.UserHostAddress,
         UserAgent = HttpContext.Request.UserAgent,
         UserId = user.Id
     });
 }
示例#3
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="mediaFiles"></param>
 /// <param name="pathToScan"></param>
 public WritePlayList(IMediaFiles mediaFiles, IPathToScan pathToScan)
 {
     _mediaFiles = mediaFiles ?? throw new ArgumentNullException(nameof(mediaFiles));
     _pathToScan = pathToScan ?? throw new ArgumentNullException(nameof(pathToScan));
 }
 /// <summary>
 /// Gets the comment.
 /// </summary>
 /// <param name="user">The user.</param>
 /// <param name="saveView">The save view.</param>
 /// <param name="media">The media.</param>
 /// <returns></returns>
 private Comment GetComment(IId<int> user, CommentSaveView saveView, IMediaFiles media)
 {
     return new Comment
     {
         Text = saveView.Comments,
         MediaId = media.MediaId,
         CommentStatus = CommentStatus.Approved,
         Email = saveView.Email,
         Name = saveView.Name,
         SiteUrl = saveView.Website ?? string.Empty,
         CommentDate = DateTime.Now,
         Ip = HttpContext.Request.UserHostAddress,
         UserAgent = HttpContext.Request.UserAgent,
         UserId = user.Id
     };
 }
 /// <summary>
 /// Rotates the specified username.
 /// </summary>
 /// <param name="media">The media.</param>
 /// <param name="resizeMethod">The resize method.</param>
 /// <returns></returns>
 private int Rotate(IMediaFiles media, Action<List<MediaFile>, Domain.Model.User> resizeMethod)
 {
     resizeMethod(media.MediaFiles, Owner);
     const int status = 1;
     return status;
 }