/// <summary>
        /// doing this cause can't get model class to do it after an add, select is OK
        /// TODO bind the Id after add
        /// </summary>
        /// <param name="fileInfo"></param>
        private DwsFileInfo SetFileInfoExt(DwsFileInfo fileinfo)
        {
            fileinfo.FileApi      = String.Format(@"/api/dws/files/view/{0}", fileinfo.Id);
            fileinfo.ThumbnailUrl = String.Format(@"/api/dws/files/thumbnail/100/100/{0}", fileinfo.Id);


            switch (fileinfo.MimeTypeCategory)
            {
            case "application":
                fileinfo.FileTarget = ".main-document";
                break;

            case "audio":
                fileinfo.FileTarget = ".main-audio";
                break;

            case "video":
                fileinfo.FileTarget = ".main-video";
                break;

            case "image":
                fileinfo.FileTarget      = ".main-image";
                fileinfo.ExifDescription = DwsImageExif.GetExifDescription(fileinfo.FileFull);
                fileinfo.ExifDetails     = DwsImageExif.GetExifDetails(fileinfo.FileFull);
                break;

            default:
                fileinfo.FileTarget = "";
                break;
            }

            return(fileinfo);
        }
Ejemplo n.º 2
0
        public IActionResult Details(int id)
        {
            var fileinfo = FileRepository.Select(id, Request.Cookies["DwsSessionToken"]);
            var details  = DwsImageExif.GetExifDetails(fileinfo.FileFull);
            var desc     = DwsImageExif.GetExifDescription(fileinfo.FileFull);

            return(Json(new { desc, details }));
        }