2010-10-05 06:21:18 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using NLog;
|
2010-10-21 01:49:23 +00:00
|
|
|
|
using NzbDrone.Core.Repository;
|
2010-10-05 06:21:18 +00:00
|
|
|
|
using SubSonic.Repository;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Providers
|
|
|
|
|
{
|
|
|
|
|
class SeasonProvider : ISeasonProvider
|
|
|
|
|
{
|
|
|
|
|
private readonly IRepository _sonicRepo;
|
|
|
|
|
private static readonly Logger Logger = NLog.LogManager.GetCurrentClassLogger();
|
|
|
|
|
|
|
|
|
|
public SeasonProvider(IRepository dataRepository)
|
|
|
|
|
{
|
|
|
|
|
_sonicRepo = dataRepository;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Season GetSeason(int seasonId)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-10 21:20:43 +00:00
|
|
|
|
public List<Season> GetSeasons(int seriesId)
|
2010-10-05 06:21:18 +00:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void EnsureSeason(int seriesId, int seasonId, int seasonNumber)
|
|
|
|
|
{
|
|
|
|
|
if (_sonicRepo.Exists<Season>(s => s.SeasonId == seasonId))
|
|
|
|
|
return;
|
|
|
|
|
//TODO: Calculate Season Folder
|
2010-10-30 02:46:32 +00:00
|
|
|
|
Logger.Trace("Adding Season To DB. [SeriesID:{0} SeasonID:{1} SeasonNumber:{2}]", seriesId, seasonId, seasonNumber, "????");
|
2010-10-05 06:21:18 +00:00
|
|
|
|
|
|
|
|
|
var newSeason = new Season()
|
|
|
|
|
{
|
|
|
|
|
Monitored = true,
|
|
|
|
|
SeasonId = seasonId,
|
|
|
|
|
SeasonNumber = seasonNumber,
|
|
|
|
|
SeriesId = seriesId
|
|
|
|
|
};
|
|
|
|
|
_sonicRepo.Add<Season>(newSeason);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int SaveSeason(Season season)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|