mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
update FindByPath
This commit is contained in:
parent
076a07a546
commit
6b1f786a44
@ -795,6 +795,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||||||
Path = path
|
Path = path
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Only use the database result if there's exactly one item, otherwise we run the risk of returning old data that hasn't been cleaned yet.
|
||||||
var items = GetItemIds(query).Select(GetItemById).Where(i => i != null).ToArray();
|
var items = GetItemIds(query).Select(GetItemById).Where(i => i != null).ToArray();
|
||||||
|
|
||||||
if (items.Length == 1)
|
if (items.Length == 1)
|
||||||
@ -802,6 +803,11 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||||||
return items[0];
|
return items[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (items.Length == 0)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return RootFolder.FindByPath(path);
|
return RootFolder.FindByPath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user