Beispiel #1
0
        public static void TrySetPreview(this RecordModel model)
        {
            var extension = Path.GetExtension(model.File?.RelativePath);
            var types     = _mapper.Map(extension);

            if (types.Contains(MediaType.Image))
            {
                model.Preview = model.File;
            }
            // TODO: if audio, set predifined image
        }
Beispiel #2
0
        private Task <string> GeneratePreview(GeneratePreviewAction action)
        {
            var mediaType = _typeMapper.Map(Path.GetExtension(action.InputPath));

            if (mediaType.Contains(MediaType.Video) || mediaType.Contains(MediaType.Gif))
            {
                return(GenerateForVideo(action));
            }
            //if (mediaType.Contains(MediaType.Image))
            //{
            //    //
            //}

            return(Task.FromResult <string>(null));
        }