## gs-external-appstream-utils

gs-external-appstream-utils

## Functions

GQuark | gs_external_appstream_error_quark ()
const gchar * | gs_external_appstream_utils_get_system_dir ()
gchar * | gs_external_appstream_utils_get_file_cache_path ()
gchar * | gs_external_appstream_utils_get_legacy_file_cache_path ()
void | gs_external_appstream_refresh_async ()
gboolean | gs_external_appstream_refresh_finish ()

## Types and Values

#define | EXTERNAL_APPSTREAM_PREFIX
enum | GsExternalAppstreamError
#define | GS_EXTERNAL_APPSTREAM_ERROR

## Description

## Functions

### gs_external_appstream_error_quark ()

    GQuark
    gs_external_appstream_error_quark (void);

### gs_external_appstream_utils_get_system_dir ()

    const gchar *
    gs_external_appstream_utils_get_system_dir
                                   (void);

### gs_external_appstream_utils_get_file_cache_path ()

    gchar *
    gs_external_appstream_utils_get_file_cache_path
                                   (const gchar *file_name);

### gs_external_appstream_utils_get_legacy_file_cache_path ()

    gchar *
    gs_external_appstream_utils_get_legacy_file_cache_path
                                   (const gchar *file_name);

### gs_external_appstream_refresh_async ()

    void
    gs_external_appstream_refresh_async (const gchar *cache_kind,
                                         GStrv appstream_urls,
                                         guint64 cache_age_secs,
                                         GsDownloadProgressCallback progress_callback,
                                         gpointer progress_user_data,
                                         GCancellable *cancellable,
                                         GAsyncReadyCallback callback,
                                         gpointer user_data);

Refresh any external appstream files, if the cache is too old.

If `cache_kind` is set, the files will be cached into a per-user cache directory, and into a global cache othwerwise. The global directory will be system-wide or user-specific according to the `external-appstream-system-wide` setting.

If a plugin requests a file to be saved in the cache it is the plugins responsibility to remove the file when it is no longer valid or is too old -- gnome-software will not ever clean the cache for the plugin. For this reason it is a good idea to use the plugin name as `cache_kind` .

#### Parameters

cache_kind | a cache kind, e.g. "fwupd" or "screenshots/123x456", or `NULL`. | [nullable]
appstream_urls | a `NULL`-terminated array of URLs |
cache_age_secs | cache age, in seconds, as passed to `GsPluginClass.refresh_metadata_async()` |
progress_callback | callback to call with progress information. | [nullable]
progress_user_data | data to pass to `progress_callback` . | [nullable][closure progress_callback]
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function call when the asynchronous operation is complete |
user_data | data to pass to `callback` |

Since: 48

### gs_external_appstream_refresh_finish ()

    gboolean
    gs_external_appstream_refresh_finish (GAsyncResult *result,
                                          gchar ***out_appstream_paths,
                                          GError **error);

Finish an asynchronous refresh operation started with `gs_external_appstream_refresh_async()`.

#### Parameters

result | a GAsyncResult |
out_appstream_paths | return location for the `NULL`-terminated array of downloaded appstream file paths, or `NULL` to ignore. | [out][transfer full][optional][nullable]
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 48

## Types and Values

### EXTERNAL_APPSTREAM_PREFIX

    #define EXTERNAL_APPSTREAM_PREFIX "org.gnome.Software"

### enum GsExternalAppstreamError

Error codes for external appstream operations.

#### Members

GS_EXTERNAL_APPSTREAM_ERROR_DOWNLOADING | Error while downloading external appstream data. |
GS_EXTERNAL_APPSTREAM_ERROR_NO_NETWORK | Offline or network unavailable. |
GS_EXTERNAL_APPSTREAM_ERROR_INSTALLING_ON_SYSTEM | Error while installing an external AppStream file system-wide. |

Since: 42

### GS_EXTERNAL_APPSTREAM_ERROR

    #define GS_EXTERNAL_APPSTREAM_ERROR gs_external_appstream_error_quark ()