gs-odrs-provider: GNOME Software Reference Manual

## gs-odrs-provider gs-odrs-provider |

## Functions

GQuark | gs_odrs_provider_error_quark ()
GsOdrsProvider * | gs_odrs_provider_new ()
void | gs_odrs_provider_refresh_ratings_async ()
gboolean | gs_odrs_provider_refresh_ratings_finish ()
void | gs_odrs_provider_refine_async ()
gboolean | gs_odrs_provider_refine_finish ()
gboolean | gs_odrs_provider_submit_review ()
gboolean | gs_odrs_provider_report_review ()
gboolean | gs_odrs_provider_upvote_review ()
gboolean | gs_odrs_provider_downvote_review ()
gboolean | gs_odrs_provider_dismiss_review ()
gboolean | gs_odrs_provider_remove_review ()
gboolean | gs_odrs_provider_add_unvoted_reviews ()

## Types and Values

enum | GsOdrsProviderError
#define | GS_ODRS_PROVIDER_ERROR
enum | GsOdrsProviderRefineFlags
#define | GS_TYPE_ODRS_PROVIDER
| GsOdrsProvider

## Description

## Functions

### gs_odrs_provider_error_quark ()

    GQuark
    gs_odrs_provider_error_quark (void);

### gs_odrs_provider_new ()

    GsOdrsProvider *
    gs_odrs_provider_new (const gchar *review_server,
                          const gchar *user_hash,
                          const gchar *distro,
                          guint64 max_cache_age_secs,
                          guint n_results_max,
                          SoupSession *session);

Create a new GsOdrsProvider. This does no network activity.

#### Parameters

review_server | value for “review-server”. | [not nullable]
user_hash | value for “user-hash”. | [not nullable]
distro | value for “distro”. | [not nullable]
max_cache_age_secs | value for “max-cache-age-secs” |
n_results_max | value for “n-results-max” |
session | value for “session” |

#### Returns

a new GsOdrsProvider.

[transfer full]

Since: 41

### gs_odrs_provider_refresh_ratings_async ()

    void
    gs_odrs_provider_refresh_ratings_async
                                   (GsOdrsProvider *self,
                                    guint64 cache_age_secs,
                                    GsDownloadProgressCallback progress_callback,
                                    gpointer progress_user_data,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Refresh the cached ODRS ratings and re-load them asynchronously.

#### Parameters

self | a GsOdrsProvider |
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 to call when the asynchronous operation is complete |
user_data | data to pass to `callback` |

Since: 42

### gs_odrs_provider_refresh_ratings_finish ()

    gboolean
    gs_odrs_provider_refresh_ratings_finish
                                   (GsOdrsProvider *self,
                                    GAsyncResult *result,
                                    GError **error);

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

#### Parameters

self | a GsOdrsProvider |
result | result of the asynchronous operation |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 42

### gs_odrs_provider_refine_async ()

    void
    gs_odrs_provider_refine_async (GsOdrsProvider *self,
                                   GsAppList *list,
                                   GsOdrsProviderRefineFlags flags,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Asynchronously refine the given `list` of apps to add ratings and review data to them, as specified in `flags` .

#### Parameters

self | a GsOdrsProvider |
list | list of apps to refine |
flags | refine flags |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | callback for asynchronous completion |
user_data | data to pass to `callback` |

Since: 42

### gs_odrs_provider_refine_finish ()

    gboolean
    gs_odrs_provider_refine_finish (GsOdrsProvider *self,
                                    GAsyncResult *result,
                                    GError **error);

Finish an asynchronous refine operation started with `gs_odrs_provider_refine_finish()`.

#### Parameters

self | a GsOdrsProvider |
result | result of the asynchronous operation |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 42

### gs_odrs_provider_submit_review ()

    gboolean
    gs_odrs_provider_submit_review (GsOdrsProvider *self,
                                    GsApp *app,
                                    AsReview *review,
                                    GCancellable *cancellable,
                                    GError **error);

Submit a new `review` for `app` .

#### Parameters

self | a GsOdrsProvider |
app | the app being reviewed |
review | the review |
cancellable | a GCancellable, or `NULL`. | [nullable]
error | return location for a GError |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 41

### gs_odrs_provider_report_review ()

    gboolean
    gs_odrs_provider_report_review (GsOdrsProvider *self,
                                    GsApp *app,
                                    AsReview *review,
                                    GCancellable *cancellable,
                                    GError **error);

Report the given `review` on `app` for being incorrect or breaking the code of conduct.

#### Parameters

self | a GsOdrsProvider |
app | the app whose review is being reported |
review | the review to report |
cancellable | a GCancellable, or `NULL`. | [nullable]
error | return location for a GError |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 41

### gs_odrs_provider_upvote_review ()

    gboolean
    gs_odrs_provider_upvote_review (GsOdrsProvider *self,
                                    GsApp *app,
                                    AsReview *review,
                                    GCancellable *cancellable,
                                    GError **error);

Add one vote to `review` on `app` .

#### Parameters

self | a GsOdrsProvider |
app | the app whose review is being upvoted |
review | the review to upvote |
cancellable | a GCancellable, or `NULL`. | [nullable]
error | return location for a GError |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 41

### gs_odrs_provider_downvote_review ()

    gboolean
    gs_odrs_provider_downvote_review (GsOdrsProvider *self,
                                      GsApp *app,
                                      AsReview *review,
                                      GCancellable *cancellable,
                                      GError **error);

Remove one vote from `review` on `app` .

#### Parameters

self | a GsOdrsProvider |
app | the app whose review is being downvoted |
review | the review to downvote |
cancellable | a GCancellable, or `NULL`. | [nullable]
error | return location for a GError |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 41

### gs_odrs_provider_dismiss_review ()

    gboolean
    gs_odrs_provider_dismiss_review (GsOdrsProvider *self,
                                     GsApp *app,
                                     AsReview *review,
                                     GCancellable *cancellable,
                                     GError **error);

Dismiss (ignore) `review` on `app` when moderating.

#### Parameters

self | a GsOdrsProvider |
app | the app whose review is being dismissed |
review | the review to dismiss |
cancellable | a GCancellable, or `NULL`. | [nullable]
error | return location for a GError |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 41

### gs_odrs_provider_remove_review ()

    gboolean
    gs_odrs_provider_remove_review (GsOdrsProvider *self,
                                    GsApp *app,
                                    AsReview *review,
                                    GCancellable *cancellable,
                                    GError **error);

Remove a `review` written by the user, from `app` .

#### Parameters

self | a GsOdrsProvider |
app | the app whose review is being removed |
review | the review to remove |
cancellable | a GCancellable, or `NULL`. | [nullable]
error | return location for a GError |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 41

### gs_odrs_provider_add_unvoted_reviews ()

    gboolean
    gs_odrs_provider_add_unvoted_reviews (GsOdrsProvider *self,
                                          GsAppList *list,
                                          GCancellable *cancellable,
                                          GError **error);

Add the unmoderated reviews for each app in `list` to the apps.

#### Parameters

self | a GsOdrsProvider |
list | list of apps to add unvoted reviews to |
cancellable | a GCancellable, or `NULL`. | [nullable]
error | return location for a GError |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 41

## Types and Values

### enum GsOdrsProviderError

Error codes for GsOdrsProvider.

#### Members

GS_ODRS_PROVIDER_ERROR_DOWNLOADING | Error while downloading ODRS data. |
GS_ODRS_PROVIDER_ERROR_PARSING_DATA | Problem parsing downloaded ODRS data. |
GS_ODRS_PROVIDER_ERROR_NO_NETWORK | Offline or network unavailable. |
GS_ODRS_PROVIDER_ERROR_SERVER_ERROR | Server rejected ODRS submission or returned an error. |

Since: 42

### GS_ODRS_PROVIDER_ERROR

    #define GS_ODRS_PROVIDER_ERROR gs_odrs_provider_error_quark ()

### enum GsOdrsProviderRefineFlags

The flags for refining apps to get their reviews or ratings.

#### Members

GS_ODRS_PROVIDER_REFINE_FLAGS_GET_RATINGS | Get the numerical ratings for the app. |
GS_ODRS_PROVIDER_REFINE_FLAGS_GET_REVIEWS | Get the written reviews for the app. |

Since: 42

### GS_TYPE_ODRS_PROVIDER

    #define GS_TYPE_ODRS_PROVIDER (gs_odrs_provider_get_type ())

### GsOdrsProvider

    typedef struct _GsOdrsProvider GsOdrsProvider;