cvarelaruiz / owi2plex

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

Unsorted dictionaries #10

Closed MrNick4B closed 4 years ago

MrNick4B commented 5 years ago

In addition to my request to add a function to have continuous channel numbering (#8), I'd like to request to use sorted dictionaries instead of the standard unsorted dictionaries. Because unsorted dictionaries are used, the order of channels in the result xml file is always different, which messes up channel mappings in Plex.

First another import is needed:

import collections

Then changes to the dictionaries of def getBouquets and def getBouquetsServices are needed:

def getBouquets(bouquet, api_root_url, list_bouquets):
...
    result = collections.OrderedDict()
def getBouquetsServices(bouquets, api_root_url):
...
    services = collections.OrderedDict()