1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +01:00

removed dead code.

This commit is contained in:
kay.one 2013-09-16 22:16:16 -07:00
parent 3d71c129eb
commit 0794affae0
13 changed files with 5 additions and 126 deletions

View File

@ -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;

View File

@ -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;

View File

@ -8,7 +8,6 @@
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;

View File

@ -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 @@ public MediaFileRepository(IDatabase database, IEventAggregator eventAggregator)
{
}
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 @@ public List<EpisodeFile> GetFilesBySeason(int seriesId, int seasonNumber)
.ToList();
}
public bool Exists(string path)
{
return Query.Any(c => c.Path == path);
}
}
}

View File

@ -14,8 +14,6 @@ public interface IMediaFileService
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 @@ public void Delete(EpisodeFile episodeFile, bool forUpgrade = false)
_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);

View File

@ -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" />

View File

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

View File

@ -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;

View File

@ -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 @@ public virtual void Update(QualitySize qualitySize)
_qualitySizeRepository.Update(qualitySize);
}
public virtual void UpdateAll(List<QualitySize> qualitySizes)
{
_qualitySizeRepository.UpdateMany(qualitySizes);
}
public virtual List<QualitySize> All()
{

View File

@ -3,7 +3,6 @@
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 @@ public interface IEpisodeRepository : IBasicRepository<Episode>
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 @@ public EpisodeRepository(IDatabase database, IEventAggregator eventAggregator)
_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 @@ public PagingSpec<Episode> EpisodesWithoutFiles(PagingSpec<Episode> pagingSpec,
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)
{

View File

@ -6,7 +6,6 @@
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 @@ public interface IEpisodeService
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 @@ public class EpisodeService : IEpisodeService,
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 @@ public Episode GetEpisode(int id)
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 @@ public List<Episode> GetEpisodesByFileId(int episodeFileId)
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)

View File

@ -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;
}
}
}

View File

@ -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 @@ public bool SeriesPathExists(string path)
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 @@ public void SetSeriesType(int seriesId, SeriesTypes seriesType)
{
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();
}
}
}