Dropped TVDbEpisodeId since its not used and was causing contraint issues

Fixed: Issues refreshing some series due to episodes being reordered on TheTVDB
pull/4/head
Mark McDowall 11 years ago
parent af278685ad
commit 9f403b46ff

@ -80,8 +80,6 @@ namespace NzbDrone.Core.Test.MetadataSourceTests
episodes.GroupBy(e => e.SeasonNumber.ToString("000") + e.EpisodeNumber.ToString("000"))
.Max(e => e.Count()).Should().Be(1);
episodes.Select(c => c.TvDbEpisodeId).Should().OnlyHaveUniqueItems();
episodes.Should().Contain(c => c.SeasonNumber > 0);
episodes.Should().Contain(c => !string.IsNullOrWhiteSpace(c.Overview));
@ -98,7 +96,6 @@ namespace NzbDrone.Core.Test.MetadataSourceTests
{
episode.Should().NotBeNull();
episode.EpisodeNumber.Should().NotBe(0);
episode.TvDbEpisodeId.Should().BeGreaterThan(0);
episode.Should().NotBeNull();

@ -48,7 +48,6 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeRepositoryTests
var monitoredSeriesEpisodes = Builder<Episode>.CreateListOfSize(3)
.All()
.With(e => e.Id = 0)
.With(e => e.TvDbEpisodeId = RandomNumber)
.With(e => e.SeriesId = _monitoredSeries.Id)
.With(e => e.EpisodeFileId = 0)
.With(e => e.AirDateUtc = DateTime.Now.AddDays(-5))
@ -62,7 +61,6 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeRepositoryTests
var unmonitoredSeriesEpisodes = Builder<Episode>.CreateListOfSize(3)
.All()
.With(e => e.Id = 0)
.With(e => e.TvDbEpisodeId = RandomNumber)
.With(e => e.SeriesId = _unmonitoredSeries.Id)
.With(e => e.EpisodeFileId = 0)
.With(e => e.AirDateUtc = DateTime.Now.AddDays(-5))

@ -0,0 +1,14 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(24)]
public class drop_tvdb_episodeid : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
SqLiteAlter.DropColumns("Episodes", new[] { "TvDbEpisodeId" });
}
}
}

@ -98,7 +98,6 @@ namespace NzbDrone.Core.MetadataSource
episode.SeasonNumber = traktEpisode.season;
episode.EpisodeNumber = traktEpisode.episode;
episode.EpisodeNumber = traktEpisode.number;
episode.TvDbEpisodeId = traktEpisode.tvdb_id;
episode.Title = traktEpisode.title;
episode.AirDate = FromIsoToString(traktEpisode.first_aired_iso);
episode.AirDateUtc = FromIso(traktEpisode.first_aired_iso);

@ -175,6 +175,7 @@
<Compile Include="Datastore\Migration\021_drop_seasons_table.cs" />
<Compile Include="Datastore\Migration\022_move_notification_to_generic_provider.cs" />
<Compile Include="Datastore\Migration\023_add_config_contract_to_indexers.cs" />
<Compile Include="Datastore\Migration\024_drop_tvdb_episodeid.cs" />
<Compile Include="Datastore\Migration\Framework\MigrationContext.cs" />
<Compile Include="Datastore\Migration\Framework\MigrationController.cs" />
<Compile Include="Datastore\Migration\Framework\MigrationExtension.cs" />

@ -11,7 +11,6 @@ namespace NzbDrone.Core.Tv
{
public const string AIR_DATE_FORMAT = "yyyy-MM-dd";
public int TvDbEpisodeId { get; set; }
public int SeriesId { get; set; }
public int EpisodeFileId { get; set; }
public int SeasonNumber { get; set; }
@ -39,7 +38,7 @@ namespace NzbDrone.Core.Tv
public override string ToString()
{
return string.Format("[{0}]{1}", TvDbEpisodeId, Title.NullSafe());
return string.Format("[{0}]{1}", Id, Title.NullSafe());
}
}
}

@ -58,7 +58,6 @@ namespace NzbDrone.Core.Tv
}
episodeToUpdate.SeriesId = series.Id;
episodeToUpdate.TvDbEpisodeId = episode.TvDbEpisodeId;
episodeToUpdate.EpisodeNumber = episode.EpisodeNumber;
episodeToUpdate.SeasonNumber = episode.SeasonNumber;
episodeToUpdate.Title = episode.Title;

@ -57,12 +57,11 @@ define(
initialize: function () {
this.collection = new LogFileCollection();
vent.on(vent.Commands.ShowLogFile, this._fetchLogFileContents, this);
vent.on(vent.Commands.ShowLogFile, this._fetchLogFileContents, this);
vent.on(vent.Events.CommandComplete, this._commandComplete, this);
this.listenTo(this.collection, 'sync', this._collectionSynced);
this.collection.fetch();
},
onShow: function () {

Loading…
Cancel
Save