Skip to content

Commit

Permalink
feat: check for description on website (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
hairmare authored Oct 5, 2021
1 parent 000e892 commit 5a179da
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,20 +287,20 @@ func checkForErrors() {
}
if slot.WebsiteEventOrganizerCalendarEvent.Title != "" && slot.LibreTimeLiveInfoV2Show.Name == "" {
if slot.WebsiteEventOrganizerCalendarEvent.Title != "Klangbecken" {
appendError(fmt.Sprintf("%s fehlt in LibreTime.",
appendError(fmt.Sprintf("%s fehlt im LibreTime.",
slot.WebsiteEventOrganizerCalendarEvent.Title),
slot.WebsiteEventOrganizerCalendarEvent.Start, slot)
}
} else if slot.LibreTimeLiveInfoV2Show.Name != "" && slot.WebsiteEventOrganizerCalendarEvent.Title == "" {
if slot.LibreTimeLiveInfoV2Show.Name != "Klangbecken" {
appendError(
fmt.Sprintf("%s fehlt auf Web Seite.",
fmt.Sprintf("%s fehlt auf der Webseite.",
slot.LibreTimeLiveInfoV2Show.Name),
slot.LibreTimeLiveInfoV2Show.Starts, slot)
}
} else if slot.WebsiteEventOrganizerCalendarEvent.Title != slot.LibreTimeLiveInfoV2Show.Name {
appendError(
fmt.Sprintf("Titel auf Webseite (%s) stimmt nicht mit LibreTime (%s) überein.",
fmt.Sprintf("Titel auf der Webseite (%s) stimmt nicht mit LibreTime (%s) überein.",
slot.WebsiteEventOrganizerCalendarEvent.Title, slot.LibreTimeLiveInfoV2Show.Name),
slot.WebsiteEventOrganizerCalendarEvent.Start, slot)
}
Expand All @@ -313,12 +313,12 @@ func checkForErrors() {
if slot.LibreTimeLiveInfoV2Show.URL != slot.WebsiteEventOrganizerCalendarEvent.URL {
if slot.WebsiteEventOrganizerCalendarEvent.URL == "#" {
appendError(
fmt.Sprintf("Keine URL für Sendung %s auf Website hinterlegt.",
fmt.Sprintf("Sendung %s hat keine URL auf der Webseite.",
slot.WebsiteEventOrganizerCalendarEvent.Title),
slot.WebsiteEventOrganizerCalendarEvent.Start, slot)
} else {
appendError(
fmt.Sprintf("URL auf Webseite (%s) stimmt nicht mit LibreTime (%s) überein.",
fmt.Sprintf("URL auf der Webseite (%s) stimmt nicht mit LibreTime (%s) überein.",
slot.WebsiteEventOrganizerCalendarEvent.URL, slot.LibreTimeLiveInfoV2Show.URL),
slot.WebsiteEventOrganizerCalendarEvent.Start, slot)
}
Expand All @@ -327,12 +327,20 @@ func checkForErrors() {
// we allow a difference of > 10 minutes at the end to account for preproduced broadcasts that go into overtime
if !slot.LibreTimeLiveInfoV2Show.Ends.Equal(slot.WebsiteEventOrganizerCalendarEvent.End.Time) && slot.LibreTimeLiveInfoV2Show.Ends.Time.Sub(slot.WebsiteEventOrganizerCalendarEvent.End.Time) > time.Minute*10 {
appendError(
fmt.Sprintf("Ende auf Webseite (%s) stimmt nicht mit LibreTime (%s) überein.",
fmt.Sprintf("Ende auf der Webseite (%s) stimmt nicht mit LibreTime (%s) überein.",
slot.WebsiteEventOrganizerCalendarEvent.End.Format("02 Jan 2006 15:04:05"),
slot.LibreTimeLiveInfoV2Show.Ends.Format("02 Jan 2006 15:04:05")),
slot.WebsiteEventOrganizerCalendarEvent.Start, slot)
}

// check if description is set on web (archiv.rabe.ch uses this information)
if slot.WebsiteEventOrganizerCalendarEvent.Description == "" {
appendError(
fmt.Sprintf("Beschreibung für Sendung %s fehlt auf der Webseite.",
slot.WebsiteEventOrganizerCalendarEvent.Title),
slot.WebsiteEventOrganizerCalendarEvent.Start, slot)
}

}
sort.Sort(errors)
}
Expand Down

0 comments on commit 5a179da

Please sign in to comment.