cvarelaruiz / owi2plex

Exporter of EPG from OpenWebif to XMLTV to use with Plex
Mozilla Public License 2.0
27 stars 6 forks source link

No continuous channel numbering #8

Closed MrNick4B closed 5 years ago

MrNick4B commented 5 years ago

There is no option to use continuous channel numbering. When using multiple bouquets, the channels from every bouquet get numbered from 1 to X.

All channels appear in the XML, but Plex does not recognize that channels with the same numbers are seperate channels. Instead, Plex uses the last channel from the XML with that number.

I think the numbering happens in def addChannels2XML, specifically at the following line: etree.SubElement(channel, 'display-name').text = str(service['pos'])

Maybe it could be useful to add an option to use incremental numbers, something like:

def addChannels2XML(xmltv, bouquets_services, epg, api_root_url):
    number = 1
        for _, services in bouquets_services.items():
            for service in services:
                ...
                etree.SubElement(channel, 'display-name').text = str(number)
                number += 1
                ...
cvarelaruiz commented 5 years ago

@MrNick4B thanks for the pull request. I've merged it into Master and will put them into Pypi today.