add color detail as well (#119)

Co-authored-by: Thomas von Dein <tom@vondein.org>
This commit is contained in:
T.v.Dein
2025-02-06 20:13:08 +01:00
committed by GitHub
parent bc01391872
commit 09948a6b39
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()