summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libappstream-builder/asb-self-test.c5
-rw-r--r--libappstream-builder/plugins/asb-plugin-appdata.c10
2 files changed, 15 insertions, 0 deletions
diff --git a/libappstream-builder/asb-self-test.c b/libappstream-builder/asb-self-test.c
index 99104d8..5eca682 100644
--- a/libappstream-builder/asb-self-test.c
+++ b/libappstream-builder/asb-self-test.c
@@ -515,6 +515,11 @@ asb_test_context_test_func (AsbTestContextMode mode)
"</kudos>\n"
"<project_license>GPL-2.0+</project_license>\n"
"<url type=\"homepage\">http://people.freedesktop.org/~hughsient/appdata/</url>\n"
+ "<screenshots>\n"
+ "<screenshot type=\"default\">\n"
+ "<image type=\"source\">http://people.freedesktop.org/~hughsient/appdata/long-description.png</image>\n"
+ "</screenshot>\n"
+ "</screenshots>\n"
"<releases>\n"
"<release version=\"1\" timestamp=\"1407844800\"/>\n"
"</releases>\n"
diff --git a/libappstream-builder/plugins/asb-plugin-appdata.c b/libappstream-builder/plugins/asb-plugin-appdata.c
index 5cf9475..56d296f 100644
--- a/libappstream-builder/plugins/asb-plugin-appdata.c
+++ b/libappstream-builder/plugins/asb-plugin-appdata.c
@@ -426,6 +426,16 @@ asb_plugin_process_filename (AsbPlugin *plugin,
if (image == NULL)
continue;
+ /* if no network just use the upstream location */
+ if (asb_context_get_flag (plugin->ctx,
+ ASB_CONTEXT_FLAG_NO_NETWORK)) {
+ asb_package_log (asb_app_get_package (app),
+ ASB_PACKAGE_LOG_LEVEL_DEBUG,
+ "Using upstream screenshot");
+ as_app_add_screenshot (AS_APP (app), ass);
+ continue;
+ }
+
/* load the URI or get from a cache */
tmp = as_image_get_url (image);
ret = asb_plugin_appdata_load_url (plugin,