rvs76 / tvdblib

Automatically exported from code.google.com/p/tvdblib
0 stars 0 forks source link

use local cache when calling GetEpisode() #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
i just started an open source project(http://www.codeplex.com/bbtv) and let
me say how much I appropriate the fact that you made your work available to
the public so I can use it without having to reinvent the wheel.

here is my question, I'm calling GetEpisode() after a GetFullSeries() call,
but the call still goes to the webserive instead of it being handle
locally? is this by design, or am i missing a step? i just don't want to
put needless stress on thetvdb.com since I have much respect for those guys
and wouldn't want to waist their resources. all I need from the second call
is the original airing of an episode. so please let me know if there a more
efficient way of getting that info based on season number and episode number.

var series = tvdbHandler.GetFullSeries( item.Id,
TvdbLanguage.DefaultLanguage, false );

var episode = tvdbHandler.GetEpisode( item.Id, 4, 16,
TvdbEpisode.EpisodeOrdering.DefaultOrder, TvdbLanguage.DefaultLanguage );
                Console.WriteLine( episode.FirstAired );

TvdbHandler.SaveCache();

Original issue reported on code.google.com by kay....@gmail.com on 11 Feb 2009 at 6:27

GoogleCodeExporter commented 9 years ago
sorry, i don't know why google marked as defect, this is just a question, not a 
defect.

Original comment by kay....@gmail.com on 11 Feb 2009 at 6:28

GoogleCodeExporter commented 9 years ago
no problem, feedback is always appreciated... As for your question: GetEpisode()
should be used if you only need an episode without the whole series, and 
currently
always gets the episode online. If you already have the full series (which 
includes
episodes, banners and actors info), you can get the episode via the list
"series.Episodes"... However it should be possible to add caching support for
GetEpisode() as well, I'll look into it ;)

On a side note, I've been working a lot on the project the last few days 
(especially
on caching and updating of content) and will upload a new release within the 
next days. 

Original comment by bgmei...@gmail.com on 11 Feb 2009 at 6:46

GoogleCodeExporter commented 9 years ago
Thanks for the fast response, another question i have is, does the local cache
expire? if yes after how long and is it configurable? and is there a way to 
only get
the delta since the last update? or every time it is a complete refresh of the 
data?

Original comment by kay....@gmail.com on 11 Feb 2009 at 6:54

GoogleCodeExporter commented 9 years ago
The data is kept up to date via the updates api from thetvdb
(http://thetvdb.com/wiki/index.php/API:Updates -> You can trigger an update via
UpdateAllSeries) which keeps the data consistent with the online version. 

Keeping the local data up to date is one of the trickier tasks and this part of 
the
project will be greatly improved with the next version...

Original comment by bgmei...@gmail.com on 11 Feb 2009 at 8:27

GoogleCodeExporter commented 9 years ago
that sounds great, when you say next version is that the version you are 
releasing
shortly or another release after that?

Original comment by kay....@gmail.com on 11 Feb 2009 at 5:41

GoogleCodeExporter commented 9 years ago
I'm talking about the release scheduled for the next days, you can try it by 
checking
out the current svn...

But be aware that there was some refactoring so there are a few build-breaking
changes! Plus the BinaryCacheProvider isn't fully integrated, but that should be
fixed within the next few hours.

Original comment by bgmei...@gmail.com on 11 Feb 2009 at 7:32

GoogleCodeExporter commented 9 years ago

Original comment by bgmei...@gmail.com on 16 Feb 2009 at 11:25

GoogleCodeExporter commented 9 years ago
When calling "GetEpisode(int _seriesId, int _seasonNr, int _episodeNr,
TvdbEpisode.EpisodeOrdering _order, TvdbLanguage _language)" or "GetEpisode(int
_seriesId, DateTime _airDate, TvdbLanguage _language)" the episode will be 
loaded
from cache now.

Original comment by bgmei...@gmail.com on 17 Jun 2009 at 4:08