add color detail as well

This commit is contained in:
2025-02-06 20:09:46 +01:00
parent bc01391872
commit d5885854ec
8 changed files with 26 additions and 7 deletions

View File

@@ -126,12 +126,14 @@ func ScrapeAd(fetch *Fetcher, uri string) error {
}
for _, detail := range advertisement.Details {
if slices.Contains(CONDITIONS, detail) {
switch {
case slices.Contains(CONDITIONS, detail):
advertisement.Condition = detail
} else {
case slices.Contains(COLORS, detail):
advertisement.Color = detail
default:
advertisement.Type = detail
}
}
advertisement.CalculateExpire()