diff --git a/DirectoryIndexers/DirectoryIndexer.go b/DirectoryIndexers/DirectoryIndexer.go index 1cbdfc6..5e4ad38 100644 --- a/DirectoryIndexers/DirectoryIndexer.go +++ b/DirectoryIndexers/DirectoryIndexer.go @@ -19,6 +19,7 @@ type FileList struct { type VideoFile struct { Filename string + Thumbnail string Extension string Title string Id string @@ -43,7 +44,9 @@ func Index(path string, results chan FileList, oldFileList *FileList) { var wg sync.WaitGroup bar := progressbar.NewOptions(len(fileList), - progressbar.OptionSetDescription("Scanning files + metadata...")) + progressbar.OptionSetDescription("Scanning files + metadata..."), + progressbar.OptionShowCount(), + progressbar.OptionShowIts()) for _, video := range fileList { wg.Add(1) @@ -61,6 +64,7 @@ func Index(path string, results chan FileList, oldFileList *FileList) { break default: wg.Done() + _ = bar.Add(1) return } @@ -80,6 +84,7 @@ func Index(path string, results chan FileList, oldFileList *FileList) { videoObject := VideoFile{ Filename: video.Name(), + Thumbnail: strings.TrimSuffix(video.Name(), filepath.Ext(video.Name())) + ".webp", Extension: extension, Title: filenameToTitle(video.Name(), extension), Id: id, diff --git a/PageHandlers/View.go b/PageHandlers/View.go index 491e2f2..b373b24 100644 --- a/PageHandlers/View.go +++ b/PageHandlers/View.go @@ -11,6 +11,7 @@ import ( type ViewPageData struct { Title string Filename string + Thumbnail string Id string Extension string Metadata DirectoryIndexers.Metadata @@ -45,6 +46,7 @@ func View(writer http.ResponseWriter, request *http.Request, FL *DirectoryIndexe data := ViewPageData{ Title: video.Title, Filename: video.Filename, + Thumbnail: video.Thumbnail, Id: video.Id, Extension: video.Extension, Metadata: video.Metadata, diff --git a/PageHandlers/templates/search.html b/PageHandlers/templates/search.html index d569350..78580c1 100644 --- a/PageHandlers/templates/search.html +++ b/PageHandlers/templates/search.html @@ -11,6 +11,6 @@ {{range .Results}} - {{.Id}} - {{.Title}}
+ {{.Title}} {{ if .Metadata.Channel }} - {{ .Metadata.Channel }} {{end}} - {{.Id}}
{{end}} {{end}} \ No newline at end of file diff --git a/PageHandlers/templates/view.html b/PageHandlers/templates/view.html index 699004e..14f6c88 100644 --- a/PageHandlers/templates/view.html +++ b/PageHandlers/templates/view.html @@ -9,7 +9,16 @@ {{define "body"}}
-