add new search filters

This commit is contained in:
Luke Pulverenti 2017-05-06 15:45:23 -04:00
parent 59f2463efd
commit d48496b843
18 changed files with 69 additions and 119 deletions

View File

@ -201,7 +201,6 @@ namespace Emby.Server.Implementations.Data
AddColumn(db, "TypedBaseItems", "SortName", "Text", existingColumnNames); AddColumn(db, "TypedBaseItems", "SortName", "Text", existingColumnNames);
AddColumn(db, "TypedBaseItems", "RunTimeTicks", "BIGINT", existingColumnNames); AddColumn(db, "TypedBaseItems", "RunTimeTicks", "BIGINT", existingColumnNames);
AddColumn(db, "TypedBaseItems", "OfficialRatingDescription", "Text", existingColumnNames);
AddColumn(db, "TypedBaseItems", "HomePageUrl", "Text", existingColumnNames); AddColumn(db, "TypedBaseItems", "HomePageUrl", "Text", existingColumnNames);
AddColumn(db, "TypedBaseItems", "VoteCount", "INT", existingColumnNames); AddColumn(db, "TypedBaseItems", "VoteCount", "INT", existingColumnNames);
AddColumn(db, "TypedBaseItems", "DisplayMediaType", "Text", existingColumnNames); AddColumn(db, "TypedBaseItems", "DisplayMediaType", "Text", existingColumnNames);
@ -426,7 +425,6 @@ namespace Emby.Server.Implementations.Data
"ParentIndexNumber", "ParentIndexNumber",
"ProductionYear", "ProductionYear",
"OfficialRating", "OfficialRating",
"OfficialRatingDescription",
"HomePageUrl", "HomePageUrl",
"DisplayMediaType", "DisplayMediaType",
"ForcedSortName", "ForcedSortName",
@ -547,7 +545,6 @@ namespace Emby.Server.Implementations.Data
"InheritedParentalRatingValue", "InheritedParentalRatingValue",
"SortName", "SortName",
"RunTimeTicks", "RunTimeTicks",
"OfficialRatingDescription",
"HomePageUrl", "HomePageUrl",
"VoteCount", "VoteCount",
"DisplayMediaType", "DisplayMediaType",
@ -825,7 +822,6 @@ namespace Emby.Server.Implementations.Data
saveItemStatement.TryBind("@SortName", item.SortName); saveItemStatement.TryBind("@SortName", item.SortName);
saveItemStatement.TryBind("@RunTimeTicks", item.RunTimeTicks); saveItemStatement.TryBind("@RunTimeTicks", item.RunTimeTicks);
saveItemStatement.TryBind("@OfficialRatingDescription", item.OfficialRatingDescription);
saveItemStatement.TryBind("@HomePageUrl", item.HomePageUrl); saveItemStatement.TryBind("@HomePageUrl", item.HomePageUrl);
saveItemStatement.TryBind("@VoteCount", item.VoteCount); saveItemStatement.TryBind("@VoteCount", item.VoteCount);
saveItemStatement.TryBind("@DisplayMediaType", item.DisplayMediaType); saveItemStatement.TryBind("@DisplayMediaType", item.DisplayMediaType);
@ -1278,22 +1274,10 @@ namespace Emby.Server.Implementations.Data
{ {
return false; return false;
} }
if (type == typeof(Year))
{
return false;
}
if (type == typeof(Book))
{
return false;
}
if (type == typeof(Person)) if (type == typeof(Person))
{ {
return false; return false;
} }
if (type == typeof(RecordingGroup))
{
return false;
}
if (type == typeof(Channel)) if (type == typeof(Channel))
{ {
return false; return false;
@ -1327,31 +1311,42 @@ namespace Emby.Server.Implementations.Data
return false; return false;
} }
} }
if (_config.Configuration.SkipDeserializationForPrograms)
if (type == typeof(Year))
{ {
if (type == typeof(LiveTvProgram)) return false;
{
return false;
}
} }
if (type == typeof(Book))
{
return false;
}
if (type == typeof(RecordingGroup))
{
return false;
}
if (type == typeof(LiveTvProgram))
{
return false;
}
if (type == typeof(LiveTvAudioRecording))
{
return false;
}
if (type == typeof(AudioPodcast))
{
return false;
}
if (type == typeof(AudioBook))
{
return false;
}
if (_config.Configuration.SkipDeserializationForAudio) if (_config.Configuration.SkipDeserializationForAudio)
{ {
if (type == typeof(Audio)) if (type == typeof(Audio))
{ {
return false; return false;
} }
if (type == typeof(LiveTvAudioRecording))
{
return false;
}
if (type == typeof(AudioPodcast))
{
return false;
}
if (type == typeof(AudioBook))
{
return false;
}
if (type == typeof(MusicAlbum)) if (type == typeof(MusicAlbum))
{ {
return false; return false;
@ -1597,15 +1592,6 @@ namespace Emby.Server.Implementations.Data
} }
index++; index++;
if (query.HasField(ItemFields.OfficialRatingDescription))
{
if (!reader.IsDBNull(index))
{
item.OfficialRatingDescription = reader.GetString(index);
}
index++;
}
if (query.HasField(ItemFields.HomePageUrl)) if (query.HasField(ItemFields.HomePageUrl))
{ {
if (!reader.IsDBNull(index)) if (!reader.IsDBNull(index))

View File

@ -168,7 +168,13 @@ namespace Emby.Server.Implementations.Library
IncludeItemsByName = string.IsNullOrWhiteSpace(query.ParentId), IncludeItemsByName = string.IsNullOrWhiteSpace(query.ParentId),
ParentId = string.IsNullOrWhiteSpace(query.ParentId) ? (Guid?)null : new Guid(query.ParentId), ParentId = string.IsNullOrWhiteSpace(query.ParentId) ? (Guid?)null : new Guid(query.ParentId),
SortBy = new[] { ItemSortBy.SortName }, SortBy = new[] { ItemSortBy.SortName },
Recursive = true Recursive = true,
IsKids = query.IsKids,
IsMovie = query.IsMovie,
IsNews = query.IsNews,
IsSeries = query.IsSeries,
IsSports = query.IsSports
}); });
// Add search hints based on item name // Add search hints based on item name

View File

@ -2155,11 +2155,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
writer.WriteElementString("mpaa", item.OfficialRating); writer.WriteElementString("mpaa", item.OfficialRating);
} }
if (!string.IsNullOrEmpty(item.OfficialRatingDescription))
{
writer.WriteElementString("mpaadescription", item.OfficialRatingDescription);
}
var overview = (item.Overview ?? string.Empty) var overview = (item.Overview ?? string.Empty)
.StripHtml() .StripHtml()
.Replace(""", "'"); .Replace(""", "'");

View File

@ -101,12 +101,6 @@ namespace Emby.Server.Implementations.Security
/// <returns></returns> /// <returns></returns>
public async Task LoadAllRegistrationInfo() public async Task LoadAllRegistrationInfo()
{ {
var response = await _httpClient.GetResponse(new HttpRequestOptions
{
Url = "http://192.168.1.2:8096/emby/Videos/663c8a38ccfe91af6566852f78e62c26/stream.mkv?Static=true&mediaSourceId=663c8a38ccfe91af6566852f78e62c26&deviceId=hyJA92oXn4RExFTGismCnY6da91kwnTvv8YvsYf0E&Tag=bcdc02b1cdd6f1eb4a57a6812831617b"
}).ConfigureAwait(false);
var tasks = new List<Task>(); var tasks = new List<Task>();
ResetSupporterInfo(); ResetSupporterInfo();

View File

@ -69,6 +69,21 @@ namespace MediaBrowser.Api
public string ParentId { get; set; } public string ParentId { get; set; }
[ApiMember(Name = "IsMovie", Description = "Optional filter for movies.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET,POST")]
public bool? IsMovie { get; set; }
[ApiMember(Name = "IsSeries", Description = "Optional filter for movies.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET,POST")]
public bool? IsSeries { get; set; }
[ApiMember(Name = "IsNews", Description = "Optional filter for news.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET,POST")]
public bool? IsNews { get; set; }
[ApiMember(Name = "IsKids", Description = "Optional filter for kids.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET,POST")]
public bool? IsKids { get; set; }
[ApiMember(Name = "IsSports", Description = "Optional filter for sports.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET,POST")]
public bool? IsSports { get; set; }
public GetSearchHints() public GetSearchHints()
{ {
IncludeArtists = true; IncludeArtists = true;
@ -139,7 +154,13 @@ namespace MediaBrowser.Api
StartIndex = request.StartIndex, StartIndex = request.StartIndex,
UserId = request.UserId, UserId = request.UserId,
IncludeItemTypes = (request.IncludeItemTypes ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToArray(), IncludeItemTypes = (request.IncludeItemTypes ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToArray(),
ParentId = request.ParentId ParentId = request.ParentId,
IsKids = request.IsKids,
IsMovie = request.IsMovie,
IsNews = request.IsNews,
IsSeries = request.IsSeries,
IsSports = request.IsSports
}).ConfigureAwait(false); }).ConfigureAwait(false);

View File

@ -95,7 +95,6 @@ namespace MediaBrowser.Api
config.EnableStandaloneMusicKeys = true; config.EnableStandaloneMusicKeys = true;
config.EnableCaseSensitiveItemIds = true; config.EnableCaseSensitiveItemIds = true;
config.SkipDeserializationForBasicTypes = true; config.SkipDeserializationForBasicTypes = true;
config.SkipDeserializationForPrograms = true;
config.SkipDeserializationForAudio = true; config.SkipDeserializationForAudio = true;
config.EnableSeriesPresentationUniqueKey = true; config.EnableSeriesPresentationUniqueKey = true;
config.EnableLocalizedGuids = true; config.EnableLocalizedGuids = true;

View File

@ -84,6 +84,7 @@ namespace MediaBrowser.Controller.Entities
public long? Size { get; set; } public long? Size { get; set; }
public string Container { get; set; } public string Container { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public string Tagline { get; set; } public string Tagline { get; set; }
@ -834,13 +835,6 @@ namespace MediaBrowser.Controller.Entities
[IgnoreDataMember] [IgnoreDataMember]
public float? CriticRating { get; set; } public float? CriticRating { get; set; }
/// <summary>
/// Gets or sets the official rating description.
/// </summary>
/// <value>The official rating description.</value>
[IgnoreDataMember]
public string OfficialRatingDescription { get; set; }
/// <summary> /// <summary>
/// Gets or sets the custom rating. /// Gets or sets the custom rating.
/// </summary> /// </summary>
@ -2291,11 +2285,6 @@ namespace MediaBrowser.Controller.Entities
ownedItem.CustomRating = item.CustomRating; ownedItem.CustomRating = item.CustomRating;
newOptions.ForceSave = true; newOptions.ForceSave = true;
} }
if (!string.Equals(item.OfficialRatingDescription, ownedItem.OfficialRatingDescription, StringComparison.Ordinal))
{
ownedItem.OfficialRatingDescription = item.OfficialRatingDescription;
newOptions.ForceSave = true;
}
} }
return ownedItem.RefreshMetadata(newOptions, cancellationToken); return ownedItem.RefreshMetadata(newOptions, cancellationToken);

View File

@ -175,7 +175,6 @@ namespace MediaBrowser.Controller.Entities
case ItemFields.DateCreated: case ItemFields.DateCreated:
case ItemFields.SortName: case ItemFields.SortName:
case ItemFields.Overview: case ItemFields.Overview:
case ItemFields.OfficialRatingDescription:
case ItemFields.HomePageUrl: case ItemFields.HomePageUrl:
case ItemFields.VoteCount: case ItemFields.VoteCount:
case ItemFields.DisplayMediaType: case ItemFields.DisplayMediaType:

View File

@ -365,17 +365,6 @@ namespace MediaBrowser.LocalMetadata.Parsers
break; break;
} }
case "MPAADescription":
{
var rating = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(rating))
{
item.OfficialRatingDescription = rating;
}
break;
}
case "CustomRating": case "CustomRating":
{ {
var val = reader.ReadElementContentAsString(); var val = reader.ReadElementContentAsString();

View File

@ -71,8 +71,6 @@ namespace MediaBrowser.LocalMetadata.Savers
// Deprecated. No longer saving in this field. // Deprecated. No longer saving in this field.
"MPAARating", "MPAARating",
"MPAADescription",
"MusicBrainzArtistId", "MusicBrainzArtistId",
"MusicBrainzAlbumArtistId", "MusicBrainzAlbumArtistId",
"MusicBrainzAlbumId", "MusicBrainzAlbumId",
@ -308,11 +306,6 @@ namespace MediaBrowser.LocalMetadata.Savers
writer.WriteElementString("ContentRating", item.OfficialRating); writer.WriteElementString("ContentRating", item.OfficialRating);
} }
if (!string.IsNullOrEmpty(item.OfficialRatingDescription))
{
writer.WriteElementString("MPAADescription", item.OfficialRatingDescription);
}
writer.WriteElementString("Added", item.DateCreated.ToLocalTime().ToString("G")); writer.WriteElementString("Added", item.DateCreated.ToLocalTime().ToString("G"));
writer.WriteElementString("LockData", item.IsLocked.ToString().ToLower()); writer.WriteElementString("LockData", item.IsLocked.ToString().ToLower());

View File

@ -164,7 +164,6 @@ namespace MediaBrowser.Model.Configuration
public bool EnableAutomaticRestart { get; set; } public bool EnableAutomaticRestart { get; set; }
public bool SkipDeserializationForBasicTypes { get; set; } public bool SkipDeserializationForBasicTypes { get; set; }
public bool SkipDeserializationForPrograms { get; set; }
public bool SkipDeserializationForAudio { get; set; } public bool SkipDeserializationForAudio { get; set; }
public string ServerName { get; set; } public string ServerName { get; set; }

View File

@ -117,8 +117,6 @@
/// </summary> /// </summary>
MediaSources, MediaSources,
OfficialRatingDescription,
OriginalTitle, OriginalTitle,
/// <summary> /// <summary>

View File

@ -36,6 +36,16 @@ namespace MediaBrowser.Model.Search
public string[] IncludeItemTypes { get; set; } public string[] IncludeItemTypes { get; set; }
public string ParentId { get; set; } public string ParentId { get; set; }
public bool? IsMovie { get; set; }
public bool? IsSeries { get; set; }
public bool? IsNews { get; set; }
public bool? IsKids { get; set; }
public bool? IsSports { get; set; }
public SearchQuery() public SearchQuery()
{ {
IncludeArtists = true; IncludeArtists = true;

View File

@ -91,11 +91,6 @@ namespace MediaBrowser.Providers.Manager
} }
} }
if (replaceData || string.IsNullOrEmpty(target.OfficialRatingDescription))
{
target.OfficialRatingDescription = source.OfficialRatingDescription;
}
if (replaceData || string.IsNullOrEmpty(target.CustomRating)) if (replaceData || string.IsNullOrEmpty(target.CustomRating))
{ {
target.CustomRating = source.CustomRating; target.CustomRating = source.CustomRating;

View File

@ -356,11 +356,6 @@ namespace MediaBrowser.Providers.MediaInfo
} }
} }
if (!string.IsNullOrWhiteSpace(data.OfficialRatingDescription) || isFullRefresh)
{
video.OfficialRatingDescription = data.OfficialRatingDescription;
}
if (!video.IsLocked && !video.LockedFields.Contains(MetadataFields.Genres)) if (!video.IsLocked && !video.LockedFields.Contains(MetadataFields.Genres))
{ {
if (video.Genres.Count == 0 || isFullRefresh) if (video.Genres.Count == 0 || isFullRefresh)

View File

@ -452,17 +452,6 @@ namespace MediaBrowser.XbmcMetadata.Parsers
break; break;
} }
case "mpaadescription":
{
var rating = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(rating))
{
item.OfficialRatingDescription = rating;
}
break;
}
case "customrating": case "customrating":
{ {
var val = reader.ReadElementContentAsString(); var val = reader.ReadElementContentAsString();

View File

@ -19,7 +19,6 @@ using System.Text;
using System.Threading; using System.Threading;
using System.Xml; using System.Xml;
using MediaBrowser.Common.IO; using MediaBrowser.Common.IO;
using MediaBrowser.Controller.IO;
using MediaBrowser.Model.Extensions; using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.Xml; using MediaBrowser.Model.Xml;
@ -42,7 +41,6 @@ namespace MediaBrowser.XbmcMetadata.Savers
"year", "year",
"sorttitle", "sorttitle",
"mpaa", "mpaa",
"mpaadescription",
"aspectratio", "aspectratio",
"website", "website",
"collectionnumber", "collectionnumber",
@ -556,11 +554,6 @@ namespace MediaBrowser.XbmcMetadata.Savers
writer.WriteElementString("mpaa", item.OfficialRating); writer.WriteElementString("mpaa", item.OfficialRating);
} }
if (!string.IsNullOrEmpty(item.OfficialRatingDescription))
{
writer.WriteElementString("mpaadescription", item.OfficialRatingDescription);
}
var hasAspectRatio = item as IHasAspectRatio; var hasAspectRatio = item as IHasAspectRatio;
if (hasAspectRatio != null) if (hasAspectRatio != null)
{ {

View File

@ -1,3 +1,3 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("3.2.13.14")] [assembly: AssemblyVersion("3.2.14.1")]