removed episode status from server.

pull/4/head
kay.one 12 years ago
parent 7701f87e82
commit 21e9bad6d5

@ -1,8 +1,6 @@
using System; using System;
using NzbDrone.Api.REST; using NzbDrone.Api.REST;
using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Model;
using NzbDrone.Core.Tv;
namespace NzbDrone.Api.Episodes namespace NzbDrone.Api.Episodes
{ {
@ -15,7 +13,6 @@ namespace NzbDrone.Api.Episodes
public Int32 EpisodeNumber { get; set; } public Int32 EpisodeNumber { get; set; }
public String Title { get; set; } public String Title { get; set; }
public DateTime? AirDate { get; set; } public DateTime? AirDate { get; set; }
public EpisodeStatuses Status { get; set; }
public String Overview { get; set; } public String Overview { get; set; }
public EpisodeFile EpisodeFile { get; set; } public EpisodeFile EpisodeFile { get; set; }
@ -27,7 +24,6 @@ namespace NzbDrone.Api.Episodes
public Int32? AbsoluteEpisodeNumber { get; set; } public Int32? AbsoluteEpisodeNumber { get; set; }
public DateTime? EndTime { get; set; } public DateTime? EndTime { get; set; }
public DateTime? GrabDate { get; set; } public DateTime? GrabDate { get; set; }
public PostDownloadStatusType PostDownloadStatus { get; set; }
public Core.Tv.Series Series { get; set; } public Core.Tv.Series Series { get; set; }
public String SeriesTitle { get; set; } public String SeriesTitle { get; set; }
} }

@ -1,47 +0,0 @@
using System;
using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Model;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test
{
[TestFixture]
public class EpisodeStatusTest : CoreTest
{
[TestCase(1, true, true, EpisodeStatuses.Ready)]
public void ignored_episode(int offsetDays, bool ignored, bool hasEpisodes, EpisodeStatuses status)
{
Episode episode = Builder<Episode>.CreateNew()
.With(e => e.AirDate = DateTime.Now.AddDays(offsetDays))
.With(e => e.Ignored = ignored)
.Build();
if (hasEpisodes)
{
episode.EpisodeFile = new EpisodeFile();
}
episode.Status.Should().Be(status);
}
[Test]
public void low_air_date()
{
Episode episode = Builder<Episode>.CreateNew()
.With(e => e.AirDate = DateTime.Now.AddDays(20))
.With(e => e.Ignored = false)
.With(e => e.EpisodeFileId = 0)
.Build();
episode.Status.Should().Be(EpisodeStatuses.NotAired);
}
}
}

@ -193,7 +193,6 @@
<Compile Include="InstrumentationTests\DatabaseTargetFixture.cs" /> <Compile Include="InstrumentationTests\DatabaseTargetFixture.cs" />
<Compile Include="OrganizerTests\GetNewFilenameFixture.cs" /> <Compile Include="OrganizerTests\GetNewFilenameFixture.cs" />
<Compile Include="DecisionEngineTests\MonitoredEpisodeSpecificationFixture.cs" /> <Compile Include="DecisionEngineTests\MonitoredEpisodeSpecificationFixture.cs" />
<Compile Include="EpisodeStatusTest.cs" />
<Compile Include="DecisionEngineTests\AllowedDownloadSpecificationFixture.cs" /> <Compile Include="DecisionEngineTests\AllowedDownloadSpecificationFixture.cs" />
<Compile Include="TvTests\QualityModelFixture.cs" /> <Compile Include="TvTests\QualityModelFixture.cs" />
<Compile Include="RootFolderTests\RootFolderServiceFixture.cs" /> <Compile Include="RootFolderTests\RootFolderServiceFixture.cs" />

@ -1,12 +0,0 @@
namespace NzbDrone.Core.Model
{
public enum PostDownloadStatusType
{
Unknown = 0,
Unpacking = 1,
Failed = 2,
UnknownSeries = 3,
ParseError = 4,
NoError = 5,
}
}

@ -336,7 +336,6 @@
<Compile Include="Download\Clients\Nzbget\PriorityType.cs" /> <Compile Include="Download\Clients\Nzbget\PriorityType.cs" />
<Compile Include="Download\Clients\Nzbget\VersionModel.cs" /> <Compile Include="Download\Clients\Nzbget\VersionModel.cs" />
<Compile Include="Indexers\Nzbx\NzbxRecentItem.cs" /> <Compile Include="Indexers\Nzbx\NzbxRecentItem.cs" />
<Compile Include="Model\PostDownloadStatusType.cs" />
<Compile Include="Model\MisnamedEpisodeModel.cs" /> <Compile Include="Model\MisnamedEpisodeModel.cs" />
<Compile Include="Organizer\NamingConfig.cs" /> <Compile Include="Organizer\NamingConfig.cs" />
<Compile Include="Parser\Language.cs" /> <Compile Include="Parser\Language.cs" />
@ -351,7 +350,6 @@
<Compile Include="Qualities\QualityProfileRepository.cs" /> <Compile Include="Qualities\QualityProfileRepository.cs" />
<Compile Include="SeriesStats\SeriesStatisticsService.cs" /> <Compile Include="SeriesStats\SeriesStatisticsService.cs" />
<Compile Include="Tv\EpisodeService.cs" /> <Compile Include="Tv\EpisodeService.cs" />
<Compile Include="Tv\EpisodeStatuses.cs" />
<Compile Include="Tv\Events\EpisodeInfoUpdatedEvent.cs" /> <Compile Include="Tv\Events\EpisodeInfoUpdatedEvent.cs" />
<Compile Include="Tv\Events\EpisodeInfoAddedEvent.cs" /> <Compile Include="Tv\Events\EpisodeInfoAddedEvent.cs" />
<Compile Include="Tv\Events\SeriesAddedEvent.cs" /> <Compile Include="Tv\Events\SeriesAddedEvent.cs" />

@ -28,22 +28,6 @@ namespace NzbDrone.Core.Tv
get { return EpisodeFileId != 0; } get { return EpisodeFileId != 0; }
} }
public EpisodeStatuses Status
{
get
{
if (HasFile) return EpisodeStatuses.Ready;
if (AirDate != null && AirDate.Value.Date == DateTime.Today)
return EpisodeStatuses.AirsToday;
if (AirDate != null && AirDate.Value.Date < DateTime.Now)
return EpisodeStatuses.Missing;
return EpisodeStatuses.NotAired;
}
}
public String SeriesTitle { get; private set; } public String SeriesTitle { get; private set; }
public Series Series { get; set; } public Series Series { get; set; }

@ -1,48 +0,0 @@
namespace NzbDrone.Core.Tv
{
public enum EpisodeStatuses
{
/// <summary>
/// Episode has not aired yet
/// </summary>
NotAired,
/// <summary>
/// Episode is ignored
/// </summary>
Ignored,
/// <summary>
/// Episode has aired, but no episode
/// files are available
/// Todo: We shouldn't set missing until the episode has past the actual airtime + runtime, including UtcOffset
/// </summary>
Missing,
/// <summary>
/// Episode airs today, but no episode
/// files are available
/// </summary>
AirsToday,
/// <summary>
/// Episode is being downloaded
/// </summary>
Downloading,
/// <summary>
/// Episode has been downloaded and is unpacking (_UNPACK_)
/// </summary>
Unpacking,
/// <summary>
/// Episode has failed to download properly (_FAILED_)
/// </summary>
Failed,
/// <summary>
/// Episode is present in disk
/// </summary>
Ready
}
}

@ -1,14 +1,26 @@
"use strict"; "use strict";
define(['app', 'Episode/Layout'], function () { define(['app', 'Episode/Layout'], function () {
NzbDrone.Series.Details.EpisodeDetailCell = Backgrid.Cell.extend({ NzbDrone.Series.Details.EpisodeStatusCell = Backgrid.Cell.extend({
events: { events: {
'click': 'showDetails' 'click': 'showDetails'
}, },
render: function () { render: function () {
this.$el.empty(); this.$el.empty();
this.$el.html('<i class="icon-ellipsis-vertical x-detail-icon"/>');
if (this.model) {
var icon;
if (this.model.get('episodeFile')) {
icon = 'icon-ok';
}
this.$el.html('<i class="{0}"/>'.format(icon));
}
return this; return this;
}, },
Loading…
Cancel
Save