From f5aaf5f46076e0ac11ab52ef2ea940fd789ff174 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 19 May 2022 21:30:40 +0200 Subject: New limit option when reloading a feed (#4370) --- app/Controllers/feedController.php | 6 +++--- app/i18n/cz/sub.php | 2 +- app/i18n/de/sub.php | 2 +- app/i18n/en-us/sub.php | 2 +- app/i18n/en/sub.php | 2 +- app/i18n/es/sub.php | 2 +- app/i18n/fr/sub.php | 2 +- app/i18n/he/sub.php | 2 +- app/i18n/it/sub.php | 2 +- app/i18n/ja/sub.php | 2 +- app/i18n/ko/sub.php | 2 +- app/i18n/nl/sub.php | 2 +- app/i18n/oc/sub.php | 2 +- app/i18n/pl/sub.php | 2 +- app/i18n/pt-br/sub.php | 2 +- app/i18n/ru/sub.php | 2 +- app/i18n/sk/sub.php | 2 +- app/i18n/tr/sub.php | 2 +- app/i18n/zh-cn/sub.php | 2 +- app/views/helpers/feed/update.phtml | 34 ++++++++++++++++++++-------------- p/scripts/extra.js | 11 +++++++++-- p/scripts/feed.js | 4 +++- 22 files changed, 53 insertions(+), 38 deletions(-) diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 4788f9639..49383342e 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -814,7 +814,8 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { @set_time_limit(300); //Get Feed ID. - $feed_id = Minz_Request::param('id'); + $feed_id = intval(Minz_Request::param('id', 0)); + $limit = intval(Minz_Request::param('reload_limit', 10)); $feedDAO = FreshRSS_Factory::createFeedDao(); $entryDAO = FreshRSS_Factory::createEntryDao(); @@ -831,8 +832,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { self::actualizeFeed($feed_id, '', false); //Extract all feed entries from database, load complete content and store them back in database. - $entries = $entryDAO->listWhere('f', $feed_id, FreshRSS_Entry::STATE_ALL, 'DESC', 0); - //TODO: Parameter to limit the number of articles to reload + $entries = $entryDAO->listWhere('f', $feed_id, FreshRSS_Entry::STATE_ALL, 'DESC', $limit); //We need another DB connection in parallel for unbuffered streaming Minz_ModelPdo::$usesSharedPdo = false; diff --git a/app/i18n/cz/sub.php b/app/i18n/cz/sub.php index 2eff49030..7efc2ab99 100644 --- a/app/i18n/cz/sub.php +++ b/app/i18n/cz/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Vymazat mezipaměť', 'clear_cache_help' => 'Vymazat mezipaměť pro tento kanál.', 'reload_articles' => 'Znovu načíst články', - 'reload_articles_help' => 'Znovu načíst články a získat úplný obsah, pokud je definován přepínač.', + 'reload_articles_help' => 'Znovu načíst články a získat úplný obsah, pokud je definován přepínač.', // DIRTY 'title' => 'Údržba', ), 'moved_category_deleted' => 'Když odstraníte kategorii, její kanály jsou automaticky přesunuty do %s.', diff --git a/app/i18n/de/sub.php b/app/i18n/de/sub.php index 52323221d..7eba536da 100644 --- a/app/i18n/de/sub.php +++ b/app/i18n/de/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Zwischenspeicher leeren', 'clear_cache_help' => 'Zwischenspeicher für diesen Feed leeren.', 'reload_articles' => 'Artikel neuladen', - 'reload_articles_help' => 'Artikel neuladen und komplette Inhalte holen, wenn ein Selektor festgelegt wurde.', + 'reload_articles_help' => 'Artikel neuladen und komplette Inhalte holen, wenn ein Selektor festgelegt wurde.', // DIRTY 'title' => 'Wartung', ), 'moved_category_deleted' => 'Wenn Sie eine Kategorie entfernen, werden deren Feeds automatisch in die Kategorie %s eingefügt.', diff --git a/app/i18n/en-us/sub.php b/app/i18n/en-us/sub.php index 41b8c377b..69853e8cb 100644 --- a/app/i18n/en-us/sub.php +++ b/app/i18n/en-us/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Clear cache', // IGNORE 'clear_cache_help' => 'Clear the cache for this feed.', // IGNORE 'reload_articles' => 'Reload articles', // IGNORE - 'reload_articles_help' => 'Reload articles and fetch complete content if a selector is defined.', // IGNORE + 'reload_articles_help' => 'Reload that many articles and fetch complete content if a selector is defined.', // IGNORE 'title' => 'Maintenance', // IGNORE ), 'moved_category_deleted' => 'When you delete a category, its feeds are automatically classified under %s.', // IGNORE diff --git a/app/i18n/en/sub.php b/app/i18n/en/sub.php index 902deb1b5..697f5facc 100644 --- a/app/i18n/en/sub.php +++ b/app/i18n/en/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Clear cache', 'clear_cache_help' => 'Clear the cache for this feed.', 'reload_articles' => 'Reload articles', - 'reload_articles_help' => 'Reload articles and fetch complete content if a selector is defined.', + 'reload_articles_help' => 'Reload that many articles and fetch complete content if a selector is defined.', 'title' => 'Maintenance', ), 'moved_category_deleted' => 'When you delete a category, its feeds are automatically classified under %s.', diff --git a/app/i18n/es/sub.php b/app/i18n/es/sub.php index f55e0cbbb..d53e6b2da 100755 --- a/app/i18n/es/sub.php +++ b/app/i18n/es/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Borrar caché', 'clear_cache_help' => 'Borrar la memoria caché de esta fuente.', 'reload_articles' => 'Recargar artículos', - 'reload_articles_help' => 'Vuelva a cargar artículos y obtenga contenido completo si se define un selector.', + 'reload_articles_help' => 'Vuelva a cargar artículos y obtenga contenido completo si se define un selector.', // DIRTY 'title' => 'Mantenimiento', ), 'moved_category_deleted' => 'Al borrar una categoría todas sus fuentes pasan automáticamente a la categoría %s.', diff --git a/app/i18n/fr/sub.php b/app/i18n/fr/sub.php index c8528504a..461c8abdd 100644 --- a/app/i18n/fr/sub.php +++ b/app/i18n/fr/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Vider le cache', 'clear_cache_help' => 'Supprime le cache de ce flux.', 'reload_articles' => 'Recharger les articles', - 'reload_articles_help' => 'Recharge les articles et récupère le contenu complet si un sélecteur est défini.', + 'reload_articles_help' => 'Recharge cette quantité d’articles et récupère le contenu complet si un sélecteur est défini.', 'title' => 'Maintenance', // IGNORE ), 'moved_category_deleted' => 'Lors de la suppression d’une catégorie, ses flux seront automatiquement classés dans %s.', diff --git a/app/i18n/he/sub.php b/app/i18n/he/sub.php index 6068a63c0..063a5da99 100644 --- a/app/i18n/he/sub.php +++ b/app/i18n/he/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Clear cache', // TODO 'clear_cache_help' => 'Clear the cache for this feed.', // TODO 'reload_articles' => 'Reload articles', // TODO - 'reload_articles_help' => 'Reload articles and fetch complete content if a selector is defined.', // TODO + 'reload_articles_help' => 'Reload that many articles and fetch complete content if a selector is defined.', // TODO 'title' => 'Maintenance', // TODO ), 'moved_category_deleted' => 'כאשר הקטגוריה נמחקת ההזנות שבתוכה אוטומטית מקוטלגות תחת %s.', diff --git a/app/i18n/it/sub.php b/app/i18n/it/sub.php index cab35180e..9ffaae80b 100644 --- a/app/i18n/it/sub.php +++ b/app/i18n/it/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Clear cache', // TODO 'clear_cache_help' => 'Clear the cache for this feed.', // TODO 'reload_articles' => 'Reload articles', // TODO - 'reload_articles_help' => 'Reload articles and fetch complete content if a selector is defined.', // TODO + 'reload_articles_help' => 'Reload that many articles and fetch complete content if a selector is defined.', // TODO 'title' => 'Maintenance', // TODO ), 'moved_category_deleted' => 'Cancellando una categoria i feed al suo interno verranno classificati automaticamente come %s.', diff --git a/app/i18n/ja/sub.php b/app/i18n/ja/sub.php index ba7fa23b1..273274d54 100644 --- a/app/i18n/ja/sub.php +++ b/app/i18n/ja/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'キャッシュのクリア', 'clear_cache_help' => 'このフィードのキャッシュをクリアします。', 'reload_articles' => '記事を再読み込みする', - 'reload_articles_help' => '記事を再読み込みして、セレクターが定義したコンテンツを完全に取得します。', + 'reload_articles_help' => '記事を再読み込みして、セレクターが定義したコンテンツを完全に取得します。', // DIRTY 'title' => 'メンテナンス', ), 'moved_category_deleted' => 'カテゴリを削除したとき、フィードは自動的に%s下に分類されます。', diff --git a/app/i18n/ko/sub.php b/app/i18n/ko/sub.php index ff9af8c39..ae048244a 100644 --- a/app/i18n/ko/sub.php +++ b/app/i18n/ko/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => '캐쉬 지우기', 'clear_cache_help' => '이 피드의 캐쉬 지우기.', 'reload_articles' => '글 다시 로드', - 'reload_articles_help' => '글 다시 로드하고 셀렉터가 정의 되었을 경우에 모든 컨텐츠 가져오기.', + 'reload_articles_help' => '글 다시 로드하고 셀렉터가 정의 되었을 경우에 모든 컨텐츠 가져오기.', // DIRTY 'title' => '유지 보수', ), 'moved_category_deleted' => '카테고리를 삭제하면, 해당 카테고리 아래에 있던 피드들은 자동적으로 %s 아래로 분류됩니다.', diff --git a/app/i18n/nl/sub.php b/app/i18n/nl/sub.php index b8439f0b5..10d158852 100644 --- a/app/i18n/nl/sub.php +++ b/app/i18n/nl/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Cache leegmaken', 'clear_cache_help' => 'Cache voor deze feed leegmaken.', 'reload_articles' => 'Artikels herladen', - 'reload_articles_help' => 'Artikels herladen en complete inhoud ophalen als een selector is gedefinieerd.', + 'reload_articles_help' => 'Artikels herladen en complete inhoud ophalen als een selector is gedefinieerd.', // DIRTY 'title' => 'Onderhoud', ), 'moved_category_deleted' => 'Als u een categorie verwijderd, worden de feeds automatisch geclassificeerd onder %s.', diff --git a/app/i18n/oc/sub.php b/app/i18n/oc/sub.php index 5cc7c792a..2f36d5889 100644 --- a/app/i18n/oc/sub.php +++ b/app/i18n/oc/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Escafar lo cache', 'clear_cache_help' => 'Escafar lo cache d’aqueste flux sul disc', 'reload_articles' => 'Recargar los articles', - 'reload_articles_help' => 'Recargar los articles e recuperar lo contengut complet', + 'reload_articles_help' => 'Recargar los articles e recuperar lo contengut complet', // DIRTY 'title' => 'Mantenença', ), 'moved_category_deleted' => 'Quand escafatz una categoria, sos fluxes son automaticament classats dins %s.', diff --git a/app/i18n/pl/sub.php b/app/i18n/pl/sub.php index 204d9ffef..103d0500e 100644 --- a/app/i18n/pl/sub.php +++ b/app/i18n/pl/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Wyczyść pamięć podręczną', 'clear_cache_help' => 'Czyści pamięć podręczną tego kanału.', 'reload_articles' => 'Przeładuj wiadomości', - 'reload_articles_help' => 'Ponownie pobiera wiadomości i przetwarza treść ze strony pierwotnej, jeżeli zdefiniowany został selektor CSS.', + 'reload_articles_help' => 'Ponownie pobiera wiadomości i przetwarza treść ze strony pierwotnej, jeżeli zdefiniowany został selektor CSS.', // DIRTY 'title' => 'Konserwacja', ), 'moved_category_deleted' => 'Po usunięciu kategorii znajdujące się w niej kanały zostaną automatycznie przeniesione do %s.', diff --git a/app/i18n/pt-br/sub.php b/app/i18n/pt-br/sub.php index 25d76ad9f..3d6f86147 100644 --- a/app/i18n/pt-br/sub.php +++ b/app/i18n/pt-br/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Limpar o cache', 'clear_cache_help' => 'Limpar o cache em disco deste feed', 'reload_articles' => 'Recarregar artigos', - 'reload_articles_help' => 'Recarregar artigos e buscar conteúdo completo', + 'reload_articles_help' => 'Recarregar artigos e buscar conteúdo completo', // DIRTY 'title' => 'Manutenção', ), 'moved_category_deleted' => 'Quando você deleta uma categoria, seus feeds são automaticamente classificados como %s.', diff --git a/app/i18n/ru/sub.php b/app/i18n/ru/sub.php index 1be761ab6..623c354f9 100644 --- a/app/i18n/ru/sub.php +++ b/app/i18n/ru/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Очистить кэш', 'clear_cache_help' => 'Очистить кэш для этой ленты.', 'reload_articles' => 'Снова загрузить статьи', - 'reload_articles_help' => 'Снова загрузить статьи и извлечь полное содержимое, если задан селектор.', + 'reload_articles_help' => 'Снова загрузить статьи и извлечь полное содержимое, если задан селектор.', // DIRTY 'title' => 'Обслуживание', ), 'moved_category_deleted' => 'Когда вы удаляете категорию, ленты категории автоматически попадают в категорию %s.', diff --git a/app/i18n/sk/sub.php b/app/i18n/sk/sub.php index ef6e037fb..8a5ede475 100644 --- a/app/i18n/sk/sub.php +++ b/app/i18n/sk/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Vymazať vyrovnáciu pamäť', 'clear_cache_help' => 'Vymazať vyrovnáciu pamäť pre tento kanál.', 'reload_articles' => 'Obnoviť články', - 'reload_articles_help' => 'Obnoviť články a stiahnuť kompletný obsah, ak je definovaný selektor.', + 'reload_articles_help' => 'Obnoviť články a stiahnuť kompletný obsah, ak je definovaný selektor.', // DIRTY 'title' => 'Údržba', ), 'moved_category_deleted' => 'Keď vymažete kategóriu, jej kanály sa automaticky zaradia pod %s.', diff --git a/app/i18n/tr/sub.php b/app/i18n/tr/sub.php index e9f58f895..c883a6caa 100644 --- a/app/i18n/tr/sub.php +++ b/app/i18n/tr/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => 'Önbelleği temizle', 'clear_cache_help' => 'Bu akışın önbelleğini temizler.', 'reload_articles' => 'Makaleleri yeniden yükle', - 'reload_articles_help' => 'Reload articles and fetch complete content if a selector is defined.', // TODO + 'reload_articles_help' => 'Reload that many articles and fetch complete content if a selector is defined.', // TODO 'title' => 'Bakım', ), 'moved_category_deleted' => 'Bir kategoriyi silerseniz, içerisindeki akışlar %s içerisine yerleşir.', diff --git a/app/i18n/zh-cn/sub.php b/app/i18n/zh-cn/sub.php index a1bb7e0d4..82b660c79 100644 --- a/app/i18n/zh-cn/sub.php +++ b/app/i18n/zh-cn/sub.php @@ -108,7 +108,7 @@ return array( 'clear_cache' => '清理缓存', 'clear_cache_help' => '清除该feed的缓存', 'reload_articles' => '重载文章', - 'reload_articles_help' => '重新加载文章并获取完整内容', + 'reload_articles_help' => '重新加载文章并获取完整内容', // DIRTY 'title' => '维护', ), 'moved_category_deleted' => '删除分类时,其中的订阅源会自动归类到 %s', diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml index da4e04e50..9764b3f47 100644 --- a/app/views/helpers/feed/update.phtml +++ b/app/views/helpers/feed/update.phtml @@ -478,7 +478,7 @@
+ data-leave-validation="feed->pathEntries() ?>" placeholder="" />
@@ -573,23 +573,29 @@
+ - -
-
- - - -

-
-
- + +
+ +
+
+ + + +

-
+
- +
+