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.
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.
The first entry is the unique identifier from the database, in most cases the xmltv id. The recordserver will use this id internaly. The second the display name, the server doesn't need it. After than comes a list were to find the channel. The first can be found on two dvb cards, but with different names, the second on a dvb card and analog on the tuner id (frequency?) 19. The last only on dvb with the given
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.
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.
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.
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:.
These measures should drasticly reduce the amount of required configuration.
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. 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.
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').
How about it? :)
-Rob
------------------------------------------------------- This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 _______________________________________________ Freevo-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freevo-devel