Merge branch 'stashapp:develop' into line-break-titles

This commit is contained in:
randemgame 2024-11-09 14:33:06 +02:00 committed by GitHub
commit 3f3c12bd92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 981 additions and 821 deletions

2
go.mod
View file

@ -20,7 +20,7 @@ require (
github.com/go-chi/httplog v0.3.1
github.com/go-toast/toast v0.0.0-20190211030409-01e6764cf0a4
github.com/gofrs/uuid/v5 v5.1.0
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/golang-jwt/jwt/v4 v4.5.1
github.com/golang-migrate/migrate/v4 v4.16.2
github.com/gorilla/securecookie v1.1.1
github.com/gorilla/sessions v1.2.1

4
go.sum
View file

@ -246,8 +246,8 @@ github.com/gofrs/uuid/v5 v5.1.0 h1:S5rqVKIigghZTCBKPCw0Y+bXkn26K3TB5mvQq2Ix8dk=
github.com/gofrs/uuid/v5 v5.1.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo=
github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang-migrate/migrate/v4 v4.16.2 h1:8coYbMKUyInrFk1lfGfRovTLAW7PhWp8qQDT2iKfuoA=
github.com/golang-migrate/migrate/v4 v4.16.2/go.mod h1:pfcJX4nPHaVdc5nmdCikFBWtm+UBpiZjRNNsyBbp0/o=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=

View file

@ -1100,7 +1100,8 @@ func (s *scanJob) removeOutdatedFingerprints(existing models.File, fp models.Fin
// oshash has changed, MD5 is missing - remove MD5 from the existing fingerprints
logger.Infof("Removing outdated checksum from %s", existing.Base().Path)
existing.Base().Fingerprints.Remove(models.FingerprintTypeMD5)
b := existing.Base()
b.Fingerprints = b.Fingerprints.Remove(models.FingerprintTypeMD5)
}
// returns a file only if it was updated

View file

@ -28,16 +28,31 @@ func (f *Fingerprint) Value() string {
type Fingerprints []Fingerprint
func (f *Fingerprints) Remove(type_ string) {
func (f Fingerprints) Remove(type_ string) Fingerprints {
var ret Fingerprints
for _, ff := range *f {
for _, ff := range f {
if ff.Type != type_ {
ret = append(ret, ff)
}
}
*f = ret
return ret
}
func (f Fingerprints) Filter(types ...string) Fingerprints {
var ret Fingerprints
for _, ff := range f {
for _, t := range types {
if ff.Type == t {
ret = append(ret, ff)
break
}
}
}
return ret
}
// Equals returns true if the contents of this slice are equal to those in the other slice.

View file

@ -16,6 +16,10 @@ import (
var (
ErrNotVideoFile = errors.New("not a video file")
// fingerprint types to match with
// only try to match by data fingerprints, _not_ perceptual fingerprints
matchableFingerprintTypes = []string{models.FingerprintTypeOshash, models.FingerprintTypeMD5}
)
type ScanCreatorUpdater interface {
@ -87,7 +91,7 @@ func (h *ScanHandler) Handle(ctx context.Context, f models.File, oldFile models.
if len(existing) == 0 {
// try also to match file by fingerprints
existing, err = h.CreatorUpdater.FindByFingerprints(ctx, videoFile.Fingerprints)
existing, err = h.CreatorUpdater.FindByFingerprints(ctx, videoFile.Fingerprints.Filter(matchableFingerprintTypes...))
if err != nil {
return fmt.Errorf("finding existing scene by fingerprints: %w", err)
}

File diff suppressed because it is too large Load diff

View file

@ -24,3 +24,10 @@
margin-left: 0.5rem;
}
}
.setup-wizard {
#blobs > div {
margin-bottom: 1rem;
margin-top: 0;
}
}

View file

@ -6,7 +6,7 @@ import {
ObjectScrapeResult,
ScrapeResult,
} from "src/components/Shared/ScrapeDialog/scrapeResult";
import { TagSelect } from "src/components/Tags/TagSelect";
import { TagIDSelect } from "src/components/Tags/TagSelect";
import { StudioSelect } from "src/components/Studios/StudioSelect";
import { GroupSelect } from "src/components/Groups/GroupSelect";
@ -269,17 +269,12 @@ export const ScrapedTagsRow: React.FC<
: scrapeResult.originalValue;
const value = resultValue ?? [];
const selectValue = value.map((p) => {
const aliases: string[] = [];
return {
id: p.stored_id ?? "",
name: p.name ?? "",
aliases,
};
});
const selectValue = value.map((p) => p.stored_id ?? "");
// we need to use TagIDSelect here because we want to use the local name
// of the tag instead of the name from the source
return (
<TagSelect
<TagIDSelect
isMulti
className="form-control"
isDisabled={!isNew}
@ -289,7 +284,7 @@ export const ScrapedTagsRow: React.FC<
onChangeFn(items.map((p) => ({ ...p, stored_id: p.id })));
}
}}
values={selectValue}
ids={selectValue}
/>
);
}

View file

@ -1298,7 +1298,9 @@
"errors": {
"something_went_wrong": "Oh no! Something went wrong!",
"something_went_wrong_description": "If this looks like a problem with your inputs, go ahead and click back to fix them up. Otherwise, raise a bug on the {githubLink} or seek help in the {discordLink}.",
"something_went_wrong_while_setting_up_your_system": "Something went wrong while setting up your system. Here is the error we received: {error}"
"something_went_wrong_while_setting_up_your_system": "Something went wrong while setting up your system. Here is the error we received: {error}",
"unable_to_retrieve_system_status": "Unable to retrieve system status: {error}",
"unexpected_error": "An unexpected error occurred: {error}"
},
"folder": {
"file_path": "File path",