Skip to content

Commit

Permalink
better decriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
flopp committed Nov 1, 2024
1 parent 4922819 commit b1cb389
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,27 @@ func (event Event) GenerateDescription() string {

var description string

location := ""
if event.Location.NameNoFlag() != "" {
location = fmt.Sprintf(" in '%s'", event.Location.NameNoFlag())
}

time := ""
if event.Time.Original != "" {
if event.Time.Original == "Verschiedene Termine" {
time = ", verschiedene Termine"
} else {
time = fmt.Sprintf(" am %s", event.Time.Original)
}
}

switch event.Type {
case "event":
description = fmt.Sprintf("Informationen zur Laufveranstaltung '%s' in '%s' am %s", event.Name, event.Location.NameNoFlag(), event.Time)
description = fmt.Sprintf("Informationen zur Laufveranstaltung '%s'%s%s", event.Name, location, time)
case "group":
description = fmt.Sprintf("Informationen zur Laufgruppe/Lauftreff '%s' in '%s' am %s", event.Name, event.Location.NameNoFlag(), event.Time)
description = fmt.Sprintf("Informationen zur Laufgruppe / zum Lauftreff '%s'%s%s", event.Name, location, time)
case "shop":
description = fmt.Sprintf("Informationen zum Laufshop '%s' in '%s'", event.Name, event.Location.NameNoFlag())
description = fmt.Sprintf("Informationen zum Laufshop '%s'%s", event.Name, location)
}

if len(description) >= min {
Expand Down

0 comments on commit b1cb389

Please sign in to comment.