Review Request: fix xkcd comic strip

Marco Martin notmart at gmail.com
Mon Feb 4 11:29:42 CET 2008


thinking a moment about it i realized that probably it does download
all the comics, since clicking on buttons always moves by one single
day, the problem is that there is not a real corrispondence between
the date and the id, so it could as you said create inconsistencies in
the cache.
the only idea that comes in my mind would be a quite big change in the
engine, it would be a little bit more cumbersome but more flexible:
the provider does not work with a date but with a generic id that is a
qstring, that could be a date or something else like xkcd.
when the provider is istantiated with an empty string it fetches the
today's comic and the ids of the next and previous comics, so clicking
on the arrows fetches that ids provided by the dataengine.
there is still a cache problem, because the today's comic would not
ave a next id, and this would be saved in cached, but tomorrow will
have one, so the cache would be broken.

Cheers,
Marco Martin

On 2/4/08, Jonas Pollok <jonas.p at gmail.com> wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://matt.rogers.name/r/54/#review55
> -----------------------------------------------------------
>
>
> Midnight passed and there is a bug of course. The cache depends on the date.
>
> Before midnight:
> 03022008 => id = 378 (today with latestid)
> 02022008 => id = 377
> etc.
>
> After midnight:
> 04022008 => id = 378
> 03022008 => id = 378 (well in fact the picture and not the id is cached for a certain date. The calculations are OK - id = 377 would be calculated if the cache have not been used)
>
> Well since the patch is not really fixing xkcd I'll remove it from the review-board. Please share your opinion on how to fix this on the mailing list.
>
> - Jonas
>
>
> On 2008-02-03 13:56:27, Jonas Pollok wrote:
> >
> > -----------------------------------------------------------
> > This is an automatically generated e-mail. To reply, visit:
> > http://matt.rogers.name/r/54/
> > -----------------------------------------------------------
> >
> > (Updated 2008-02-03 13:56:27)
> >
> >
> > Review request for Plasma.
> >
> >
> > Summary
> > -------
> >
> > I tried to fix the xkcd part of the comic dataengine.
> > xkcd uses incremental ids and not dates to identify a comic strip.
> > The old code assumes that xkcd releases one comic strip per day which is not the case.
> > I'll write down what i _wanted_ to do and you can either find a better way or improve the code :)
> >
> > On creation the latest comic strip id is parsed from 'http://xkcd.com' and associated with currentDate().
> > When requesting a comic strip by providing a certain date the delta between the given date and currentDate
> > should be the delta between the wanted id and the latest id.
> >
> >
> > Diffs
> > -----
> >
> >   trunk/extragear/plasma/dataengines/comic/xkcdprovider.h
> >   trunk/extragear/plasma/dataengines/comic/xkcdprovider.cpp
> >
> > Diff: http://matt.rogers.name/r/54/diff
> >
> >
> > Testing
> > -------
> >
> >
> > Thanks,
> >
> > Jonas
> >
> >
>
> _______________________________________________
> Panel-devel mailing list
> Panel-devel at kde.org
> https://mail.kde.org/mailman/listinfo/panel-devel
>


More information about the Panel-devel mailing list