Updated EpisodeProvider methods

pull/4/head
markus101 14 years ago
parent b112e28b80
commit 3157ee4aba

@ -40,27 +40,34 @@ namespace NzbDrone.Core.Providers
_series = seriesProvider;
_tvDb = tvDbProvider;
_seasons = seasonProvider;
}
public BasicEpisode GetEpisode(long id)
public EpisodeInfo GetEpisode(long id)
{
throw new NotImplementedException();
return _sonicRepo.Single<EpisodeInfo>(e => e.EpisodeId == id);
}
public BasicEpisode UpdateEpisode(BasicEpisode episode)
public void UpdateEpisode(EpisodeInfo episode)
{
throw new NotImplementedException();
var episodeToUpdate = _sonicRepo.Single<EpisodeInfo>(e => e.EpisodeId == episode.EpisodeId);
episodeToUpdate.AirDate = episode.AirDate;
episodeToUpdate.Overview = episode.Overview;
episodeToUpdate.Title = episode.Title;
episodeToUpdate.EpisodeNumber = episode.EpisodeNumber;
episodeToUpdate.SeasonNumber = episode.SeasonNumber;
_sonicRepo.Update<EpisodeInfo>(episodeToUpdate);
}
public IList<BasicEpisode> GetEpisodesBySeason(long seasonId)
public IList<EpisodeInfo> GetEpisodesBySeason(long seasonId)
{
throw new NotImplementedException();
return _sonicRepo.Find<EpisodeInfo>(e => e.SeasonId == seasonId);
}
public IList<BasicEpisode> GetEpisodeBySeries(long seriesId)
public IList<EpisodeInfo> GetEpisodeBySeries(long seriesId)
{
throw new NotImplementedException();
return _sonicRepo.Find<EpisodeInfo>(e => e.SeriesId == seriesId);
}
public String GetSabTitle(BasicEpisode episode)
@ -70,7 +77,6 @@ namespace NzbDrone.Core.Providers
//TODO: This method should return a standard title for the sab episode.
throw new NotImplementedException();
}
/// <summary>
@ -78,7 +84,7 @@ namespace NzbDrone.Core.Providers
/// </summary>
/// <param name="episode">Episode that needs to be checked</param>
/// <returns></returns>
public bool IsNeeded(BasicEpisode episode)
public bool IsNeeded(RemoteEpisode episode)
{
throw new NotImplementedException();
}
@ -153,6 +159,5 @@ namespace NzbDrone.Core.Providers
return result;
}
}
}

@ -6,10 +6,10 @@ namespace NzbDrone.Core.Providers
{
public interface IEpisodeProvider
{
BasicEpisode GetEpisode(long id);
BasicEpisode UpdateEpisode(BasicEpisode episode);
IList<BasicEpisode> GetEpisodesBySeason(long seasonId);
IList<BasicEpisode> GetEpisodeBySeries(long seriesId);
EpisodeInfo GetEpisode(long id);
void UpdateEpisode(EpisodeInfo episode);
IList<EpisodeInfo> GetEpisodesBySeason(long seasonId);
IList<EpisodeInfo> GetEpisodeBySeries(long seriesId);
String GetSabTitle(BasicEpisode episode);
/// <summary>
@ -17,7 +17,7 @@ namespace NzbDrone.Core.Providers
/// </summary>
/// <param name="episode">Episode that needs to be checked</param>
/// <returns></returns>
bool IsNeeded(BasicEpisode episode);
bool IsNeeded(RemoteEpisode episode);
void RefreshSeries(int seriesId);
}

@ -6,7 +6,7 @@ namespace NzbDrone.Core.Providers
public interface ISeasonProvider
{
Season GetSeason(int seasonId);
List<Season> GetSeasongs(int seriesId);
List<Season> GetSeasons(int seriesId);
void EnsureSeason(int seriesId, int seasonId, int seasonNumber);
int SaveSeason(Season season);
}

@ -21,7 +21,7 @@ namespace NzbDrone.Core.Providers
throw new NotImplementedException();
}
public List<Season> GetSeasongs(int seriesId)
public List<Season> GetSeasons(int seriesId)
{
throw new NotImplementedException();
}

Loading…
Cancel
Save