PoulKalff / angularJS

0 stars 1 forks source link

Need ability to select source of EPG programme description #6

Closed dave-p closed 3 years ago

dave-p commented 3 years ago

The EIT standard provides two locations for storing information about a programme in the EPG; "Summary" and "Description". Unfortunately some broadcasters use one field and some the other, so it is necessary to have some way of selecting the correct one.

As an example, this patch changes from the "description" field to "summary" for use with UK DVB-T and DVB-S.

diff --git a/static/templates/epg_page.html b/static/templates/epg_page.html
index cfb92a3..4656622 100755
--- a/static/templates/epg_page.html
+++ b/static/templates/epg_page.html
@@ -48,7 +48,7 @@
                                        <div class="row">
                                                <div class="col-12 overflow-hidden">
                                                        <div id="epg_bottom_description">
-                                                               {{selectedEpgUnit['data']['description']}}
+                                                               {{selectedEpgUnit['data']['summary']}}
                                                        </div>
                                                </div>
                                        </div>
PoulKalff commented 3 years ago

Yeah, I see.. so what would be the logical thing to do? Choose one, unless it is .length == 0 then use the other?

dave-p commented 3 years ago

TVHadmin has a configuration item so the user can choose. Deciding automatically would be better, however the 'wrong' item isn't just length zero it's non-existent:

    {
      "eventId": 729321,
      "episodeUri": "crid://www.itv.com/1001802101",
      "serieslinkUri": "crid://www.itv.com/ebs50965",
      "channelName": "ITV2",
      "channelUuid": "fad0d38c8e890d8949d369687d27dafa",
      "channelNumber": "6",
      "start": 1600596600,
      "stop": 1600623900,
      "title": "British Touring Car...",
      "summary": "...Championship Live. The championship heads to Thruxton for Rounds 13, 14 and 15 of the season. Presented by Steve Rider and Louise Goodman. [S]",
      "widescreen": 1,
      "subtitled": 1,
      "genre": [
        64
      ],
      "nextEventId": 727496
    }
PoulKalff commented 3 years ago

Well, non-existence is just as easy to check for. Do you have a channel to check this, if I implement it? All my channels use 'description'... They way you did it above, both text would be pasted in to the same field... which is fine if only one exists, but what if both exist? Probably better to have the controller check what's there, wouldn't you say?

PoulKalff commented 3 years ago

Implemented as

###         // hotfix for no description
if (!angular.isDefined(epgUnit['data']['summary']))
    epgUnit['data']['description'] = epgUnit['data']['summary'];
else:
    epgUnit['data']['description'] = '<no description available>';
dave-p commented 3 years ago

Raised PR #7 to correct inverted logic - works now.

PoulKalff commented 3 years ago

Awesome, thanks