mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
Code Clean up: Convert to null-coalescing operator ?? (#5845)
Co-authored-by: Cody Robibero <cody@robibe.ro> Co-authored-by: Patrick Barron <18354464+barronpm@users.noreply.github.com>
This commit is contained in:
@@ -106,15 +106,10 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_themeSongIds == null)
|
||||
{
|
||||
_themeSongIds = GetExtras()
|
||||
.Where(extra => extra.ExtraType == Model.Entities.ExtraType.ThemeSong)
|
||||
.Select(song => song.Id)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
return _themeSongIds;
|
||||
return _themeSongIds ??= GetExtras()
|
||||
.Where(extra => extra.ExtraType == Model.Entities.ExtraType.ThemeSong)
|
||||
.Select(song => song.Id)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
private set
|
||||
@@ -128,15 +123,10 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_themeVideoIds == null)
|
||||
{
|
||||
_themeVideoIds = GetExtras()
|
||||
.Where(extra => extra.ExtraType == Model.Entities.ExtraType.ThemeVideo)
|
||||
.Select(song => song.Id)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
return _themeVideoIds;
|
||||
return _themeVideoIds ??= GetExtras()
|
||||
.Where(extra => extra.ExtraType == Model.Entities.ExtraType.ThemeVideo)
|
||||
.Select(song => song.Id)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
private set
|
||||
|
||||
@@ -75,10 +75,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public override List<BaseItem> GetChildren(User user, bool includeLinkedChildren, InternalItemsQuery query)
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
query = new InternalItemsQuery(user);
|
||||
}
|
||||
query ??= new InternalItemsQuery(user);
|
||||
|
||||
query.EnableTotalRecordCount = false;
|
||||
var result = GetItemList(query);
|
||||
|
||||
Reference in New Issue
Block a user