diff options
Diffstat (limited to 'src')
18 files changed, 46 insertions, 37 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 3dad0b8f..4e5ed9ae 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | |||
@@ -430,6 +430,7 @@ flashes: | |||
430 | # failed: 'Import failed, please try again.' | 430 | # failed: 'Import failed, please try again.' |
431 | # failed_on_file: 'Error while processing import. Please verify your import file.' | 431 | # failed_on_file: 'Error while processing import. Please verify your import file.' |
432 | # summary: 'Import summary: %imported% imported, %skipped% already saved.' | 432 | # summary: 'Import summary: %imported% imported, %skipped% already saved.' |
433 | # summary_with_queue: 'Import summary: %queued% queued.' | ||
433 | developer: | 434 | developer: |
434 | notice: | 435 | notice: |
435 | # client_created: 'New client created.' | 436 | # client_created: 'New client created.' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index c0a674e3..107187bf 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml | |||
@@ -430,6 +430,7 @@ flashes: | |||
430 | failed: 'Import fehlgeschlagen, bitte erneut probieren.' | 430 | failed: 'Import fehlgeschlagen, bitte erneut probieren.' |
431 | failed_on_file: 'Fehler während des Imports. Bitte überprüfe deine Import-Datei.' | 431 | failed_on_file: 'Fehler während des Imports. Bitte überprüfe deine Import-Datei.' |
432 | summary: 'Import-Zusammenfassung: %imported% importiert, %skipped% bereits gespeichert.' | 432 | summary: 'Import-Zusammenfassung: %imported% importiert, %skipped% bereits gespeichert.' |
433 | # summary_with_queue: 'Import summary: %queued% queued.' | ||
433 | developer: | 434 | developer: |
434 | notice: | 435 | notice: |
435 | client_created: 'Neuer Client erstellt.' | 436 | client_created: 'Neuer Client erstellt.' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 4104f4d4..ac60295f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | |||
@@ -432,6 +432,7 @@ flashes: | |||
432 | failed: 'Import failed, please try again.' | 432 | failed: 'Import failed, please try again.' |
433 | failed_on_file: 'Error while processing import. Please verify your import file.' | 433 | failed_on_file: 'Error while processing import. Please verify your import file.' |
434 | summary: 'Import summary: %imported% imported, %skipped% already saved.' | 434 | summary: 'Import summary: %imported% imported, %skipped% already saved.' |
435 | summary_with_queue: 'Import summary: %queued% queued.' | ||
435 | developer: | 436 | developer: |
436 | notice: | 437 | notice: |
437 | client_created: 'New client %name% created.' | 438 | client_created: 'New client %name% created.' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index e5604fda..1082e6de 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | |||
@@ -427,9 +427,10 @@ flashes: | |||
427 | tag_added: 'Etiqueta añadida' | 427 | tag_added: 'Etiqueta añadida' |
428 | import: | 428 | import: |
429 | notice: | 429 | notice: |
430 | failed: 'Importación reprobada, por favor inténtelo de nuevo.' | 430 | failed: 'Importación reprobada, por favor inténtelo de nuevo.' |
431 | failed_on_file: 'Se ocurre un error por procesar importación. Por favor verifique su archivo importado.' | 431 | failed_on_file: 'Se ocurre un error por procesar importación. Por favor verifique su archivo importado.' |
432 | summary: 'Resúmen importado: %importado% importado, %saltados% ya guardado.' | 432 | summary: 'Resúmen importado: %importado% importado, %saltados% ya guardado.' |
433 | # summary_with_queue: 'Import summary: %queued% queued.' | ||
433 | developer: | 434 | developer: |
434 | notice: | 435 | notice: |
435 | client_created: 'Nuevo cliente creado.' | 436 | client_created: 'Nuevo cliente creado.' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 63464d94..78317a9c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | |||
@@ -430,6 +430,7 @@ flashes: | |||
430 | failed: 'درونریزی شکست خورد. لطفاً دوباره تلاش کنید.' | 430 | failed: 'درونریزی شکست خورد. لطفاً دوباره تلاش کنید.' |
431 | failed_on_file: 'خطا هنگام پردازش پروندهٔ ورودی. آیا پروندهٔ درونریزی شده سالم است؟' | 431 | failed_on_file: 'خطا هنگام پردازش پروندهٔ ورودی. آیا پروندهٔ درونریزی شده سالم است؟' |
432 | summary: 'گزارش درونریزی: %imported% وارد شد, %skipped% از قبل ذخیره شده بود.' | 432 | summary: 'گزارش درونریزی: %imported% وارد شد, %skipped% از قبل ذخیره شده بود.' |
433 | # summary_with_queue: 'Import summary: %queued% queued.' | ||
433 | developer: | 434 | developer: |
434 | notice: | 435 | notice: |
435 | # client_created: 'New client created.' | 436 | # client_created: 'New client created.' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 3207b7f9..50515d80 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | |||
@@ -432,6 +432,7 @@ flashes: | |||
432 | failed: "L'import a échoué, veuillez ré-essayer" | 432 | failed: "L'import a échoué, veuillez ré-essayer" |
433 | failed_on_file: "Erreur lors du traitement de l'import. Vérifier votre fichier." | 433 | failed_on_file: "Erreur lors du traitement de l'import. Vérifier votre fichier." |
434 | summary: "Rapport d'import: %imported% importés, %skipped% déjà présent." | 434 | summary: "Rapport d'import: %imported% importés, %skipped% déjà présent." |
435 | summary_with_queue: "Rapport d'import: %queued% en cours de traitement." | ||
435 | developer: | 436 | developer: |
436 | notice: | 437 | notice: |
437 | client_created: 'Nouveau client %name% créé' | 438 | client_created: 'Nouveau client %name% créé' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 5be376c8..5badeffc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | |||
@@ -429,6 +429,7 @@ flashes: | |||
429 | failed: 'Importazione fallita, riprova.' | 429 | failed: 'Importazione fallita, riprova.' |
430 | failed_on_file: 'Errore durante la processazione dei dati da importare. Verifica il tuo file di import.' | 430 | failed_on_file: 'Errore durante la processazione dei dati da importare. Verifica il tuo file di import.' |
431 | summary: 'Sommario di importazione: %imported% importati, %skipped% già salvati.' | 431 | summary: 'Sommario di importazione: %imported% importati, %skipped% già salvati.' |
432 | # summary_with_queue: 'Import summary: %queued% queued.' | ||
432 | developer: | 433 | developer: |
433 | notice: | 434 | notice: |
434 | client_created: 'Nuovo client creato.' | 435 | client_created: 'Nuovo client creato.' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 3778b868..2383886c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml | |||
@@ -430,6 +430,7 @@ flashes: | |||
430 | failed: "L'importacion a fracassat, mercés de tornar ensajar" | 430 | failed: "L'importacion a fracassat, mercés de tornar ensajar" |
431 | failed_on_file: "Errorr pendent du tractament de l'import. Mercés de verificar vòstre fichièr." | 431 | failed_on_file: "Errorr pendent du tractament de l'import. Mercés de verificar vòstre fichièr." |
432 | summary: "Rapòrt d'import: %imported% importats, %skipped% ja presents." | 432 | summary: "Rapòrt d'import: %imported% importats, %skipped% ja presents." |
433 | # summary_with_queue: 'Import summary: %queued% queued.' | ||
433 | developer: | 434 | developer: |
434 | notice: | 435 | notice: |
435 | client_created: 'Novèl client creat' | 436 | client_created: 'Novèl client creat' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 8b536679..40cd2b71 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | |||
@@ -430,6 +430,7 @@ flashes: | |||
430 | failed: 'Nieudany import, prosimy spróbować ponownie.' | 430 | failed: 'Nieudany import, prosimy spróbować ponownie.' |
431 | failed_on_file: 'Błąd podczas ptrzetwarzania pliku. Sprawdż swój importowany plik.' | 431 | failed_on_file: 'Błąd podczas ptrzetwarzania pliku. Sprawdż swój importowany plik.' |
432 | summary: 'Podsumowanie importu: %imported% zaimportowane, %skipped% już zapisane.' | 432 | summary: 'Podsumowanie importu: %imported% zaimportowane, %skipped% już zapisane.' |
433 | # summary_with_queue: 'Import summary: %queued% queued.' | ||
433 | developer: | 434 | developer: |
434 | notice: | 435 | notice: |
435 | client_created: 'Nowy klient utworzony.' | 436 | client_created: 'Nowy klient utworzony.' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 3f330da4..b18eab9e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | |||
@@ -430,6 +430,7 @@ flashes: | |||
430 | # failed: 'Import failed, please try again.' | 430 | # failed: 'Import failed, please try again.' |
431 | # failed_on_file: 'Error while processing import. Please verify your import file.' | 431 | # failed_on_file: 'Error while processing import. Please verify your import file.' |
432 | # summary: 'Import summary: %imported% imported, %skipped% already saved.' | 432 | # summary: 'Import summary: %imported% imported, %skipped% already saved.' |
433 | # summary_with_queue: 'Import summary: %queued% queued.' | ||
433 | developer: | 434 | developer: |
434 | notice: | 435 | notice: |
435 | # client_created: 'New client created.' | 436 | # client_created: 'New client created.' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 5216ebe5..82fa93af 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | |||
@@ -430,6 +430,7 @@ flashes: | |||
430 | # failed: 'Import failed, please try again.' | 430 | # failed: 'Import failed, please try again.' |
431 | # failed_on_file: 'Error while processing import. Please verify your import file.' | 431 | # failed_on_file: 'Error while processing import. Please verify your import file.' |
432 | # summary: 'Import summary: %imported% imported, %skipped% already saved.' | 432 | # summary: 'Import summary: %imported% imported, %skipped% already saved.' |
433 | # summary_with_queue: 'Import summary: %queued% queued.' | ||
433 | developer: | 434 | developer: |
434 | notice: | 435 | notice: |
435 | # client_created: 'New client created.' | 436 | # client_created: 'New client created.' |
diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php index 3d555717..1f92c182 100644 --- a/src/Wallabag/ImportBundle/Controller/PocketController.php +++ b/src/Wallabag/ImportBundle/Controller/PocketController.php | |||
@@ -102,6 +102,12 @@ class PocketController extends Controller | |||
102 | '%imported%' => $summary['imported'], | 102 | '%imported%' => $summary['imported'], |
103 | '%skipped%' => $summary['skipped'], | 103 | '%skipped%' => $summary['skipped'], |
104 | ]); | 104 | ]); |
105 | |||
106 | if (0 < $summary['queued']) { | ||
107 | $message = $this->get('translator')->trans('flashes.import.notice.summary_with_queue', [ | ||
108 | '%queued%' => $summary['queued'], | ||
109 | ]); | ||
110 | } | ||
105 | } | 111 | } |
106 | 112 | ||
107 | $this->get('session')->getFlashBag()->add( | 113 | $this->get('session')->getFlashBag()->add( |
diff --git a/src/Wallabag/ImportBundle/Controller/ReadabilityController.php b/src/Wallabag/ImportBundle/Controller/ReadabilityController.php index 8775e8a3..d00e22c2 100644 --- a/src/Wallabag/ImportBundle/Controller/ReadabilityController.php +++ b/src/Wallabag/ImportBundle/Controller/ReadabilityController.php | |||
@@ -46,6 +46,12 @@ class ReadabilityController extends Controller | |||
46 | '%skipped%' => $summary['skipped'], | 46 | '%skipped%' => $summary['skipped'], |
47 | ]); | 47 | ]); |
48 | 48 | ||
49 | if (0 < $summary['queued']) { | ||
50 | $message = $this->get('translator')->trans('flashes.import.notice.summary_with_queue', [ | ||
51 | '%queued%' => $summary['queued'], | ||
52 | ]); | ||
53 | } | ||
54 | |||
49 | unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name); | 55 | unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name); |
50 | } | 56 | } |
51 | 57 | ||
diff --git a/src/Wallabag/ImportBundle/Controller/WallabagController.php b/src/Wallabag/ImportBundle/Controller/WallabagController.php index 3c2dd6d1..9c0cde80 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagController.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagController.php | |||
@@ -60,6 +60,12 @@ abstract class WallabagController extends Controller | |||
60 | '%skipped%' => $summary['skipped'], | 60 | '%skipped%' => $summary['skipped'], |
61 | ]); | 61 | ]); |
62 | 62 | ||
63 | if (0 < $summary['queued']) { | ||
64 | $message = $this->get('translator')->trans('flashes.import.notice.summary_with_queue', [ | ||
65 | '%queued%' => $summary['queued'], | ||
66 | ]); | ||
67 | } | ||
68 | |||
63 | unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name); | 69 | unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name); |
64 | } | 70 | } |
65 | 71 | ||
diff --git a/src/Wallabag/ImportBundle/Import/AbstractImport.php b/src/Wallabag/ImportBundle/Import/AbstractImport.php index 4cd8e846..2af0e69b 100644 --- a/src/Wallabag/ImportBundle/Import/AbstractImport.php +++ b/src/Wallabag/ImportBundle/Import/AbstractImport.php | |||
@@ -21,6 +21,7 @@ abstract class AbstractImport implements ImportInterface | |||
21 | protected $markAsRead; | 21 | protected $markAsRead; |
22 | protected $skippedEntries = 0; | 22 | protected $skippedEntries = 0; |
23 | protected $importedEntries = 0; | 23 | protected $importedEntries = 0; |
24 | protected $queuedEntries = 0; | ||
24 | 25 | ||
25 | public function __construct(EntityManager $em, ContentProxy $contentProxy) | 26 | public function __construct(EntityManager $em, ContentProxy $contentProxy) |
26 | { | 27 | { |
@@ -145,13 +146,25 @@ abstract class AbstractImport implements ImportInterface | |||
145 | $importedEntry = $this->setEntryAsRead($importedEntry); | 146 | $importedEntry = $this->setEntryAsRead($importedEntry); |
146 | } | 147 | } |
147 | 148 | ||
148 | ++$this->importedEntries; | 149 | ++$this->queuedEntries; |
149 | 150 | ||
150 | $this->producer->publish(json_encode($importedEntry)); | 151 | $this->producer->publish(json_encode($importedEntry)); |
151 | } | 152 | } |
152 | } | 153 | } |
153 | 154 | ||
154 | /** | 155 | /** |
156 | * {@inheritdoc} | ||
157 | */ | ||
158 | public function getSummary() | ||
159 | { | ||
160 | return [ | ||
161 | 'skipped' => $this->skippedEntries, | ||
162 | 'imported' => $this->importedEntries, | ||
163 | 'queued' => $this->queuedEntries, | ||
164 | ]; | ||
165 | } | ||
166 | |||
167 | /** | ||
155 | * Parse one entry. | 168 | * Parse one entry. |
156 | * | 169 | * |
157 | * @param array $importedEntry | 170 | * @param array $importedEntry |
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index fe39d33f..cc6faf1f 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php | |||
@@ -173,17 +173,6 @@ class PocketImport extends AbstractImport | |||
173 | } | 173 | } |
174 | 174 | ||
175 | /** | 175 | /** |
176 | * {@inheritdoc} | ||
177 | */ | ||
178 | public function getSummary() | ||
179 | { | ||
180 | return [ | ||
181 | 'skipped' => $this->skippedEntries, | ||
182 | 'imported' => $this->importedEntries, | ||
183 | ]; | ||
184 | } | ||
185 | |||
186 | /** | ||
187 | * Set the Guzzle client. | 176 | * Set the Guzzle client. |
188 | * | 177 | * |
189 | * @param Client $client | 178 | * @param Client $client |
diff --git a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php index 8f080d38..b852f8f0 100644 --- a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php +++ b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php | |||
@@ -47,17 +47,6 @@ class ReadabilityImport extends AbstractImport | |||
47 | /** | 47 | /** |
48 | * {@inheritdoc} | 48 | * {@inheritdoc} |
49 | */ | 49 | */ |
50 | public function getSummary() | ||
51 | { | ||
52 | return [ | ||
53 | 'skipped' => $this->skippedEntries, | ||
54 | 'imported' => $this->importedEntries, | ||
55 | ]; | ||
56 | } | ||
57 | |||
58 | /** | ||
59 | * {@inheritdoc} | ||
60 | */ | ||
61 | public function import() | 50 | public function import() |
62 | { | 51 | { |
63 | if (!$this->user) { | 52 | if (!$this->user) { |
diff --git a/src/Wallabag/ImportBundle/Import/WallabagImport.php b/src/Wallabag/ImportBundle/Import/WallabagImport.php index 8e50b135..969a6a04 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagImport.php +++ b/src/Wallabag/ImportBundle/Import/WallabagImport.php | |||
@@ -73,17 +73,6 @@ abstract class WallabagImport extends AbstractImport | |||
73 | } | 73 | } |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * {@inheritdoc} | ||
77 | */ | ||
78 | public function getSummary() | ||
79 | { | ||
80 | return [ | ||
81 | 'skipped' => $this->skippedEntries, | ||
82 | 'imported' => $this->importedEntries, | ||
83 | ]; | ||
84 | } | ||
85 | |||
86 | /** | ||
87 | * Set file path to the json file. | 76 | * Set file path to the json file. |
88 | * | 77 | * |
89 | * @param string $filepath | 78 | * @param string $filepath |