示例#1
0
        JsonResult IDriver.Thumbs(IEnumerable <string> targets)
        {
            var response = new ThumbsResponse();

            foreach (var target in targets)
            {
                var path = ParsePath(target);
                response.Images.Add(target, String.Format("/Tools/GetThumbnail/", path.File));
            }
            return(Json(response));
        }
示例#2
0
        JsonResult IDriver.Thumbs(IEnumerable <string> targets)
        {
            ThumbsResponse response = new ThumbsResponse();

            foreach (string target in targets)
            {
                FullPath path = ParsePath(target);
                response.Images.Add(target, path.Root.GenerateThumbHash(path.File));
            }
            return(Json(response));
        }
示例#3
0
        JsonResult IDriver.Thumbs(IEnumerable <string> targets)
        {
            ThumbsResponse response = new ThumbsResponse();

            foreach (string target in targets)
            {
                string   targetDecoded = this.DecodeTarget(this.GetCorectTarget(target));
                DirInfo  targetInfo    = client.GetInfo(targetDecoded);
                DirInfo  parentInfo    = this.GetParent(targetInfo);
                DateTime lastTimeModified;
                if (!DateTime.TryParse(targetInfo.LastModified, out lastTimeModified))
                {
                    continue;
                }

                string thumbName = Path.GetFileNameWithoutExtension(targetInfo.DisplayName) +
                                   "_" + Helper.GetFileMd5(targetInfo.DisplayName, lastTimeModified) +
                                   Path.GetExtension(targetInfo.DisplayName);

                response.Images.Add(this.GetCorectTarget(target), Helper.EncodePath(parentInfo.RelPath + thumbName));
            }
            return(Json(response));
        }