Linux Channel Numbering
#1
Tongue 
Hi


Is there any way to renumber the channels by it's SID ?
I'm using xbmc eden + vdr + xvdr plugin

Other issue: I loose the channel groups I create in every reboot. How can we fix them ?
Reply
#2
have you set XBMC to use the channel numbering from the backend?

To set the channel numbers put them in the order you require in your vdr channels.conf file
Guide to building an all in one Ubuntu Server - TV(vdr),File,Music,Web

Server Fractal Designs Define XL, Asus P5QL/EPU, Dual Core E5200, 4gb, L4M-Twin S2 v6.2, Supermicro AOC-USAS-L8I, 1*SSD & 13*HDD drives (24TB total) - Ubuntu Server
XBMC 1 ASRock Z77E-ITX, G850, 8GB RAM, SSD, BD - Ubuntu / OpenElec frodo
XBMC 2 Revo 3700 - OpenElec frodo
XBMC 3 Raspb Pi
Reply
#3
Well, I was looking at http://www.vdr-wiki.de/wiki/index.php/Vd...9#CHANNELS
So I found what I wanted. Now I can number the channels the way I want. (and make channel groups too)

I even did a somewhat dirty shell script to number the channels by its SID and sort them in channels.conf file

Code:
#!/bin/bash

exchange(){
temp=${array[$1]}
array[$1]=${array[$2]}
array[$2]=$temp
}

Well, it could be better, but worked for me.

numlines=$(cat channels.conf | wc -l)
i=0


while read line
do
    chan_num=$(echo $line | cut -d: -f10  ) #get channel number
    array[i]=$chan_num
    i=$((i+1))
    array[i]=$line
    i=$((i+1))
done < channels.conf

arraysize=${#array[@]}


#bublesort, as said by Schildt, "the evil of swaps"
for ((last=arraysize-2;last>0;last=last-2))
do
    for((i=0;i<last;i=i+2))
    do
        j=$((i+2))
        if [ ${array[i]} -gt ${array[j]} ]
        then
            exchange $i $j
            exchange $((i+1)) $((j+1))

        fi
    done
done


for((i=0;i<arraysize-2;i=i+2))
do
    echo -e ":@${array[i]}\n${array[$((i+1))]}" >> channels.conf.sorted

done


Reply

Logout Mark Read Team Forum Stats Members Help
Channel Numbering0