You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.Model/Dlna/SearchCriteria.cs

42 lines
1.3 KiB

using MediaBrowser.Model.Extensions;
using System;
11 years ago
namespace MediaBrowser.Model.Dlna
{
public class SearchCriteria
{
public SearchType SearchType { get; set; }
public SearchCriteria(string search)
{
if (string.IsNullOrEmpty(search))
{
throw new ArgumentNullException("search");
}
SearchType = SearchType.Unknown;
if (StringHelper.IndexOfIgnoreCase(search, "upnp:class") != -1 &&
StringHelper.IndexOfIgnoreCase(search, "derivedfrom") != -1)
11 years ago
{
if (StringHelper.IndexOfIgnoreCase(search, "object.item.audioItem") != -1)
11 years ago
{
SearchType = SearchType.Audio;
}
else if (StringHelper.IndexOfIgnoreCase(search, "object.item.imageItem") != -1)
11 years ago
{
SearchType = SearchType.Image;
}
else if (StringHelper.IndexOfIgnoreCase(search, "object.item.videoItem") != -1)
11 years ago
{
SearchType = SearchType.Video;
}
else if (StringHelper.IndexOfIgnoreCase(search, "object.container.playlistContainer") != -1)
11 years ago
{
SearchType = SearchType.Playlist;
}
}
}
}
}