From be81f772dfc6aff39fd7d7ec85b54f42604a3e77 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Wed, 22 May 2013 22:33:12 -0700 Subject: [PATCH] removed UTC conversion, now being done by DB. --- .../Converters/UtcDateTimeConverter.cs | 40 ------------------- NzbDrone.Core/Datastore/TableMapping.cs | 1 - NzbDrone.Core/NzbDrone.Core.csproj | 1 - 3 files changed, 42 deletions(-) delete mode 100644 NzbDrone.Core/Datastore/Converters/UtcDateTimeConverter.cs diff --git a/NzbDrone.Core/Datastore/Converters/UtcDateTimeConverter.cs b/NzbDrone.Core/Datastore/Converters/UtcDateTimeConverter.cs deleted file mode 100644 index 2aa40a871..000000000 --- a/NzbDrone.Core/Datastore/Converters/UtcDateTimeConverter.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Globalization; -using Marr.Data.Converters; -using Marr.Data.Mapping; - -namespace NzbDrone.Core.Datastore.Converters -{ - public class UtcDateTimeConverter : IConverter - { - public Type DbType - { - get - { - return typeof(DateTime); - } - } - - public object FromDB(ColumnMap map, object dbValue) - { - if (dbValue != null && dbValue != DBNull.Value) - { - var dateTime = (DateTime)dbValue; - dateTime = new DateTime(dateTime.Ticks, DateTimeKind.Local); - return dateTime.ToUniversalTime(); - } - - return null; - } - - public object ToDB(object clrValue) - { - if (clrValue != null && clrValue != DBNull.Value) - { - return ((DateTime)clrValue).ToUniversalTime(); - } - - return DBNull.Value; - } - } -} \ No newline at end of file diff --git a/NzbDrone.Core/Datastore/TableMapping.cs b/NzbDrone.Core/Datastore/TableMapping.cs index 7abec53f4..8e2d48ca5 100644 --- a/NzbDrone.Core/Datastore/TableMapping.cs +++ b/NzbDrone.Core/Datastore/TableMapping.cs @@ -82,7 +82,6 @@ namespace NzbDrone.Core.Datastore MapRepository.Instance.RegisterTypeConverter(typeof(Boolean), new BooleanIntConverter()); MapRepository.Instance.RegisterTypeConverter(typeof(Enum), new EnumIntConverter()); MapRepository.Instance.RegisterTypeConverter(typeof(Quality), new QualityIntConverter()); - MapRepository.Instance.RegisterTypeConverter(typeof(DateTime), new UtcDateTimeConverter()); } private static void RegisterEmbeddedConverter() diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index 07ca1d9d8..72038b0c8 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -193,7 +193,6 @@ -