This commit is contained in:
Luke Pulverenti 2017-08-13 16:15:07 -04:00
parent 9c5bfeddca
commit 0951819f00
9 changed files with 74 additions and 5 deletions

View File

@ -1331,7 +1331,8 @@ namespace Emby.Server.Implementations.Dto
var series = item as Series;
if (series != null)
{
dto.AirDays = new DayOfWeek[] {};
dto.AirDays = series.AirDays;
dto.AirTime = series.AirTime;
dto.Status = series.Status.HasValue ? series.Status.Value.ToString() : null;
}

View File

@ -372,6 +372,12 @@ namespace MediaBrowser.Api
if (series != null)
{
series.Status = GetSeriesStatus(request);
if (request.AirDays != null)
{
series.AirDays = request.AirDays;
series.AirTime = request.AirTime;
}
}
}

View File

@ -25,8 +25,12 @@ namespace MediaBrowser.Controller.Entities.TV
RemoteTrailers = EmptyMediaUrlArray;
LocalTrailerIds = EmptyGuidArray;
RemoteTrailerIds = EmptyGuidArray;
AirDays = new DayOfWeek[] { };
}
public DayOfWeek[] AirDays { get; set; }
public string AirTime { get; set; }
[IgnoreDataMember]
public override bool SupportsAddingToPlaylist
{

View File

@ -22,13 +22,13 @@ namespace MediaBrowser.Controller.Library
/// </summary>
/// <param name="day">The day.</param>
/// <returns>List{DayOfWeek}.</returns>
public static List<DayOfWeek> GetAirDays(string day)
public static DayOfWeek[] GetAirDays(string day)
{
if (!string.IsNullOrWhiteSpace(day))
{
if (day.Equals("Daily", StringComparison.OrdinalIgnoreCase))
{
return new List<DayOfWeek>
return new DayOfWeek[]
{
DayOfWeek.Sunday,
DayOfWeek.Monday,
@ -44,13 +44,13 @@ namespace MediaBrowser.Controller.Library
if (Enum.TryParse(day, true, out value))
{
return new List<DayOfWeek>
return new DayOfWeek[]
{
value
};
}
return new List<DayOfWeek>();
return new DayOfWeek[]{};
}
return null;
}

View File

@ -211,6 +211,10 @@ namespace MediaBrowser.Controller.MediaEncoding
{
return null;
}
if (string.Equals(container, "rtp", StringComparison.OrdinalIgnoreCase))
{
return null;
}
// Seeing reported failures here, not sure yet if this is related to specfying input format
if (string.Equals(container, "m4v", StringComparison.OrdinalIgnoreCase))

View File

@ -404,6 +404,12 @@ namespace MediaBrowser.Model.Dto
/// <value>The status.</value>
public string Status { get; set; }
/// <summary>
/// Gets or sets the air time.
/// </summary>
/// <value>The air time.</value>
public string AirTime { get; set; }
/// <summary>
/// Gets or sets the air days.
/// </summary>

View File

@ -64,10 +64,20 @@ namespace MediaBrowser.Providers.TV
var sourceItem = source.Item;
var targetItem = target.Item;
if (replaceData || string.IsNullOrEmpty(targetItem.AirTime))
{
targetItem.AirTime = sourceItem.AirTime;
}
if (replaceData || !targetItem.Status.HasValue)
{
targetItem.Status = sourceItem.Status;
}
if (replaceData || targetItem.AirDays == null || targetItem.AirDays.Length == 0)
{
targetItem.AirDays = sourceItem.AirDays;
}
}
}
}

View File

@ -1090,6 +1090,28 @@ namespace MediaBrowser.Providers.TV
break;
}
case "Airs_DayOfWeek":
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{
item.AirDays = TVUtils.GetAirDays(val);
}
break;
}
case "Airs_Time":
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{
item.AirTime = val;
}
break;
}
case "ContentRating":
{
var val = reader.ReadElementContentAsString();

View File

@ -61,6 +61,22 @@ namespace MediaBrowser.XbmcMetadata.Parsers
}
break;
}
case "airs_dayofweek":
{
item.AirDays = TVUtils.GetAirDays(reader.ReadElementContentAsString());
break;
}
case "airs_time":
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{
item.AirTime = val;
}
break;
}
case "status":
{