fixed CustomName whitespace

This commit is contained in:
Elmar Kresse
2023-09-22 16:31:12 +02:00
parent 023cca3105
commit 334dd406a7
3 changed files with 7 additions and 7 deletions

View File

@@ -43,7 +43,7 @@ func (icalModel IcalModel) EmitICal() goics.Componenter {
func replaceNameIfUserDefined(name string, mapping []model.FeedCollection) string {
for _, mapEntry := range mapping {
if mapEntry.Name == name {
if mapEntry.Name == name && !functions.OnlyWhitespace(mapEntry.UserDefinedName) {
return mapEntry.UserDefinedName
}
}
@@ -53,13 +53,13 @@ func replaceNameIfUserDefined(name string, mapping []model.FeedCollection) strin
func generateDescription(event *model.Event) string {
var description string
if !functions.CheckIfOnlyWhitespace(event.Notes) {
if !functions.OnlyWhitespace(event.Notes) {
description += "Notizen: " + event.Notes + "\n"
}
if !functions.CheckIfOnlyWhitespace(event.Prof) {
if !functions.OnlyWhitespace(event.Prof) {
description += "Prof: " + event.Prof + "\n"
}
if !functions.CheckIfOnlyWhitespace(event.Course) {
if !functions.OnlyWhitespace(event.Course) {
description += "Gruppe: " + event.Course + "\n"
}