public UploaderService(ConfigInfo configInfo, HttpService httpService, UploadVideoService uploadVideoService, GetAllVideosService getAllVideosService, GetStatusAnimatedThumbnailService getStatusAnimatedThumbnailService, GetAnimatedThumbnailService getAnimatedThumbnailService, AddAnimatedThumbnailsToVideoService addAnimatedThumbnailsToVideoService, UploadSubtitleToVideoService uploadSubtitleToVideoService, DeleteVideoService deleteVideoService, GetVideoService getVideoService, ILogger <UploaderService> logger) { _configInfo = configInfo; httpService.SetAuthorization(_configInfo.Token); _uploadVideoService = uploadVideoService; _getAllVideosService = getAllVideosService; _addAnimatedThumbnailsToVideoService = addAnimatedThumbnailsToVideoService; _uploadSubtitleToVideoService = uploadSubtitleToVideoService; _getAnimatedThumbnailService = getAnimatedThumbnailService; _getStatusAnimatedThumbnailService = getStatusAnimatedThumbnailService; _getVideoService = getVideoService; _deleteVideoService = deleteVideoService; _logger = logger; var clientHttp = new System.Net.Http.HttpClient(); clientHttp.BaseAddress = new Uri(_configInfo.ApiLink); clientHttp.DefaultRequestHeaders.Add(API_KEY_NAME, _configInfo.ApiKey); var videoInfoHttpService = new HttpService(clientHttp); _addVideoInfo = new AddVideoInfo(videoInfoHttpService); _updateVideoThumbnails = new UpdateVideoThumbnails(videoInfoHttpService); _deleteVideo = new DeleteVideo(videoInfoHttpService); }
public ActionResult AddVideo() { IEnumerable <VideoCategory> categories = this.videoRepository.GetAllCategories(); IEnumerable <string> thumbnails = this.videoRepository.GetUnmappedThumbnailFiles(); IEnumerable <string> videos = this.videoRepository.GetUnmappedVideoFiles(); IEnumerable <string> posters = this.videoRepository.GetUnmappedPosterFiles(); AddVideoInfo addVideoInfo = new AddVideoInfo { AvailableCategories = categories, AvailableThumbnails = thumbnails, AvailableVideos = videos, AvailablePosters = posters }; return(this.View(addVideoInfo)); }