add series works again, now includes title.

This commit is contained in:
Keivan Beigi 2013-02-25 19:58:57 -08:00
parent 9ed7c03d48
commit 94daf08361
80 changed files with 303 additions and 284 deletions

1
.gitignore vendored
View File

@ -134,3 +134,4 @@ UpdateLogs/
*.userprefs
*/test-results/*
.idea/*
NzbDrone.Web/*

View File

@ -40,7 +40,7 @@ namespace NzbDrone.Api
//Series
Mapper.CreateMap<Core.Tv.Series, SeriesResource>()
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.OID))
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Id))
.ForMember(dest => dest.CustomStartDate, opt => opt.ResolveUsing<NullableDatetimeToString>().FromMember(src => src.CustomStartDate))
.ForMember(dest => dest.BacklogSetting, opt => opt.MapFrom(src => (Int32)src.BacklogSetting))
.ForMember(dest => dest.NextAiring, opt => opt.ResolveUsing<NextAiringResolver>());

View File

@ -59,7 +59,7 @@ namespace NzbDrone.Api.Series
//(we can just create the folder and it won't blow up if it already exists)
//We also need to remove any special characters from the filename before attempting to create it
_seriesService.AddSeries("", request.Path, request.OID, request.QualityProfileId, null);
_seriesService.AddSeries(request.Title, request.Path, request.TvDbId, request.QualityProfileId, null);
_jobProvider.QueueJob(typeof(ImportNewSeriesJob));
return new Response { StatusCode = HttpStatusCode.Created };
@ -89,7 +89,7 @@ namespace NzbDrone.Api.Series
_seriesRepository.Update(series);
if (oldPath != series.Path)
_jobProvider.QueueJob(typeof(DiskScanJob), new { SeriesId = series.OID });
_jobProvider.QueueJob(typeof(DiskScanJob), new { SeriesId = series.Id });
_seriesRepository.Update(series);
@ -117,7 +117,7 @@ namespace NzbDrone.Api.Series
{
RuleSet("POST", () =>
{
RuleFor(s => ((ModelBase)s).OID).GreaterThan(0);
RuleFor(s => ((ModelBase)s).Id).GreaterThan(0);
RuleFor(s => s.Path).NotEmpty().Must(_diskProvider.FolderExists);
RuleFor(s => s.QualityProfileId).GreaterThan(0);
});

View File

@ -1,5 +1,9 @@
<div class="line row folder-match-result-view">
<a href="http://thetvdb.com/?tab=series&id={{id}}" target="_blank" class="icon-info-sign"></a>
<span>{{seriesName}} {{seriesYear}}</span>
<span class="icon-plus pull-right btn btn-success x-btn-add"></span>
<div class="span6">
{{title}} {{seriesYear}}
</div>
<div class="btn btn-success x-btn-add">
<icon class="icon-plus "></icon>
</div>
</div>

View File

@ -15,13 +15,13 @@ define([
var self = this;
var seriesId = this.model.get('id');
var title = this.model.get('seriesName');
var seriesId = this.model.get('tvDbId');
var title = this.model.get('title');
var quality = this.options.qualityProfile.val();
var path = this.options.folder.path;
var model = new NzbDrone.Series.SeriesModel({
seriesId:seriesId,
tvDbId: seriesId,
title:title,
qualityProfileId:quality,
path:path
@ -34,6 +34,7 @@ define([
model.save(undefined, {
success:function () {
var notificationModel = new NzbDrone.Shared.NotificationModel({
tvDbId: seriesId,
title:'Added',
message:title,
level:'success'

View File

@ -11,7 +11,7 @@
<icon class="icon-search "></icon>
</div>
<div class="row">
<div class="x-folder-name-match-results span11" />
<div class="x-folder-name-match-results folder-name-matches span11" />
</div>
</div>

View File

@ -1,9 +1,9 @@
<div class="accordion-group">
<div class="accordion-heading">
<a href="http://thetvdb.com/?tab=series&id={{id}}" target="_blank" class="icon-info-sign pull-left"></a>
<a class="accordion-toggle" data-toggle="collapse" href="#{{id}}">{{seriesName}} {{seriesYear}}</a>
<a href="http://thetvdb.com/?tab=series&id={{tvDbId}}" target="_blank" class="icon-info-sign pull-left"></a>
<a class="accordion-toggle" data-toggle="collapse" href="#{{tvDbId}}">{{title}} {{seriesYear}}</a>
</div>
<div id="{{id}}" class="accordion-body collapse">
<div id="{{tvDbId}}" class="accordion-body collapse">
<div class="accordion-inner">
<select class="span7 x-root-folder">
{{#each rootFolders.models}}

View File

@ -1,6 +1,6 @@
'use strict';
define(['app','Shared/NotificationCollection', 'AddSeries/SearchResultCollection', 'AddSeries/SearchResultModel', 'Series/SeriesCollection'], function (app,notificationCollection) {
define(['app', 'Shared/NotificationCollection', 'AddSeries/SearchResultCollection', 'AddSeries/SearchResultModel', 'Series/SeriesCollection'], function (app, notificationCollection) {
NzbDrone.AddSeries.New.SearchItemView = Backbone.Marionette.ItemView.extend({
@ -23,8 +23,8 @@ define(['app','Shared/NotificationCollection', 'AddSeries/SearchResultCollection
add: function () {
var seriesId = this.model.get('id');
var title = this.model.get('seriesName');
var seriesId = this.model.get('tvDbId');
var title = this.model.get('title');
var quality = this.ui.qualityProfile.val();
var rootFolderId = this.ui.rootFolder.val();
@ -33,7 +33,7 @@ define(['app','Shared/NotificationCollection', 'AddSeries/SearchResultCollection
var path = rootPath + "\\" + title;
var model = new NzbDrone.Series.SeriesModel({
seriesId: seriesId,
tvdbId: seriesId,
title: title,
qualityProfileId: quality,
path: path

View File

@ -7,7 +7,7 @@
var date = Date.utc.create(this.get('firstAired')).format('({yyyy})');
//don't append year, if the series name already has the name appended.
if (this.get('seriesName').endsWith(date)) {
if (this.get('title').endsWith(date)) {
return "";
} else {
return date;

View File

@ -21,12 +21,12 @@ namespace NzbDrone.Core.Test.Datastore
{
childModel = Builder<ChildModel>
.CreateNew()
.With(s => s.OID = 0)
.With(s => s.Id = 0)
.Build();
ParentModel = Builder<ParentModel>
.CreateNew()
.With(e => e.OID = 0)
.With(e => e.Id = 0)
.Build();
}
@ -48,7 +48,7 @@ namespace NzbDrone.Core.Test.Datastore
[Test]
public void update_item_with_root_index_0_should_faile()
{
childModel.OID = 0;
childModel.Id = 0;
Assert.Throws<InvalidOperationException>(() => Db.Update(childModel));
}
@ -89,7 +89,7 @@ namespace NzbDrone.Core.Test.Datastore
{
ParentModel.Child = Builder<ChildModel>
.CreateNew()
.With(s => s.OID = 0)
.With(s => s.Id = 0)
.Build();
Db.Insert(ParentModel);
@ -106,19 +106,19 @@ namespace NzbDrone.Core.Test.Datastore
[Test]
public void new_objects_should_get_id()
{
childModel.OID = 0;
childModel.Id = 0;
Db.Insert(childModel);
childModel.OID.Should().NotBe(0);
childModel.Id.Should().NotBe(0);
}
[Test]
public void new_object_should_get_new_id()
{
childModel.OID = 0;
childModel.Id = 0;
Db.Insert(childModel);
Db.AsQueryable<ChildModel>().Should().HaveCount(1);
childModel.OID.Should().Be(1);
childModel.Id.Should().Be(1);
}
@ -131,31 +131,31 @@ namespace NzbDrone.Core.Test.Datastore
Db.Insert(nested);
nested.OID.Should().Be(1);
nested.List.Should().OnlyContain(c => c.OID > 0);
nested.Id.Should().Be(1);
nested.List.Should().OnlyContain(c => c.Id > 0);
}
[Test]
public void should_have_id_when_returned_from_database()
{
childModel.OID = 0;
childModel.Id = 0;
Db.Insert(childModel);
var item = Db.AsQueryable<ChildModel>();
item.Should().HaveCount(1);
item.First().OID.Should().NotBe(0);
item.First().OID.Should().BeLessThan(100);
item.First().OID.Should().Be(childModel.OID);
item.First().Id.Should().NotBe(0);
item.First().Id.Should().BeLessThan(100);
item.First().Id.Should().Be(childModel.Id);
}
[Test]
public void should_be_able_to_find_object_by_id()
{
Db.Insert(childModel);
var item = Db.AsQueryable<ChildModel>().Single(c => c.OID == childModel.OID);
var item = Db.AsQueryable<ChildModel>().Single(c => c.Id == childModel.Id);
item.OID.Should().NotBe(0);
item.OID.Should().Be(childModel.OID);
item.Id.Should().NotBe(0);
item.Id.Should().Be(childModel.Id);
}
[Test]

View File

@ -27,7 +27,7 @@ namespace NzbDrone.Core.Test.Datastore
{
sampleType = Builder<SampleType>
.CreateNew()
.With(c => c.OID = 0)
.With(c => c.Id = 0)
.Build();
}
@ -47,7 +47,7 @@ namespace NzbDrone.Core.Test.Datastore
Subject.Insert(sampleType);
Subject.All().Should().HaveCount(1);
Subject.Delete(sampleType.OID);
Subject.Delete(sampleType.Id);
Subject.All().Should().BeEmpty();
}
@ -55,7 +55,7 @@ namespace NzbDrone.Core.Test.Datastore
public void should_be_able_to_find_by_id()
{
Subject.Insert(sampleType);
Subject.Get(sampleType.OID)
Subject.Get(sampleType.Id)
.ShouldHave()
.AllProperties()
.EqualTo(sampleType);

View File

@ -66,9 +66,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
firstQuality = new QualityModel(QualityTypes.Bluray1080p, true);
secondQuality = new QualityModel(QualityTypes.Bluray1080p, true);
Mocker.GetMock<IHistoryService>().Setup(c => c.GetBestQualityInHistory(fakeSeries.OID, 12, 3)).Returns(firstQuality);
Mocker.GetMock<IHistoryService>().Setup(c => c.GetBestQualityInHistory(fakeSeries.OID, 12, 4)).Returns(secondQuality);
Mocker.GetMock<IHistoryService>().Setup(c => c.GetBestQualityInHistory(fakeSeries.OID, 12, 5)).Returns<QualityModel>(null);
Mocker.GetMock<IHistoryService>().Setup(c => c.GetBestQualityInHistory(fakeSeries.Id, 12, 3)).Returns(firstQuality);
Mocker.GetMock<IHistoryService>().Setup(c => c.GetBestQualityInHistory(fakeSeries.Id, 12, 4)).Returns(secondQuality);
Mocker.GetMock<IHistoryService>().Setup(c => c.GetBestQualityInHistory(fakeSeries.Id, 12, 5)).Returns<QualityModel>(null);
}
private void WithFirstReportUpgradable()
@ -124,7 +124,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
parseResultSingle.Quality = new QualityModel(QualityTypes.WEBDL1080p, false);
firstQuality = new QualityModel(QualityTypes.WEBDL1080p, false);
Mocker.GetMock<IHistoryService>().Setup(c => c.GetBestQualityInHistory(fakeSeries.OID, 12, 3)).Returns(firstQuality);
Mocker.GetMock<IHistoryService>().Setup(c => c.GetBestQualityInHistory(fakeSeries.Id, 12, 3)).Returns(firstQuality);
_upgradeHistory.IsSatisfiedBy(parseResultSingle).Should().BeFalse();
}

View File

@ -39,7 +39,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.Build();
_episode = Builder<Episode>.CreateNew()
.With(e => e.SeriesId = _series.OID)
.With(e => e.SeriesId = _series.Id)
.With(e => e.Series = _series)
.With(e => e.EpisodeFile = _episodeFile)
.Build();

View File

@ -19,7 +19,7 @@ namespace NzbDrone.Core.Test.HistoryTests
{
var historyItem = Builder<History.History>.CreateListOfSize(30)
.All()
.With(c=>c.OID = 0)
.With(c=>c.Id = 0)
.TheFirst(10).With(c => c.Date = DateTime.Now)
.TheNext(20).With(c => c.Date = DateTime.Now.AddDays(-31))
.Build();
@ -46,13 +46,13 @@ namespace NzbDrone.Core.Test.HistoryTests
var series = Builder<Series>.CreateNew().Build();
var episode = Builder<Episode>.CreateNew()
.With(c => c.Series = series)
.With(c => c.SeriesId = series.OID)
.With(c => c.SeriesId = series.Id)
.Build();
var history = Builder<History.History>.CreateNew()
.With(c => c.OID = 0)
.With(c => c.Id = 0)
.With(h => h.Quality = new QualityModel(QualityTypes.Bluray720p, true))
.With(h => h.Episode = episode)
.Build();
@ -73,14 +73,14 @@ namespace NzbDrone.Core.Test.HistoryTests
var series = Builder<Series>.CreateNew().Build();
var episode = Builder<Episode>.CreateNew()
.With(c => c.Series = series)
.With(c => c.SeriesId = series.OID)
.With(c => c.SeriesId = series.Id)
.Build();
var history = Builder<History.History>
.CreateListOfSize(5)
.All()
.With(c => c.OID = 0)
.With(c => c.Id = 0)
.With(h => h.Episode = episode)
.TheFirst(1)
.With(h => h.Quality = new QualityModel(QualityTypes.DVD, true))

View File

@ -40,7 +40,7 @@ namespace NzbDrone.Core.Test.Indexers
Mocker.GetMock<IIndexerRepository>()
.Setup(s => s.All())
.Returns(new List<Indexer> {new Indexer {OID = 1, Type = "", Enable = false, Name = "Fake Indexer"}});
.Returns(new List<Indexer> {new Indexer {Id = 1, Type = "", Enable = false, Name = "Fake Indexer"}});
Subject.GetEnabledIndexers().Should().BeEmpty();
}

View File

@ -21,14 +21,14 @@ namespace NzbDrone.Core.Test.Indexers
{
Mocker.GetMock<INewznabRepository>()
.Setup(s => s.All())
.Returns(new List<NewznabDefinition>{new NewznabDefinition { OID = 1, Name = "", Url = "http://www.nzbdrone.com" }});
.Returns(new List<NewznabDefinition>{new NewznabDefinition { Id = 1, Name = "", Url = "http://www.nzbdrone.com" }});
}
private void WithExisting()
{
Mocker.GetMock<INewznabRepository>()
.Setup(s => s.All())
.Returns(new List<NewznabDefinition> { new NewznabDefinition { OID = 1, Name = "Nzbs.org", Url = "http://nzbs.org" } });
.Returns(new List<NewznabDefinition> { new NewznabDefinition { Id = 1, Name = "Nzbs.org", Url = "http://nzbs.org" } });
}
[Test]

View File

@ -158,7 +158,7 @@ namespace NzbDrone.Core.Test.JobTests
var episodes = Builder<Episode>.CreateListOfSize(5)
.All()
.With(e => e.Series = series)
.With(e => e.SeriesId = series.OID)
.With(e => e.SeriesId = series.Id)
.With(e => e.SeasonNumber = 1)
.Build();
@ -198,7 +198,7 @@ namespace NzbDrone.Core.Test.JobTests
var episodes = Builder<Episode>.CreateListOfSize(10)
.TheFirst(5)
.With(e => e.Series = series)
.With(e => e.SeriesId = series.OID)
.With(e => e.SeriesId = series.Id)
.With(e => e.SeasonNumber = 1)
.TheNext(5)
.With(e => e.Series = series2)

View File

@ -82,10 +82,10 @@ namespace NzbDrone.Core.Test.JobTests
var series = Builder<Series>.CreateNew()
.Build();
Mocker.GetMock<ISeriesRepository>().Setup(s => s.Get(series.OID))
Mocker.GetMock<ISeriesRepository>().Setup(s => s.Get(series.Id))
.Returns(series);
Mocker.Resolve<BannerDownloadJob>().Start(_notification, new { SeriesId = series.OID });
Mocker.Resolve<BannerDownloadJob>().Start(_notification, new { SeriesId = series.Id });
VerifyDownloadMock(1);
}
}

View File

@ -26,12 +26,12 @@ namespace NzbDrone.Core.Test.JobTests
public void series_specific_scan_should_scan_series()
{
var series = Builder<Series>.CreateNew()
.With(s => s.OID = 12)
.With(s => s.Id = 12)
.Build();
Mocker.GetMock<ISeriesRepository>()
.Setup(p => p.Get(series.OID));
.Setup(p => p.Get(series.Id));
Mocker.GetMock<DiskScanProvider>()
@ -39,7 +39,7 @@ namespace NzbDrone.Core.Test.JobTests
.Returns(new List<EpisodeFile>());
//Act
Mocker.Resolve<DiskScanJob>().Start(new ProgressNotification("Test"), new { SeriesId = series.OID });
Mocker.Resolve<DiskScanJob>().Start(new ProgressNotification("Test"), new { SeriesId = series.Id });
//Assert
Mocker.VerifyAllMocks();
@ -51,8 +51,8 @@ namespace NzbDrone.Core.Test.JobTests
public void job_with_no_target_should_scan_all_series()
{
var series = Builder<Series>.CreateListOfSize(2)
.TheFirst(1).With(s => s.OID = 12)
.TheNext(1).With(s => s.OID = 15)
.TheFirst(1).With(s => s.Id = 12)
.TheNext(1).With(s => s.Id = 15)
.Build().ToList();
Mocker.GetMock<ISeriesRepository>()
@ -77,8 +77,8 @@ namespace NzbDrone.Core.Test.JobTests
public void failed_scan_should_not_terminated_job()
{
var series = Builder<Series>.CreateListOfSize(2)
.TheFirst(1).With(s => s.OID = 12)
.TheNext(1).With(s => s.OID = 15)
.TheFirst(1).With(s => s.Id = 12)
.TheNext(1).With(s => s.Id = 15)
.Build().ToList();
Mocker.GetMock<ISeriesRepository>()
@ -104,8 +104,8 @@ namespace NzbDrone.Core.Test.JobTests
public void job_with_no_target_should_scan_series_with_episodes()
{
var series = Builder<Series>.CreateListOfSize(2)
.TheFirst(1).With(s => s.OID = 12)
.TheNext(1).With(s => s.OID = 15)
.TheFirst(1).With(s => s.Id = 12)
.TheNext(1).With(s => s.Id = 15)
.Build().ToList();
Mocker.GetMock<ISeriesRepository>()

View File

@ -26,8 +26,8 @@ namespace NzbDrone.Core.Test.JobTests
{
var series = Builder<Series>.CreateListOfSize(2)
.All().With(s => s.LastInfoSync = null)
.TheFirst(1).With(s => s.OID = 12)
.TheNext(1).With(s => s.OID = 15)
.TheFirst(1).With(s => s.Id = 12)
.TheNext(1).With(s => s.Id = 15)
.Build();
var notification = new ProgressNotification("Test");
@ -40,11 +40,11 @@ namespace NzbDrone.Core.Test.JobTests
Mocker.GetMock<DiskScanJob>()
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)))
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)))
.Callback(() => series[0].LastDiskSync = DateTime.Now);
Mocker.GetMock<DiskScanJob>()
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].OID)))
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].Id)))
.Callback(() => series[1].LastDiskSync = DateTime.Now);
Mocker.GetMock<BannerDownloadJob>()
@ -54,18 +54,18 @@ namespace NzbDrone.Core.Test.JobTests
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") > 0)));
Mocker.GetMock<UpdateInfoJob>()
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)))
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)))
.Callback(() => series[0].LastInfoSync = DateTime.Now);
Mocker.GetMock<UpdateInfoJob>()
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].OID)))
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].Id)))
.Callback(() => series[1].LastInfoSync = DateTime.Now);
Mocker.GetMock<ISeriesRepository>()
.Setup(s => s.Get(series[0].OID)).Returns(series[0]);
.Setup(s => s.Get(series[0].Id)).Returns(series[0]);
Mocker.GetMock<ISeriesRepository>()
.Setup(s => s.Get(series[1].OID)).Returns(series[1]);
.Setup(s => s.Get(series[1].Id)).Returns(series[1]);
Mocker.GetMock<MediaFileProvider>()
.Setup(s => s.GetSeriesFiles(It.IsAny<int>())).Returns(new List<EpisodeFile>());
@ -74,11 +74,11 @@ namespace NzbDrone.Core.Test.JobTests
Mocker.Resolve<ImportNewSeriesJob>().Start(notification, null);
//Assert
Mocker.GetMock<DiskScanJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)), Times.Once());
Mocker.GetMock<DiskScanJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].OID)), Times.Once());
Mocker.GetMock<DiskScanJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)), Times.Once());
Mocker.GetMock<DiskScanJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].Id)), Times.Once());
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)), Times.Once());
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].OID)), Times.Once());
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)), Times.Once());
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].Id)), Times.Once());
}
@ -91,8 +91,8 @@ namespace NzbDrone.Core.Test.JobTests
{
var series = Builder<Series>.CreateListOfSize(2)
.All().With(s => s.LastInfoSync = null)
.TheFirst(1).With(s => s.OID = 12)
.TheNext(1).With(s => s.OID = 15)
.TheFirst(1).With(s => s.Id = 12)
.TheNext(1).With(s => s.Id = 15)
.Build();
var notification = new ProgressNotification("Test");
@ -104,37 +104,37 @@ namespace NzbDrone.Core.Test.JobTests
.Returns(series);
Mocker.GetMock<UpdateInfoJob>()
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)))
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)))
.Callback(() => series[0].LastInfoSync = DateTime.Now);
Mocker.GetMock<UpdateInfoJob>()
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].OID)))
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].Id)))
.Throws(new InvalidOperationException());
Mocker.GetMock<DiskScanJob>()
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)))
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)))
.Callback(() => series[0].LastDiskSync = DateTime.Now);
Mocker.GetMock<BannerDownloadJob>()
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)));
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)));
Mocker.GetMock<ISeriesRepository>()
.Setup(s => s.Get(series[0].OID)).Returns(series[0]);
.Setup(s => s.Get(series[0].Id)).Returns(series[0]);
Mocker.GetMock<MediaFileProvider>()
.Setup(s => s.GetSeriesFiles(It.IsAny<int>())).Returns(new List<EpisodeFile>());
Mocker.GetMock<XemUpdateJob>()
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)));
.Setup(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)));
//Act
Mocker.Resolve<ImportNewSeriesJob>().Start(notification, null);
//Assert
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)), Times.Once());
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].OID)), Times.Once());
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)), Times.Once());
Mocker.GetMock<UpdateInfoJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[1].Id)), Times.Once());
Mocker.GetMock<DiskScanJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].OID)), Times.Once());
Mocker.GetMock<DiskScanJob>().Verify(j => j.Start(notification, It.Is<object>(d => d.GetPropertyValue<int>("SeriesId") == series[0].Id)), Times.Once());
ExceptionVerification.ExpectedErrors(1);

View File

@ -59,7 +59,7 @@ namespace NzbDrone.Core.Test.JobTests
Subject.Init();
var deletedJob = Builder<JobDefinition>.CreateNew()
.With(c => c.OID = 0)
.With(c => c.Id = 0)
.Build();
Db.Insert(deletedJob);
@ -80,7 +80,7 @@ namespace NzbDrone.Core.Test.JobTests
var deletedJob = Builder<JobDefinition>.CreateNew()
.With(c => c.Name = _fakeJob.Name)
.With(c => c.OID = 0)
.With(c => c.Id = 0)
.Build();
@ -99,7 +99,7 @@ namespace NzbDrone.Core.Test.JobTests
{
var oldJob = Builder<JobDefinition>.CreateNew()
.With(c => c.OID = 0)
.With(c => c.Id = 0)
.With(c => c.Name = "OldName")
.With(c => c.TypeName = typeof(FakeJob).ToString())
.With(c => c.Interval = 0)

View File

@ -37,11 +37,11 @@ namespace NzbDrone.Core.Test.JobTests
.Build();
Mocker.GetMock<ISeriesRepository>()
.Setup(s => s.Get(_series.OID))
.Setup(s => s.Get(_series.Id))
.Returns(_series);
Mocker.GetMock<MediaFileProvider>()
.Setup(s => s.GetSeasonFiles(_series.OID, 5))
.Setup(s => s.GetSeasonFiles(_series.Id, 5))
.Returns(_episodeFiles);
}
@ -63,13 +63,13 @@ namespace NzbDrone.Core.Test.JobTests
public void should_throw_if_seasonId_is_less_than_zero()
{
Assert.Throws<ArgumentException>(() =>
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.OID, SeasonNumber = -10 }));
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.Id, SeasonNumber = -10 }));
}
[Test]
public void should_log_warning_if_no_episode_files_are_found()
{
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.OID, SeasonNumber = 10 });
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.Id, SeasonNumber = 10 });
ExceptionVerification.ExpectedWarns(1);
}
@ -77,7 +77,7 @@ namespace NzbDrone.Core.Test.JobTests
[Test]
public void should_return_if_no_episodes_are_moved()
{
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.OID, SeasonNumber = 5 });
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.Id, SeasonNumber = 5 });
Mocker.GetMock<MetadataProvider>().Verify(v => v.RemoveForEpisodeFiles(It.IsAny<List<EpisodeFile>>()), Times.Never());
}
@ -86,7 +86,7 @@ namespace NzbDrone.Core.Test.JobTests
public void should_return_process_metadata_if_files_are_moved()
{
WithMovedFiles();
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.OID, SeasonNumber = 5 });
Mocker.Resolve<RenameSeasonJob>().Start(_testNotification, new { SeriesId = _series.Id, SeasonNumber = 5 });
Mocker.GetMock<MetadataProvider>().Verify(v => v.RemoveForEpisodeFiles(It.IsAny<List<EpisodeFile>>()), Times.Once());
}

View File

@ -30,7 +30,7 @@ namespace NzbDrone.Core.Test.ProviderTests
WithTempAsAppPath();
_series = Builder<Series>.CreateNew()
.With(s => s.OID = 12345)
.With(s => s.Id = 12345)
.Build();
var path = @"C:\Windows\Temp";

View File

@ -81,7 +81,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DiskScanProviderTests
.Build();
var series = Builder<Series>.CreateNew()
.With(s => s.OID = seriesId)
.With(s => s.Id = seriesId)
.With(s => s.Title = "The Office")
.Build();

View File

@ -29,13 +29,13 @@ namespace NzbDrone.Core.Test.ProviderTests.DiskScanProviderTests
public void should_not_move_file_if_source_and_destination_are_the_same_path()
{
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 5)
.With(s => s.Id = 5)
.With(s => s.Title = "30 Rock")
.Build();
var fakeEpisode = Builder<Episode>.CreateListOfSize(1)
.All()
.With(e => e.SeriesId = fakeSeries.OID)
.With(e => e.SeriesId = fakeSeries.Id)
.With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumber = 1)
.Build();
@ -44,12 +44,12 @@ namespace NzbDrone.Core.Test.ProviderTests.DiskScanProviderTests
var fi = new FileInfo(Path.Combine(@"C:\Test\TV\30 Rock\Season 01\", filename + ".avi"));
var file = Builder<EpisodeFile>.CreateNew()
.With(f => f.SeriesId = fakeSeries.OID)
.With(f => f.SeriesId = fakeSeries.Id)
.With(f => f.Path = fi.FullName)
.Build();
Mocker.GetMock<ISeriesRepository>()
.Setup(e => e.Get(fakeSeries.OID))
.Setup(e => e.Get(fakeSeries.Id))
.Returns(fakeSeries);
Mocker.GetMock<IEpisodeService>()
@ -75,13 +75,13 @@ namespace NzbDrone.Core.Test.ProviderTests.DiskScanProviderTests
public void should_use_EpisodeFiles_quality()
{
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 5)
.With(s => s.Id = 5)
.With(s => s.Title = "30 Rock")
.Build();
var fakeEpisode = Builder<Episode>.CreateListOfSize(1)
.All()
.With(e => e.SeriesId = fakeSeries.OID)
.With(e => e.SeriesId = fakeSeries.Id)
.With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumber = 1)
.Build();
@ -92,14 +92,14 @@ namespace NzbDrone.Core.Test.ProviderTests.DiskScanProviderTests
const string message = "30 Rock - 1x01 - [WEBDL]";
var file = Builder<EpisodeFile>.CreateNew()
.With(f => f.SeriesId = fakeSeries.OID)
.With(f => f.SeriesId = fakeSeries.Id)
.With(f => f.Path = currentFilename)
.With(f => f.Quality = QualityTypes.WEBDL720p)
.With(f => f.Proper = false)
.Build();
Mocker.GetMock<ISeriesRepository>()
.Setup(e => e.Get(fakeSeries.OID))
.Setup(e => e.Get(fakeSeries.Id))
.Returns(fakeSeries);
Mocker.GetMock<IEpisodeService>()
@ -127,13 +127,13 @@ namespace NzbDrone.Core.Test.ProviderTests.DiskScanProviderTests
public void should_log_error_and_return_null_when_source_file_does_not_exists()
{
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 5)
.With(s => s.Id = 5)
.With(s => s.Title = "30 Rock")
.Build();
var fakeEpisode = Builder<Episode>.CreateListOfSize(1)
.All()
.With(e => e.SeriesId = fakeSeries.OID)
.With(e => e.SeriesId = fakeSeries.Id)
.With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumber = 1)
.Build();
@ -144,14 +144,14 @@ namespace NzbDrone.Core.Test.ProviderTests.DiskScanProviderTests
const string message = "30 Rock - 1x01 - [WEBDL]";
var file = Builder<EpisodeFile>.CreateNew()
.With(f => f.SeriesId = fakeSeries.OID)
.With(f => f.SeriesId = fakeSeries.Id)
.With(f => f.Path = currentFilename)
.With(f => f.Quality = QualityTypes.WEBDL720p)
.With(f => f.Proper = false)
.Build();
Mocker.GetMock<ISeriesRepository>()
.Setup(e => e.Get(fakeSeries.OID))
.Setup(e => e.Get(fakeSeries.Id))
.Returns(fakeSeries);
Mocker.GetMock<IEpisodeService>()

View File

@ -32,8 +32,8 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadProviderTests
private EpisodeParseResult SetupParseResult()
{
var episodes = Builder<Episode>.CreateListOfSize(2)
.TheFirst(1).With(s => s.OID = 12)
.TheNext(1).With(s => s.OID = 99)
.TheFirst(1).With(s => s.Id = 12)
.TheNext(1).With(s => s.Id = 99)
.All().With(s => s.SeriesId = 5)
.Build().ToList();

View File

@ -97,7 +97,7 @@ namespace NzbDrone.Core.Test.ProviderTests
.Returns(true);
var series = Builder<Series>.CreateNew()
.With(s => s.OID = 12).Build();
.With(s => s.Id = 12).Build();
//Act
Mocker.Resolve<DiskScanProvider>().Scan(series);

View File

@ -39,7 +39,7 @@ namespace NzbDrone.Core.Test.ProviderTests.Metadata
series = Builder<Series>
.CreateNew()
.With(s => s.OID == 79488)
.With(s => s.Id == 79488)
.With(s => s.Title == "30 Rock")
.Build();

View File

@ -37,7 +37,7 @@ namespace NzbDrone.Core.Test.ProviderTests.Metadata
series = Builder<Series>
.CreateNew()
.With(s => s.OID == 79488)
.With(s => s.Id == 79488)
.With(s => s.Title == "30 Rock")
.Build();

View File

@ -72,7 +72,7 @@ namespace NzbDrone.Core.Test.ProviderTests.PostDownloadProviderTests
{
var fakeEpisodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.All()
.With(f => f.SeriesId = fakeSeries.OID)
.With(f => f.SeriesId = fakeSeries.Id)
.Build().ToList();
Mocker.GetMock<DiskScanProvider>().Setup(s => s.Scan(fakeSeries, droppedFolder)).Returns(fakeEpisodeFiles);
@ -224,7 +224,7 @@ namespace NzbDrone.Core.Test.ProviderTests.PostDownloadProviderTests
var fakeEpisodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
.All()
.With(f => f.SeriesId = fakeSeries.OID)
.With(f => f.SeriesId = fakeSeries.Id)
.Build().ToList();
//Act

View File

@ -71,7 +71,7 @@ namespace NzbDrone.Core.Test.ProviderTests.PostDownloadProviderTests
private void WithImportedFile(string file)
{
var fakeEpisodeFile = Builder<EpisodeFile>.CreateNew()
.With(f => f.SeriesId = fakeSeries.OID)
.With(f => f.SeriesId = fakeSeries.Id)
.Build();
Mocker.GetMock<DiskScanProvider>().Setup(s => s.ImportFile(fakeSeries, file)).Returns(fakeEpisodeFile);

View File

@ -138,11 +138,11 @@ namespace NzbDrone.Core.Test.ProviderTests
.All()
.With(s => s.SeriesType = SeriesType.Standard)
.TheFirst(1)
.With(s => s.OID = 10)
.With(s => s.Id = 10)
.TheNext(1)
.With(s => s.OID = 11)
.With(s => s.Id = 11)
.TheNext(1)
.With(s => s.OID = 12)
.With(s => s.Id = 12)
.Build();
Db.InsertMany(fakeSeries);
@ -170,12 +170,12 @@ namespace NzbDrone.Core.Test.ProviderTests
.All()
.With(s => s.SeriesType = SeriesType.Standard)
.TheFirst(1)
.With(s => s.OID = 10)
.With(s => s.Id = 10)
.With(s => s.SeriesType = SeriesType.Daily)
.TheNext(1)
.With(s => s.OID = 11)
.With(s => s.Id = 11)
.TheNext(1)
.With(s => s.OID = 12)
.With(s => s.Id = 12)
.Build();
Db.InsertMany(fakeSeries);

View File

@ -33,7 +33,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.DailyEpisodeSearchTests
_episode = Builder<Episode>
.CreateNew()
.With(e => e.SeriesId = _series.OID)
.With(e => e.SeriesId = _series.Id)
.With(e => e.Series = _series)
.Build();

View File

@ -33,7 +33,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.EpisodeSearchTests
_episode = Builder<Episode>
.CreateNew()
.With(e => e.SeriesId = _series.OID)
.With(e => e.SeriesId = _series.Id)
.With(e => e.Series = _series)
.Build();

View File

@ -29,7 +29,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests
private void WithSceneMapping()
{
Mocker.GetMock<SceneMappingProvider>()
.Setup(s => s.GetSceneName(_series.OID, -1))
.Setup(s => s.GetSceneName(_series.Id, -1))
.Returns("Hawaii Five 0 2010");
}
@ -53,7 +53,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests
public void should_return_season_scene_name_when_one_exists()
{
Mocker.GetMock<SceneMappingProvider>()
.Setup(s => s.GetSceneName(_series.OID, 5))
.Setup(s => s.GetSceneName(_series.Id, 5))
.Returns("Hawaii Five 0 2010 - Season 5");
Mocker.Resolve<TestSearch>().GetSearchTitle(_series, 5)
@ -86,7 +86,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests
_series.Title = input;
Mocker.GetMock<SceneMappingProvider>()
.Setup(s => s.GetSceneName(_series.OID, -1))
.Setup(s => s.GetSceneName(_series.Id, -1))
.Returns("");
Mocker.Resolve<TestSearch>().GetSearchTitle(_series, 5)

View File

@ -34,7 +34,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests.PartialSeasonSearchTests
_episodes = Builder<Episode>
.CreateListOfSize(10)
.All()
.With(e => e.SeriesId = _series.OID)
.With(e => e.SeriesId = _series.Id)
.With(e => e.Series = _series)
.Build()
.ToList();

View File

@ -36,14 +36,14 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests
_episode = Builder<Episode>
.CreateNew()
.With(e => e.SeriesId = _series.OID)
.With(e => e.SeriesId = _series.Id)
.With(e => e.Series = _series)
.Build();
_episodes = Builder<Episode>
.CreateListOfSize(10)
.All()
.With(e => e.SeriesId = _series.OID)
.With(e => e.SeriesId = _series.Id)
.With(e => e.Series = _series)
.Build()
.ToList();

View File

@ -36,12 +36,12 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchTests
public void Setup()
{
_matchingSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 79488)
.With(s => s.Id = 79488)
.With(s => s.Title = "30 Rock")
.Build();
_mismatchedSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 12345)
.With(s => s.Id = 12345)
.With(s => s.Title = "Not 30 Rock")
.Build();

View File

@ -49,7 +49,7 @@ namespace NzbDrone.Core.Test.ProviderTests
var result = tvDbProvider.SearchSeries(title);
result.Should().NotBeEmpty();
result[0].SeriesName.Should().Be(title);
result[0].Title.Should().Be(title);
}

View File

@ -46,11 +46,11 @@ namespace NzbDrone.Core.Test.ProviderTests.TvRageMappingProviderTests
.Build();
Mocker.GetMock<IEpisodeService>()
.Setup(s => s.GetEpisode(_series.OID, 1, 1))
.Setup(s => s.GetEpisode(_series.Id, 1, 1))
.Returns(_episode);
Mocker.GetMock<SceneMappingProvider>()
.Setup(s => s.GetCleanName(_series.OID))
.Setup(s => s.GetCleanName(_series.Id))
.Returns("");
Mocker.GetMock<TvRageProvider>()

View File

@ -43,7 +43,7 @@ namespace NzbDrone.Core.Test.ProviderTests
.Build();
series = Builder<Series>.CreateNew()
.With(s => s.OID = 1)
.With(s => s.Id = 1)
.And(c => c.Monitored = true)
.Build();
@ -71,7 +71,7 @@ namespace NzbDrone.Core.Test.ProviderTests
//Assert
result.Should().HaveCount(5);
result.Should().OnlyContain(c => c.Series != null && c.SeriesId == series.OID);
result.Should().OnlyContain(c => c.Series != null && c.SeriesId == series.Id);
}
[Test]

View File

@ -465,7 +465,7 @@ namespace NzbDrone.Core.Test.ProviderTests
var url = "http://localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(video,smb://xbmc:xbmc@HOMESERVER/TV/30 Rock/))";
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 79488)
.With(s => s.Id = 79488)
.With(s => s.Title = "30 Rock")
.Build();
@ -491,7 +491,7 @@ namespace NzbDrone.Core.Test.ProviderTests
var url = "http://localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(video))";
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 79488)
.With(s => s.Id = 79488)
.With(s => s.Title = "30 Rock")
.Build();
@ -519,7 +519,7 @@ namespace NzbDrone.Core.Test.ProviderTests
var tvshows = "{\"id\":10,\"jsonrpc\":\"2.0\",\"result\":{\"limits\":{\"end\":5,\"start\":0,\"total\":5},\"tvshows\":[{\"file\":\"smb://HOMESERVER/TV/7th Heaven/\",\"imdbnumber\":\"73928\",\"label\":\"7th Heaven\",\"tvshowid\":3},{\"file\":\"smb://HOMESERVER/TV/8 Simple Rules/\",\"imdbnumber\":\"78461\",\"label\":\"8 Simple Rules\",\"tvshowid\":4},{\"file\":\"smb://HOMESERVER/TV/24-7 Penguins-Capitals- Road to the NHL Winter Classic/\",\"imdbnumber\":\"213041\",\"label\":\"24/7 Penguins/Capitals: Road to the NHL Winter Classic\",\"tvshowid\":1},{\"file\":\"smb://HOMESERVER/TV/30 Rock/\",\"imdbnumber\":\"79488\",\"label\":\"30 Rock\",\"tvshowid\":2},{\"file\":\"smb://HOMESERVER/TV/90210/\",\"imdbnumber\":\"82716\",\"label\":\"90210\",\"tvshowid\":5}]}}";
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 79488)
.With(s => s.Id = 79488)
.With(s => s.Title = "30 Rock")
.Build();
@ -552,7 +552,7 @@ namespace NzbDrone.Core.Test.ProviderTests
var tvshows = "{\"id\":10,\"jsonrpc\":\"2.0\",\"result\":{\"limits\":{\"end\":5,\"start\":0,\"total\":5},\"tvshows\":[{\"file\":\"smb://HOMESERVER/TV/7th Heaven/\",\"imdbnumber\":\"73928\",\"label\":\"7th Heaven\",\"tvshowid\":3},{\"file\":\"smb://HOMESERVER/TV/8 Simple Rules/\",\"imdbnumber\":\"78461\",\"label\":\"8 Simple Rules\",\"tvshowid\":4},{\"file\":\"smb://HOMESERVER/TV/24-7 Penguins-Capitals- Road to the NHL Winter Classic/\",\"imdbnumber\":\"213041\",\"label\":\"24/7 Penguins/Capitals: Road to the NHL Winter Classic\",\"tvshowid\":1},{\"file\":\"smb://HOMESERVER/TV/90210/\",\"imdbnumber\":\"82716\",\"label\":\"90210\",\"tvshowid\":5}]}}";
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 79488)
.With(s => s.Id = 79488)
.With(s => s.Title = "30 Rock")
.Build();
@ -585,7 +585,7 @@ namespace NzbDrone.Core.Test.ProviderTests
var tvshows = "{\"id\":10,\"jsonrpc\":\"2.0\",\"result\":{\"limits\":{\"end\":5,\"start\":0,\"total\":5},\"tvshows\":[{\"file\":\"smb://HOMESERVER/TV/7th Heaven/\",\"imdbnumber\":\"73928\",\"label\":\"7th Heaven\",\"tvshowid\":3},{\"file\":\"smb://HOMESERVER/TV/8 Simple Rules/\",\"imdbnumber\":\"78461\",\"label\":\"8 Simple Rules\",\"tvshowid\":4},{\"file\":\"smb://HOMESERVER/TV/24-7 Penguins-Capitals- Road to the NHL Winter Classic/\",\"imdbnumber\":\"213041\",\"label\":\"24/7 Penguins/Capitals: Road to the NHL Winter Classic\",\"tvshowid\":1},{\"file\":\"smb://HOMESERVER/TV/30 Rock/\",\"imdbnumber\":\"79488\",\"label\":\"30 Rock\",\"tvshowid\":2},{\"file\":\"smb://HOMESERVER/TV/90210/\",\"imdbnumber\":\"82716\",\"label\":\"90210\",\"tvshowid\":5}]}}";
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 79488)
.With(s => s.Id = 79488)
.With(s => s.Title = "30 Rock")
.Build();
@ -617,7 +617,7 @@ namespace NzbDrone.Core.Test.ProviderTests
var tvshows = "{\"id\":10,\"jsonrpc\":\"2.0\",\"result\":{\"limits\":{\"end\":5,\"start\":0,\"total\":5},\"tvshows\":[{\"file\":\"smb://HOMESERVER/TV/7th Heaven/\",\"imdbnumber\":\"73928\",\"label\":\"7th Heaven\",\"tvshowid\":3},{\"file\":\"smb://HOMESERVER/TV/8 Simple Rules/\",\"imdbnumber\":\"78461\",\"label\":\"8 Simple Rules\",\"tvshowid\":4},{\"file\":\"smb://HOMESERVER/TV/24-7 Penguins-Capitals- Road to the NHL Winter Classic/\",\"imdbnumber\":\"213041\",\"label\":\"24/7 Penguins/Capitals: Road to the NHL Winter Classic\",\"tvshowid\":1},{\"file\":\"smb://HOMESERVER/TV/90210/\",\"imdbnumber\":\"82716\",\"label\":\"90210\",\"tvshowid\":5}]}}";
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 79488)
.With(s => s.Id = 79488)
.With(s => s.Title = "30 Rock")
.Build();

View File

@ -24,7 +24,7 @@ namespace NzbDrone.Core.Test.RootFolderTests
{
Mocker.GetMock<IBasicRepository<RootFolder>>()
.Setup(s => s.All())
.Returns(new List<RootFolder> { new RootFolder { OID = 1, Path = @"C:\Test\TV" } });
.Returns(new List<RootFolder> { new RootFolder { Id = 1, Path = @"C:\Test\TV" } });
Mocker.GetMock<DiskProvider>()
.Setup(s => s.GetPathRoot(@"C:\Test\TV"))
@ -44,8 +44,8 @@ namespace NzbDrone.Core.Test.RootFolderTests
{
Mocker.GetMock<IBasicRepository<RootFolder>>()
.Setup(s => s.All())
.Returns(new List<RootFolder> { new RootFolder { OID = 1, Path = @"C:\Test\TV" },
new RootFolder { OID = 2, Path = @"C:\Test\TV2" }});
.Returns(new List<RootFolder> { new RootFolder { Id = 1, Path = @"C:\Test\TV" },
new RootFolder { Id = 2, Path = @"C:\Test\TV2" }});
Mocker.GetMock<DiskProvider>()
.Setup(s => s.GetPathRoot(It.IsAny<String>()))
@ -65,8 +65,8 @@ namespace NzbDrone.Core.Test.RootFolderTests
{
Mocker.GetMock<IBasicRepository<RootFolder>>()
.Setup(s => s.All())
.Returns(new List<RootFolder> { new RootFolder { OID = 1, Path = @"C:\Test\TV" },
new RootFolder { OID = 2, Path = @"D:\Test\TV" }});
.Returns(new List<RootFolder> { new RootFolder { Id = 1, Path = @"C:\Test\TV" },
new RootFolder { Id = 2, Path = @"D:\Test\TV" }});
Mocker.GetMock<DiskProvider>()
.Setup(s => s.GetPathRoot(@"C:\Test\TV"))
@ -90,7 +90,7 @@ namespace NzbDrone.Core.Test.RootFolderTests
{
Mocker.GetMock<IBasicRepository<RootFolder>>()
.Setup(s => s.All())
.Returns(new List<RootFolder> { new RootFolder { OID = 1, Path = @"C:\Test\TV" } });
.Returns(new List<RootFolder> { new RootFolder { Id = 1, Path = @"C:\Test\TV" } });
Mocker.GetMock<DiskProvider>()
.Setup(s => s.GetPathRoot(@"C:\Test\TV"))

View File

@ -90,7 +90,7 @@ namespace NzbDrone.Core.Test.RootFolderTests
public void invalid_folder_path_throws_on_add(string path)
{
Assert.Throws<ArgumentException>(() =>
Mocker.Resolve<RootFolderService>().Add(new RootFolder { OID = 0, Path = path })
Mocker.Resolve<RootFolderService>().Add(new RootFolder { Id = 0, Path = path })
);
}

View File

@ -50,7 +50,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
WithRealDb();
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 1)
.With(s => s.Id = 1)
.Build();
var fakeEpisodes = Builder<Episode>.CreateNew()
.With(e => e.SeriesId = 1)
@ -61,7 +61,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
Db.Insert(fakeEpisodes);
//Act
var episode = Mocker.Resolve<EpisodeService>().GetEpisode(fakeSeries.OID, 2, 1);
var episode = Mocker.Resolve<EpisodeService>().GetEpisode(fakeSeries.Id, 2, 1);
//Assert
episode.ShouldHave().AllPropertiesBut(e => e.Series).EqualTo(fakeEpisodes);
@ -128,7 +128,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
WithRealDb();
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 12)
.With(s => s.Id = 12)
.Build();
var episodes = Builder<Episode>.CreateListOfSize(10)
@ -162,7 +162,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
WithRealDb();
@ -196,7 +196,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
WithRealDb();
@ -237,7 +237,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
WithRealDb();
Db.Insert(fakeSeries);
@ -274,7 +274,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
WithRealDb();
@ -313,7 +313,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
WithRealDb();
@ -351,7 +351,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
WithRealDb();
@ -384,7 +384,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
WithRealDb();
@ -417,7 +417,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
WithRealDb();
@ -452,7 +452,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
WithRealDb();
@ -484,7 +484,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.With(c => c.Episodes = new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(5).Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
var currentEpisodes = new List<Episode>();
@ -515,7 +515,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.With(c => c.Episodes = new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(5).Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
var currentEpisodes = new List<Episode>();
foreach (var tvDbEpisode in tvdbSeries.Episodes)
@ -553,7 +553,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
)
.Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
var fakeEpisodeList = new List<Episode> { new Episode { TvDbEpisodeId = 99, SeasonNumber = 10, EpisodeNumber = 10, Series = fakeSeries } };
Mocker.GetMock<IDatabase>()
@ -595,7 +595,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
Mocker.GetMock<TvDbProvider>(MockBehavior.Strict)
.Setup(c => c.GetSeries(seriesId, true, false))
@ -621,7 +621,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.With(c => c.Episodes = new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(5).Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
var currentEpisodes = new List<Episode>();
foreach (var tvDbEpisode in tvdbSeries.Episodes)
@ -629,7 +629,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
currentEpisodes.Add(new Episode
{
TvDbEpisodeId = tvDbEpisode.Id,
OID = 99,
Id = 99,
EpisodeFile = new EpisodeFile { EpisodeFileId = 69 },
Ignored = true,
Series = fakeSeries,
@ -657,7 +657,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
//Assert
updatedEpisodes.Should().HaveSameCount(tvdbSeries.Episodes);
updatedEpisodes.Should().OnlyContain(c => c.OID == 99);
updatedEpisodes.Should().OnlyContain(c => c.Id == 99);
updatedEpisodes.Should().OnlyContain(c => c.EpisodeFileId == 69);
updatedEpisodes.Should().OnlyContain(c => c.Ignored == true);
}
@ -670,7 +670,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.With(c => c.Episodes = new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(5).Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
var currentEpisodes = new List<Episode>();
foreach (var tvDbEpisode in tvdbSeries.Episodes)
@ -678,7 +678,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
currentEpisodes.Add(new Episode
{
TvDbEpisodeId = tvDbEpisode.Id,
OID = 99,
Id = 99,
EpisodeFile = new EpisodeFile { EpisodeFileId = 69 },
Ignored = true,
Series = fakeSeries,
@ -716,7 +716,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.With(c => c.Episodes = new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(5).Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
var currentEpisodes = new List<Episode>();
foreach (var tvDbEpisode in tvdbSeries.Episodes)
@ -724,7 +724,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
currentEpisodes.Add(new Episode
{
TvDbEpisodeId = tvDbEpisode.Id,
OID = 99,
Id = 99,
EpisodeFile = new EpisodeFile { EpisodeFileId = 69 },
Ignored = true,
Series = fakeSeries,
@ -784,7 +784,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
WithRealDb();
@ -1121,7 +1121,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
WithRealDb();
var series = Builder<Series>.CreateNew()
.With(s => s.OID = 10)
.With(s => s.Id = 10)
.Build();
var episodes = Builder<Episode>.CreateListOfSize(4)
@ -1164,7 +1164,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
WithRealDb();
var series = Builder<Series>.CreateNew()
.With(s => s.OID = 10)
.With(s => s.Id = 10)
.Build();
var episodes = Builder<Episode>.CreateListOfSize(4)
@ -1208,7 +1208,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
WithRealDb();
var series = Builder<Series>.CreateNew()
.With(s => s.OID = 10)
.With(s => s.Id = 10)
.Build();
var episodeFile = Builder<EpisodeFile>.CreateNew()
@ -1252,7 +1252,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
WithRealDb();
var series = Builder<Series>.CreateNew()
.With(s => s.OID = 10)
.With(s => s.Id = 10)
.Build();
var episodes = Builder<Episode>.CreateListOfSize(2)
@ -1281,7 +1281,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
WithRealDb();
var series = Builder<Series>.CreateNew()
.With(s => s.OID = 10)
.With(s => s.Id = 10)
.Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(2)
@ -1308,7 +1308,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
WithRealDb();
var series = Builder<Series>.CreateNew()
.With(s => s.OID = 10)
.With(s => s.Id = 10)
.Build();
var fakeEpisode = Builder<Episode>.CreateNew()
@ -1400,7 +1400,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
WithRealDb();
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 12345)
.With(s => s.Id = 12345)
.With(s => s.CleanTitle = "officeus")
.Build();
@ -1417,7 +1417,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
Mocker.GetMock<ISeriesRepository>().Setup(s => s.GetByTitle("officeus")).Returns(fakeSeries);
//Act
Mocker.Resolve<EpisodeService>().SetPostDownloadStatus(fakeEpisodes.Select(e => e.OID).ToList(), postDownloadStatus);
Mocker.Resolve<EpisodeService>().SetPostDownloadStatus(fakeEpisodes.Select(e => e.Id).ToList(), postDownloadStatus);
//Assert
var result = Db.Fetch<Episode>();
@ -1432,7 +1432,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
var postDownloadStatus = PostDownloadStatusType.Failed;
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.OID = 12345)
.With(s => s.Id = 12345)
.With(s => s.CleanTitle = "officeus")
.Build();
@ -1489,7 +1489,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.Build())
).With(c => c.Id = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.OID = seriesId).Build();
var fakeSeries = Builder<Series>.CreateNew().With(c => c.Id = seriesId).Build();
WithRealDb();

View File

@ -36,19 +36,19 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
.Build();
fakeEpisode = Builder<Episode>.CreateNew()
.With(e => e.SeriesId = fakeSeries.OID)
.With(e => e.SeriesId = fakeSeries.Id)
.With(e => e.Title = "Episode (1)")
.Build();
fakeEpisode2 = Builder<Episode>.CreateNew()
.With(e => e.SeriesId = fakeSeries.OID)
.With(e => e.SeriesId = fakeSeries.Id)
.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.OID)
.With(e => e.SeriesId = fakeSeries.Id)
.With(e => e.AirDate = DateTime.Now.Date)
.With(e => e.Title = "Daily Episode 1")
.Build();

View File

@ -32,7 +32,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
{
_episode = Builder<Episode>
.CreateNew()
.With(e => e.SeriesId = _series.OID)
.With(e => e.SeriesId = _series.Id)
.Build();
Db.Insert(_episode);
@ -43,7 +43,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
{
_episode = Builder<Episode>
.CreateNew()
.With(e => e.SeriesId = _series.OID)
.With(e => e.SeriesId = _series.Id)
.Build();
Db.Insert(_episode);
@ -52,14 +52,14 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
[Test]
public void should_return_null_if_no_episodes_in_db()
{
Mocker.Resolve<EpisodeService>().GetEpisodeBySceneNumbering(_series.OID, 1, 1).Should().BeNull();
Mocker.Resolve<EpisodeService>().GetEpisodeBySceneNumbering(_series.Id, 1, 1).Should().BeNull();
}
[Test]
public void should_return_null_if_no_matching_episode_is_found()
{
WithNullSceneNumbering();
Mocker.Resolve<EpisodeService>().GetEpisodeBySceneNumbering(_series.OID, 1, 1).Should().BeNull();
Mocker.Resolve<EpisodeService>().GetEpisodeBySceneNumbering(_series.Id, 1, 1).Should().BeNull();
}
[Test]
@ -68,9 +68,9 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeProviderTests
WithSceneNumbering();
var result = Mocker.Resolve<EpisodeService>()
.GetEpisodeBySceneNumbering(_series.OID, _episode.SceneSeasonNumber, _episode.SceneEpisodeNumber);
.GetEpisodeBySceneNumbering(_series.Id, _episode.SceneSeasonNumber, _episode.SceneEpisodeNumber);
result.OID.Should().Be(_episode.OID);
result.Id.Should().Be(_episode.Id);
}
}
}

View File

@ -33,7 +33,7 @@ namespace NzbDrone.Core.Test.TvTests
var fakeEpisodes = Builder<Episode>.CreateListOfSize(4)
.All()
.With(c => c.SeriesId = fakeSeason.SeriesId)
.With(c => c.SeasonNumber = fakeSeason.OID)
.With(c => c.SeasonNumber = fakeSeason.Id)
.With(c => c.Ignored = !ignoreFlag)
.Build().ToList();

View File

@ -40,7 +40,7 @@ namespace NzbDrone.Core.Datastore
public TModel Get(int id)
{
return Queryable.Single(c => c.OID == id);
return Queryable.Single(c => c.Id == id);
}
public TModel Insert(TModel model)
@ -65,7 +65,7 @@ namespace NzbDrone.Core.Datastore
public TModel Upsert(TModel model)
{
if (model.OID == 0)
if (model.Id == 0)
{
return ObjectDatabase.Insert(model);
}
@ -88,7 +88,7 @@ namespace NzbDrone.Core.Datastore
public void Purge()
{
DeleteMany(Queryable.Select(c => c.OID));
DeleteMany(Queryable.Select(c => c.Id));
}
}
}

View File

@ -4,11 +4,19 @@ using Newtonsoft.Json;
namespace NzbDrone.Core.Datastore
{
[DebuggerDisplay("ID = {OID}")]
[DebuggerDisplay("{GetType()} ID = {Id}")]
public abstract class ModelBase
{
[PetaPoco.Ignore]
[JsonIgnore]
public int Id
{
get { return OID; }
set { OID = value; }
}
[JsonProperty(PropertyName = "id")]
public int OID { get; set; }
private int OID { get; set; }
}
}

View File

@ -22,7 +22,7 @@ namespace PetaPoco
episode.EpisodeFile = (episode.EpisodeFileId == 0 ? null : episodeFile);
// Is this the same season as the current one we're processing
if (_current != null && _current.OID == season.OID)
if (_current != null && _current.Id == season.Id)
{
// Yes, just add this post to the current author's collection of posts
_current.Episodes.Add(episode);

View File

@ -37,7 +37,7 @@ namespace NzbDrone.Core.Datastore
public T Insert<T>(T obj) where T : ModelBase
{
if (obj.OID != 0)
if (obj.Id != 0)
{
throw new InvalidOperationException("Attempted to insert object with existing ID as new object");
}
@ -48,7 +48,7 @@ namespace NzbDrone.Core.Datastore
public T Update<T>(T obj) where T : ModelBase
{
if (obj.OID == 0)
if (obj.Id == 0)
{
throw new InvalidOperationException("Attempted to update object without an ID");
}

View File

@ -57,7 +57,7 @@ namespace NzbDrone.Core.DecisionEngine
//Check if there was only one episode parsed
//and it is the first or last episode of the season
if (subject.EpisodeNumbers != null && subject.EpisodeNumbers.Count == 1 &&
_episodeService.IsFirstOrLastEpisodeOfSeason(series.OID,
_episodeService.IsFirstOrLastEpisodeOfSeason(series.Id,
subject.SeasonNumber, subject.EpisodeNumbers[0]))
{
maxSize = maxSize * 2;

View File

@ -27,7 +27,7 @@ namespace NzbDrone.Core.DecisionEngine
{
foreach (var episode in subject.Episodes)
{
var bestQualityInHistory = _historyService.GetBestQualityInHistory(subject.Series.OID, episode.SeasonNumber, episode.EpisodeNumber);
var bestQualityInHistory = _historyService.GetBestQualityInHistory(subject.Series.Id, episode.SeasonNumber, episode.EpisodeNumber);
if (bestQualityInHistory != null)
{
logger.Trace("Comparing history quality with report. History is {0}", bestQualityInHistory);

View File

@ -20,14 +20,14 @@ namespace NzbDrone.Core.History
public void Trim()
{
var oldIds = Queryable.Where(c => c.Date < DateTime.Now.AddDays(-30).Date).Select(c => c.OID);
var oldIds = Queryable.Where(c => c.Date < DateTime.Now.AddDays(-30).Date).Select(c => c.Id);
DeleteMany(oldIds);
}
public QualityModel GetBestQualityInHistory(int seriesId, int seasonNumber, int episodeNumber)
{
var history = Queryable.OrderByDescending(c => c.Quality).FirstOrDefault(c => c.Episode.Series.OID == seriesId && c.Episode.SeasonNumber == seasonNumber &&
var history = Queryable.OrderByDescending(c => c.Quality).FirstOrDefault(c => c.Episode.Series.Id == seriesId && c.Episode.SeasonNumber == seasonNumber &&
c.Episode.EpisodeNumber == episodeNumber);
if (history != null)

View File

@ -92,7 +92,7 @@ namespace NzbDrone.Core.Indexers
_logger.Debug("Deleting broken Newznab indexer");
var brokenIndexers = currentIndexers.Where(i => String.IsNullOrEmpty(i.Name) || String.IsNullOrWhiteSpace(i.Url)).ToList();
brokenIndexers.ForEach(e => Delete(e.OID));
brokenIndexers.ForEach(e => Delete(e.Id));
currentIndexers = All();

View File

@ -18,7 +18,7 @@ namespace NzbDrone.Core.Instrumentation
public void Trim()
{
var oldIds = Queryable.Where(c => c.Time < DateTime.Now.AddDays(-30).Date).Select(c => c.OID);
var oldIds = Queryable.Where(c => c.Time < DateTime.Now.AddDays(-30).Date).Select(c => c.Id);
DeleteMany(oldIds);
}
}

View File

@ -81,7 +81,7 @@ namespace NzbDrone.Core.Jobs
//Process the list of remaining episodes, 1 by 1
foreach (var episode in individualEpisodes)
{
_episodeSearchJob.Start(notification, new { EpisodeId = episode.OID});
_episodeSearchJob.Start(notification, new { EpisodeId = episode.Id});
}
}

View File

@ -66,7 +66,7 @@ namespace NzbDrone.Core.Jobs
private void ScanSeries(ProgressNotification notification)
{
var syncList = _seriesRepository.All().Where(s => s.LastInfoSync == null && !_attemptedSeries.Contains(s.OID)).ToList();
var syncList = _seriesRepository.All().Where(s => s.LastInfoSync == null && !_attemptedSeries.Contains(s.Id)).ToList();
if (syncList.Count == 0)
{
return;
@ -76,20 +76,20 @@ namespace NzbDrone.Core.Jobs
{
try
{
_attemptedSeries.Add(((ModelBase)currentSeries).OID);
_attemptedSeries.Add(((ModelBase)currentSeries).Id);
notification.CurrentMessage = String.Format("Searching for '{0}'", new DirectoryInfo(currentSeries.Path).Name);
_updateInfoJob.Start(notification, new { SeriesId = ((ModelBase)currentSeries).OID });
_diskScanJob.Start(notification, new { SeriesId = ((ModelBase)currentSeries).OID });
_updateInfoJob.Start(notification, new { SeriesId = ((ModelBase)currentSeries).Id });
_diskScanJob.Start(notification, new { SeriesId = ((ModelBase)currentSeries).Id });
var updatedSeries = _seriesRepository.Get(((ModelBase)currentSeries).OID);
AutoIgnoreSeasons(((ModelBase)updatedSeries).OID);
var updatedSeries = _seriesRepository.Get(((ModelBase)currentSeries).Id);
AutoIgnoreSeasons(((ModelBase)updatedSeries).Id);
//Download the banner for the new series
_bannerDownloadJob.Start(notification, new { SeriesId = ((ModelBase)updatedSeries).OID });
_bannerDownloadJob.Start(notification, new { SeriesId = ((ModelBase)updatedSeries).Id });
//Get Scene Numbering if applicable
_xemUpdateJob.Start(notification, new { SeriesId = ((ModelBase)updatedSeries).OID });
_xemUpdateJob.Start(notification, new { SeriesId = ((ModelBase)updatedSeries).Id });
notification.CurrentMessage = String.Format("{0} was successfully imported", updatedSeries.Title);
}

View File

@ -46,7 +46,7 @@ namespace NzbDrone.Core.Jobs
if (_jobs.All(c => c.GetType().ToString() != currentJob.TypeName))
{
_logger.Debug("Removing job from database '{0}'", currentJob.Name);
Delete(currentJob.OID);
Delete(currentJob.Id);
}
}

View File

@ -45,7 +45,7 @@ namespace NzbDrone.Core.Jobs
Logger.Debug("Processing missing episodes from the past week, count: {0}", missingEpisodes.Count);
foreach (var episode in missingEpisodes)
{
_episodeSearchJob.Start(notification, new { EpisodeId = episode.OID });
_episodeSearchJob.Start(notification, new { EpisodeId = episode.Id });
}
}

View File

@ -45,7 +45,7 @@ namespace NzbDrone.Core.Jobs
Logger.Debug("Processing missing episodes from the last 30 days, count: {0}", missingEpisodes.Count);
foreach (var episode in missingEpisodes)
{
_episodeSearchJob.Start(notification, new { EpisodeId = episode.OID });
_episodeSearchJob.Start(notification, new { EpisodeId = episode.Id });
}
}

View File

@ -58,12 +58,12 @@ namespace NzbDrone.Core.Jobs
{
notification.CurrentMessage = String.Format("Refreshing episode metadata for '{0}'", series.Title);
Logger.Debug("Getting episodes from database for series: {0}", series.OID);
var episodeFiles = _mediaFileProvider.GetSeriesFiles(series.OID);
Logger.Debug("Getting episodes from database for series: {0}", series.Id);
var episodeFiles = _mediaFileProvider.GetSeriesFiles(series.Id);
if (episodeFiles == null || episodeFiles.Count == 0)
{
Logger.Warn("No episodes in database found for series: {0}", series.OID);
Logger.Warn("No episodes in database found for series: {0}", series.Id);
return;
}

View File

@ -58,12 +58,12 @@ namespace NzbDrone.Core.Jobs
{
notification.CurrentMessage = String.Format("Renaming episodes for '{0}'", series.Title);
Logger.Debug("Getting episodes from database for series: {0}", series.OID);
var episodeFiles = _mediaFileProvider.GetSeriesFiles(series.OID);
Logger.Debug("Getting episodes from database for series: {0}", series.Id);
var episodeFiles = _mediaFileProvider.GetSeriesFiles(series.Id);
if (episodeFiles == null || episodeFiles.Count == 0)
{
Logger.Warn("No episodes in database found for series: {0}", series.OID);
Logger.Warn("No episodes in database found for series: {0}", series.Id);
return;
}

View File

@ -68,11 +68,11 @@ namespace NzbDrone.Core.Jobs
if (episodes.Count == successes.Count)
return;
var missingEpisodes = episodes.Select(e => e.OID).Except(successes).ToList();
var missingEpisodes = episodes.Select(e => e.Id).Except(successes).ToList();
foreach (var episode in episodes.Where(e => !e.Ignored && missingEpisodes.Contains(e.OID)).OrderBy(o => o.EpisodeNumber))
foreach (var episode in episodes.Where(e => !e.Ignored && missingEpisodes.Contains(e.Id)).OrderBy(o => o.EpisodeNumber))
{
_episodeSearchJob.Start(notification, new { EpisodeId = episode.OID });
_episodeSearchJob.Start(notification, new { EpisodeId = episode.Id });
}
}
}

View File

@ -74,7 +74,7 @@ namespace NzbDrone.Core.Jobs
try
{
notification.CurrentMessage = "Updating " + series.Title;
_seriesService.UpdateSeriesInfo(series.OID);
_seriesService.UpdateSeriesInfo(series.Id);
_episodeService.RefreshEpisodeInfo(series);
notification.CurrentMessage = "Update completed for " + series.Title;
}

View File

@ -41,7 +41,7 @@ namespace NzbDrone.Core.Providers
logger.Trace("Ensuring Banner Folder exists: ", bannerPath);
_diskProvider.CreateDirectory(bannerPath);
var bannerFilename = Path.Combine(bannerPath, series.OID.ToString()) + ".jpg";
var bannerFilename = Path.Combine(bannerPath, series.Id.ToString()) + ".jpg";
logger.Trace("Downloading banner for '{0}'", series.Title);

View File

@ -70,13 +70,13 @@ namespace NzbDrone.Core.Providers
return new List<EpisodeFile>();
}
if (_episodeService.GetEpisodeBySeries(series.OID).Count == 0)
if (_episodeService.GetEpisodeBySeries(series.Id).Count == 0)
{
Logger.Debug("Series {0} has no episodes. skipping", series.Title);
return new List<EpisodeFile>();
}
var seriesFile = _mediaFileProvider.GetSeriesFiles(series.OID);
var seriesFile = _mediaFileProvider.GetSeriesFiles(series.Id);
CleanUp(seriesFile);
var mediaFileList = GetVideoFiles(path);
@ -158,7 +158,7 @@ namespace NzbDrone.Core.Providers
var episodeFile = new EpisodeFile();
episodeFile.DateAdded = DateTime.Now;
episodeFile.SeriesId = series.OID;
episodeFile.SeriesId = series.Id;
episodeFile.Path = filePath.NormalizePath();
episodeFile.Size = size;
episodeFile.Quality = parseResult.Quality.Quality;
@ -236,7 +236,7 @@ namespace NzbDrone.Core.Providers
_eventAggregator.Publish(new EpisodeDownloadedEvent(parseResult));
foreach (var episode in episodes)
_signalRProvider.UpdateEpisodeStatus(episode.OID, EpisodeStatusType.Ready, parseResult.Quality);
_signalRProvider.UpdateEpisodeStatus(episode.Id, EpisodeStatusType.Ready, parseResult.Quality);
}
return episodeFile;
@ -259,7 +259,7 @@ namespace NzbDrone.Core.Providers
//Set the EpisodeFileId for each episode attached to this file to 0
foreach (var episode in _episodeService.GetEpisodesByFileId(episodeFile.EpisodeFileId))
{
Logger.Trace("Detaching episode {0} from file.", episode.OID);
Logger.Trace("Detaching episode {0} from file.", episode.Id);
episode.EpisodeFile = null;
episode.Ignored = _configService.AutoIgnorePreviouslyDownloadedEpisodes;
episode.GrabDate = null;

View File

@ -32,7 +32,7 @@ namespace NzbDrone.Core.Providers.Metadata
public override void CreateForSeries(Series series, TvdbSeries tvDbSeries)
{
//Create tvshow.nfo, fanart.jpg, folder.jpg and season##.tbn
var episodeGuideUrl = GetEpisodeGuideUrl(series.OID);
var episodeGuideUrl = GetEpisodeGuideUrl(series.Id);
_logger.Debug("Generating tvshow.nfo for: {0}", series.Title);
var sb = new StringBuilder();

View File

@ -91,7 +91,7 @@ namespace NzbDrone.Core.Providers
public virtual void CreateForSeries(Series series)
{
var tvDbSeries = _tvDbProvider.GetSeries(series.OID, false, true);
var tvDbSeries = _tvDbProvider.GetSeries(series.TvDbId, false, true);
CreateForSeries(series, tvDbSeries);
}

View File

@ -57,7 +57,7 @@ namespace NzbDrone.Core.Providers.Search
var searchResult = new SearchHistory
{
SearchTime = DateTime.Now,
SeriesId = series.OID,
SeriesId = series.Id,
EpisodeId = options.GetType().GetProperty("Episode") != null ? options.Episode.EpisodeId : null,
SeasonNumber = options.GetType().GetProperty("SeasonNumber") != null ? options.SeasonNumber : null
};
@ -106,7 +106,7 @@ namespace NzbDrone.Core.Providers.Search
logger.Trace("Analysing report " + episodeParseResult);
episodeParseResult.Series = _seriesRepository.GetByTitle(episodeParseResult.CleanTitle);
if(episodeParseResult.Series == null || ((ModelBase)episodeParseResult.Series).OID != series.OID)
if(episodeParseResult.Series == null || ((ModelBase)episodeParseResult.Series).Id != series.Id)
{
item.SearchError = ReportRejectionType.WrongSeries;
continue;
@ -114,7 +114,7 @@ namespace NzbDrone.Core.Providers.Search
episodeParseResult.Episodes = _episodeService.GetEpisodesByParseResult(episodeParseResult);
if (searchResult.Successes.Intersect(episodeParseResult.Episodes.Select(e => e.OID)).Any())
if (searchResult.Successes.Intersect(episodeParseResult.Episodes.Select(e => e.Id)).Any())
{
item.SearchError = ReportRejectionType.Skipped;
continue;
@ -129,7 +129,7 @@ namespace NzbDrone.Core.Providers.Search
if(item.SearchError == ReportRejectionType.None)
{
if(DownloadReport(notification, episodeParseResult, item))
searchResult.Successes.AddRange(episodeParseResult.Episodes.Select(e => e.OID));
searchResult.Successes.AddRange(episodeParseResult.Episodes.Select(e => e.Id));
}
}
catch(Exception e)
@ -168,12 +168,12 @@ namespace NzbDrone.Core.Providers.Search
public virtual string GetSearchTitle(Series series, int seasonNumber = -1)
{
var seasonTitle = _sceneMappingProvider.GetSceneName(series.OID, seasonNumber);
var seasonTitle = _sceneMappingProvider.GetSceneName(series.Id, seasonNumber);
if(!String.IsNullOrWhiteSpace(seasonTitle))
return seasonTitle;
var title = _sceneMappingProvider.GetSceneName(series.OID);
var title = _sceneMappingProvider.GetSceneName(series.Id);
if (String.IsNullOrWhiteSpace(title))
{

View File

@ -42,7 +42,7 @@ namespace NzbDrone.Core.Providers
{
foreach (var episode in message.ParseResult.Episodes)
{
UpdateEpisodeStatus(episode.OID, EpisodeStatusType.Downloading, message.ParseResult.Quality);
UpdateEpisodeStatus(episode.Id, EpisodeStatusType.Downloading, message.ParseResult.Quality);
}
}
}

View File

@ -4,7 +4,6 @@ using System.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Tvdb;
using TvdbLib;
using TvdbLib.Cache;
using TvdbLib.Data;
@ -36,7 +35,7 @@ namespace NzbDrone.Core.Providers
}
public virtual List<TvdbSeriesSearchItem> SearchSeries(string title)
public virtual List<Series> SearchSeries(string title)
{
logger.Debug("Searching TVDB for '{0}'", title);
@ -45,18 +44,24 @@ namespace NzbDrone.Core.Providers
title = title.Replace(" & ", " ");
}
var result = _handlerV2.SearchSeries(title);
var searchResult = _handlerV2.SearchSeries(title).Select(tvdbSeriesSearchItem => new Series
{
TvDbId = tvdbSeriesSearchItem.seriesid,
Title = tvdbSeriesSearchItem.SeriesName,
FirstAired = tvdbSeriesSearchItem.FirstAired,
Overview = tvdbSeriesSearchItem.Overview
}).ToList();
logger.Debug("Search for '{0}' returned {1} possible results", title, result.Count);
return result;
logger.Debug("Search for '{0}' returned {1} possible results", title, searchResult.Count);
return searchResult;
}
public virtual TvdbSeries GetSeries(int id, bool loadEpisodes, bool loadActors = false)
public virtual TvdbSeries GetSeries(int tvDbSeriesId, bool loadEpisodes, bool loadActors = false)
{
lock (_handler)
{
logger.Debug("Fetching SeriesId'{0}' from tvdb", id);
var result = _handler.GetSeries(id, TvdbLanguage.DefaultLanguage, loadEpisodes, loadActors, true, true);
logger.Debug("Fetching SeriesId'{0}' from tvdb", tvDbSeriesId);
var result = _handler.GetSeries(tvDbSeriesId, TvdbLanguage.DefaultLanguage, loadEpisodes, loadActors, true, true);
//Remove duplicated episodes
var episodes = result.Episodes.OrderByDescending(e => e.FirstAired).ThenByDescending(e => e.EpisodeName)

View File

@ -32,9 +32,9 @@ namespace NzbDrone.Core.Providers
public Series FindMatchingTvRageSeries(Series series)
{
var firstEpisode = _episodeService.GetEpisode(series.OID, 1, 1);
var firstEpisode = _episodeService.GetEpisode(series.Id, 1, 1);
var cleanName = _sceneMappingProvider.GetCleanName(series.OID);
var cleanName = _sceneMappingProvider.GetCleanName(series.Id);
var results = _tvRageProvider.SearchSeries(series.Title);
var result = ProcessResults(results, series, cleanName, firstEpisode);

View File

@ -138,7 +138,7 @@ namespace NzbDrone.Core.Providers
Logger.Trace("Failed to get TV Shows from XBMC");
else
path = xbmcShows.FirstOrDefault(s => s.ImdbNumber == series.OID || s.Label == series.Title);
path = xbmcShows.FirstOrDefault(s => s.ImdbNumber == series.Id || s.Label == series.Title);
//var hostOnly = GetHostWithoutPort(host);
@ -179,7 +179,7 @@ namespace NzbDrone.Core.Providers
Logger.Trace("Failed to get TV Shows from XBMC");
else
path = xbmcShows.FirstOrDefault(s => s.ImdbNumber == series.OID || s.Label == series.Title);
path = xbmcShows.FirstOrDefault(s => s.ImdbNumber == series.Id || s.Label == series.Title);
var postJson = new JObject();
postJson.Add(new JProperty("jsonrpc", "2.0"));
@ -221,7 +221,7 @@ namespace NzbDrone.Core.Providers
try
{
Logger.Trace("Sending Update DB Request to XBMC Host: {0}", host);
var xbmcSeriesPath = GetXbmcSeriesPath(host, series.OID, username, password);
var xbmcSeriesPath = GetXbmcSeriesPath(host, series.Id, username, password);
//If the path is found update it, else update the whole library
if (!String.IsNullOrEmpty(xbmcSeriesPath))

View File

@ -38,7 +38,7 @@ namespace NzbDrone.Core.Providers
{
var ids = _xemCommunicationProvider.GetXemSeriesIds();
var series = _seriesRepository.All();
var wantedSeries = series.Where(s => ids.Contains(s.OID)).ToList();
var wantedSeries = series.Where(s => ids.Contains(s.Id)).ToList();
foreach(var ser in wantedSeries)
{
@ -82,7 +82,7 @@ namespace NzbDrone.Core.Providers
try
{
var episodesToUpdate = new List<Episode>();
var mappings = _xemCommunicationProvider.GetSceneTvdbMappings(series.OID);
var mappings = _xemCommunicationProvider.GetSceneTvdbMappings(series.Id);
if (mappings == null)
{
@ -90,7 +90,7 @@ namespace NzbDrone.Core.Providers
return;
}
var episodes = _episodeService.GetEpisodeBySeries(series.OID);
var episodes = _episodeService.GetEpisodeBySeries(series.Id);
foreach (var mapping in mappings)
{

View File

@ -94,7 +94,7 @@ namespace NzbDrone.Core.Tv
return new List<Episode>();
}
var episodeInfo = GetEpisode(((ModelBase)parseResult.Series).OID, parseResult.AirDate.Value);
var episodeInfo = GetEpisode(((ModelBase)parseResult.Series).Id, parseResult.AirDate.Value);
if (episodeInfo != null)
{
@ -116,14 +116,14 @@ namespace NzbDrone.Core.Tv
Episode episodeInfo = null;
if (parseResult.SceneSource && parseResult.Series.UseSceneNumbering)
episodeInfo = GetEpisodeBySceneNumbering(((ModelBase)parseResult.Series).OID, parseResult.SeasonNumber, episodeNumber);
episodeInfo = GetEpisodeBySceneNumbering(((ModelBase)parseResult.Series).Id, parseResult.SeasonNumber, episodeNumber);
if (episodeInfo == null)
{
episodeInfo = GetEpisode(((ModelBase)parseResult.Series).OID, parseResult.SeasonNumber, episodeNumber);
episodeInfo = GetEpisode(((ModelBase)parseResult.Series).Id, parseResult.SeasonNumber, episodeNumber);
if (episodeInfo == null && parseResult.AirDate != null)
{
episodeInfo = GetEpisode(((ModelBase)parseResult.Series).OID, parseResult.AirDate.Value);
episodeInfo = GetEpisode(((ModelBase)parseResult.Series).Id, parseResult.AirDate.Value);
}
}
@ -176,14 +176,14 @@ namespace NzbDrone.Core.Tv
public virtual void RefreshEpisodeInfo(Series series)
{
logger.Trace("Starting episode info refresh for series: {0}", series.Title.WithDefault(series.OID));
logger.Trace("Starting episode info refresh for series: {0}", series.Title.WithDefault(series.Id));
var successCount = 0;
var failCount = 0;
var tvdbEpisodes = _tvDbProvider.GetEpisodes(series.OID);
var tvdbEpisodes = _tvDbProvider.GetEpisodes(series.TvDbId);
var seriesEpisodes = GetEpisodeBySeries(series.OID);
var seriesEpisodes = GetEpisodeBySeries(series.Id);
var updateList = new List<Episode>();
var newList = new List<Episode>();
@ -214,7 +214,7 @@ namespace NzbDrone.Core.Tv
}
else
{
episodeToUpdate.Ignored = _seasonRepository.IsIgnored(series.OID, episode.SeasonNumber);
episodeToUpdate.Ignored = _seasonRepository.IsIgnored(series.Id, episode.SeasonNumber);
}
}
else
@ -230,7 +230,7 @@ namespace NzbDrone.Core.Tv
episodeToUpdate.EpisodeFile = null;
}
episodeToUpdate.SeriesId = series.OID;
episodeToUpdate.SeriesId = series.Id;
episodeToUpdate.Series = series;
episodeToUpdate.TvDbEpisodeId = episode.TvDbEpisodeId;
episodeToUpdate.EpisodeNumber = episode.EpisodeNumber;
@ -273,7 +273,7 @@ namespace NzbDrone.Core.Tv
public virtual IList<int> GetEpisodeNumbersBySeason(int seriesId, int seasonNumber)
{
return GetEpisodesBySeason(seriesId, seasonNumber).Select(c => c.OID).ToList();
return GetEpisodesBySeason(seriesId, seasonNumber).Select(c => c.Id).ToList();
}
public virtual void SetEpisodeIgnore(int episodeId, bool isIgnored)
@ -302,13 +302,13 @@ namespace NzbDrone.Core.Tv
private void DeleteEpisodesNotInTvdb(Series series, IEnumerable<Episode> tvdbEpisodes)
{
logger.Trace("Starting deletion of episodes that no longer exist in TVDB: {0}", series.Title.WithDefault(series.OID));
logger.Trace("Starting deletion of episodes that no longer exist in TVDB: {0}", series.Title.WithDefault(series.Id));
foreach (var episode in tvdbEpisodes)
{
_episodeRepository.Delete(episode.OID);
_episodeRepository.Delete(episode.Id);
}
logger.Trace("Deleted episodes that no longer exist in TVDB for {0}", series.OID);
logger.Trace("Deleted episodes that no longer exist in TVDB for {0}", series.Id);
}
public virtual void SetPostDownloadStatus(List<int> episodeIds, PostDownloadStatusType postDownloadStatus)
@ -349,7 +349,7 @@ namespace NzbDrone.Core.Tv
{
foreach (var episode in message.ParseResult.Episodes)
{
logger.Trace("Marking episode {0} as fetched.", episode.OID);
logger.Trace("Marking episode {0} as fetched.", episode.Id);
episode.GrabDate = DateTime.UtcNow;
_episodeRepository.Update(episode);
}

View File

@ -33,7 +33,7 @@ namespace NzbDrone.Core.Tv
public bool IsIgnored(int seriesId, int seasonNumber)
{
var season = Queryable.SingleOrDefault(c => c.OID == seriesId && c.SeasonNumber == seasonNumber);
var season = Queryable.SingleOrDefault(c => c.Id == seriesId && c.SeasonNumber == seasonNumber);
if(season == null) return false;

View File

@ -59,7 +59,7 @@ namespace NzbDrone.Core.Tv
public Series UpdateSeriesInfo(int seriesId)
{
var series = _seriesRepository.Get(seriesId);
var tvDbSeries = _tvDbProvider.GetSeries(series.OID, false, true);
var tvDbSeries = _tvDbProvider.GetSeries(series.TvDbId, false, true);
series.Title = tvDbSeries.SeriesName;
series.AirTime = CleanAirsTime(tvDbSeries.AirsTime);
@ -146,7 +146,7 @@ namespace NzbDrone.Core.Tv
foreach (var series in allSeries)
{
//Only update parameters that can be changed in MassEdit
var edited = editedSeries.Single(s => ((ModelBase)s).OID == series.OID);
var edited = editedSeries.Single(s => ((ModelBase)s).Id == series.Id);
series.QualityProfileId = edited.QualityProfileId;
series.Monitored = edited.Monitored;
series.SeasonFolder = edited.SeasonFolder;