2021-05-07 14:43:50 +02:00
|
|
|
#nullable disable
|
|
|
|
|
2020-01-22 21:00:07 +01:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 20:54:44 +01:00
|
|
|
using System;
|
2020-08-20 21:04:57 +02:00
|
|
|
using System.Collections.Generic;
|
2016-10-30 00:22:20 +02:00
|
|
|
|
2016-10-30 00:34:54 +02:00
|
|
|
namespace Emby.Dlna.PlayTo
|
2016-10-30 00:22:20 +02:00
|
|
|
{
|
2020-08-20 21:04:57 +02:00
|
|
|
public class UBaseObject
|
2016-10-30 00:22:20 +02: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; }
|
|
|
|
|
2020-08-20 21:04:57 +02:00
|
|
|
public IReadOnlyList<string> ProtocolInfo { get; set; }
|
2016-10-30 00:22:20 +02:00
|
|
|
|
|
|
|
public string UpnpClass { get; set; }
|
|
|
|
|
|
|
|
public string MediaType
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
var classType = UpnpClass ?? string.Empty;
|
|
|
|
|
2016-10-30 00:34:54 +02:00
|
|
|
if (classType.IndexOf(MediaBrowser.Model.Entities.MediaType.Audio, StringComparison.Ordinal) != -1)
|
2016-10-30 00:22:20 +02:00
|
|
|
{
|
2016-10-30 00:34:54 +02:00
|
|
|
return MediaBrowser.Model.Entities.MediaType.Audio;
|
2016-10-30 00:22:20 +02:00
|
|
|
}
|
2020-06-15 23:43:52 +02:00
|
|
|
|
2016-10-30 00:34:54 +02:00
|
|
|
if (classType.IndexOf(MediaBrowser.Model.Entities.MediaType.Video, StringComparison.Ordinal) != -1)
|
2016-10-30 00:22:20 +02:00
|
|
|
{
|
2016-10-30 00:34:54 +02:00
|
|
|
return MediaBrowser.Model.Entities.MediaType.Video;
|
2016-10-30 00:22:20 +02:00
|
|
|
}
|
2020-06-15 23:43:52 +02:00
|
|
|
|
2016-10-30 00:22:20 +02:00
|
|
|
if (classType.IndexOf("image", StringComparison.Ordinal) != -1)
|
|
|
|
{
|
2016-10-30 00:34:54 +02:00
|
|
|
return MediaBrowser.Model.Entities.MediaType.Photo;
|
2016-10-30 00:22:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
2020-08-20 17:01:04 +02:00
|
|
|
|
2020-08-20 21:04:57 +02:00
|
|
|
public bool Equals(UBaseObject obj)
|
2020-08-20 17:01:04 +02:00
|
|
|
{
|
2022-10-06 20:21:23 +02:00
|
|
|
ArgumentNullException.ThrowIfNull(obj);
|
2020-08-20 17:01:04 +02:00
|
|
|
|
2020-08-20 18:50:15 +02:00
|
|
|
return string.Equals(Id, obj.Id, StringComparison.Ordinal);
|
2020-08-20 17:01:04 +02:00
|
|
|
}
|
2016-10-30 00:22:20 +02:00
|
|
|
}
|
|
|
|
}
|