[grilo-plugins] local-metadata: fix regexp and tests



commit 37663268236c5552f6245103d52634124066e03b
Author: Victor Toso <me victortoso com>
Date:   Sun May 11 14:43:10 2014 -0300

    local-metadata: fix regexp and tests
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727181
    https://bugzilla.gnome.org/show_bug.cgi?id=725025

 src/local-metadata/grl-local-metadata.c    |    6 +++---
 tests/local-metadata/test_local_metadata.c |    9 +++------
 2 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/local-metadata/grl-local-metadata.c b/src/local-metadata/grl-local-metadata.c
index 704bb85..18837ba 100644
--- a/src/local-metadata/grl-local-metadata.c
+++ b/src/local-metadata/grl-local-metadata.c
@@ -47,12 +47,12 @@ GRL_LOG_DOMAIN_STATIC(local_metadata_log_domain);
 
 #define TV_REGEX                                \
   "(?<showname>.*)\\."                          \
-  "(?<season>(?:\\d{1,2})|(?:[sS]\\K\\d{1,2}))" \
-  "(?<episode>(?:\\d{2})|(?:[eEx]\\K\\d{1,2}))"  \
+  "(?<season>[sS]\\d{1,2}|\\d{1,2})"            \
+  "(?<episode>(?:[eExX]\\d{1,2}))"              \
   "\\.?(?<name>.*)?"
 #define MOVIE_REGEX                             \
   "(?<name>.*)"                                 \
-  "\\.?[\\(\\[](?<year>[12][90]\\d{2})[\\)\\]]"
+  "(?<year>19\\d{2}|20\\d{2})"
 
 /**/
 
diff --git a/tests/local-metadata/test_local_metadata.c b/tests/local-metadata/test_local_metadata.c
index b5670cc..90fee56 100644
--- a/tests/local-metadata/test_local_metadata.c
+++ b/tests/local-metadata/test_local_metadata.c
@@ -97,12 +97,9 @@ test_episodes (void)
     { NULL, "file:///home/test/My%20super%20series.S01E01.mp4", "My super series", 1, 1 },
     { "Adventure Time - 2x01 - It Came from the Nightosphere.mp4", NULL, "Adventure Time", 2, 1 },
 
-    /* FIXME: Incorrect checks below */
-
-    /* https://bugzilla.gnome.org/show_bug.cgi?id=725025 */
-    { "My.Neighbor.Totoro.1988.1080p.BluRay.X264.mkv", NULL, "My Neighbor Totoro", 19, 88 },
-    /* https://bugzilla.gnome.org/show_bug.cgi?id=727181 */
-    { NULL, "file:///home/hadess/.cache/totem/media/140127Mata-16x9%20(bug%20723166).mp4", "140127Mata-16x9 
(bug", 72, 31 }
+    /* These below should not be detected as an episode of a series. */
+    { "My.Neighbor.Totoro.1988.1080p.BluRay.X264.mkv", NULL, NULL, 0, 0 },
+    { NULL, "file:///home/hadess/.cache/totem/media/140127Mata-16x9%20(bug%20723166).mp4", NULL, 0, 0 }
   };
 
 


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