xaccrocheur/nws — pull request #4 by flavien75 (2013-11-17 21:20:16+00:00)
Title: correction for image detection and better use of cache

I corrected a bug and added a feature:
- some feed does not proved media:thumbnail but media:content , so nws should use that tag. Example feed :
http://www.gizmodo.fr/feed
- it happens, sometime, the cache is more than one hour old, so it should be refreshed, but the website can't be reached (overcrowded ?). In that case it is better to fallback to the old version we have in cache instead of printing an error. This situation is indicated to the user by putting the feed title in italic and adding the age of cache file into the tooltip (I am not sure that is the best way to inform the user, so if you have any idea or advice...).

The second part is difficult to reproduce (it never happens when we need to...), the only way I found to force the rendering is:
1. load the page
2. inside nws-load-feed.php, change the line :
if ($xmlrss_age > $max_age) {
to
if (true) {
3. reload just one feed
4. that feed will show in error.

By the way, the cache's age is truncated (so one hour and 55 minutes is shown as 1 hour). I don't know how to show it clearly without over-precise (I don't care if it is 1 hour 55 minutes or 1 hour 55 minutes and 10 seconds). So I am looking for ideas for that part as well.