refactor: reverting changes no longer needed

This commit is contained in:
Cy Allen Scott 2022-04-22 15:08:37 -04:00
parent bddf17ba4e
commit 18f705850e

View File

@ -27,7 +27,6 @@ import (
type FileInfo struct { type FileInfo struct {
*Listing *Listing
Fs afero.Fs `json:"-"` Fs afero.Fs `json:"-"`
Dir string `json:"dir"`
Path string `json:"path"` Path string `json:"path"`
Name string `json:"name"` Name string `json:"name"`
Size int64 `json:"size"` Size int64 `json:"size"`
@ -106,10 +105,8 @@ func stat(opts FileOptions) (*FileInfo, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
dir, _ := filepath.Split(opts.Path)
file = &FileInfo{ file = &FileInfo{
Fs: opts.Fs, Fs: opts.Fs,
Dir: dir,
Path: opts.Path, Path: opts.Path,
Name: info.Name(), Name: info.Name(),
ModTime: info.ModTime(), ModTime: info.ModTime(),
@ -144,10 +141,8 @@ func stat(opts FileOptions) (*FileInfo, error) {
return file, nil return file, nil
} }
dir, _ := filepath.Split(opts.Path)
file = &FileInfo{ file = &FileInfo{
Fs: opts.Fs, Fs: opts.Fs,
Dir: dir,
Path: opts.Path, Path: opts.Path,
Name: info.Name(), Name: info.Name(),
ModTime: info.ModTime(), ModTime: info.ModTime(),
@ -222,8 +217,6 @@ func (i *FileInfo) Thumbnail() (*FileInfo, error) {
path := ThumbnailPath(realPath) path := ThumbnailPath(realPath)
dir, _ := filepath.Split(path)
info, err := os.Stat(path) info, err := os.Stat(path)
if err != nil { if err != nil {
@ -232,7 +225,6 @@ func (i *FileInfo) Thumbnail() (*FileInfo, error) {
file := &FileInfo{ file := &FileInfo{
Fs: i.Fs, Fs: i.Fs,
Dir: dir,
Path: path, Path: path,
Name: info.Name(), Name: info.Name(),
ModTime: info.ModTime(), ModTime: info.ModTime(),