Rob Shortt wrote: > Hi, I've finally got a chance to check this out. > > Dirk Meyer wrote: >> The server also needs a valid TV_CHANNELS listing. It doesn't work >> without it. Here a small example. > > This part I do _not_ like (sorry). I wish to run Freevo with > TV_CHANNELS=None and use info from the DB. Before the last changes to > tv/channels.py it used TV_CHANNELS to compliment data from the DB. > Now it is all or nothing.
Sorry, but the old way didn't work for me. There are no dvb informations in the db and the old code added every channel twice (one From the db, one from TV_CHANNELS). I guess what we should do is: if not TV_CHANNELS: TV_CHANNELS = create_from_epg >> TV_CHANNELS = [ >> ( 'ard.de', 'ARD', 'dvb0:Das Erste RB', 'dvb1:Das Erste' ), ( >> 'ndr.de', 'NDR', 'NDR RB', 19 ), ( 'kika.de', 'Kika', 'Doku KiKa' >> ) ] > > I like the new format. fine. > Through Freevo the analog tuner id should be a string, even when it's > an integar. In many places (I'd say about 1/3 the world) the tuner id > contains letters and may be something like 'E9'. Please don't confuse > the tuner id with the frequency. The frequency is a number in MHz or > KHz that the channel is broadcast on, this is a big number like > 489250. In Freevo we take the user's CONF.chanlist and find their > frequency table in tv/freq.py. I mix up tuner id, frequency and all the other things. > Problem: If tuner id and the dvb name are both strings, how to tell > them apart? > > Well, we already have TV_DEFAULT_SETTINGS, mine is set to > 'ivtv0'. TV_DEFAULT_SETTINGS defaults to the first one of ['dvb0', > 'tv0', 'ivtv0'] found in TV_SETTINGS.keys(). That will take care of > 99% of our users. TV_CHANNELS then only needs to look like: > > TV_CHANNELS = [ > ( 'ard.de', 'ARD', 'dvb0:Das Erste RB', 'dvb1:Das Erste' ), > ( 'ndr.de', 'NDR', 'tv0:19' ), > ( 'blah.de', 'BLAH', 'Ich Blah', 'tv1:20' ), > ( 'kika.de', 'Kika', 'Doku KiKa' ) ] > > That example is mixed up only for demonstration. If a user has no > TV_CHANNELS all channels can be assumed to be available on > TV_DEFAULT_SETTINGS, same thing for those channels that are in the DB > and not found in TV_CHANNELS. OK, so we keep the scanning code like it is now (does it start with dvb, tv or ivtv) and if not, use TV_DEFAULT_SETTINGS. We could make this variable auto detected. If a dvb card is found, set it to dvb:, if ivtv is found (can you detect this?), use this and if both fail, use tv. And back to your example: TV_CHANNELS = [ ( 'ard.de', 'ARD', 'dvb0:Das Erste RB', 'dvb1:Das Erste' ), ( 'ndr.de', 'NDR', 'tv:19' ), ( 'kika.de', 'Kika', 'tv1:20' ) ] ard is simple, ndr.de is on _all_ dvb cards on NDR (when default is dvb) and on _all_ tv cards on tuner id 19 (because there is only tv: without a number). > What to do if a user has multiple cards? Best case scenario is that > these cards have the same capabilities and only server to reduce > conflicts in recording and watching tv. Then we should allow > TV_DEFAULT_SETTINGS to be a list, ['tv0', 'tv1']. Ok, that would > cover 99.5% of the users. So TV_DEFAULT_SETTINGS is only 'tv'. The code in config.py can handle this by match tv: to all tv[0-9] cards. > If the user has multiple cards and they have different capabilities > then they _must_ have their channels in TV_CHANNELS, well at least all > channels for one card (the one not the default). If the channel is > available on different cards but as different tuner ids or different > dvb name then they MUST supply tvX: or dvbX:. How do you plan to use dvb without a TV_CHANNELS? You have no id in the xmltv file and even for analog tv, the tuner id is not in all xmltv files (at least not in Germany). And even if: my dvb card has a /dev/dvb/adapter0 and also a /dev/video0. Freevo should not think that this /dev/video0 is a tv: device, that doesn't work. So my proposal: write a small helper to help users to generate a TV_CHANNELS. I still don't understand how we could use dvb without it and why some people don't want to sort the channels in order how often see use them. > Since reading channels from memory is faster than querying the DB then > we simply load the DB on bootup and merge it with TV_CHANNELS, or vice > verca. Please do not merge it. I want to create my TV_CHANNELS without the db adding stuff to it. > In tv/channels.py there is the hook to pyepg so we can again > have it check TV_CHANNELS when it creates or refreshes the ChannelList. tv/channels.py is a bad place for it. The recordserver doesn't use this file, it uses the epg directly. > This could go further with what we were talking about earlier with > autodetection, 'channels' could be one of the things to detect: > > import config # home for variables that get filled in when > # things are autodetected > > import system # autodetect code under src/system/ > > system.detect('channels', 'devices', 'cache', 'xine') > > That way only Freevo processes that need to detect things like devices > and channels will have that work done. We could even update one of > these at a recurring time: system.detect('channels'). Sounds good. Dischi -- Nondeterminism means never having to say you are wrong.
pgpt5fu9mdLrp.pgp
Description: PGP signature