Converter ServiceName2 Number and %n conversions fallback code matches service in wrong bouquet

Issue #435 resolved
prl created an issue

The ServiceName2 Number and %n format codes expect that their source will have a "serviceref" attribute, but fall back to searching bouquets to calculate the service number.

When MENU>Setup>TV>Channel selection>Alternative numbering mode is enabled, this fallback code returns incorrect matches to servicerefs it encounters in the search if bouquets searched earlier contain the desired serviceref.

If some bouquet other than the first in the bouquet list is current, Components.Converters.ServiceName2.getServiceNumber.searchHelper will terminate its count for bouquets other than the current bouquet if they contain the serviceref which is being serached for. This throws out the start count for other bouquets.

searchHelper needs a Boolean parameter to tell it whether the bouquet being searched is the currently selected one. If it is not the currently selected bouquet, it should simply return the count of entries in the bouquet, and not return if it finds a match to the service reference being searched for.

        <widget source="ServiceEvent" render="Label" position="50,110" size="60,30" backgroundColor="black" font="Regular;18" foregroundColor="white" transparent="1">
            <convert type="ServiceName2">%n</convert>
        </widget>
        <widget source="ServiceEvent" render="Label" position="110,110" size="60,30" backgroundColor="black" font="Regular;18" foregroundColor="white" transparent="1">
            <convert type="ServiceName2">Number</convert>
        </widget>

Then press FAV and select any bouquet other than the Terrestrial LCN TV bouquet as the current bouquet by going to FAV, OK, navigate to another bouquet, BLUE Favourites.

Then press FAV again, then DOWN. Now, moving up and down in the bouquet will show numbers that have an apparently random order.

Comments (2)

  1. Peter Urbanec

    Fix bug #435: Converter ServiceName2 Number and %n conversions fallback code matches service in wrong bouquet

    Add parameter to searchHelper() to only return a non-None serviceref if the bouquet being searched is the target bouquet. Otherwise it returns a None serviceref and a count of the number of (non-padding) entries in the bouquet.

    → <<cset 7cac31a7bdc6>>

  2. Log in to comment