1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

removed episode status from server.

This commit is contained in:
kay.one 2013-05-20 14:05:48 -07:00
parent 7701f87e82
commit 21e9bad6d5
8 changed files with 14 additions and 132 deletions

View File

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

View File

@ -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);
}
}
}

View File

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

View File

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

View File

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

View File

@ -28,22 +28,6 @@ public bool HasFile
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 Series Series { get; set; }

View File

@ -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
}
}

View File

@ -1,14 +1,26 @@
"use strict";
define(['app', 'Episode/Layout'], function () {
NzbDrone.Series.Details.EpisodeDetailCell = Backgrid.Cell.extend({
NzbDrone.Series.Details.EpisodeStatusCell = Backgrid.Cell.extend({
events: {
'click': 'showDetails'
},
render: function () {
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;
},