ximion / appstream

Tools and libraries to work with AppStream metadata
http://www.freedesktop.org/wiki/Distributions/AppStream/
GNU Lesser General Public License v2.1
210 stars 115 forks source link

as_release_get_date always returns NULL #621

Closed sophie-h closed 6 months ago

sophie-h commented 6 months ago

Maybe I understand something wrong, but as_release_get_timestamp gives me a date and as_release_get_date doesn't. Sounds like that shouldn't be the case? Or did I get something wrong in my rust bindings?

ximion commented 6 months ago

How do you mean? as_release_get_timestamp should always give you the release date as UNIX timestamp, while as_release_get_date will give you the release date as a ISO8601 string, if one is available.

sophie-h commented 6 months ago

As I said, I couldn't get as_release_get_date to return anything but NULL

ximion commented 6 months ago

Was this for a MetaInfo file or for Catalog metadata? How does the metadata look like? If it has a timestamp, but no date, then this behavior is expected.

sophie-h commented 6 months ago

If it has a timestamp, but no date, then this behavior is expected.

Ah, okay. Yes, looks like Flathub converts everything to timestamp only. Wasn't clear from the docs to me that this is expected.

Thanks.

ximion commented 6 months ago

Initially there was just timestamp, so this is a backward-compatibility fix, and all catalog metadata must have it. It's also much faster to parse. The date however is optional (and will be converted to a timestamp and vice versa, but not when parsing catalog data to no sacrifice the speed we gained when parsing the data).