Symptom: screenshot URLs look like this (note double https://) (sreenshot from debugger session)
As we can see in src/as-image.c#L342 base url is appended unconditinally, resulting in screenshot image that cannot be downloaded and degraded user experience in software center application (plasma-discover in our case).
test: Pool default flags: "FlagLoadOsCollection | FlagLoadOsMetainfo | FlagLoadFlatpak"
test: Pool new flags: "FlagLoadOsCollection"
test: Adding extra metadata path: "/home/lexx/dev/test/build-test_appstream-System_Qt-Debug/metadata"
test: Loaded total 1 components
test: Found ktorrent 1 times
test: "org.kde.ktorrent.desktop"
test: "KindSource" ; url: "https://appstream.alpinelinux.org/media/edge/https://cdn.kde.org/screenshots/ktorrent/ktorrent.png"
test: "KindSource" ; url: "https://appstream.alpinelinux.org/media/edge/org/kde/ktorrent.desktop/2250ef363428df697ba6e87d1d66e821/screenshots/image-1_orig.png"
test: "KindThumbnail" ; url: "https://appstream.alpinelinux.org/media/edge/org/kde/ktorrent.desktop/2250ef363428df697ba6e87d1d66e821/screenshots/image-1_752x531.png"
test: "KindThumbnail" ; url: "https://appstream.alpinelinux.org/media/edge/org/kde/ktorrent.desktop/2250ef363428df697ba6e87d1d66e821/screenshots/image-1_624x440.png"
test: "KindThumbnail" ; url: "https://appstream.alpinelinux.org/media/edge/org/kde/ktorrent.desktop/2250ef363428df697ba6e87d1d66e821/screenshots/image-1_224x158.png"
As you can see also from test example, first screenshot URL has extra https:// added.
Suggested fix is by checking for absolute URL with g_str_has_prefix (or whatever the correct way in glib is, I'm Qt user, don't know much about glib). In case if screenshot URL is already starting with https://, do not append media_baseurl.
Symptom: screenshot URLs look like this (note double

https://) (sreenshot from debugger session)As we can see in src/as-image.c#L342 base url is appended unconditinally, resulting in screenshot image that cannot be downloaded and degraded user experience in software center application (plasma-discover in our case).
Metadata XML fragment for this looks like:
The issue can be reproduced by small example program that loads single metadata file:
taken from real data
As you can see also from test example, first screenshot URL has extra
https://added.Suggested fix is by checking for absolute URL with g_str_has_prefix (or whatever the correct way in glib is, I'm Qt user, don't know much about glib). In case if screenshot URL is already starting with
https://, do not append media_baseurl.P.S. downstream issue for reference: https://gitlab.alpinelinux.org/alpine/infra/compose/appstream-generator/-/issues/2
The text was updated successfully, but these errors were encountered: