2020-01-22 13:00:07 -07:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 12:54:44 -07:00
|
|
|
using System;
|
2016-10-29 15:22:20 -07:00
|
|
|
|
2016-10-29 15:34:54 -07:00
|
|
|
namespace Emby.Dlna.PlayTo
|
2016-10-29 15:22:20 -07:00
|
|
|
{
|
2019-01-07 16:27:46 -07:00
|
|
|
public class uBaseObject
|
2016-10-29 15:22:20 -07:00
|
|
|
{
|
|
|
|
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; }
|
|
|
|
|
|
|
|
public string UpnpClass { get; set; }
|
|
|
|
|
|
|
|
public bool Equals(uBaseObject obj)
|
|
|
|
{
|
|
|
|
if (obj == null)
|
|
|
|
{
|
2019-01-06 13:50:43 -07:00
|
|
|
throw new ArgumentNullException(nameof(obj));
|
2016-10-29 15:22:20 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return string.Equals(Id, obj.Id);
|
|
|
|
}
|
|
|
|
|
|
|
|
public string MediaType
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
var classType = UpnpClass ?? string.Empty;
|
|
|
|
|
2016-10-29 15:34:54 -07:00
|
|
|
if (classType.IndexOf(MediaBrowser.Model.Entities.MediaType.Audio, StringComparison.Ordinal) != -1)
|
2016-10-29 15:22:20 -07:00
|
|
|
{
|
2016-10-29 15:34:54 -07:00
|
|
|
return MediaBrowser.Model.Entities.MediaType.Audio;
|
2016-10-29 15:22:20 -07:00
|
|
|
}
|
2016-10-29 15:34:54 -07:00
|
|
|
if (classType.IndexOf(MediaBrowser.Model.Entities.MediaType.Video, StringComparison.Ordinal) != -1)
|
2016-10-29 15:22:20 -07:00
|
|
|
{
|
2016-10-29 15:34:54 -07:00
|
|
|
return MediaBrowser.Model.Entities.MediaType.Video;
|
2016-10-29 15:22:20 -07:00
|
|
|
}
|
|
|
|
if (classType.IndexOf("image", StringComparison.Ordinal) != -1)
|
|
|
|
{
|
2016-10-29 15:34:54 -07:00
|
|
|
return MediaBrowser.Model.Entities.MediaType.Photo;
|
2016-10-29 15:22:20 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|