Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-03-13 16:44:20 +03:00
parent 72a5a4f0ac
commit b9322cda2f

View File

@@ -64,6 +64,19 @@ func imageFileHasDim3Pattern(fileName string) bool {
return false
}
func firstThreeDigitToken(tokens []string) string {
for _, t := range tokens {
base := t
if idx := strings.Index(base, "_"); idx >= 0 {
base = base[:idx]
}
if len(base) == 3 && isAllDigits(base) {
return base
}
}
return ""
}
func imageFileMatches(fileName, dim1, dim3 string) bool {
dim1 = strings.ToUpper(strings.TrimSpace(dim1))
dim3 = strings.ToUpper(strings.TrimSpace(dim3))
@@ -99,6 +112,15 @@ func imageFileMatches(fileName, dim1, dim3 string) bool {
return false
}
// dim1 filtresi varsa, dosya adindaki primary renk token'i farkliysa eslesme sayma.
// Ornek: "017--002_1" dosyasi dim1=002 icin degil, primary=017 oldugu icin dislanmali.
if dim1 != "" {
primary := firstThreeDigitToken(tokens)
if primary != "" && primary != dim1 {
return false
}
}
return hasToken(dim1) && hasToken(dim3)
}