cluster_search_ui/commit
Added catches to image checking on server, in case of working offline..
author | Chris Dijkshoorn |
---|---|
Sat Jan 17 20:36:22 2015 +0100 | |
committer | Chris Dijkshoorn |
Sat Jan 17 20:36:22 2015 +0100 | |
commit | 0a63d0767dd810d1ffbf9502546fa19ae96697cc |
tree | ad8d3c9f049b69b1f7e972e8c0ccc9ead76491c0 |
parent | 3196392c0fc654a25e4b4aa82625918b94f21806 |
Diff style: patch stat
diff --git a/lib/cluster_search_ui/enrichment.pl b/lib/cluster_search_ui/enrichment.pl index 4710e7e..e3547b4 100644 --- a/lib/cluster_search_ui/enrichment.pl +++ b/lib/cluster_search_ui/enrichment.pl @@ -95,13 +95,13 @@ thumbnail_url(Uri, ThumbUrl) :- check_cache_shown(Uri, Image), !, thumb_link(Image, ThumbUrl). thumbnail_url(Uri, ThumbUrl) :- - check_server_shown(Uri, Image), !, + catch(check_server_shown(Uri, Image), _, fail), !, thumb_link(Image, ThumbUrl). thumbnail_url(Uri, ThumbUrl) :- check_cache_view(Uri, Image), !, thumb_link(Image, ThumbUrl). thumbnail_url(Uri, ThumbUrl) :- - check_server_view(Uri, Image), !, + catch(check_server_view(Uri, Image), _, fail), !, thumb_link(Image, ThumbUrl). thumbnail_url(_, Stub) :- http_absolute_location(img('stub.png'), Stub, []). @@ -157,10 +157,13 @@ ssl_verify(_SSL, %% get_title(+Uri, -Title) % -% Returns a title or the URI if no title is found. +% Returns a title or the last part of the URI if no title is found. get_title(Uri, Title) :- rdf(Uri, dc:title, literal(lang(_,Title))), !. +get_title(Uri, UriLabel) :- + iri_xml_namespace(Uri, _, UriLabel), !. get_title(Uri, Uri). sandbox:safe_primitive(rdf_label:rdf_display_label(_,_,_)). sandbox:safe_primitive(enrichment:enrich_item(_,_)). +sandbox:safe_primitive(sgml:iri_xml_namespace(_,_,_)).