jellyfin-server/MediaBrowser.Model/Dto/MediaSourceInfo.cs

87 lines
2.1 KiB
C#
Raw Normal View History

2014-05-09 23:08:08 +00:00
using System;
using System.Runtime.Serialization;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.MediaInfo;
2014-05-01 03:24:55 +00:00
using System.Collections.Generic;
2014-03-19 04:59:45 +00:00
namespace MediaBrowser.Model.Dto
{
2014-03-22 16:16:43 +00:00
public class MediaSourceInfo
2014-03-19 04:59:45 +00:00
{
public string Id { get; set; }
2014-03-19 04:59:45 +00:00
public string Path { get; set; }
2014-04-01 22:23:07 +00:00
public string Container { get; set; }
2014-04-18 05:03:01 +00:00
public long? Size { get; set; }
2014-04-01 22:23:07 +00:00
2014-03-19 04:59:45 +00:00
public LocationType LocationType { get; set; }
2014-05-09 23:08:08 +00:00
2014-03-19 04:59:45 +00:00
public string Name { get; set; }
2014-05-09 23:08:08 +00:00
2014-03-19 04:59:45 +00:00
public long? RunTimeTicks { get; set; }
public VideoType? VideoType { get; set; }
public IsoType? IsoType { get; set; }
public Video3DFormat? Video3DFormat { get; set; }
2014-05-09 23:08:08 +00:00
2014-03-19 04:59:45 +00:00
public List<MediaStream> MediaStreams { get; set; }
2014-04-06 17:53:23 +00:00
2014-04-18 05:03:01 +00:00
public List<string> Formats { get; set; }
2014-05-09 23:08:08 +00:00
2014-04-06 17:53:23 +00:00
public int? Bitrate { get; set; }
2014-04-18 05:03:01 +00:00
2014-04-25 02:45:06 +00:00
public TransportStreamTimestamp? Timestamp { get; set; }
2014-05-09 23:08:08 +00:00
2014-04-18 05:03:01 +00:00
public MediaSourceInfo()
{
Formats = new List<string>();
MediaStreams = new List<MediaStream>();
}
2014-05-09 23:08:08 +00:00
[IgnoreDataMember]
public MediaStream DefaultAudioStream
{
get
{
foreach (MediaStream i in MediaStreams)
{
if (i.Type == MediaStreamType.Audio && i.IsDefault)
{
return i;
}
}
foreach (MediaStream i in MediaStreams)
{
if (i.Type == MediaStreamType.Audio)
{
return i;
}
}
return null;
}
}
[IgnoreDataMember]
public MediaStream VideoStream
{
get
{
foreach (MediaStream i in MediaStreams)
{
if (i.Type == MediaStreamType.Video && (i.Codec ?? string.Empty).IndexOf("jpeg", StringComparison.OrdinalIgnoreCase) == -1)
{
return i;
}
}
return null;
}
}
2014-03-19 04:59:45 +00:00
}
}