removed dead code.

pull/6/head
kay.one 11 years ago
parent 3d71c129eb
commit 0794affae0

@ -8,9 +8,9 @@ namespace NzbDrone.Api.Qualities
{
public class QualityProfileModule : NzbDroneRestModule<QualityProfileResource>
{
private readonly QualityProfileService _qualityProfileService;
private readonly IQualityProfileService _qualityProfileService;
public QualityProfileModule(QualityProfileService qualityProfileService)
public QualityProfileModule(IQualityProfileService qualityProfileService)
: base("/qualityprofiles")
{
_qualityProfileService = qualityProfileService;

@ -6,9 +6,9 @@ namespace NzbDrone.Api.Qualities
{
public class QualitySizeModule : NzbDroneRestModule<QualitySizeResource>
{
private readonly QualitySizeService _qualityTypeProvider;
private readonly IQualitySizeService _qualityTypeProvider;
public QualitySizeModule(QualitySizeService qualityTypeProvider)
public QualitySizeModule(IQualitySizeService qualityTypeProvider)
{
_qualityTypeProvider = qualityTypeProvider;

@ -8,7 +8,6 @@ using NzbDrone.Core.Configuration;
using NzbDrone.Core.MediaFiles.Commands;
using NzbDrone.Core.MediaFiles.EpisodeImport;
using NzbDrone.Core.MediaFiles.EpisodeImport.Specifications;
using NzbDrone.Core.Messaging;
using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Tv;

@ -9,10 +9,8 @@ namespace NzbDrone.Core.MediaFiles
{
public interface IMediaFileRepository : IBasicRepository<EpisodeFile>
{
EpisodeFile GetFileByPath(string path);
List<EpisodeFile> GetFilesBySeries(int seriesId);
List<EpisodeFile> GetFilesBySeason(int seriesId, int seasonNumber);
bool Exists(string path);
}
@ -23,11 +21,6 @@ namespace NzbDrone.Core.MediaFiles
{
}
public EpisodeFile GetFileByPath(string path)
{
return Query.SingleOrDefault(c => c.Path == path);
}
public List<EpisodeFile> GetFilesBySeries(int seriesId)
{
return Query.Where(c => c.SeriesId == seriesId).ToList();
@ -40,9 +33,5 @@ namespace NzbDrone.Core.MediaFiles
.ToList();
}
public bool Exists(string path)
{
return Query.Any(c => c.Path == path);
}
}
}

@ -14,8 +14,6 @@ namespace NzbDrone.Core.MediaFiles
EpisodeFile Add(EpisodeFile episodeFile);
void Update(EpisodeFile episodeFile);
void Delete(EpisodeFile episodeFile, bool forUpgrade = false);
bool Exists(string path);
EpisodeFile GetFileByPath(string path);
List<EpisodeFile> GetFilesBySeries(int seriesId);
List<EpisodeFile> GetFilesBySeason(int seriesId, int seasonNumber);
List<string> FilterExistingFiles(List<string> files, int seriesId);
@ -54,16 +52,6 @@ namespace NzbDrone.Core.MediaFiles
_eventAggregator.PublishEvent(new EpisodeFileDeletedEvent(episodeFile, forUpgrade));
}
public bool Exists(string path)
{
return _mediaFileRepository.Exists(path);
}
public EpisodeFile GetFileByPath(string path)
{
return _mediaFileRepository.GetFileByPath(path.Normalize());
}
public List<EpisodeFile> GetFilesBySeries(int seriesId)
{
return _mediaFileRepository.GetFilesBySeries(seriesId);

@ -407,7 +407,6 @@
<Compile Include="Datastore\ResultSet.cs" />
<Compile Include="Tv\Commands\RefreshSeriesCommand.cs" />
<Compile Include="Tv\RefreshEpisodeService.cs" />
<Compile Include="Tv\SeasonRepository.cs" />
<Compile Include="Tv\SeriesRepository.cs" />
<Compile Include="Tv\QualityModel.cs" />
<Compile Include="Download\Clients\Sabnzbd\SabAddResponse.cs" />

@ -1,5 +1,4 @@
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging;
using NzbDrone.Core.Messaging.Events;

@ -2,7 +2,6 @@
using System.Linq;
using NLog;
using NzbDrone.Core.Lifecycle;
using NzbDrone.Core.Messaging;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Tv;

@ -2,7 +2,6 @@
using System.Linq;
using NLog;
using NzbDrone.Core.Lifecycle;
using NzbDrone.Core.Messaging;
using NzbDrone.Core.Messaging.Events;
namespace NzbDrone.Core.Qualities
@ -10,7 +9,6 @@ namespace NzbDrone.Core.Qualities
public interface IQualitySizeService
{
void Update(QualitySize qualitySize);
void UpdateAll(List<QualitySize> qualitySizes);
List<QualitySize> All();
QualitySize Get(int qualityId);
}
@ -31,10 +29,6 @@ namespace NzbDrone.Core.Qualities
_qualitySizeRepository.Update(qualitySize);
}
public virtual void UpdateAll(List<QualitySize> qualitySizes)
{
_qualitySizeRepository.UpdateMany(qualitySizes);
}
public virtual List<QualitySize> All()
{

@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq;
using Marr.Data.QGen;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging;
using NzbDrone.Core.Messaging.Events;
@ -11,7 +10,6 @@ namespace NzbDrone.Core.Tv
{
public interface IEpisodeRepository : IBasicRepository<Episode>
{
Episode Get(int seriesId, int season, int episodeNumber);
Episode Find(int seriesId, int season, int episodeNumber);
Episode Get(int seriesId, DateTime date);
Episode Find(int seriesId, DateTime date);
@ -19,9 +17,7 @@ namespace NzbDrone.Core.Tv
List<Episode> GetEpisodes(int seriesId, int seasonNumber);
List<Episode> GetEpisodeByFileId(int fileId);
PagingSpec<Episode> EpisodesWithoutFiles(PagingSpec<Episode> pagingSpec, bool includeSpecials);
Episode GetEpisodeBySceneNumbering(int seriesId, int seasonNumber, int episodeNumber);
Episode FindEpisodeBySceneNumbering(int seriesId, int seasonNumber, int episodeNumber);
List<Episode> EpisodesWithFiles();
List<Episode> EpisodesBetweenDates(DateTime startDate, DateTime endDate);
void SetMonitoredFlat(Episode episode, bool monitored);
void SetMonitoredBySeason(int seriesId, int seasonNumber, bool monitored);
@ -38,11 +34,6 @@ namespace NzbDrone.Core.Tv
_database = database;
}
public Episode Get(int seriesId, int season, int episodeNumber)
{
return Query.Single(s => s.SeriesId == seriesId && s.SeasonNumber == season && s.EpisodeNumber == episodeNumber);
}
public Episode Find(int seriesId, int season, int episodeNumber)
{
return Query.SingleOrDefault(s => s.SeriesId == seriesId && s.SeasonNumber == season && s.EpisodeNumber == episodeNumber);
@ -89,20 +80,11 @@ namespace NzbDrone.Core.Tv
return pagingSpec;
}
public Episode GetEpisodeBySceneNumbering(int seriesId, int seasonNumber, int episodeNumber)
{
return Query.Single(s => s.SeriesId == seriesId && s.SceneSeasonNumber == seasonNumber && s.SceneEpisodeNumber == episodeNumber);
}
public Episode FindEpisodeBySceneNumbering(int seriesId, int seasonNumber, int episodeNumber)
{
return Query.SingleOrDefault(s => s.SeriesId == seriesId && s.SceneSeasonNumber == seasonNumber && s.SceneEpisodeNumber == episodeNumber);
}
public List<Episode> EpisodesWithFiles()
{
return Query.Where(s => s.EpisodeFileId != 0).ToList();
}
public List<Episode> EpisodesBetweenDates(DateTime startDate, DateTime endDate)
{

@ -6,7 +6,6 @@ using NzbDrone.Common.Instrumentation;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Messaging;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Tv.Events;
@ -15,7 +14,6 @@ namespace NzbDrone.Core.Tv
public interface IEpisodeService
{
Episode GetEpisode(int id);
Episode GetEpisode(int seriesId, int seasonNumber, int episodeNumber, bool useScene = false);
Episode FindEpisode(int seriesId, int seasonNumber, int episodeNumber, bool useScene = false);
Episode GetEpisode(int seriesId, DateTime date);
Episode FindEpisode(int seriesId, DateTime date);
@ -23,9 +21,7 @@ namespace NzbDrone.Core.Tv
List<Episode> GetEpisodesBySeason(int seriesId, int seasonNumber);
PagingSpec<Episode> EpisodesWithoutFiles(PagingSpec<Episode> pagingSpec);
List<Episode> GetEpisodesByFileId(int episodeFileId);
List<Episode> EpisodesWithFiles();
void UpdateEpisode(Episode episode);
List<int> GetEpisodeNumbersBySeason(int seriesId, int seasonNumber);
void SetEpisodeMonitored(int episodeId, bool monitored);
bool IsFirstOrLastEpisodeOfSeason(int episodeId);
void UpdateEpisodes(List<Episode> episodes);
@ -42,8 +38,6 @@ namespace NzbDrone.Core.Tv
IHandleAsync<SeriesDeletedEvent>
{
private static readonly Logger logger = NzbDroneLogger.GetLogger();
private readonly IEpisodeRepository _episodeRepository;
private readonly IConfigService _configService;
private readonly Logger _logger;
@ -60,15 +54,6 @@ namespace NzbDrone.Core.Tv
return _episodeRepository.Get(id);
}
public Episode GetEpisode(int seriesId, int seasonNumber, int episodeNumber, bool useSceneNumbering = false)
{
if (useSceneNumbering)
{
return _episodeRepository.GetEpisodeBySceneNumbering(seriesId, seasonNumber, episodeNumber);
}
return _episodeRepository.Find(seriesId, seasonNumber, episodeNumber);
}
public Episode FindEpisode(int seriesId, int seasonNumber, int episodeNumber, bool useSceneNumbering = false)
{
if (useSceneNumbering)
@ -110,27 +95,17 @@ namespace NzbDrone.Core.Tv
return _episodeRepository.GetEpisodeByFileId(episodeFileId);
}
public List<Episode> EpisodesWithFiles()
{
return _episodeRepository.EpisodesWithFiles();
}
public void UpdateEpisode(Episode episode)
{
_episodeRepository.Update(episode);
}
public List<int> GetEpisodeNumbersBySeason(int seriesId, int seasonNumber)
{
return GetEpisodesBySeason(seriesId, seasonNumber).Select(c => c.Id).ToList();
}
public void SetEpisodeMonitored(int episodeId, bool monitored)
{
var episode = _episodeRepository.Get(episodeId);
_episodeRepository.SetMonitoredFlat(episode, monitored);
logger.Debug("Monitored flag for Episode:{0} was set to {1}", episodeId, monitored);
_logger.Debug("Monitored flag for Episode:{0} was set to {1}", episodeId, monitored);
}
public void SetEpisodeMonitoredBySeason(int seriesId, int seasonNumber, bool monitored)

@ -1,27 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging;
using NzbDrone.Core.Messaging.Events;
namespace NzbDrone.Core.Tv
{
public interface ISeasonRepository : IBasicRepository<Series>
{
List<Season> GetSeasonBySeries(int seriesId);
}
public class SeasonRepository : BasicRepository<Series>, ISeasonRepository
{
public SeasonRepository(IDatabase database, IEventAggregator eventAggregator)
: base(database, eventAggregator)
{
}
public List<Season> GetSeasonBySeries(int seriesId)
{
return Query.Single(s => s.Id == seriesId).Seasons;
}
}
}

@ -11,13 +11,10 @@ namespace NzbDrone.Core.Tv
public interface ISeriesRepository : IBasicRepository<Series>
{
bool SeriesPathExists(string path);
List<Series> Search(string title);
Series FindByTitle(string cleanTitle);
Series FindByTvdbId(int tvdbId);
Series FindByTvRageId(int tvRageId);
void SetSeriesType(int seriesId, SeriesTypes seriesTypes);
Series FindBySlug(string slug);
List<String> GetSeriesPaths();
}
public class SeriesRepository : BasicRepository<Series>, ISeriesRepository
@ -32,11 +29,6 @@ namespace NzbDrone.Core.Tv
return Query.Any(c => c.Path == path);
}
public List<Series> Search(string title)
{
return Query.Where(s => s.Title.Contains(title));
}
public Series FindByTitle(string cleanTitle)
{
return Query.SingleOrDefault(s => s.CleanTitle.Equals(cleanTitle, StringComparison.InvariantCultureIgnoreCase));
@ -56,15 +48,5 @@ namespace NzbDrone.Core.Tv
{
SetFields(new Series { Id = seriesId, SeriesType = seriesType }, s => s.SeriesType);
}
public Series FindBySlug(string slug)
{
return Query.SingleOrDefault(c => c.TitleSlug == slug.ToLower());
}
public List<string> GetSeriesPaths()
{
return Query.Select(s => s.Path).ToList();
}
}
}
Loading…
Cancel
Save