Converter ServiceName2 Number and %n conversions fallback code ignores Alternative numbering mode

Issue #434 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.

The setting of MENU>Setup>TV>Channel selection>Alternative numbering mode is ignored by the ServiceName2 Number and %n conversions fallback code.

This is because the alternative counting mode is set by Components.Converters.ServiceName2 using:

            try:
                acount = config.plugins.NumberZapExt.enable.value and config.plugins.NumberZapExt.acount.value or config.usage.alternative_number_mode.value 
            except:
                acount = False

If the NumberZapExt plugin is not loaded, this will raise an exception and set acount to False, even though if config.usage.alternative_number_mode.value is True, acount should also be set to true.

The bug can be fixed by reversing the order of the or in the calculation of acount:

                acount = config.usage.alternative_number_mode.value or config.plugins.NumberZapExt.enable.value and config.plugins.NumberZapExt.acount.value

Replication steps

Add the following to the ChannelSelection skin in either the easy-skin-aus-hd or the Full-Metal-Wizard skin, set MENU>Setup>TV>Channel selection>Alternative numbering mode to "on" and restart the GUI.

        <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 service numbers not commencing at 1 in the bouquet as they should with Alternative numbering mode enabled. The numbers will have an apparently random order, too. This is due to bug #435.

Comments (2)

  1. Peter Urbanec

    Fix bug #434: Converter ServiceName2 Number and %n conversions fallback code ignores Alternative numbering mode

    Change order of calculation of acount so that it returns the correct result if the NumberZapExt plugin is not installed.

    → <<cset 7662a7b68782>>

  2. Log in to comment