+ /**
+ * Shows untagged articles for current user.
+ *
+ * @param Request $request
+ * @param int $page
+ *
+ * @Route("/untagged/list/{page}", name="untagged", defaults={"page" = "1"})
+ *
+ * @return \Symfony\Component\HttpFoundation\Response
+ */
+ public function showUntaggedEntriesAction(Request $request, $page)
+ {
+ return $this->showEntries('untagged', $request, $page);
+ }
+
+ /**
+ * Shows random entry depending on the given type.
+ *
+ * @param string $type
+ *
+ * @Route("/{type}/random", name="random_entry", requirements={"_locale": "unread|starred|archive|untagged|all"})
+ *
+ * @return \Symfony\Component\HttpFoundation\RedirectResponse
+ */
+ public function redirectRandomEntryAction($type = 'all')
+ {
+ try {
+ $entry = $this->get('wallabag_core.entry_repository')
+ ->getRandomEntry($this->getUser()->getId(), $type);
+ } catch (NoResultException $e) {
+ $bag = $this->get('session')->getFlashBag();
+ $bag->clear();
+ $bag->add('notice', 'flashes.entry.notice.no_random_entry');
+
+ return $this->redirect($this->generateUrl($type));
+ }
+
+ return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
+ }
+