Merge pull request #2814 from MediaBrowser/dev

fixes #2798, fixes #2799
This commit is contained in:
Luke 2017-08-13 16:15:33 -04:00 committed by GitHub
commit 7f200f057d
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; var series = item as Series;
if (series != null) 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; dto.Status = series.Status.HasValue ? series.Status.Value.ToString() : null;
} }

View File

@ -372,6 +372,12 @@ namespace MediaBrowser.Api
if (series != null) if (series != null)
{ {
series.Status = GetSeriesStatus(request); 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; RemoteTrailers = EmptyMediaUrlArray;
LocalTrailerIds = EmptyGuidArray; LocalTrailerIds = EmptyGuidArray;
RemoteTrailerIds = EmptyGuidArray; RemoteTrailerIds = EmptyGuidArray;
AirDays = new DayOfWeek[] { };
} }
public DayOfWeek[] AirDays { get; set; }
public string AirTime { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAddingToPlaylist public override bool SupportsAddingToPlaylist
{ {

View File

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

View File

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

View File

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

View File

@ -64,10 +64,20 @@ namespace MediaBrowser.Providers.TV
var sourceItem = source.Item; var sourceItem = source.Item;
var targetItem = target.Item; var targetItem = target.Item;
if (replaceData || string.IsNullOrEmpty(targetItem.AirTime))
{
targetItem.AirTime = sourceItem.AirTime;
}
if (replaceData || !targetItem.Status.HasValue) if (replaceData || !targetItem.Status.HasValue)
{ {
targetItem.Status = sourceItem.Status; 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; 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": case "ContentRating":
{ {
var val = reader.ReadElementContentAsString(); var val = reader.ReadElementContentAsString();

View File

@ -61,6 +61,22 @@ namespace MediaBrowser.XbmcMetadata.Parsers
} }
break; 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": case "status":
{ {