From 2c8b71598eb0c0a051261b38f653d9b470239ef5 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Sat, 22 Feb 2025 12:20:38 +0530 Subject: [PATCH] Skip items in feeds if they don't have link or title & description --- .../rss/reader/core/network/parser/AtomContentParser.kt | 2 +- .../rss/reader/core/network/parser/RDFContentParser.kt | 2 +- .../rss/reader/core/network/parser/RSSContentParser.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/AtomContentParser.kt b/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/AtomContentParser.kt index 22ac98d8e..cb3f1033c 100644 --- a/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/AtomContentParser.kt +++ b/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/AtomContentParser.kt @@ -131,7 +131,7 @@ internal object AtomContentParser : ContentParser() { val postPubDateInMillis = date?.dateStringToEpochMillis() - if (title.isNullOrBlank() && content.isNullOrBlank()) { + if (link.isNullOrBlank() || (title.isNullOrBlank() && content.isNullOrBlank())) { return null } diff --git a/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/RDFContentParser.kt b/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/RDFContentParser.kt index af9eb19e9..f5979cf26 100644 --- a/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/RDFContentParser.kt +++ b/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/RDFContentParser.kt @@ -130,7 +130,7 @@ internal object RDFContentParser : ContentParser() { val postPubDateInMillis = date?.dateStringToEpochMillis() - if (title.isNullOrBlank() && description.isNullOrBlank()) { + if (link.isNullOrBlank() || (title.isNullOrBlank() && description.isNullOrBlank())) { return null } diff --git a/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/RSSContentParser.kt b/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/RSSContentParser.kt index 974e42f80..d760c9c9c 100644 --- a/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/RSSContentParser.kt +++ b/core/network/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/network/parser/RSSContentParser.kt @@ -139,7 +139,7 @@ internal object RSSContentParser : ContentParser() { val postPubDateInMillis = date?.dateStringToEpochMillis() - if (title.isNullOrBlank() && description.isNullOrBlank()) { + if (link.isNullOrBlank() || (title.isNullOrBlank() && description.isNullOrBlank())) { return null }