mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
update name searching
This commit is contained in:
parent
829aa9e855
commit
04d3175473
@ -933,21 +933,10 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
Path.Combine(path, validFilename) :
|
||||
Path.Combine(path, subFolderPrefix, validFilename);
|
||||
|
||||
var id = GetNewItemId(fullPath, type);
|
||||
|
||||
BaseItem obj;
|
||||
|
||||
if (!_libraryItemsCache.TryGetValue(id, out obj))
|
||||
{
|
||||
obj = CreateItemByName<T>(fullPath, name, id);
|
||||
|
||||
RegisterItem(id, obj);
|
||||
}
|
||||
|
||||
return obj as T;
|
||||
return CreateItemByName<T>(fullPath, name);
|
||||
}
|
||||
|
||||
private T CreateItemByName<T>(string path, string name, Guid id)
|
||||
private T CreateItemByName<T>(string path, string name)
|
||||
where T : BaseItem, new()
|
||||
{
|
||||
var isArtist = typeof(T) == typeof(MusicArtist);
|
||||
@ -970,6 +959,8 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
}
|
||||
}
|
||||
|
||||
var id = GetNewItemId(path, typeof(T));
|
||||
|
||||
var item = GetItemById(id) as T;
|
||||
|
||||
if (item == null)
|
||||
|
@ -89,10 +89,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
|
||||
/// </summary>
|
||||
/// appPaths
|
||||
/// or
|
||||
/// jsonSerializer
|
||||
/// </exception>
|
||||
public SqliteItemRepository(IServerConfigurationManager config, IJsonSerializer jsonSerializer, ILogManager logManager)
|
||||
: base(logManager)
|
||||
{
|
||||
@ -2317,12 +2313,13 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
if (_config.Configuration.SchemaVersion >= 66)
|
||||
{
|
||||
whereClauses.Add("CleanName=@Name");
|
||||
cmd.Parameters.Add(cmd, "@Name", DbType.String).Value = query.Name.RemoveDiacritics();
|
||||
}
|
||||
else
|
||||
{
|
||||
whereClauses.Add("Name=@Name");
|
||||
cmd.Parameters.Add(cmd, "@Name", DbType.String).Value = query.Name;
|
||||
}
|
||||
cmd.Parameters.Add(cmd, "@Name", DbType.String).Value = query.Name;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(query.NameContains))
|
||||
@ -2335,7 +2332,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
{
|
||||
whereClauses.Add("Name like @NameContains");
|
||||
}
|
||||
cmd.Parameters.Add(cmd, "@NameContains", DbType.String).Value = "%" + query.NameContains + "%";
|
||||
cmd.Parameters.Add(cmd, "@NameContains", DbType.String).Value = "%" + query.NameContains.RemoveDiacritics() + "%";
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(query.NameStartsWith))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user