mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-08 13:56:40 +02:00
Downstream issue: https://gitlab.alpinelinux.org/alpine/infra/compose/appstream-generator/-/issues/2 Upstream discussion: https://github.com/ximion/appstream/issues/395
72 lines
2.5 KiB
Diff
72 lines
2.5 KiB
Diff
diff --git c/compose/asc-utils-screenshots.c w/compose/asc-utils-screenshots.c
|
|
index f42579eb..4e8beec8 100644
|
|
--- c/compose/asc-utils-screenshots.c
|
|
+++ w/compose/asc-utils-screenshots.c
|
|
@@ -410,7 +410,7 @@ asc_process_screenshot_images (AscResult *cres,
|
|
gboolean thumbnails_generated = FALSE;
|
|
g_autoptr(GError) error = NULL;
|
|
|
|
- imgs = as_screenshot_get_images (scr);
|
|
+ imgs = as_screenshot_get_images_all (scr);
|
|
if (imgs->len == 0) {
|
|
asc_result_add_hint_simple (cres, cpt, "metainfo-screenshot-but-no-media");
|
|
return NULL;
|
|
@@ -434,7 +434,7 @@ asc_process_screenshot_images (AscResult *cres,
|
|
orig_img = g_object_ref (AS_IMAGE (g_ptr_array_index (imgs, 0)));
|
|
|
|
/* drop metainfo images */
|
|
- g_ptr_array_remove_range (imgs, 0, imgs->len);
|
|
+ as_screenshot_clear_images (scr);
|
|
|
|
orig_img_url = as_image_get_url (orig_img);
|
|
orig_img_locale = as_image_get_locale (orig_img);
|
|
@@ -621,7 +621,7 @@ asc_process_screenshot_images (AscResult *cres,
|
|
continue;
|
|
}
|
|
|
|
- // finally prepare the thumbnail definition and add it to the metadata
|
|
+ /* finally prepare the thumbnail definition and add it to the metadata */
|
|
img = as_image_new ();
|
|
as_image_set_locale (img, orig_img_locale);
|
|
as_image_set_kind (img, AS_IMAGE_KIND_THUMBNAIL);
|
|
diff --git c/src/as-screenshot.c w/src/as-screenshot.c
|
|
index c2e722a7..dfad8910 100644
|
|
--- c/src/as-screenshot.c
|
|
+++ w/src/as-screenshot.c
|
|
@@ -264,6 +264,23 @@ as_screenshot_add_image (AsScreenshot *screenshot, AsImage *image)
|
|
g_ptr_array_add (priv->images_lang, g_object_ref (image));
|
|
}
|
|
|
|
+/**
|
|
+ * as_screenshot_clear_images:
|
|
+ * @screenshot: a #AsScreenshot instance.
|
|
+ *
|
|
+ * Remove all images associated with this screenshot.
|
|
+ *
|
|
+ * Since: 0.15.4
|
|
+ **/
|
|
+void
|
|
+as_screenshot_clear_images (AsScreenshot *screenshot)
|
|
+{
|
|
+ AsScreenshotPrivate *priv = GET_PRIVATE (screenshot);
|
|
+
|
|
+ g_ptr_array_remove_range (priv->images, 0, priv->images->len);
|
|
+ g_ptr_array_remove_range (priv->images_lang, 0, priv->images_lang->len);
|
|
+}
|
|
+
|
|
/**
|
|
* as_screenshot_get_videos:
|
|
* @screenshot: a #AsScreenshot instance.
|
|
diff --git c/src/as-screenshot.h w/src/as-screenshot.h
|
|
index 6901f39e..6fa886bb 100644
|
|
--- c/src/as-screenshot.h
|
|
+++ w/src/as-screenshot.h
|
|
@@ -104,6 +104,7 @@ AsImage *as_screenshot_get_image (AsScreenshot *screenshot,
|
|
guint height);
|
|
void as_screenshot_add_image (AsScreenshot *screenshot,
|
|
AsImage *image);
|
|
+void as_screenshot_clear_images (AsScreenshot *screenshot);
|
|
|
|
GPtrArray *as_screenshot_get_videos (AsScreenshot *screenshot);
|
|
void as_screenshot_add_video (AsScreenshot *screenshot,
|