[totem/wip/hadess/filter-content-changes] grilo: Make sure to only add videos to the library view
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/wip/hadess/filter-content-changes] grilo: Make sure to only add videos to the library view
- Date: Fri, 21 Aug 2020 17:37:47 +0000 (UTC)
commit 0d19be07b85a8fc08a3c3e654cba4ef2739d8151
Author: Bastien Nocera <hadess hadess net>
Date: Fri Aug 21 19:36:12 2020 +0200
grilo: Make sure to only add videos to the library view
Don't handle changes related to non-video files in monitored grilo
sources.
src/totem-grilo.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index a3ab074ad..ee4befc4e 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -1169,11 +1169,15 @@ content_changed (TotemGrilo *self,
for (i = 0; i < changed_medias->len; i++) {
GrlMedia *media = changed_medias->pdata[i];
GtkTreeIter *iter;
- char *str;
+ g_autofree char *str;
str = grl_media_serialize (media);
- g_debug ("About to change %s in the store", str);
- g_free (str);
+ if (!grl_media_is_video (media)) {
+ g_debug ("Ignoring content changes for %s", str);
+ continue;
+ }
+
+ g_message ("About to change %s in the store", str);
if (find_media (model, media, &iter)) {
update_media (GTK_TREE_STORE (model), iter, source, media);
@@ -1198,11 +1202,10 @@ content_removed (TotemGrilo *self,
for (i = 0; i < changed_medias->len; i++) {
GrlMedia *media = changed_medias->pdata[i];
GtkTreeIter *iter;
- char *str;
+ g_autofree char *str;
str = grl_media_serialize (media);
g_debug ("About to remove %s from the store", str);
- g_free (str);
if (find_media (model, media, &iter)) {
gtk_tree_store_remove (GTK_TREE_STORE (model), iter);
@@ -1229,11 +1232,14 @@ content_added (TotemGrilo *self,
for (i = 0; i < changed_medias->len; i++) {
GrlMedia *media = changed_medias->pdata[i];
- char *str;
+ g_autofree char *str;
str = grl_media_serialize (media);
+ if (!grl_media_is_video (media)) {
+ g_debug ("Ignoring content added for %s", str);
+ continue;
+ }
g_debug ("About to add %s to the store", str);
- g_free (str);
add_local_metadata (self, source, media);
add_media_to_model (GTK_TREE_STORE (model), NULL, source, media);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]