atom: avoid debug message when the date is empty
This commit is contained in:
parent
b1e73fafdf
commit
8212f16aa2
1 changed files with 11 additions and 9 deletions
|
@ -106,15 +106,17 @@ func (a *Atom10Adapter) BuildFeed(baseURL string) *model.Feed {
|
||||||
|
|
||||||
// Populate the entry date.
|
// Populate the entry date.
|
||||||
for _, value := range []string{atomEntry.Published, atomEntry.Updated} {
|
for _, value := range []string{atomEntry.Published, atomEntry.Updated} {
|
||||||
if parsedDate, err := date.Parse(value); err != nil {
|
if value != "" {
|
||||||
slog.Debug("Unable to parse date from Atom 1.0 feed",
|
if parsedDate, err := date.Parse(value); err != nil {
|
||||||
slog.String("date", value),
|
slog.Debug("Unable to parse date from Atom 1.0 feed",
|
||||||
slog.String("url", entry.URL),
|
slog.String("date", value),
|
||||||
slog.Any("error", err),
|
slog.String("url", entry.URL),
|
||||||
)
|
slog.Any("error", err),
|
||||||
} else {
|
)
|
||||||
entry.Date = parsedDate
|
} else {
|
||||||
break
|
entry.Date = parsedDate
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if entry.Date.IsZero() {
|
if entry.Date.IsZero() {
|
||||||
|
|
Loading…
Reference in a new issue