1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-22 17:18:37 +00:00

Ability to reload an entry

Could be useful when we want to update the content or when the content failed to be fetched.

Fix #1503
This commit is contained in:
Jeremy Benoist 2015-12-30 09:41:17 +01:00
parent e6a228c43b
commit 831b02aaf2
4 changed files with 68 additions and 0 deletions

View file

@ -266,6 +266,33 @@ class EntryController extends Controller
);
}
/**
* Reload an entry.
* Refetch content from the website and make it readable again.
*
* @param Entry $entry
*
* @Route("/reload/{id}", requirements={"id" = "\d+"}, name="reload_entry")
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/
public function reloadAction(Entry $entry)
{
$this->checkUserAction($entry);
$message = 'Entry reloaded';
if (false === $this->updateEntry($entry)) {
$message = 'Failed to reload entry';
}
$this->get('session')->getFlashBag()->add(
'notice',
$message
);
return $this->redirect($this->generateUrl('view', array('id' => $entry->getId())));
}
/**
* Changes read status for an entry.
*