Something like this at the end of your hacks section should create an HD section as the first bouquet. Order would be identical to your current list.
Code:
current_first_section = sorted(sections.keys())[0] # get the current first section number
start_HD_bouquet_at = 1 # where we are going to place our new HD section (i.e. the first bouquet)
if start_HD_bouquet_at < current_first_section: # Only add this section if there is space
sections[start_HD_bouquet_at] = "HD Channels" # name the HD section
current_slot = start_HD_bouquet_at # remember the next available slot
for lcn in sorted(customised["video"].keys()): # iterate through occupied slots
if not (current_slot < current_first_section): # if there are no more slots in the HD section
break
if customised["video"][lcn]["service_type"] in DvbScanner.HD_ALLOWED_TYPES: # if this channel is HD
customised["video"][current_slot] = customised["video"][lcn]
current_slot += 1
Last edited: