After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 732261 - local-metadata: new regexp match
local-metadata: new regexp match
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: plugins
git master
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2014-06-26 02:34 UTC by Victor Toso
Modified: 2014-06-30 13:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
local-metadata: new match (3.25 KB, patch)
2014-06-26 02:36 UTC, Victor Toso
needs-work Details | Review
local-metadata: new match (1.92 KB, patch)
2014-06-26 14:07 UTC, Victor Toso
accepted-commit_now Details | Review
local-metadata: fix spaces on metadata (1.29 KB, patch)
2014-06-26 14:20 UTC, Victor Toso
accepted-commit_now Details | Review
local-metadata: add test of new matching case (1.14 KB, patch)
2014-06-26 14:21 UTC, Victor Toso
needs-work Details | Review
local-metadata: new match (1.92 KB, patch)
2014-06-27 02:53 UTC, Victor Toso
committed Details | Review
local-metadata: fix spaces on metadata (1.29 KB, patch)
2014-06-27 02:54 UTC, Victor Toso
committed Details | Review
local-metadata: fix to case insensitive on black list of words (1023 bytes, patch)
2014-06-27 02:55 UTC, Victor Toso
needs-work Details | Review
local-metadata: add test of new matching case (3.97 KB, patch)
2014-06-27 02:58 UTC, Victor Toso
needs-work Details | Review
local-metadata: fix to case insensitive on blacklist of words (1023 bytes, patch)
2014-06-30 01:30 UTC, Victor Toso
committed Details | Review
local-metadata: check for updated title on tests (3.77 KB, patch)
2014-06-30 01:33 UTC, Victor Toso
committed Details | Review
local-metadata: add test of new matching case (1.39 KB, patch)
2014-06-30 01:35 UTC, Victor Toso
committed Details | Review

Description Victor Toso 2014-06-26 02:34:13 UTC
Case: Felicity 4.08 (Last Thanksgiving).avi

Match: season 4, episode 8 and title is everything inside ();.
Comment 1 Victor Toso 2014-06-26 02:36:35 UTC
Created attachment 279280 [details] [review]
local-metadata: new match
Comment 2 Victor Toso 2014-06-26 02:37:25 UTC
I forgot to mention that the patch includes the test case.
Comment 3 Bastien Nocera 2014-06-26 09:30:00 UTC
Review of attachment 279280 [details] [review]:

::: src/local-metadata/grl-local-metadata.c
@@ +311,3 @@
       /* Replace "." with <space> */
       g_strdelimit (*title, ".", ' ');
+      *title = g_strstrip (*title);

That doesn't look related, do this in a separate patch.

@@ +350,3 @@
       *title = g_match_info_fetch_named (info, "name");
+      g_strdelimit (*title, ".()", ' ');
+      *title = g_strstrip (*title);

Ditto.

@@ +356,3 @@
       *showname = g_match_info_fetch_named (info, "showname");
       g_strdelimit (*showname, ".", ' ');
+      *showname = g_strstrip (*showname);

Ditto.

::: tests/local-metadata/test_local_metadata.c
@@ +97,3 @@
     { 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 },
+    { NULL, "file:///home/toso/Downloads/Felicity/Felicity%202.05%20(Crash).avi", "Felicity", 2, 5 },

Can you please add a test case for the new matches, separately?
Comment 4 Victor Toso 2014-06-26 14:07:56 UTC
Created attachment 279316 [details] [review]
local-metadata: new match
Comment 5 Victor Toso 2014-06-26 14:20:53 UTC
Created attachment 279317 [details] [review]
local-metadata: fix spaces on metadata
Comment 6 Victor Toso 2014-06-26 14:21:18 UTC
Created attachment 279318 [details] [review]
local-metadata: add test of new matching case
Comment 7 Bastien Nocera 2014-06-26 14:40:59 UTC
Review of attachment 279316 [details] [review]:

Looks fine.
Comment 8 Bastien Nocera 2014-06-26 14:41:36 UTC
Review of attachment 279317 [details] [review]:

Looks good
Comment 9 Bastien Nocera 2014-06-26 14:42:41 UTC
Review of attachment 279318 [details] [review]:

::: tests/local-metadata/test_local_metadata.c
@@ +97,3 @@
     { 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 },
+    { NULL, "file:///home/toso/Downloads/Felicity/Felicity%202.05%20(Crash).avi", "Felicity", 2, 5 },

Can you please add separate test cases for the "." separated season/episode numbers and for the parenthesis-wrapped episode title?
Comment 10 Victor Toso 2014-06-27 02:53:02 UTC
Thanks for the review!

I've included in the tests a check on the new-title of the media, after resolving.

With this new test, I could verify a problem due case sensitive comparasion on strstr when the source is removing black-listed words such as DVDRip.

I've included a fix for that too using strcasestr but that requires the #define _GNU_SOURCE and I'm not sure if that is fine.
Comment 11 Victor Toso 2014-06-27 02:53:47 UTC
Created attachment 279354 [details] [review]
local-metadata: new match
Comment 12 Victor Toso 2014-06-27 02:54:19 UTC
Created attachment 279355 [details] [review]
local-metadata: fix spaces on metadata
Comment 13 Victor Toso 2014-06-27 02:55:16 UTC
Created attachment 279356 [details] [review]
local-metadata: fix to case insensitive on black list of words
Comment 14 Victor Toso 2014-06-27 02:58:14 UTC
Created attachment 279357 [details] [review]
local-metadata: add test of new matching case

New the test case using a dot to separate season to episode and the episode name between parentheses.
Comment 15 Bastien Nocera 2014-06-27 08:13:48 UTC
Review of attachment 279354 [details] [review]:

++
Comment 16 Bastien Nocera 2014-06-27 08:14:08 UTC
Review of attachment 279355 [details] [review]:

++
Comment 17 Bastien Nocera 2014-06-27 08:14:48 UTC
Review of attachment 279356 [details] [review]:

blacklist is one word. Please also add a test case for this.
Comment 18 Bastien Nocera 2014-06-27 08:18:45 UTC
Review of attachment 279357 [details] [review]:

The code doesn't seem to match the commit message.

The code seems to be about testing for the updated title.
Comment 19 Victor Toso 2014-06-30 01:24:59 UTC
(In reply to comment #17)
> Review of attachment 279356 [details] [review]:
> 
> blacklist is one word. Please also add a test case for this.

Thanks. I've mistaken in bugzilla.

As test case, we already have the: "metalocalypse.s02e01.dvdrip.xvid-ffndvd.avi". It found 'dvdrip' as new title before the patch (should be NULL).
Comment 20 Victor Toso 2014-06-30 01:28:16 UTC
Review of attachment 279354 [details] [review]:

up
Comment 21 Victor Toso 2014-06-30 01:28:30 UTC
Review of attachment 279355 [details] [review]:

up
Comment 22 Victor Toso 2014-06-30 01:30:20 UTC
Created attachment 279569 [details] [review]
local-metadata: fix to case insensitive on blacklist of words

same as before, changing only bugzilla description
Comment 23 Victor Toso 2014-06-30 01:33:30 UTC
Created attachment 279570 [details] [review]
local-metadata: check for updated title on tests

Split last patch in two. This patch include a check in the new-title after resolving data with local-metadata source
Comment 24 Victor Toso 2014-06-30 01:35:38 UTC
Created attachment 279571 [details] [review]
local-metadata: add test of new matching case

I've included a comment in the code to specify the test.
Comment 25 Bastien Nocera 2014-06-30 09:27:59 UTC
Review of attachment 279569 [details] [review]:

Looks good.
Comment 26 Bastien Nocera 2014-06-30 09:28:34 UTC
Review of attachment 279570 [details] [review]:

Looks good.
Comment 27 Bastien Nocera 2014-06-30 09:29:06 UTC
Review of attachment 279571 [details] [review]:

Fine.
Comment 28 Bastien Nocera 2014-06-30 09:40:44 UTC
By the way, use "git bz push" to push your patches, it'll be faster than changing the status of patches one-by-one.
Comment 29 Victor Toso 2014-06-30 13:04:28 UTC
Attachment 279570 [details] pushed as a7483e2 - local-metadata: check for updated title on tests