From 0b219e11690b634cea3814f50283809a9a23d492 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sat, 3 Oct 2015 21:19:25 +0200 Subject: [PATCH] Fixed nullables. --- src/NzbDrone.Api/ClientSchema/SchemaBuilder.cs | 2 +- src/NzbDrone.Api/Episodes/EpisodeResource.cs | 8 ++++---- src/NzbDrone.Common/Extensions/TryParseExtensions.cs | 2 +- .../Datastore/MappingExtentionFixture.cs | 2 +- .../DataAugmentation/Scene/SceneMappingService.cs | 8 ++++---- src/NzbDrone.Core/Tv/Episode.cs | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/NzbDrone.Api/ClientSchema/SchemaBuilder.cs b/src/NzbDrone.Api/ClientSchema/SchemaBuilder.cs index b91e2cea5..4a0dbc82c 100644 --- a/src/NzbDrone.Api/ClientSchema/SchemaBuilder.cs +++ b/src/NzbDrone.Api/ClientSchema/SchemaBuilder.cs @@ -89,7 +89,7 @@ namespace NzbDrone.Api.ClientSchema propertyInfo.SetValue(target, value, null); } - else if (propertyInfo.PropertyType == typeof(Nullable)) + else if (propertyInfo.PropertyType == typeof(int?)) { var value = field.Value.ToString().ParseInt32(); propertyInfo.SetValue(target, value, null); diff --git a/src/NzbDrone.Api/Episodes/EpisodeResource.cs b/src/NzbDrone.Api/Episodes/EpisodeResource.cs index f63eb8d75..5a2d72d90 100644 --- a/src/NzbDrone.Api/Episodes/EpisodeResource.cs +++ b/src/NzbDrone.Api/Episodes/EpisodeResource.cs @@ -20,10 +20,10 @@ namespace NzbDrone.Api.Episodes public bool HasFile { get; set; } public bool Monitored { get; set; } - public Nullable AbsoluteEpisodeNumber { get; set; } - public Nullable SceneAbsoluteEpisodeNumber { get; set; } - public Nullable SceneEpisodeNumber { get; set; } - public Nullable SceneSeasonNumber { get; set; } + public int? AbsoluteEpisodeNumber { get; set; } + public int? SceneAbsoluteEpisodeNumber { get; set; } + public int? SceneEpisodeNumber { get; set; } + public int? SceneSeasonNumber { get; set; } public bool UnverifiedSceneNumbering { get; set; } public DateTime? EndTime { get; set; } public DateTime? GrabDate { get; set; } diff --git a/src/NzbDrone.Common/Extensions/TryParseExtensions.cs b/src/NzbDrone.Common/Extensions/TryParseExtensions.cs index 1d9fc1bdc..c485fbd54 100644 --- a/src/NzbDrone.Common/Extensions/TryParseExtensions.cs +++ b/src/NzbDrone.Common/Extensions/TryParseExtensions.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Common.Extensions { public static class TryParseExtensions { - public static Nullable ParseInt32(this string source) + public static int? ParseInt32(this string source) { int result = 0; diff --git a/src/NzbDrone.Core.Test/Datastore/MappingExtentionFixture.cs b/src/NzbDrone.Core.Test/Datastore/MappingExtentionFixture.cs index 75ee030f9..c73b00353 100644 --- a/src/NzbDrone.Core.Test/Datastore/MappingExtentionFixture.cs +++ b/src/NzbDrone.Core.Test/Datastore/MappingExtentionFixture.cs @@ -24,7 +24,7 @@ namespace NzbDrone.Core.Test.Datastore public string PropString { get; set; } public int PropInt { get; set; } public bool PropBool { get; set; } - public Nullable PropNullable { get; set; } + public int? PropNullable { get; set; } public EmbeddedType Embedded { get; set; } public List EmbeddedList { get; set; } } diff --git a/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs b/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs index 4523cf10f..a7f5c318a 100644 --- a/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs +++ b/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs @@ -15,9 +15,9 @@ namespace NzbDrone.Core.DataAugmentation.Scene public interface ISceneMappingService { List GetSceneNames(int tvdbId, IEnumerable seasonNumbers); - Nullable FindTvdbId(string title); + int? FindTvdbId(string title); List FindByTvdbId(int tvdbId); - Nullable GetSeasonNumber(string title); + int? GetSeasonNumber(string title); } public class SceneMappingService : ISceneMappingService, @@ -61,7 +61,7 @@ namespace NzbDrone.Core.DataAugmentation.Scene .Select(m => m.SearchTerm).Distinct().ToList()); } - public Nullable FindTvdbId(string title) + public int? FindTvdbId(string title) { var mapping = FindMapping(title); @@ -88,7 +88,7 @@ namespace NzbDrone.Core.DataAugmentation.Scene return mappings; } - public Nullable GetSeasonNumber(string title) + public int? GetSeasonNumber(string title) { var mapping = FindMapping(title); diff --git a/src/NzbDrone.Core/Tv/Episode.cs b/src/NzbDrone.Core/Tv/Episode.cs index 3f0c18b32..fdbd22704 100644 --- a/src/NzbDrone.Core/Tv/Episode.cs +++ b/src/NzbDrone.Core/Tv/Episode.cs @@ -25,10 +25,10 @@ namespace NzbDrone.Core.Tv public DateTime? AirDateUtc { get; set; } public string Overview { get; set; } public bool Monitored { get; set; } - public Nullable AbsoluteEpisodeNumber { get; set; } - public Nullable SceneAbsoluteEpisodeNumber { get; set; } - public Nullable SceneSeasonNumber { get; set; } - public Nullable SceneEpisodeNumber { get; set; } + public int? AbsoluteEpisodeNumber { get; set; } + public int? SceneAbsoluteEpisodeNumber { get; set; } + public int? SceneSeasonNumber { get; set; } + public int? SceneEpisodeNumber { get; set; } public bool UnverifiedSceneNumbering { get; set; } public Ratings Ratings { get; set; } public List Images { get; set; }