Skip to content

Commit 66aa8ec

Browse files
committed
Allow user to set per-feed polling intervals.
set per-feed polling interval in database. use per-feed polling interval when refresh the feed. set polling interval to 0 for global config.
1 parent 0bece2d commit 66aa8ec

28 files changed

+297
-78
lines changed

client/core.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ type Feed struct {
117117
RewriteRules string `json:"rewrite_rules"`
118118
BlocklistRules string `json:"blocklist_rules"`
119119
KeeplistRules string `json:"keeplist_rules"`
120+
PollingInterval int `json:"polling_interval_minutes"`
120121
Crawler bool `json:"crawler"`
121122
UserAgent string `json:"user_agent"`
122123
Username string `json:"username"`
@@ -139,6 +140,7 @@ type FeedCreationRequest struct {
139140
RewriteRules string `json:"rewrite_rules"`
140141
BlocklistRules string `json:"blocklist_rules"`
141142
KeeplistRules string `json:"keeplist_rules"`
143+
PollingInterval int `json:"polling_interval_minutes"`
142144
}
143145

144146
// FeedModificationRequest represents the request to update a feed.
@@ -158,6 +160,7 @@ type FeedModificationRequest struct {
158160
Disabled *bool `json:"disabled"`
159161
IgnoreHTTPCache *bool `json:"ignore_http_cache"`
160162
FetchViaProxy *bool `json:"fetch_via_proxy"`
163+
PollingInterval *int `json:"polling_interval_minutes"`
161164
}
162165

163166
// FeedIcon represents the feed icon.

database/migrations.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,4 +514,12 @@ var migrations = []func(tx *sql.Tx) error{
514514
`)
515515
return err
516516
},
517+
func(tx *sql.Tx) (err error) {
518+
sql := `
519+
ALTER TABLE feeds
520+
ADD COLUMN polling_interval_minutes int default 0
521+
`
522+
_, err = tx.Exec(sql)
523+
return err
524+
},
517525
}

locale/translations.go

Lines changed: 33 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locale/translations/de_DE.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@
266266
"form.feed.label.ignore_http_cache": "Ignoriere HTTP-cache",
267267
"form.feed.label.fetch_via_proxy": "Über Proxy abrufen",
268268
"form.feed.label.disabled": "Dieses Abonnement nicht aktualisieren",
269+
"form.feed.label.polling_interval": "Abfrageintervall in Minuten",
270+
"form.feed.label.polling_interval_note": "Zur Verwendung der globalen Konfiguration auf 0 setzen",
269271
"form.category.label.title": "Titel",
270272
"form.user.label.username": "Benutzername",
271273
"form.user.label.password": "Passwort",

locale/translations/en_US.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@
266266
"form.feed.label.ignore_http_cache": "Ignore HTTP cache",
267267
"form.feed.label.fetch_via_proxy": "Fetch via proxy",
268268
"form.feed.label.disabled": "Do not refresh this feed",
269+
"form.feed.label.polling_interval": "Polling interval in minutes",
270+
"form.feed.label.polling_interval_note": "Set to 0 to use the global configurations",
269271
"form.category.label.title": "Title",
270272
"form.user.label.username": "Username",
271273
"form.user.label.password": "Password",

locale/translations/es_ES.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@
266266
"form.feed.label.ignore_http_cache": "Ignorar caché HTTP",
267267
"form.feed.label.fetch_via_proxy": "Buscar a través de proxy",
268268
"form.feed.label.disabled": "No actualice este feed",
269+
"form.feed.label.polling_interval": "Intervalo de sondeo en minutos",
270+
"form.feed.label.polling_interval_note": "establecido en 0 para usar la configuración global",
269271
"form.category.label.title": "Título",
270272
"form.user.label.username": "Nombre de usuario",
271273
"form.user.label.password": "Contraseña",

locale/translations/fr_FR.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@
266266
"form.feed.label.ignore_http_cache": "Ignore cache HTTP",
267267
"form.feed.label.fetch_via_proxy": "Récupérer via proxy",
268268
"form.feed.label.disabled": "Ne pas actualiser ce flux",
269+
"form.feed.label.polling_interval": "Intervalle d'interrogation en minutes",
270+
"form.feed.label.polling_interval_note": "défini sur 0 pour utiliser la configuration globale",
269271
"form.category.label.title": "Titre",
270272
"form.user.label.username": "Nom d'utilisateur",
271273
"form.user.label.password": "Mot de passe",

locale/translations/it_IT.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@
266266
"form.feed.label.ignore_http_cache": "Ignora cache HTTP",
267267
"form.feed.label.fetch_via_proxy": "Recuperare tramite proxy",
268268
"form.feed.label.disabled": "Non aggiornare questo feed",
269+
"form.feed.label.polling_interval": "Intervallo di polling in minuti",
270+
"form.feed.label.polling_interval_note": "impostare a 0 per utilizzare la configurazione globale",
269271
"form.category.label.title": "Titolo",
270272
"form.user.label.username": "Nome utente",
271273
"form.user.label.password": "Password",

locale/translations/ja_JP.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@
266266
"form.feed.label.ignore_http_cache": "HTTPキャッシュを無視",
267267
"form.feed.label.fetch_via_proxy": "プロキシ経由でフェッチ",
268268
"form.feed.label.disabled": "このフィードを更新しない",
269+
"form.feed.label.polling_interval": "分単位のポーリング間隔",
270+
"form.feed.label.polling_interval_note": "グローバル構成を使用するには0に設定",
269271
"form.category.label.title": "タイトル",
270272
"form.user.label.username": "ユーザー名",
271273
"form.user.label.password": "パスワード",

locale/translations/nl_NL.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@
266266
"form.feed.label.ignore_http_cache": "Negeer HTTP-cache",
267267
"form.feed.label.fetch_via_proxy": "Ophalen via proxy",
268268
"form.feed.label.disabled": "Vernieuw deze feed niet",
269+
"form.feed.label.polling_interval": "Polling-interval in minuten",
270+
"form.feed.label.polling_interval_note": "ingesteld op 0 om de algemene configuratie te gebruiken",
269271
"form.category.label.title": "Naam",
270272
"form.user.label.username": "Gebruikersnaam",
271273
"form.user.label.password": "Wachtwoord",

0 commit comments

Comments
 (0)