Re: Patch for kaa.epg

Jason Tackaberry <[email protected]>
Newsgroups gmane.comp.video.freevo.devel
Message-ID <1272476946.21155.1876.camel@arrakis>
Hi Adam,

On Wed, 2010-04-28 at 13:14 +0100, Adam Charrett wrote:
> I'm starting to look into moving freevo 1.x to using the kaa.epg as I'm
> hoping this should reduce memory requirements for my record server.

Cool.  Would be nice to get kaa.epg a bit more testing.


>              'title':'title',
>              'sub-title':'subtitle',
>              'episode-num':'episode',
> -            'category':'genre',
> +            'category':'genres',
>              'desc':'desc',
>              'date':'date'
>              }

I don't think the 'category' key is needed at all now with your patch,
no?


> @@ -156,6 +156,11 @@
>              stop = attrs.get('stop',None)
>              self._dict['stop'] = stop
>              self._dict['channel_id'] = attrs.get('channel',None)
> +        elif name == 'category':
> +            if 'genres' not in self._dict:
> +                self._dict['genres']=[]
> +            self._dict['genres'].append(u'')
> +            self._current = 'genre'

Better to use self._current = name here, as with display-name.

> +            elif self._current == 'genre':
> +                self._dict['genres'][-1] += ch

And then check for 'category' here.


> -            db_id = self.add_channel(tuner_id=channel, name=station, long_name=name)
> -            self.channels[attr['channel_id']] = [db_id, None]
> +        if not channel:
> +            channel = channel_id
> +            
> +        db_id = self.add_channel(tuner_id=channel, name=station, long_name=name)
> +        self.channels[attr['channel_id']] = [db_id, None]

Surely this is also a bug fix?  Looks like the current code would only
actually add channels whose names _couldn't_ be determined, which your
patch fixes.

Otherwise looks ok.  I assume you tested it. :)  Please comment on the
above and either submit a new patch or let me know if you agree and I
can make the changes when committing.

Thanks,
Jason.


------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.