Don't save date if is the default min value

Avoid empty dates to be saved
This commit is contained in:
Luis Miguel Almánzar 2013-06-09 16:51:57 -03:00
parent 2aece7376e
commit 96eb5bd367

View File

@ -258,8 +258,8 @@ namespace MediaBrowser.Api
item.Studios = request.Studios.Select(x=>x.Name).ToList(); item.Studios = request.Studios.Select(x=>x.Name).ToList();
item.People = request.People.Select(x=> new PersonInfo{Name = x.Name,Role = x.Role,Type = x.Type}).ToList(); item.People = request.People.Select(x=> new PersonInfo{Name = x.Name,Role = x.Role,Type = x.Type}).ToList();
item.EndDate = request.EndDate; item.EndDate = request.EndDate != default(DateTime) ? request.EndDate : null;
item.PremiereDate = request.PremiereDate; item.PremiereDate = request.PremiereDate != default(DateTime)? request.PremiereDate : null;
item.ProductionYear = request.ProductionYear; item.ProductionYear = request.ProductionYear;
item.AspectRatio = request.AspectRatio; item.AspectRatio = request.AspectRatio;
item.Language = request.Language; item.Language = request.Language;