From eb344733800b5bcc7c12bc5509f4fd339dfe7055 Mon Sep 17 00:00:00 2001 From: Dave Gittins Date: Sun, 29 Oct 2023 11:55:11 +0100 Subject: [PATCH] Unsubscribe broken feeds automatically --- server/manifest.go | 2 +- server/plugin.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/manifest.go b/server/manifest.go index 294643c..f936672 100644 --- a/server/manifest.go +++ b/server/manifest.go @@ -7,5 +7,5 @@ var manifest = struct { Version string }{ ID: "rssfeed", - Version: "0.2.6" + Version: "0.2.6", } diff --git a/server/plugin.go b/server/plugin.go index 677e48f..ac59f64 100644 --- a/server/plugin.go +++ b/server/plugin.go @@ -82,6 +82,11 @@ func (p *RSSFeedPlugin) processHeartBeat() error { err := p.processSubscription(value) if err != nil { p.API.LogError(err.Error()) + p.API.LogInfo(fmt.Sprintf("Unsubscribing invalid URL %s from channel %s", value.URL, value.ChannelID)) + err := p.unsubscribe(value.ChannelID, value.URL) + if err != nil { + p.API.LogError(err.Error()) + } } }