|
|
@ -57,7 +57,7 @@ namespace MediaBrowser.Providers.Savers
|
|
|
|
"RunningTime",
|
|
|
|
"RunningTime",
|
|
|
|
"Runtime",
|
|
|
|
"Runtime",
|
|
|
|
"TagLine",
|
|
|
|
"TagLine",
|
|
|
|
"TagLines",
|
|
|
|
"Taglines",
|
|
|
|
"IMDB_ID",
|
|
|
|
"IMDB_ID",
|
|
|
|
"IMDB",
|
|
|
|
"IMDB",
|
|
|
|
"IMDbId",
|
|
|
|
"IMDbId",
|
|
|
@ -71,7 +71,9 @@ namespace MediaBrowser.Providers.Savers
|
|
|
|
"Tags",
|
|
|
|
"Tags",
|
|
|
|
"Added",
|
|
|
|
"Added",
|
|
|
|
"LockData",
|
|
|
|
"LockData",
|
|
|
|
"Trailer"
|
|
|
|
"Trailer",
|
|
|
|
|
|
|
|
"CriticRating",
|
|
|
|
|
|
|
|
"CriticRatingSummary"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var position = xml.ToString().LastIndexOf("</", StringComparison.OrdinalIgnoreCase);
|
|
|
|
var position = xml.ToString().LastIndexOf("</", StringComparison.OrdinalIgnoreCase);
|
|
|
@ -299,14 +301,14 @@ namespace MediaBrowser.Providers.Savers
|
|
|
|
{
|
|
|
|
{
|
|
|
|
builder.Append("<TagLine>" + SecurityElement.Escape(item.Taglines[0]) + "</TagLine>");
|
|
|
|
builder.Append("<TagLine>" + SecurityElement.Escape(item.Taglines[0]) + "</TagLine>");
|
|
|
|
|
|
|
|
|
|
|
|
builder.Append("<TagLines>");
|
|
|
|
builder.Append("<Taglines>");
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var tagline in item.Taglines)
|
|
|
|
foreach (var tagline in item.Taglines)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
builder.Append("<Tagline>" + SecurityElement.Escape(tagline) + "</Tagline>");
|
|
|
|
builder.Append("<Tagline>" + SecurityElement.Escape(tagline) + "</Tagline>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
builder.Append("</TagLines>");
|
|
|
|
builder.Append("</Taglines>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (item.Genres.Count > 0)
|
|
|
|
if (item.Genres.Count > 0)
|
|
|
@ -369,60 +371,73 @@ namespace MediaBrowser.Providers.Savers
|
|
|
|
/// <typeparam name="T"></typeparam>
|
|
|
|
/// <typeparam name="T"></typeparam>
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
/// <param name="builder">The builder.</param>
|
|
|
|
/// <param name="builder">The builder.</param>
|
|
|
|
public static void AppendMediaInfo<T>(T item, StringBuilder builder)
|
|
|
|
public static void AddMediaInfo<T>(T item, StringBuilder builder)
|
|
|
|
where T : BaseItem, IHasMediaStreams
|
|
|
|
where T : BaseItem, IHasMediaStreams
|
|
|
|
{
|
|
|
|
{
|
|
|
|
builder.Append("<MediaInfo>");
|
|
|
|
builder.Append("<MediaInfo>");
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var stream in item.MediaStreams)
|
|
|
|
foreach (var stream in item.MediaStreams)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (stream.Type == MediaStreamType.Video)
|
|
|
|
builder.Append("<" + stream.Type + ">");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(stream.Codec))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
builder.Append("<Video>");
|
|
|
|
builder.Append("<Codec>" + SecurityElement.Escape(stream.Codec) + "</Codec>");
|
|
|
|
|
|
|
|
builder.Append("<FFCodec>" + SecurityElement.Escape(stream.Codec) + "</FFCodec>");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(stream.Codec))
|
|
|
|
if (stream.BitRate.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
builder.Append("<Codec>" + SecurityElement.Escape(stream.Codec) + "</Codec>");
|
|
|
|
builder.Append("<BitRate>" + stream.BitRate.Value.ToString(UsCulture) + "</BitRate>");
|
|
|
|
builder.Append("<FFCodec>" + SecurityElement.Escape(stream.Codec) + "</FFCodec>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (stream.BitRate.HasValue)
|
|
|
|
if (stream.Width.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
builder.Append("<BitRate>" + stream.BitRate.Value.ToString(UsCulture) + "</BitRate>");
|
|
|
|
builder.Append("<Width>" + stream.Width.Value.ToString(UsCulture) + "</Width>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (stream.Width.HasValue)
|
|
|
|
if (stream.Height.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
builder.Append("<Width>" + stream.Width.Value.ToString(UsCulture) + "</Width>");
|
|
|
|
builder.Append("<Height>" + stream.Height.Value.ToString(UsCulture) + "</Height>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (stream.Height.HasValue)
|
|
|
|
if (!string.IsNullOrEmpty(stream.AspectRatio))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
builder.Append("<Height>" + stream.Height.Value.ToString(UsCulture) + "</Height>");
|
|
|
|
builder.Append("<AspectRatio>" + SecurityElement.Escape(stream.AspectRatio) + "</AspectRatio>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(stream.AspectRatio))
|
|
|
|
var framerate = stream.AverageFrameRate ?? stream.RealFrameRate;
|
|
|
|
{
|
|
|
|
|
|
|
|
builder.Append("<AspectRatio>" + SecurityElement.Escape(stream.AspectRatio) + "</AspectRatio>");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var framerate = stream.AverageFrameRate ?? stream.RealFrameRate;
|
|
|
|
if (framerate.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
builder.Append("<FrameRate>" + framerate.Value.ToString(UsCulture) + "</FrameRate>");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (framerate.HasValue)
|
|
|
|
if (!string.IsNullOrEmpty(stream.Language))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
builder.Append("<FrameRate>" + framerate.Value.ToString(UsCulture) + "</FrameRate>");
|
|
|
|
builder.Append("<Language>" + SecurityElement.Escape(stream.Language) + "</Language>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(stream.Language))
|
|
|
|
if (!string.IsNullOrEmpty(stream.ScanType))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
builder.Append("<Language>" + SecurityElement.Escape(stream.Language) + "</Language>");
|
|
|
|
builder.Append("<ScanType>" + SecurityElement.Escape(stream.ScanType) + "</ScanType>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (stream.Channels.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
builder.Append("<Channels>" + stream.Channels.Value.ToString(UsCulture) + "</Channels>");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(stream.ScanType))
|
|
|
|
if (stream.SampleRate.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
builder.Append("<ScanType>" + SecurityElement.Escape(stream.ScanType) + "</ScanType>");
|
|
|
|
builder.Append("<SamplingRate>" + stream.SampleRate.Value.ToString(UsCulture) + "</SamplingRate>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.Append("<Default>" + SecurityElement.Escape(stream.IsDefault.ToString()) + "</Default>");
|
|
|
|
|
|
|
|
builder.Append("<Forced>" + SecurityElement.Escape(stream.IsForced.ToString()) + "</Forced>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (stream.Type == MediaStreamType.Video)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (item.RunTimeTicks.HasValue)
|
|
|
|
if (item.RunTimeTicks.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var timespan = TimeSpan.FromTicks(item.RunTimeTicks.Value);
|
|
|
|
var timespan = TimeSpan.FromTicks(item.RunTimeTicks.Value);
|
|
|
@ -431,9 +446,6 @@ namespace MediaBrowser.Providers.Savers
|
|
|
|
builder.Append("<DurationSeconds>" + Convert.ToInt32(timespan.TotalSeconds).ToString(UsCulture) + "</DurationSeconds>");
|
|
|
|
builder.Append("<DurationSeconds>" + Convert.ToInt32(timespan.TotalSeconds).ToString(UsCulture) + "</DurationSeconds>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
builder.Append("<Default>" + SecurityElement.Escape(stream.IsDefault.ToString()) + "</Default>");
|
|
|
|
|
|
|
|
builder.Append("<Forced>" + SecurityElement.Escape(stream.IsForced.ToString()) + "</Forced>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var video = item as Video;
|
|
|
|
var video = item as Video;
|
|
|
|
|
|
|
|
|
|
|
|
if (video != null && video.Video3DFormat.HasValue)
|
|
|
|
if (video != null && video.Video3DFormat.HasValue)
|
|
|
@ -454,58 +466,9 @@ namespace MediaBrowser.Providers.Savers
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
builder.Append("</Video>");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (stream.Type == MediaStreamType.Audio)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
builder.Append("<Audio>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(stream.Codec))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
builder.Append("<Codec>" + SecurityElement.Escape(stream.Codec) + "</Codec>");
|
|
|
|
|
|
|
|
builder.Append("<FFCodec>" + SecurityElement.Escape(stream.Codec) + "</FFCodec>");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (stream.Channels.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
builder.Append("<Channels>" + stream.Channels.Value.ToString(UsCulture) + "</Channels>");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (stream.BitRate.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
builder.Append("<BitRate>" + stream.BitRate.Value.ToString(UsCulture) + "</BitRate>");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (stream.SampleRate.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
builder.Append("<SamplingRate>" + stream.SampleRate.Value.ToString(UsCulture) + "</SamplingRate>");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(stream.Language))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
builder.Append("<Language>" + SecurityElement.Escape(stream.Language) + "</Language>");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.Append("<Default>" + SecurityElement.Escape(stream.IsDefault.ToString()) + "</Default>");
|
|
|
|
|
|
|
|
builder.Append("<Forced>" + SecurityElement.Escape(stream.IsForced.ToString()) + "</Forced>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.Append("</Audio>");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (stream.Type == MediaStreamType.Subtitle)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
builder.Append("<Subtitle>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(stream.Language))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
builder.Append("<Language>" + SecurityElement.Escape(stream.Language) + "</Language>");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.Append("<Default>" + SecurityElement.Escape(stream.IsDefault.ToString()) + "</Default>");
|
|
|
|
|
|
|
|
builder.Append("<Forced>" + SecurityElement.Escape(stream.IsForced.ToString()) + "</Forced>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.Append("</Subtitle>");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.Append("</" + stream.Type + ">");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
builder.Append("</MediaInfo>");
|
|
|
|
builder.Append("</MediaInfo>");
|
|
|
|