jellyfin/MediaBrowser.Dlna/PlayTo/uBaseObject.cs

59 lines
1.5 KiB
C#
Raw Normal View History

2014-04-22 17:25:54 +00:00
using System;
2014-02-26 21:31:47 +00:00
namespace MediaBrowser.Dlna.PlayTo
{
public class uBaseObject
{
public string Id { get; set; }
public string ParentId { get; set; }
public string Title { get; set; }
public string SecondText { get; set; }
public string IconUrl { get; set; }
public string MetaData { get; set; }
public string Url { get; set; }
public string[] ProtocolInfo { get; set; }
2014-04-22 17:25:54 +00:00
public string UpnpClass { get; set; }
public bool Equals(uBaseObject obj)
{
if (obj == null)
{
throw new ArgumentNullException("obj");
}
return string.Equals(Id, obj.Id);
}
public string MediaType
{
get
{
var classType = UpnpClass ?? string.Empty;
if (classType.IndexOf(Model.Entities.MediaType.Audio, StringComparison.Ordinal) != -1)
{
return Model.Entities.MediaType.Audio;
}
if (classType.IndexOf(Model.Entities.MediaType.Video, StringComparison.Ordinal) != -1)
{
return Model.Entities.MediaType.Video;
}
if (classType.IndexOf("image", StringComparison.Ordinal) != -1)
{
return Model.Entities.MediaType.Photo;
}
return null;
}
}
2014-02-26 21:31:47 +00:00
}
}