Commit 6158eb5a authored by Bastien Nocera's avatar Bastien Nocera

bookmarks: Fix duplicate GRL_CONTENT_ADDED notifications

The bookmarks source only ever knew how to send GRL_CONTENT_ADDED
notifications, even when modifying a new resource to the database.
Track whether the resource is new to send the correct notification.

This was causing saved streams in Videos to appear duplicated.
parent 552f3cf5
Pipeline #57050 passed with stage
in 3 minutes and 23 seconds
......@@ -686,6 +686,7 @@ store_bookmark (GrlBookmarksSource *bookmarks_source,
gchar *str_id;
GError *local_error = NULL;
gboolean ret;
gboolean is_new_bookmark = FALSE;
GRL_DEBUG ("store_bookmark");
......@@ -722,6 +723,7 @@ store_bookmark (GrlBookmarksSource *bookmarks_source,
"parent", parent_id,
"type", type,
NULL);
is_new_bookmark = TRUE;
}
if (type == BOOKMARK_TYPE_STREAM) {
......@@ -780,7 +782,7 @@ store_bookmark (GrlBookmarksSource *bookmarks_source,
if (bookmarks_source->priv->notify_changes) {
grl_source_notify_change (GRL_SOURCE (bookmarks_source),
bookmark,
GRL_CONTENT_ADDED,
is_new_bookmark ? GRL_CONTENT_ADDED : GRL_CONTENT_CHANGED,
FALSE);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment