mirror of
https://github.com/Radarr/Radarr
synced 2024-12-25 17:27:59 +00:00
removed UTC conversion, now being done by DB.
This commit is contained in:
parent
c357d062d3
commit
be81f772df
3 changed files with 0 additions and 42 deletions
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -82,7 +82,6 @@ private static void RegisterMappers()
|
||||||
MapRepository.Instance.RegisterTypeConverter(typeof(Boolean), new BooleanIntConverter());
|
MapRepository.Instance.RegisterTypeConverter(typeof(Boolean), new BooleanIntConverter());
|
||||||
MapRepository.Instance.RegisterTypeConverter(typeof(Enum), new EnumIntConverter());
|
MapRepository.Instance.RegisterTypeConverter(typeof(Enum), new EnumIntConverter());
|
||||||
MapRepository.Instance.RegisterTypeConverter(typeof(Quality), new QualityIntConverter());
|
MapRepository.Instance.RegisterTypeConverter(typeof(Quality), new QualityIntConverter());
|
||||||
MapRepository.Instance.RegisterTypeConverter(typeof(DateTime), new UtcDateTimeConverter());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void RegisterEmbeddedConverter()
|
private static void RegisterEmbeddedConverter()
|
||||||
|
|
|
@ -193,7 +193,6 @@
|
||||||
<Compile Include="Datastore\Converters\QualityIntConverter.cs" />
|
<Compile Include="Datastore\Converters\QualityIntConverter.cs" />
|
||||||
<Compile Include="Datastore\Converters\Int32Converter.cs" />
|
<Compile Include="Datastore\Converters\Int32Converter.cs" />
|
||||||
<Compile Include="Datastore\Converters\EmbeddedDocumentConverter.cs" />
|
<Compile Include="Datastore\Converters\EmbeddedDocumentConverter.cs" />
|
||||||
<Compile Include="Datastore\Converters\UtcDateTimeConverter.cs" />
|
|
||||||
<Compile Include="Datastore\Database.cs" />
|
<Compile Include="Datastore\Database.cs" />
|
||||||
<Compile Include="Datastore\DbFactory.cs" />
|
<Compile Include="Datastore\DbFactory.cs" />
|
||||||
<Compile Include="Datastore\Converters\EnumIntConverter.cs" />
|
<Compile Include="Datastore\Converters\EnumIntConverter.cs" />
|
||||||
|
|
Loading…
Reference in a new issue