mirror of
https://github.com/stashapp/stash.git
synced 2025-12-07 08:54:10 +01:00
Only add image files to imageBox files slice (#2017)
* Only add image files to `imageBox` files slice * Update Changelog
This commit is contained in:
parent
89c7c022f6
commit
955083882e
3 changed files with 29 additions and 4 deletions
|
|
@ -17,14 +17,31 @@ type imageBox struct {
|
||||||
files []string
|
files []string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var imageExtensions = []string{
|
||||||
|
".jpg",
|
||||||
|
".jpeg",
|
||||||
|
".png",
|
||||||
|
".gif",
|
||||||
|
".svg",
|
||||||
|
".webp",
|
||||||
|
}
|
||||||
|
|
||||||
func newImageBox(box fs.FS) (*imageBox, error) {
|
func newImageBox(box fs.FS) (*imageBox, error) {
|
||||||
ret := &imageBox{
|
ret := &imageBox{
|
||||||
box: box,
|
box: box,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := fs.WalkDir(box, ".", func(path string, d fs.DirEntry, err error) error {
|
err := fs.WalkDir(box, ".", func(path string, d fs.DirEntry, err error) error {
|
||||||
if !d.IsDir() {
|
if d.IsDir() {
|
||||||
ret.files = append(ret.files, path)
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
baseName := strings.ToLower(d.Name())
|
||||||
|
for _, ext := range imageExtensions {
|
||||||
|
if strings.HasSuffix(baseName, ext) {
|
||||||
|
ret.files = append(ret.files, path)
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import V080 from "./versions/v080.md";
|
||||||
import V090 from "./versions/v090.md";
|
import V090 from "./versions/v090.md";
|
||||||
import V0100 from "./versions/v0100.md";
|
import V0100 from "./versions/v0100.md";
|
||||||
import V0110 from "./versions/v0110.md";
|
import V0110 from "./versions/v0110.md";
|
||||||
|
import V0120 from "./versions/v0120.md";
|
||||||
import { MarkdownPage } from "../Shared/MarkdownPage";
|
import { MarkdownPage } from "../Shared/MarkdownPage";
|
||||||
|
|
||||||
// to avoid use of explicit any
|
// to avoid use of explicit any
|
||||||
|
|
@ -52,9 +53,9 @@ const Changelog: React.FC = () => {
|
||||||
// after new release:
|
// after new release:
|
||||||
// add entry to releases, using the current* fields
|
// add entry to releases, using the current* fields
|
||||||
// then update the current fields.
|
// then update the current fields.
|
||||||
const currentVersion = stashVersion || "v0.11.0";
|
const currentVersion = stashVersion || "v0.12.0";
|
||||||
const currentDate = buildDate;
|
const currentDate = buildDate;
|
||||||
const currentPage = V0110;
|
const currentPage = V0120;
|
||||||
|
|
||||||
const releases: IStashRelease[] = [
|
const releases: IStashRelease[] = [
|
||||||
{
|
{
|
||||||
|
|
@ -63,6 +64,11 @@ const Changelog: React.FC = () => {
|
||||||
page: currentPage,
|
page: currentPage,
|
||||||
defaultOpen: true,
|
defaultOpen: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
version: "v0.11.0",
|
||||||
|
date: "2021-11-15",
|
||||||
|
page: V0110,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
version: "v0.10.0",
|
version: "v0.10.0",
|
||||||
date: "2021-10-11",
|
date: "2021-10-11",
|
||||||
|
|
|
||||||
2
ui/v2.5/src/components/Changelog/versions/v0120.md
Normal file
2
ui/v2.5/src/components/Changelog/versions/v0120.md
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
### 🐛 Bug fixes
|
||||||
|
* Fix "Custom Performer Images" feature picking up non-image files. ([#2017](https://github.com/stashapp/stash/pull/2017))
|
||||||
Loading…
Reference in a new issue