chore: splits out article into db specific entity and generic struct

This commit is contained in:
Dennis Schoepf 2025-08-29 14:12:21 +02:00
parent 5a4a4d387a
commit 2322b9170d
3 changed files with 41 additions and 20 deletions

View file

@ -34,14 +34,14 @@ func AddFeed(feedUrl string) (string, int, error) {
}
// TODO: Make the amount of articles configurable
articles := make([]database.Article, 0, 10)
articles := make([]database.ArticleEntity, 0, 10)
for i, v := range feed.Items {
if i > 10 {
continue
}
a := database.Article{
a := database.ArticleEntity{
Name: v.Title,
Url: v.Link,
FeedId: feedId,
@ -143,14 +143,14 @@ func syncFeed(
return
}
var articles []database.Article
var articles []database.ArticleEntity
for _, item := range gFeed.Items {
if item.PublishedParsed.Before(*feed.LastSyncedAt) {
continue
}
article := database.Article{
article := database.ArticleEntity{
Name: item.Title,
Url: item.Link,
FeedId: feed.ID,