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 754275 - Fix metrolyrics source and test
Fix metrolyrics source and test
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: plugins
unspecified
Other All
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2015-08-29 09:45 UTC by Victor Toso
Modified: 2015-08-29 16:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: match lyrics in the test with metrolyrics (1000 bytes, patch)
2015-08-29 09:46 UTC, Victor Toso
committed Details | Review
metrolyrics: fix source by removing noise (1.01 KB, patch)
2015-08-29 09:46 UTC, Victor Toso
committed Details | Review
metrolyrics: Do not crash when parser fails (1.10 KB, patch)
2015-08-29 09:56 UTC, Victor Toso
none Details | Review
metrolyrics: Do not crash when parser fails (1.10 KB, patch)
2015-08-29 10:10 UTC, Victor Toso
committed Details | Review

Description Victor Toso 2015-08-29 09:45:55 UTC
Finally... not sure if we should include the queen change upstream, looks like they got the lyrics wrong. Maybe we could remove queen from the test.
Comment 1 Victor Toso 2015-08-29 09:46:00 UTC
Created attachment 310239 [details] [review]
tests: match lyrics in the test with metrolyrics
Comment 2 Victor Toso 2015-08-29 09:46:09 UTC
Created attachment 310240 [details] [review]
metrolyrics: fix source by removing noise

Some changes in the metrolyrics website included more html noise in the
lyrics.
Comment 3 Victor Toso 2015-08-29 09:56:31 UTC
Created attachment 310241 [details] [review]
metrolyrics: Do not crash when parser fails

(lt-grilo-test-ui-0.2:8463): Grilo-WARNING **: [lua-library]
grl-lua-library.c:509: calling source callback function fail
(fetch_page_cb) grl-metrolyrics.lua:99:
attempt to index a nil value (local 'feed')'
Comment 4 Victor Toso 2015-08-29 10:10:59 UTC
Created attachment 310242 [details] [review]
metrolyrics: Do not crash when parser fails

(lt-grilo-test-ui-0.2:8463): Grilo-WARNING **: [lua-library]
grl-lua-library.c:509: calling source callback function fail
(fetch_page_cb) grl-metrolyrics.lua:99:
attempt to index a nil value (local 'feed')'
Comment 5 Bastien Nocera 2015-08-29 15:09:51 UTC
Review of attachment 310239 [details] [review]:

Sure.
Comment 6 Bastien Nocera 2015-08-29 15:10:08 UTC
Review of attachment 310240 [details] [review]:

Yep.
Comment 7 Bastien Nocera 2015-08-29 15:12:23 UTC
Review of attachment 310242 [details] [review]:

Sure, but I don't think that's enough. You also need to check *before* whether feed is nil, eg. you got a 404. This can be done in another patch.
Comment 8 Victor Toso 2015-08-29 15:39:32 UTC
Attachment 310239 [details] pushed as 722e3fd - tests: match lyrics in the test with metrolyrics
Attachment 310240 [details] pushed as 3874725 - metrolyrics: fix source by removing noise
Attachment 310242 [details] pushed as a692b9e - metrolyrics: Do not crash when parser fails
Comment 9 Victor Toso 2015-08-29 15:44:50 UTC
(In reply to Bastien Nocera from comment #7)
> Review of attachment 310242 [details] [review] [review]:
> 
> Sure, but I don't think that's enough. You also need to check *before*
> whether feed is nil, eg. you got a 404. This can be done in another patch.

That should be covered by fetch_page_cb(feed), no?

<snip>
function fetch_page_cb(feed)
  local media = nil 
  if feed and not feed:find("notfound") then
    media = metrolyrics_get_lyrics(feed)
  end 
  grl.callback(media, 0)
end
</snip>
Comment 10 Bastien Nocera 2015-08-29 16:54:53 UTC
(In reply to Victor Toso from comment #9)
> (In reply to Bastien Nocera from comment #7)
> > Review of attachment 310242 [details] [review] [review] [review]:
> > 
> > Sure, but I don't think that's enough. You also need to check *before*
> > whether feed is nil, eg. you got a 404. This can be done in another patch.
> 
> That should be covered by fetch_page_cb(feed), no?
> 
> <snip>
> function fetch_page_cb(feed)
>   local media = nil 
>   if feed and not feed:find("notfound") then
>     media = metrolyrics_get_lyrics(feed)
>   end 
>   grl.callback(media, 0)
> end
> </snip>

You're right, yes.