mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Various bug fixes (#2945)
* Only update fingerprints if changed * Fix panic when loading primary file fails * Fix gallery/scene association * Fix display of scene gallery in card * Use natural_cs collation with paths for title sorting
This commit is contained in:
@@ -26,6 +26,7 @@ func (f *Fingerprints) Remove(type_ string) {
|
||||
*f = ret
|
||||
}
|
||||
|
||||
// Equals returns true if the contents of this slice are equal to those in the other slice.
|
||||
func (f Fingerprints) Equals(other Fingerprints) bool {
|
||||
if len(f) != len(other) {
|
||||
return false
|
||||
@@ -48,6 +49,18 @@ func (f Fingerprints) Equals(other Fingerprints) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// ContentsChanged returns true if this Fingerprints slice contains any Fingerprints that different Fingerprint values for the matching type in other, or if this slice contains any Fingerprint types that are not in other.
|
||||
func (f Fingerprints) ContentsChanged(other Fingerprints) bool {
|
||||
for _, ff := range f {
|
||||
oo := other.For(ff.Type)
|
||||
if oo == nil || oo.Fingerprint != ff.Fingerprint {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// For returns a pointer to the first Fingerprint element matching the provided type.
|
||||
func (f Fingerprints) For(type_ string) *Fingerprint {
|
||||
for _, fp := range f {
|
||||
|
||||
Reference in New Issue
Block a user