Hello Guest, if you are reading this it means you have not registered yet. Please take a second, Click here to register, and in a few simple steps you will be able to enjoy our community and use our OpenViX support section.

View Entry Info: OpenWebif issue

Category:
Possible Bug
What ViX Image build number are you using?
Please provide your ViX Team image build number. Menu > Information > About > Build number > ENTER THIS NUMBER e.g. 4.2.028
5.0.020
Have you tried a flash WITHOUT settings restore?
Have you tried this? PLEASE SELECT YES OR NO.
No
Have you tried a flash WITH settings restore?
Have you tried this? PLEASE SELECT YES OR NO.
No
Attachments
Results 1 to 12 of 12

Thread: OpenWebif issue

  1. #1
    enf70's Avatar
    Title
    Junior Member
    Join Date
    May 2014
    Posts
    13
    Thanks
    1
    Thanked 4 Times in 3 Posts

    OpenWebif issue

    Expanding a bouquet of TV channels (when EPG is not loaded - for instance a DVB-T bouquet) the following exception is thrown:
    (bouquet is not expanded, "loading..." message remains on the screen)

    Code:
    <  1488.547> Unhandled Error
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/twisted/protocols/basic.py", line 571, in dataReceived
        
      File "/usr/lib/python2.7/site-packages/twisted/web/http.py", line 1752, in lineReceived
        
      File "/usr/lib/python2.7/site-packages/twisted/web/http.py", line 1845, in allContentReceived
        
      File "/usr/lib/python2.7/site-packages/twisted/web/http.py", line 766, in requestReceived
        
    --- <exception caught here> ---
      File "/usr/lib/python2.7/site-packages/twisted/web/server.py", line 190, in process
        
      File "/usr/lib/python2.7/site-packages/twisted/web/server.py", line 241, in render
        
      File "/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/controllers/base.py", line 123, in render
        data = func(request)
      File "/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/controllers/ajax.py", line 67, in P_channels
        channels = getChannels(idbouquet, stype)
      File "/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/controllers/models/services.py", line 367, in getChannels
        chan['next_end'] = strftime("%H:%M",(localtime(nextevent[0][1] + nextevent[0][2])))
    exceptions.TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'

  2. #2
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,794
    Thanks
    237
    Thanked 1,659 Times in 1,307 Posts
    Quote Originally Posted by enf70 View Post
    Expanding a bouquet of TV channels (when EPG is not loaded - for instance a DVB-T bouquet)
    Could you expand on what you mean by "EPG is not loaded"?

    (The actual problem seems to be that there is a now event, but not a next one. There's a check for the former existing but not the latter).
    Last edited by birdman; 27-06-17 at 14:26.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  3. #3
    enf70's Avatar
    Title
    Junior Member
    Join Date
    May 2014
    Posts
    13
    Thanks
    1
    Thanked 4 Times in 3 Posts
    Actually it seems EPG is there, for one channel "next_end" and "next_duration" are not set.

    Screen Shot 2017-06-27 at 14.14.42.png

    I changed the code like this:

    Code:
    root@vuduo2:/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/controllers/models$ diff services.py_orig services.py 
    --- services.py_orig
    +++ services.py
    @@ -364,8 +364,12 @@
     				nextevent = epgcache.lookupEvent(['TBDIX', (channel[0], +1, -1)])
     				chan['next_title'] = filterName(nextevent[0][0])
     				chan['next_begin'] =  strftime("%H:%M", (localtime(nextevent[0][1])))
    -				chan['next_end'] = strftime("%H:%M",(localtime(nextevent[0][1] + nextevent[0][2])))
    -				chan['next_duration'] = int(nextevent[0][2] / 60)
    +				if len(nextevent) > 0 and nextevent[0][0] is not None:
    +				    chan['next_end'] = strftime("%H:%M",(localtime(nextevent[0][1] + nextevent[0][2])))
    +				    chan['next_duration'] = int(nextevent[0][2] / 60)
    +				else:
    +				    chan['next_end'] = None
    +				    chan['next_duration'] = None
     				chan['next_ev_id'] = nextevent[0][3]
     				chan['next_idp'] = "nextd" + str(idp)
     				idp += 1

  4. #4
    enf70's Avatar
    Title
    Junior Member
    Join Date
    May 2014
    Posts
    13
    Thanks
    1
    Thanked 4 Times in 3 Posts
    Quote Originally Posted by birdman View Post
    Could you expand on what you mean by "EPG is not loaded"?

    (The actual problem seems to be that there is a now event, but not a next one. There's a check for the former existing but not the latter).
    You are right, the entire "nextevent" is not there.
    I only added the check for the two fields triggering the exception but we need a proper fix in place.

  5. #5
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,794
    Thanks
    237
    Thanked 1,659 Times in 1,307 Posts
    Assuming that your problem is what I think it is, I have a fix.
    But since I can't reproduce a situation that has a now event but not a next one (except artificially) I'm not certain that it will fix what you have seen.

    Mind you, in the process I've come across an additonal bug in OpenWebIF. It should be html-escaping the programme title (and channel name), but it isn't. As I discovered when trying to set a dummy title of "<<absent>>" and ending up with just "<>" displayed.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  6. #6
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,794
    Thanks
    237
    Thanked 1,659 Times in 1,307 Posts
    Quote Originally Posted by enf70 View Post
    I only added the check for the two fields triggering the exception but we need a proper fix in place.
    Try this?

    services.zip

    No, don't. I've just read your post and it needs a finer set of tests....
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  7. #7
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,794
    Thanks
    237
    Thanked 1,659 Times in 1,307 Posts
    OK, try this one.

    services.zip

    It (should) handle missing the next event having a missing begin or duration. It also handles there being no next event at all (the rest of the OWI code expects to find some...).

    Now I'm going to look at html-escaping titles....
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  8. #8
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,794
    Thanks
    237
    Thanked 1,659 Times in 1,307 Posts
    Can of worms here!
    I've now found another bug (with URL unquoting) whilst looking for html escaping.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  9. The Following User Says Thank You to birdman For This Useful Post:

    pembo (27-06-17)

  10. #9
    enf70's Avatar
    Title
    Junior Member
    Join Date
    May 2014
    Posts
    13
    Thanks
    1
    Thanked 4 Times in 3 Posts
    Quote Originally Posted by birdman View Post
    OK, try this one.

    services.zip

    It (should) handle missing the next event having a missing begin or duration. It also handles there being no next event at all (the rest of the OWI code expects to find some...).

    Now I'm going to look at html-escaping titles....
    Thanks, I'll try your fix later on and report back.

  11. #10
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,794
    Thanks
    237
    Thanked 1,659 Times in 1,307 Posts
    Quote Originally Posted by birdman View Post
    Mind you, in the process I've come across an additonal bug in OpenWebIF. It should be html-escaping the programme title (and channel name), but it isn't. As I discovered when trying to set a dummy title of "<<absent>>" and ending up with just "<>" displayed.
    Hmmm....weird.

    I do need to put that string in as html-escaped ( &lt;&lt;absent&gt;&gt ), but as far as I can see every other instance of text arriving back for display is already escaped. Which makes no sense as the titles being set in services.py certainly are not (I've printed them all out...). Actually, it looks like the title field isn't escaped, but the running text is. And If I change the title to contain "<&> it all gets horribly messed up....
    Fortunately there seems to be a simple fix for all relevant fields in this file as they are all fetched via filterName() or convertDesc().
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  12. #11
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,794
    Thanks
    237
    Thanked 1,659 Times in 1,307 Posts
    OK. Three PRs.

    A call to an undefined function, unescape (should be unquote). That's gone in (and wasn't a problem unless there were tags - just that I noticed it while looking for any uses of "escape").

    A fix for missing fields in the next item (what you were suffering):
    Code:
    https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/pull/622
    A fix to HTML-escape the title and descriptions (which was what I was falling foul of with the "<<absent>>" string).
    Code:
    https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/pull/623
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  13. The Following 2 Users Say Thank You to birdman For This Useful Post:

    pembo (28-06-17),Sicilian (28-06-17)

  14. #12

    Title
    ViX Beta Tester
    Join Date
    Jun 2014
    Location
    UK
    Posts
    642
    Thanks
    157
    Thanked 318 Times in 173 Posts
    you've got to love it when something that should be simple to fix turns up 5 other things at the same time and you're sat there wishing you never opened the can

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.