本文整理汇总了C#中NzbDrone.Core.Repository.Series类的典型用法代码示例。如果您正苦于以下问题:C# Series类的具体用法?C# Series怎么用?C# Series使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Series类属于NzbDrone.Core.Repository命名空间,在下文中一共展示了Series类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Setup
public void Setup()
{
_series = Builder<Series>
.CreateNew()
.With(s => s.Title = "Hawaii Five-0")
.Build();
}
示例2: Setup
public void Setup()
{
_series = Builder<Series>
.CreateNew()
.Build();
_episode = Builder<Episode>
.CreateNew()
.With(e => e.SeriesId = _series.SeriesId)
.With(e => e.Series = _series)
.Build();
_episodes = Builder<Episode>
.CreateListOfSize(10)
.All()
.With(e => e.SeriesId = _series.SeriesId)
.With(e => e.Series = _series)
.Build()
.ToList();
_parseResults = Builder<EpisodeParseResult>
.CreateListOfSize(10)
.Build();
_indexer1 = new Mock<IndexerBase>();
_indexer2 = new Mock<IndexerBase>();
_indexers = new List<IndexerBase> { _indexer1.Object, _indexer2.Object };
Mocker.GetMock<IndexerProvider>()
.Setup(c => c.GetEnabledIndexers())
.Returns(_indexers);
}
示例3: MapIt
public EpisodeFile MapIt(EpisodeFile episodeFile, Series series, Episode episode)
{
// Terminating call. Since we can return null from this function
// we need to be ready for PetaPoco to callback later with null
// parameters
if (episodeFile == null)
return _current;
// Is this the same EpisodeFile as the current one we're processing
if (_current != null && _current.EpisodeFileId == episodeFile.EpisodeFileId)
{
// Yes, just add this post to the current EpisodeFiles's collection of Episodes
_current.Episodes.Add(episode);
// Return null to indicate we're not done with this EpisodeFiles yet
return null;
}
// This is a different EpisodeFile to the current one, or this is the
// first time through and we don't have an EpisodeFile yet
// Save the current EpisodeFile
var prev = _current;
// Setup the new current EpisodeFile
_current = episodeFile;
_current.Episodes = new List<Episode>();
_current.Episodes.Add(episode);
_current.Series = series;
// Return the now populated previous EpisodeFile (or null if first time through)
return prev;
}
示例4: FinalizeSearch
protected override void FinalizeSearch(Series series, dynamic options, Boolean reportsFound, ProgressNotification notification)
{
logger.Warn("Unable to find {0} in any of indexers.", options.Episode);
notification.CurrentMessage = reportsFound ? String.Format("Sorry, couldn't find {0}, that matches your preferences.", options.Episode.AirDate)
: String.Format("Sorry, couldn't find {0} in any of indexers.", options.Episode);
}
示例5: Setup
public void Setup()
{
WithRealDb();
episodes = Builder<Episode>.CreateListOfSize(6)
.All()
.With(e => e.SeriesId = 1)
.With(e => e.Ignored = false)
.TheFirst(1)
.With(e => e.AirDate = DateTime.Today.AddDays(-1))
.TheNext(1)
.With(e => e.AirDate = DateTime.Today)
.TheNext(1)
.With(e => e.AirDate = DateTime.Today.AddDays(1))
.TheNext(1)
.With(e => e.AirDate = DateTime.Today.AddDays(2))
.TheNext(1)
.With(e => e.AirDate = DateTime.Today.AddDays(7))
.TheNext(1)
.With(e => e.AirDate = DateTime.Today.AddDays(9))
.Build();
series = Builder<Series>.CreateNew()
.With(s => s.SeriesId = 1)
.And(c => c.Monitored = true)
.Build();
Db.InsertMany(episodes);
Db.Insert(series);
}
示例6: PerformSearch
public override List<EpisodeParseResult> PerformSearch(Series series, dynamic options, ProgressNotification notification)
{
if (options.Episode == null)
throw new ArgumentException("Episode is invalid");
notification.CurrentMessage = "Looking for " + options.Episode;
var reports = new List<EpisodeParseResult>();
var title = GetSearchTitle(series);
Parallel.ForEach(_indexerProvider.GetEnabledIndexers(), indexer =>
{
try
{
reports.AddRange(indexer.FetchDailyEpisode(title, options.Episode.AirDate));
}
catch (Exception e)
{
logger.ErrorException(String.Format("An error has occurred while searching for {0} - {1:yyyy-MM-dd} from: {2}",
series.Title, options.Episode.AirDate, indexer.Name), e);
}
});
return reports;
}
示例7: Search
public virtual List<Int32> Search(Series series, dynamic options, ProgressNotification notification)
{
if (options == null)
throw new ArgumentNullException(options);
var searchResult = new SearchHistory
{
SearchTime = DateTime.Now,
SeriesId = series.SeriesId,
EpisodeId = options.GetType().GetProperty("Episode") != null ? options.Episode.EpisodeId : null,
SeasonNumber = options.GetType().GetProperty("SeasonNumber") != null ? options.SeasonNumber : null
};
List<EpisodeParseResult> reports = PerformSearch(series, options, notification);
logger.Debug("Finished searching all indexers. Total {0}", reports.Count);
notification.CurrentMessage = "Processing search results";
ProcessReports(series, options, reports, searchResult, notification);
_searchHistoryProvider.Add(searchResult);
if(searchResult.Successes.Any())
return searchResult.Successes;
FinalizeSearch(series, options, reports.Any(), notification);
return new List<Int32>();
}
示例8: RefreshMetadata
private void RefreshMetadata(ProgressNotification notification, Series series)
{
notification.CurrentMessage = String.Format("Refreshing episode metadata for '{0}'", series.Title);
Logger.Debug("Getting episodes from database for series: {0}", series.SeriesId);
var episodeFiles = _mediaFileProvider.GetSeriesFiles(series.SeriesId);
if (episodeFiles == null || episodeFiles.Count == 0)
{
Logger.Warn("No episodes in database found for series: {0}", series.SeriesId);
return;
}
try
{
_metadataProvider.CreateForEpisodeFiles(episodeFiles.ToList());
}
catch (Exception e)
{
Logger.WarnException("An error has occurred while refreshing episode metadata", e);
}
notification.CurrentMessage = String.Format("Epsiode metadata refresh completed for {0}", series.Title);
}
示例9: Setup
public void Setup()
{
_series = Builder<Series>
.CreateNew()
.With(s => s.IsDaily = false)
.Build();
}
示例10: Setup
public void Setup()
{
_customStartDateSpecification = Mocker.Resolve<CustomStartDateSpecification>();
firstEpisode = new Episode { AirDate = DateTime.Today };
secondEpisode = new Episode { AirDate = DateTime.Today };
fakeSeries = Builder<Series>.CreateNew()
.With(c => c.Monitored = true)
.With(c => c.CustomStartDate = null)
.Build();
parseResultMulti = new EpisodeParseResult
{
SeriesTitle = "Title",
Series = fakeSeries,
EpisodeNumbers = new List<int> { 3, 4 },
SeasonNumber = 12,
Episodes = new List<Episode> { firstEpisode, secondEpisode }
};
parseResultSingle = new EpisodeParseResult
{
SeriesTitle = "Title",
Series = fakeSeries,
EpisodeNumbers = new List<int> { 3 },
SeasonNumber = 12,
Episodes = new List<Episode> { firstEpisode }
};
}
示例11: Setup
public void Setup()
{
fakeSeries = Builder<Series>.CreateNew().Build();
fakeDailySeries = Builder<Series>.CreateNew()
.With(c => c.IsDaily = true)
.Build();
fakeEpisode = Builder<Episode>.CreateNew()
.With(e => e.SeriesId = fakeSeries.SeriesId)
.With(e => e.Title = "Episode (1)")
.Build();
fakeEpisode2 = Builder<Episode>.CreateNew()
.With(e => e.SeriesId = fakeSeries.SeriesId)
.With(e => e.SeasonNumber = fakeEpisode.SeasonNumber)
.With(e => e.EpisodeNumber = fakeEpisode.EpisodeNumber + 1)
.With(e => e.Title = "Episode (2)")
.Build();
fakeDailyEpisode = Builder<Episode>.CreateNew()
.With(e => e.SeriesId = fakeSeries.SeriesId)
.With(e => e.AirDate = DateTime.Now.Date)
.With(e => e.Title = "Daily Episode 1")
.Build();
WithRealDb();
episodeProvider = Mocker.Resolve<EpisodeProvider>();
}
示例12: Setup
public void Setup()
{
_series = Builder<Series>
.CreateNew()
.With(s => s.Title = "Scandal (2012)")
.Build();
}
示例13: OnDownload
public override void OnDownload(string message, Series series)
{
if (_configProvider.TwitterNotifyOnDownload)
{
_logger.Trace("Sending Notification to Twitter (On Grab)");
_twitterProvider.SendTweet("Download Completed: " + message);
}
}
示例14: Update
public virtual void Update(Series series)
{
//Use Json for Eden/Nightly or depricated HTTP for 10.x (Dharma) to get the proper path
//Perform update with EventServer (Json currently doesn't support updating a specific path only - July 2011)
var username = _configProvider.XbmcUsername;
var password = _configProvider.XbmcPassword;
foreach (var host in _configProvider.XbmcHosts.Split(','))
{
Logger.Trace("Determining version of XBMC Host: {0}", host);
var version = GetJsonVersion(host, username, password);
//If Dharma
if (version == 2)
{
//Check for active player only when we should skip updates when playing
if (!_configProvider.XbmcUpdateWhenPlaying)
{
Logger.Trace("Determining if there are any active players on XBMC host: {0}", host);
var activePlayers = GetActivePlayersDharma(host, username, password);
//If video is currently playing, then skip update
if(activePlayers["video"])
{
Logger.Debug("Video is currently playing, skipping library update");
continue;
}
}
UpdateWithHttp(series, host, username, password);
}
//If Eden or newer (attempting to make it future compatible)
else if (version >= 3)
{
//Check for active player only when we should skip updates when playing
if (!_configProvider.XbmcUpdateWhenPlaying)
{
Logger.Trace("Determining if there are any active players on XBMC host: {0}", host);
var activePlayers = GetActivePlayersEden(host, username, password);
//If video is currently playing, then skip update
if(activePlayers.Any(a => a.Type.Equals("video")))
{
Logger.Debug("Video is currently playing, skipping library update");
continue;
}
}
UpdateWithJson(series, host, username, password);
}
//Log Version zero if check failed
else
Logger.Trace("Unknown version: [{0}], skipping.", version);
}
}
示例15: Setup
public void Setup()
{
WithTempAsAppPath();
series = Builder<Series>
.CreateNew()
.With(s => s.SeriesId == 79488)
.With(s => s.Title == "30 Rock")
.Build();
episodeFile = Builder<EpisodeFile>.CreateNew()
.With(f => f.SeriesId = 79488)
.With(f => f.SeasonNumber = 1)
.With(f => f.Path = @"C:\Test\30 Rock\Season 01\30 Rock - S01E01 - Pilot.avi")
.Build();
var tvdbEpisodes = Builder<TvdbEpisode>.CreateListOfSize(2)
.All()
.With(e => e.SeriesId = 79488)
.With(e => e.SeasonNumber = 1)
.With(e => e.Directors = new List<string>{ "Fake Director" })
.With(e => e.Writer = new List<string>{ "Fake Writer" })
.With(e => e.GuestStars = new List<string> { "Guest Star 1", "Guest Star 2", "Guest Star 3", "" })
.Build();
var seasonBanners = Builder<TvdbSeasonBanner>
.CreateListOfSize(4)
.TheFirst(2)
.With(b => b.Season = 1)
.TheLast(2)
.With(b => b.Season = 2)
.TheFirst(1)
.With(b => b.BannerType = TvdbSeasonBanner.Type.season)
.With(b => b.BannerPath = "seasons/79488-1-1.jpg")
.TheNext(2)
.With(b => b.BannerType = TvdbSeasonBanner.Type.seasonwide)
.With(b => b.BannerPath = "banners/seasons/79488-test.jpg")
.TheLast(1)
.With(b => b.BannerType = TvdbSeasonBanner.Type.season)
.With(b => b.BannerPath = "seasons/79488-2-1.jpg")
.Build();
var seriesActors = Builder<TvdbActor>
.CreateListOfSize(5)
.All()
.With(a => a.ActorImage = Builder<TvdbActorBanner>.CreateNew().Build())
.Build();
tvdbSeries = Builder<TvdbSeries>
.CreateNew()
.With(s => s.Id = 79488)
.With(s => s.SeriesName = "30 Rock")
.With(s => s.TvdbActors = seriesActors.ToList())
.With(s => s.Episodes = tvdbEpisodes.ToList())
.Build();
tvdbSeries.Banners.AddRange(seasonBanners);
}