[totem] properties: Fix Year tag not showing in some cases



commit fac67d1876b962c7110e21f94063d4608a01dd91
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Aug 22 17:34:32 2013 +0200

    properties: Fix Year tag not showing in some cases
    
    The DATE tag might not contain the year, but the DATE_TIME tag
    might, so try and use that if the first one fails.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706397

 src/totem-properties-view.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/totem-properties-view.c b/src/totem-properties-view.c
index 5a24dcd..4ddf3e1 100644
--- a/src/totem-properties-view.c
+++ b/src/totem-properties-view.c
@@ -77,6 +77,7 @@ update_general (TotemPropertiesView *props,
        };
        guint i;
         GDate *date;
+       GstDateTime *datetime;
        gchar *comment;
 
        for (i = 0; i < G_N_ELEMENTS(items); i++) {
@@ -111,7 +112,16 @@ update_general (TotemPropertiesView *props,
                                                         "year",
                                                         string);
                g_free (string);
-        }
+        } else if (gst_tag_list_get_date_time (list, GST_TAG_DATE_TIME, &datetime)) {
+               char *string;
+
+               string = g_strdup_printf ("%d", gst_date_time_get_year (datetime));
+               gst_date_time_unref (datetime);
+               bacon_video_widget_properties_set_label (props->priv->props,
+                                                        "year",
+                                                        string);
+               g_free (string);
+       }
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]