mirror of
https://github.com/Sonarr/Sonarr
synced 2025-02-25 07:23:16 +00:00
Dropped TVDbEpisodeId since its not used and was causing contraint issues
Fixed: Issues refreshing some series due to episodes being reordered on TheTVDB
This commit is contained in:
parent
af278685ad
commit
9f403b46ff
9 changed files with 17 additions and 11 deletions
|
@ -80,8 +80,6 @@ namespace NzbDrone.Core.Test.MetadataSourceTests
|
||||||
episodes.GroupBy(e => e.SeasonNumber.ToString("000") + e.EpisodeNumber.ToString("000"))
|
episodes.GroupBy(e => e.SeasonNumber.ToString("000") + e.EpisodeNumber.ToString("000"))
|
||||||
.Max(e => e.Count()).Should().Be(1);
|
.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 => c.SeasonNumber > 0);
|
||||||
episodes.Should().Contain(c => !string.IsNullOrWhiteSpace(c.Overview));
|
episodes.Should().Contain(c => !string.IsNullOrWhiteSpace(c.Overview));
|
||||||
|
|
||||||
|
@ -98,7 +96,6 @@ namespace NzbDrone.Core.Test.MetadataSourceTests
|
||||||
{
|
{
|
||||||
episode.Should().NotBeNull();
|
episode.Should().NotBeNull();
|
||||||
episode.EpisodeNumber.Should().NotBe(0);
|
episode.EpisodeNumber.Should().NotBe(0);
|
||||||
episode.TvDbEpisodeId.Should().BeGreaterThan(0);
|
|
||||||
|
|
||||||
episode.Should().NotBeNull();
|
episode.Should().NotBeNull();
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,6 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeRepositoryTests
|
||||||
var monitoredSeriesEpisodes = Builder<Episode>.CreateListOfSize(3)
|
var monitoredSeriesEpisodes = Builder<Episode>.CreateListOfSize(3)
|
||||||
.All()
|
.All()
|
||||||
.With(e => e.Id = 0)
|
.With(e => e.Id = 0)
|
||||||
.With(e => e.TvDbEpisodeId = RandomNumber)
|
|
||||||
.With(e => e.SeriesId = _monitoredSeries.Id)
|
.With(e => e.SeriesId = _monitoredSeries.Id)
|
||||||
.With(e => e.EpisodeFileId = 0)
|
.With(e => e.EpisodeFileId = 0)
|
||||||
.With(e => e.AirDateUtc = DateTime.Now.AddDays(-5))
|
.With(e => e.AirDateUtc = DateTime.Now.AddDays(-5))
|
||||||
|
@ -62,7 +61,6 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeRepositoryTests
|
||||||
var unmonitoredSeriesEpisodes = Builder<Episode>.CreateListOfSize(3)
|
var unmonitoredSeriesEpisodes = Builder<Episode>.CreateListOfSize(3)
|
||||||
.All()
|
.All()
|
||||||
.With(e => e.Id = 0)
|
.With(e => e.Id = 0)
|
||||||
.With(e => e.TvDbEpisodeId = RandomNumber)
|
|
||||||
.With(e => e.SeriesId = _unmonitoredSeries.Id)
|
.With(e => e.SeriesId = _unmonitoredSeries.Id)
|
||||||
.With(e => e.EpisodeFileId = 0)
|
.With(e => e.EpisodeFileId = 0)
|
||||||
.With(e => e.AirDateUtc = DateTime.Now.AddDays(-5))
|
.With(e => e.AirDateUtc = DateTime.Now.AddDays(-5))
|
||||||
|
|
Binary file not shown.
|
@ -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.SeasonNumber = traktEpisode.season;
|
||||||
episode.EpisodeNumber = traktEpisode.episode;
|
episode.EpisodeNumber = traktEpisode.episode;
|
||||||
episode.EpisodeNumber = traktEpisode.number;
|
episode.EpisodeNumber = traktEpisode.number;
|
||||||
episode.TvDbEpisodeId = traktEpisode.tvdb_id;
|
|
||||||
episode.Title = traktEpisode.title;
|
episode.Title = traktEpisode.title;
|
||||||
episode.AirDate = FromIsoToString(traktEpisode.first_aired_iso);
|
episode.AirDate = FromIsoToString(traktEpisode.first_aired_iso);
|
||||||
episode.AirDateUtc = FromIso(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\021_drop_seasons_table.cs" />
|
||||||
<Compile Include="Datastore\Migration\022_move_notification_to_generic_provider.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\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\MigrationContext.cs" />
|
||||||
<Compile Include="Datastore\Migration\Framework\MigrationController.cs" />
|
<Compile Include="Datastore\Migration\Framework\MigrationController.cs" />
|
||||||
<Compile Include="Datastore\Migration\Framework\MigrationExtension.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 const string AIR_DATE_FORMAT = "yyyy-MM-dd";
|
||||||
|
|
||||||
public int TvDbEpisodeId { get; set; }
|
|
||||||
public int SeriesId { get; set; }
|
public int SeriesId { get; set; }
|
||||||
public int EpisodeFileId { get; set; }
|
public int EpisodeFileId { get; set; }
|
||||||
public int SeasonNumber { get; set; }
|
public int SeasonNumber { get; set; }
|
||||||
|
@ -39,7 +38,7 @@ namespace NzbDrone.Core.Tv
|
||||||
|
|
||||||
public override string ToString()
|
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.SeriesId = series.Id;
|
||||||
episodeToUpdate.TvDbEpisodeId = episode.TvDbEpisodeId;
|
|
||||||
episodeToUpdate.EpisodeNumber = episode.EpisodeNumber;
|
episodeToUpdate.EpisodeNumber = episode.EpisodeNumber;
|
||||||
episodeToUpdate.SeasonNumber = episode.SeasonNumber;
|
episodeToUpdate.SeasonNumber = episode.SeasonNumber;
|
||||||
episodeToUpdate.Title = episode.Title;
|
episodeToUpdate.Title = episode.Title;
|
||||||
|
|
|
@ -62,7 +62,6 @@ define(
|
||||||
this.listenTo(this.collection, 'sync', this._collectionSynced);
|
this.listenTo(this.collection, 'sync', this._collectionSynced);
|
||||||
|
|
||||||
this.collection.fetch();
|
this.collection.fetch();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
|
|
Loading…
Reference in a new issue