[grilo-plugins/0.1.x] local-metadata: Parse filenames for videos too



commit 18f018ed33c9ca3caf7268895653a84d6c451729
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Apr 11 16:46:39 2012 +0100

    local-metadata: Parse filenames for videos too
    
    So we can fetch some extra metadata like Series name, or the likes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673916

 src/metadata/local-metadata/grl-local-metadata.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/metadata/local-metadata/grl-local-metadata.c b/src/metadata/local-metadata/grl-local-metadata.c
index 99d51ed..c3a2207 100644
--- a/src/metadata/local-metadata/grl-local-metadata.c
+++ b/src/metadata/local-metadata/grl-local-metadata.c
@@ -928,18 +928,21 @@ grl_local_metadata_source_resolve (GrlMetadataSource *source,
   resolution_flags_t flags;
   GrlLocalMetadataSourcePriv *priv =
     GRL_LOCAL_METADATA_SOURCE_GET_PRIVATE (source);
+  gboolean can_access;
 
   GRL_DEBUG ("grl_local_metadata_source_resolve");
 
+  /* Can we access the media through gvfs? */
+  can_access = has_compatible_media_url (rs->media);
+
   flags = get_resolution_flags (rs->keys);
 
    if (!flags)
      error = g_error_new (GRL_CORE_ERROR, GRL_CORE_ERROR_RESOLVE_FAILED,
                           "local-metadata cannot resolve any of the given keys");
-   else if (!(GRL_IS_MEDIA_AUDIO (rs->media)
-              || has_compatible_media_url (rs->media)))
+   if (GRL_IS_MEDIA_IMAGE (rs->media) && can_access == FALSE)
      error = g_error_new (GRL_CORE_ERROR, GRL_CORE_ERROR_RESOLVE_FAILED,
-                          "local-metadata needs a url in the file:// scheme for videos and images");
+                          "local-metadata needs a GIO supported URL for images");
 
   if (error) {
     /* No can do! */
@@ -953,7 +956,8 @@ grl_local_metadata_source_resolve (GrlMetadataSource *source,
   if (GRL_IS_MEDIA_VIDEO (rs->media)) {
     if (priv->guess_video)
       resolve_video (source, rs, flags);
-    resolve_image (source, rs, flags);
+    if (can_access)
+      resolve_image (source, rs, flags);
   } else if (GRL_IS_MEDIA_IMAGE (rs->media)) {
     resolve_image (source, rs, flags);
   } else if (GRL_IS_MEDIA_AUDIO (rs->media)) {



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