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 725456 - grilo sometimes calls plugins with %20 instead of spaces
grilo sometimes calls plugins with %20 instead of spaces
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: core
git master
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2014-03-01 18:00 UTC by Elad Alfassa
Modified: 2014-03-27 18:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Add test for episode resolution with URLs (2.45 KB, patch)
2014-03-27 17:08 UTC, Bastien Nocera
committed Details | Review
local-metadata: Fix %20 in deduced titles (3.54 KB, patch)
2014-03-27 17:08 UTC, Bastien Nocera
committed Details | Review

Description Elad Alfassa 2014-03-01 18:00:00 UTC
grilo sometimes calls plugins with %20 instead of spaces. This confuses the regexes in the local-metadata plugin, for examle.

A workaround for this is to call g_uri_unescape_string() on the path in the plugin, but that's not a proper solution in my opinion.
Comment 1 Juan A. Suarez Romero 2014-03-02 23:28:13 UTC
I'm a bit lost. What it means "grilo sometimes calls plugins"? Do you mean it calls the search with %20 instead of spaces in the search term? Which plugins exactly?
Comment 2 Elad Alfassa 2014-03-03 16:36:59 UTC
It happened in local-metadata. I added debug prints to see why my regex was only working sometime with no apparent outside reason, and discovered that grl_local_metadata_source_resolve() was called with %20 instead of spaces. For the same files, it sometimes happen and sometimes doesn't - very inconsistent.

I assume this might happen in other plugins too, but I really don't know.
Comment 3 Bastien Nocera 2014-03-27 16:49:04 UTC
video_guess_values_from_uri() is sometimes being passed a TITLE (if one is available) or a URL. If a URL is passed (because there's no title available), we need to get the basename, and then unescape it before passing it to video_guess_values_from_uri().
Comment 4 Bastien Nocera 2014-03-27 17:08:45 UTC
Created attachment 273100 [details] [review]
tests: Add test for episode resolution with URLs

When passing a GrlMedia without a title, make sure to get the basename
of the URL, and unescape it before trying to manipulate it.

file:///home/test/My%20super%20series.S01E01.mp4
should give:
My super series
as the show name, not:
My%20super%20series
Comment 5 Bastien Nocera 2014-03-27 17:08:50 UTC
Created attachment 273101 [details] [review]
local-metadata: Fix %20 in deduced titles

When passing a GrlMedia without a title, make sure to get the basename
of the URL, and unescape it before trying to manipulate it.
Comment 6 Juan A. Suarez Romero 2014-03-27 18:45:45 UTC
Attachment 273100 [details] pushed as 68e45ff - tests: Add test for episode resolution with URLs
Attachment 273101 [details] pushed as a7f7d03 - local-metadata: Fix %20 in deduced titles