mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-01 05:18:27 +01:00
Replace == null with is null
This commit is contained in:
@@ -56,7 +56,7 @@ namespace MediaBrowser.Controller.BaseItemManager
|
||||
|
||||
var itemConfig = _serverConfigurationManager.Configuration.MetadataOptions.FirstOrDefault(i => string.Equals(i.ItemType, baseItem.GetType().Name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
return itemConfig == null || !itemConfig.DisabledMetadataFetchers.Contains(name.AsSpan(), StringComparison.OrdinalIgnoreCase);
|
||||
return itemConfig is null || !itemConfig.DisabledMetadataFetchers.Contains(name.AsSpan(), StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -81,7 +81,7 @@ namespace MediaBrowser.Controller.BaseItemManager
|
||||
|
||||
var itemConfig = _serverConfigurationManager.Configuration.MetadataOptions.FirstOrDefault(i => string.Equals(i.ItemType, baseItem.GetType().Name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
return itemConfig == null || !itemConfig.DisabledImageFetchers.Contains(name.AsSpan(), StringComparison.OrdinalIgnoreCase);
|
||||
return itemConfig is null || !itemConfig.DisabledImageFetchers.Contains(name.AsSpan(), StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace MediaBrowser.Controller.Drawing
|
||||
{
|
||||
var imageInfo = item.GetImageInfo(imageType, imageIndex);
|
||||
|
||||
if (imageInfo == null)
|
||||
if (imageInfo is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
lock (_childIdsLock)
|
||||
{
|
||||
if (_childrenIds == null || _childrenIds.Length == 0)
|
||||
if (_childrenIds is null || _childrenIds.Length == 0)
|
||||
{
|
||||
var list = base.LoadChildren();
|
||||
_childrenIds = list.Select(i => i.Id).ToArray();
|
||||
|
||||
@@ -494,7 +494,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_sortName == null)
|
||||
if (_sortName is null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ForcedSortName))
|
||||
{
|
||||
@@ -880,7 +880,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <returns>System.String.</returns>
|
||||
protected virtual string CreateSortName()
|
||||
{
|
||||
if (Name == null)
|
||||
if (Name is null)
|
||||
{
|
||||
return null; // some items may not have name filled in properly
|
||||
}
|
||||
@@ -1073,7 +1073,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var stream = i.VideoStream;
|
||||
|
||||
return stream == null || stream.Width == null ? 0 : stream.Width.Value;
|
||||
return stream is null || stream.Width is null ? 0 : stream.Width.Value;
|
||||
})
|
||||
.ToList();
|
||||
}
|
||||
@@ -1330,7 +1330,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public void SetParent(Folder parent)
|
||||
{
|
||||
ParentId = parent == null ? Guid.Empty : parent.Id;
|
||||
ParentId = parent is null ? Guid.Empty : parent.Id;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1534,7 +1534,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
var maxAllowedRating = user.MaxParentalAgeRating;
|
||||
|
||||
if (maxAllowedRating == null)
|
||||
if (maxAllowedRating is null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1701,7 +1701,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
var item = FindLinkedChild(info);
|
||||
|
||||
// If still null, log
|
||||
if (item == null)
|
||||
if (item is null)
|
||||
{
|
||||
// Don't keep searching over and over
|
||||
info.ItemId = Guid.Empty;
|
||||
@@ -1725,7 +1725,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
var itemByPath = LibraryManager.FindByPath(path, null);
|
||||
|
||||
if (itemByPath == null)
|
||||
if (itemByPath is null)
|
||||
{
|
||||
Logger.LogWarning("Unable to find linked item at path {0}", info.Path);
|
||||
}
|
||||
@@ -1737,7 +1737,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var item = LibraryManager.GetItemById(info.LibraryItemId);
|
||||
|
||||
if (item == null)
|
||||
if (item is null)
|
||||
{
|
||||
Logger.LogWarning("Unable to find linked item at path {0}", info.Path);
|
||||
}
|
||||
@@ -1892,7 +1892,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
var existingImage = GetImageInfo(image.Type, index);
|
||||
|
||||
if (existingImage == null)
|
||||
if (existingImage is null)
|
||||
{
|
||||
AddImage(image);
|
||||
}
|
||||
@@ -1915,7 +1915,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
var image = GetImageInfo(type, index);
|
||||
|
||||
if (image == null)
|
||||
if (image is null)
|
||||
{
|
||||
AddImage(GetImageInfo(file, type));
|
||||
}
|
||||
@@ -1942,7 +1942,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var info = GetImageInfo(type, index);
|
||||
|
||||
if (info == null)
|
||||
if (info is null)
|
||||
{
|
||||
// Nothing to do
|
||||
return;
|
||||
@@ -2035,7 +2035,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var chapter = ItemRepository.GetChapter(this, imageIndex);
|
||||
|
||||
if (chapter == null)
|
||||
if (chapter is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -2147,7 +2147,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
foreach (var newImage in images)
|
||||
{
|
||||
if (newImage == null)
|
||||
if (newImage is null)
|
||||
{
|
||||
throw new ArgumentException("null image found in list");
|
||||
}
|
||||
@@ -2155,7 +2155,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
var existing = existingImages
|
||||
.Find(i => string.Equals(i.Path, newImage.FullName, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (existing == null)
|
||||
if (existing is null)
|
||||
{
|
||||
newImageList.Add(newImage);
|
||||
}
|
||||
@@ -2241,7 +2241,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
var info1 = GetImageInfo(type, index1);
|
||||
var info2 = GetImageInfo(type, index2);
|
||||
|
||||
if (info1 == null || info2 == null)
|
||||
if (info1 is null || info2 is null)
|
||||
{
|
||||
// Nothing to do
|
||||
return Task.CompletedTask;
|
||||
@@ -2290,7 +2290,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
var userdata = UserDataManager.GetUserData(user, this);
|
||||
|
||||
return userdata == null || !userdata.Played;
|
||||
return userdata is null || !userdata.Played;
|
||||
}
|
||||
|
||||
ItemLookupInfo IHasLookupInfo<ItemLookupInfo>.GetLookupInfo()
|
||||
@@ -2445,14 +2445,14 @@ namespace MediaBrowser.Controller.Entities
|
||||
// Try to retrieve it from the db. If we don't find it, use the resolved version
|
||||
var video = LibraryManager.GetItemById(id) as Video;
|
||||
|
||||
if (video == null)
|
||||
if (video is null)
|
||||
{
|
||||
video = LibraryManager.ResolvePath(FileSystem.GetFileSystemInfo(path)) as Video;
|
||||
|
||||
newOptions.ForceSave = true;
|
||||
}
|
||||
|
||||
if (video == null)
|
||||
if (video is null)
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
var v = sourceProp.GetValue(source);
|
||||
if (v == null)
|
||||
if (v is null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
var current = item.RemoteTrailers.FirstOrDefault(i => string.Equals(i.Url, url, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (current == null)
|
||||
if (current is null)
|
||||
{
|
||||
var mediaUrl = new MediaUrl
|
||||
{
|
||||
|
||||
@@ -703,7 +703,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
IEnumerable<BaseItem> items;
|
||||
Func<BaseItem, bool> filter = i => UserViewBuilder.Filter(i, user, query, UserDataManager, LibraryManager);
|
||||
|
||||
if (query.User == null)
|
||||
if (query.User is null)
|
||||
{
|
||||
items = GetRecursiveChildren(filter);
|
||||
}
|
||||
@@ -961,7 +961,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
IEnumerable<BaseItem> items;
|
||||
|
||||
if (query.User == null)
|
||||
if (query.User is null)
|
||||
{
|
||||
items = Children.Where(filter);
|
||||
}
|
||||
@@ -1311,7 +1311,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
// If there are not sub-folders, proceed as normal.
|
||||
if (children == null)
|
||||
if (children is null)
|
||||
{
|
||||
children = GetEligibleChildrenForRecursiveChildren(user);
|
||||
}
|
||||
@@ -1320,7 +1320,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
bool? isVisibleToUser = null;
|
||||
|
||||
if (query == null || UserViewBuilder.FilterItem(child, query))
|
||||
if (query is null || UserViewBuilder.FilterItem(child, query))
|
||||
{
|
||||
isVisibleToUser = child.IsVisible(user);
|
||||
|
||||
@@ -1345,7 +1345,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
foreach (var child in GetLinkedChildren(user))
|
||||
{
|
||||
if (query == null || UserViewBuilder.FilterItem(child, query))
|
||||
if (query is null || UserViewBuilder.FilterItem(child, query))
|
||||
{
|
||||
if (child.IsVisible(user))
|
||||
{
|
||||
@@ -1402,7 +1402,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
foreach (var child in Children)
|
||||
{
|
||||
if (filter == null || filter(child))
|
||||
if (filter is null || filter(child))
|
||||
{
|
||||
result[child.Id] = child;
|
||||
}
|
||||
@@ -1420,7 +1420,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
foreach (var child in GetLinkedChildren())
|
||||
{
|
||||
if (filter == null || filter(child))
|
||||
if (filter is null || filter(child))
|
||||
{
|
||||
result[child.Id] = child;
|
||||
}
|
||||
@@ -1478,7 +1478,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public List<BaseItem> GetLinkedChildren(User user)
|
||||
{
|
||||
if (!FilterLinkedChildrenPerUser || user == null)
|
||||
if (!FilterLinkedChildrenPerUser || user is null)
|
||||
{
|
||||
return GetLinkedChildren();
|
||||
}
|
||||
@@ -1504,7 +1504,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var child = GetLinkedChild(i);
|
||||
|
||||
if (child == null)
|
||||
if (child is null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
{
|
||||
ParentId = Guid.Empty;
|
||||
ParentType = null;
|
||||
|
||||
@@ -39,6 +39,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
public string BlurHash { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool IsLocalFile => Path == null || !Path.StartsWith("http", StringComparison.OrdinalIgnoreCase);
|
||||
public bool IsLocalFile => Path is null || !Path.StartsWith("http", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
// If the actor already exists without a role and we have one, fill it in
|
||||
var existing = people.FirstOrDefault(p => p.Name.Equals(person.Name, StringComparison.OrdinalIgnoreCase) && (p.Type.Equals(PersonType.Actor, StringComparison.OrdinalIgnoreCase) || p.Type.Equals(PersonType.GuestStar, StringComparison.OrdinalIgnoreCase)));
|
||||
if (existing == null)
|
||||
if (existing is null)
|
||||
{
|
||||
// Wasn't there - add it
|
||||
people.Add(person);
|
||||
@@ -76,7 +76,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
string.Equals(p.Type, person.Type, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
// Check for dupes based on the combination of Name and Type
|
||||
if (existing == null)
|
||||
if (existing is null)
|
||||
{
|
||||
people.Add(person);
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
public string FindSeriesSortName()
|
||||
{
|
||||
var series = Series;
|
||||
return series == null ? SeriesName : series.SortName;
|
||||
return series is null ? SeriesName : series.SortName;
|
||||
}
|
||||
|
||||
public override double GetDefaultPrimaryImageAspectRatio()
|
||||
@@ -181,14 +181,14 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
public string FindSeriesPresentationUniqueKey()
|
||||
{
|
||||
var series = Series;
|
||||
return series == null ? null : series.PresentationUniqueKey;
|
||||
return series is null ? null : series.PresentationUniqueKey;
|
||||
}
|
||||
|
||||
public string FindSeasonName()
|
||||
{
|
||||
var season = Season;
|
||||
|
||||
if (season == null)
|
||||
if (season is null)
|
||||
{
|
||||
if (ParentIndexNumber.HasValue)
|
||||
{
|
||||
@@ -204,7 +204,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
public string FindSeriesName()
|
||||
{
|
||||
var series = Series;
|
||||
return series == null ? SeriesName : series.Name;
|
||||
return series is null ? SeriesName : series.Name;
|
||||
}
|
||||
|
||||
public Guid FindSeasonId()
|
||||
@@ -212,7 +212,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
var season = FindParent<Season>();
|
||||
|
||||
// Episodes directly in series folder
|
||||
if (season == null)
|
||||
if (season is null)
|
||||
{
|
||||
var series = Series;
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
}
|
||||
}
|
||||
|
||||
return season == null ? Guid.Empty : season.Id;
|
||||
return season is null ? Guid.Empty : season.Id;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -262,7 +262,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
public Guid FindSeriesId()
|
||||
{
|
||||
var series = FindParent<Series>();
|
||||
return series == null ? Guid.Empty : series.Id;
|
||||
return series is null ? Guid.Empty : series.Id;
|
||||
}
|
||||
|
||||
public override IEnumerable<Guid> GetAncestorIds()
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
public string FindSeriesSortName()
|
||||
{
|
||||
var series = Series;
|
||||
return series == null ? SeriesName : series.SortName;
|
||||
return series is null ? SeriesName : series.SortName;
|
||||
}
|
||||
|
||||
public override List<string> GetUserDataKeys()
|
||||
@@ -149,7 +149,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query)
|
||||
{
|
||||
if (query.User == null)
|
||||
if (query.User is null)
|
||||
{
|
||||
return base.GetItemsInternal(query);
|
||||
}
|
||||
@@ -208,13 +208,13 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
public string FindSeriesPresentationUniqueKey()
|
||||
{
|
||||
var series = Series;
|
||||
return series == null ? null : series.PresentationUniqueKey;
|
||||
return series is null ? null : series.PresentationUniqueKey;
|
||||
}
|
||||
|
||||
public string FindSeriesName()
|
||||
{
|
||||
var series = Series;
|
||||
return series == null ? SeriesName : series.Name;
|
||||
return series is null ? SeriesName : series.Name;
|
||||
}
|
||||
|
||||
public Guid FindSeriesId()
|
||||
|
||||
@@ -266,7 +266,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
DtoOptions = options
|
||||
};
|
||||
|
||||
if (user == null || !user.DisplayMissingEpisodes)
|
||||
if (user is null || !user.DisplayMissingEpisodes)
|
||||
{
|
||||
query.IsMissing = false;
|
||||
}
|
||||
@@ -384,7 +384,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
public List<BaseItem> GetSeasonEpisodes(Season parentSeason, User user, IEnumerable<BaseItem> allSeriesEpisodes, DtoOptions options)
|
||||
{
|
||||
if (allSeriesEpisodes == null)
|
||||
if (allSeriesEpisodes is null)
|
||||
{
|
||||
return GetSeasonEpisodes(parentSeason, user, options);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
lock (_childIdsLock)
|
||||
{
|
||||
if (_childrenIds == null)
|
||||
if (_childrenIds is null)
|
||||
{
|
||||
var list = base.LoadChildren();
|
||||
_childrenIds = list.Select(i => i.Id).ToList();
|
||||
|
||||
@@ -559,7 +559,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
var val = query.Is3D.Value;
|
||||
var video = item as Video;
|
||||
|
||||
if (video == null || val != video.Video3DFormat.HasValue)
|
||||
if (video is null || val != video.Video3DFormat.HasValue)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -689,7 +689,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
var video = item as Video;
|
||||
|
||||
if (video == null || val != video.HasSubtitles)
|
||||
if (video is null || val != video.HasSubtitles)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -776,7 +776,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
if (query.VideoTypes.Length > 0)
|
||||
{
|
||||
var video = item as Video;
|
||||
if (video == null || !query.VideoTypes.Contains(video.VideoType))
|
||||
if (video is null || !query.VideoTypes.Contains(video.VideoType))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -913,7 +913,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var episode = item as Episode;
|
||||
|
||||
if (episode == null)
|
||||
if (episode is null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -929,7 +929,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
private IEnumerable<BaseItem> GetMediaFolders(User user)
|
||||
{
|
||||
if (user == null)
|
||||
if (user is null)
|
||||
{
|
||||
return _libraryManager.RootFolder
|
||||
.Children
|
||||
@@ -945,7 +945,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
private BaseItem[] GetMediaFolders(User user, IEnumerable<string> viewTypes)
|
||||
{
|
||||
if (user == null)
|
||||
if (user is null)
|
||||
{
|
||||
return GetMediaFolders(null)
|
||||
.Where(i =>
|
||||
@@ -967,7 +967,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
private BaseItem[] GetMediaFolders(Folder parent, User user, IEnumerable<string> viewTypes)
|
||||
{
|
||||
if (parent == null || parent is UserView)
|
||||
if (parent is null || parent is UserView)
|
||||
{
|
||||
return GetMediaFolders(user, viewTypes);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace MediaBrowser.Controller.Library
|
||||
|
||||
public LibraryOptions LibraryOptions
|
||||
{
|
||||
get => _libraryOptions ??= Parent == null ? new LibraryOptions() : BaseItem.LibraryManager.GetLibraryOptions(Parent);
|
||||
get => _libraryOptions ??= Parent is null ? new LibraryOptions() : BaseItem.LibraryManager.GetLibraryOptions(Parent);
|
||||
set => _libraryOptions = value;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace MediaBrowser.Controller.Library
|
||||
get
|
||||
{
|
||||
var paths = string.IsNullOrEmpty(Path) ? Array.Empty<string>() : new[] { Path };
|
||||
return AdditionalLocations == null ? paths : paths.Concat(AdditionalLocations).ToArray();
|
||||
return AdditionalLocations is null ? paths : paths.Concat(AdditionalLocations).ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace MediaBrowser.Controller.Library
|
||||
|
||||
// Just in case the user decided to nest episodes.
|
||||
// Not officially supported but in some cases we can handle it.
|
||||
if (item == null)
|
||||
if (item is null)
|
||||
{
|
||||
var parents = parent.GetParents();
|
||||
foreach (var currentParent in parents)
|
||||
@@ -289,7 +289,7 @@ namespace MediaBrowser.Controller.Library
|
||||
{
|
||||
if (args != null)
|
||||
{
|
||||
if (args.Path == null && Path == null)
|
||||
if (args.Path is null && Path is null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace MediaBrowser.Controller.Library
|
||||
|
||||
private static string RemoveDiacritics(string? name)
|
||||
{
|
||||
if (name == null)
|
||||
if (name is null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
Path = Path,
|
||||
RunTimeTicks = RunTimeTicks,
|
||||
Type = MediaSourceType.Placeholder,
|
||||
IsInfiniteStream = RunTimeTicks == null
|
||||
IsInfiniteStream = RunTimeTicks is null
|
||||
};
|
||||
|
||||
list.Add(info);
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
private bool IsHwTonemapAvailable(EncodingJobInfo state, EncodingOptions options)
|
||||
{
|
||||
if (state.VideoStream == null
|
||||
if (state.VideoStream is null
|
||||
|| !options.EnableTonemapping
|
||||
|| GetVideoColorBitDepth(state) != 10)
|
||||
{
|
||||
@@ -189,7 +189,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
private bool IsVulkanHwTonemapAvailable(EncodingJobInfo state, EncodingOptions options)
|
||||
{
|
||||
if (state.VideoStream == null)
|
||||
if (state.VideoStream is null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -202,7 +202,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
private bool IsVaapiVppTonemapAvailable(EncodingJobInfo state, EncodingOptions options)
|
||||
{
|
||||
if (state.VideoStream == null
|
||||
if (state.VideoStream is null
|
||||
|| !options.EnableVppTonemapping
|
||||
|| GetVideoColorBitDepth(state) != 10)
|
||||
{
|
||||
@@ -1066,7 +1066,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
public string GetVideoBitrateParam(EncodingJobInfo state, string videoCodec)
|
||||
{
|
||||
if (state.OutputVideoBitrate == null)
|
||||
if (state.OutputVideoBitrate is null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
@@ -2076,7 +2076,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
public int? GetAudioBitrateParam(int? audioBitRate, string audioCodec, MediaStream audioStream)
|
||||
{
|
||||
if (audioStream == null)
|
||||
if (audioStream is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -2167,7 +2167,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
/// <returns>System.Nullable{System.Int32}.</returns>
|
||||
public int? GetNumAudioChannelsParam(EncodingJobInfo state, MediaStream audioStream, string outputAudioCodec)
|
||||
{
|
||||
if (audioStream == null)
|
||||
if (audioStream is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -2320,7 +2320,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
// If we don't have known media info
|
||||
// If input is video, use -sn to drop subtitles
|
||||
// Otherwise just return empty
|
||||
if (state.VideoStream == null && state.AudioStream == null)
|
||||
if (state.VideoStream is null && state.AudioStream is null)
|
||||
{
|
||||
return state.IsInputVideo ? "-sn" : string.Empty;
|
||||
}
|
||||
@@ -2385,7 +2385,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
}
|
||||
|
||||
var subtitleMethod = state.SubtitleDeliveryMethod;
|
||||
if (state.SubtitleStream == null || subtitleMethod == SubtitleDeliveryMethod.Hls)
|
||||
if (state.SubtitleStream is null || subtitleMethod == SubtitleDeliveryMethod.Hls)
|
||||
{
|
||||
args += " -map -0:s";
|
||||
}
|
||||
@@ -2731,7 +2731,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
}
|
||||
|
||||
// default
|
||||
if (filter == null)
|
||||
if (filter is null)
|
||||
{
|
||||
if (requestedHeight > 0)
|
||||
{
|
||||
@@ -4440,7 +4440,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
string outputVideoCodec)
|
||||
{
|
||||
var videoStream = state.VideoStream;
|
||||
if (videoStream == null)
|
||||
if (videoStream is null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
@@ -4623,7 +4623,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
{
|
||||
var videoStream = state.VideoStream;
|
||||
var mediaSource = state.MediaSource;
|
||||
if (videoStream == null || mediaSource == null)
|
||||
if (videoStream is null || mediaSource is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -5469,7 +5469,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
return;
|
||||
}
|
||||
|
||||
var inputChannels = audioStream == null ? 6 : audioStream.Channels ?? 6;
|
||||
var inputChannels = audioStream is null ? 6 : audioStream.Channels ?? 6;
|
||||
if (inputChannels >= 6)
|
||||
{
|
||||
return;
|
||||
@@ -5521,7 +5521,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
private void NormalizeSubtitleEmbed(EncodingJobInfo state)
|
||||
{
|
||||
if (state.SubtitleStream == null || state.SubtitleDeliveryMethod != SubtitleDeliveryMethod.Embed)
|
||||
if (state.SubtitleStream is null || state.SubtitleDeliveryMethod != SubtitleDeliveryMethod.Embed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -5536,7 +5536,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
public string GetSubtitleEmbedArguments(EncodingJobInfo state)
|
||||
{
|
||||
if (state.SubtitleStream == null || state.SubtitleDeliveryMethod != SubtitleDeliveryMethod.Embed)
|
||||
if (state.SubtitleStream is null || state.SubtitleDeliveryMethod != SubtitleDeliveryMethod.Embed)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
@@ -5694,7 +5694,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
public string GetProgressiveVideoAudioArguments(EncodingJobInfo state, EncodingOptions encodingOptions)
|
||||
{
|
||||
// If the video doesn't have an audio stream, return a default.
|
||||
if (state.AudioStream == null && state.VideoStream != null)
|
||||
if (state.AudioStream is null && state.VideoStream != null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
{
|
||||
if (!_transcodeReasons.HasValue)
|
||||
{
|
||||
if (BaseRequest.TranscodeReasons == null)
|
||||
if (BaseRequest.TranscodeReasons is null)
|
||||
{
|
||||
_transcodeReasons = 0;
|
||||
return 0;
|
||||
@@ -305,7 +305,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
if (BaseRequest.Static
|
||||
|| EncodingHelper.IsCopyCodec(OutputVideoCodec))
|
||||
{
|
||||
return VideoStream == null ? null : (VideoStream.AverageFrameRate ?? VideoStream.RealFrameRate);
|
||||
return VideoStream is null ? null : (VideoStream.AverageFrameRate ?? VideoStream.RealFrameRate);
|
||||
}
|
||||
|
||||
return BaseRequest.MaxFramerate ?? BaseRequest.Framerate;
|
||||
@@ -419,7 +419,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
{
|
||||
get
|
||||
{
|
||||
if (VideoStream == null)
|
||||
if (VideoStream is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -437,7 +437,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
{
|
||||
get
|
||||
{
|
||||
if (AudioStream == null)
|
||||
if (AudioStream is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
/// </summary>
|
||||
public void ResetPeople()
|
||||
{
|
||||
if (People == null)
|
||||
if (People is null)
|
||||
{
|
||||
People = new List<PersonInfo>();
|
||||
}
|
||||
@@ -83,7 +83,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
}
|
||||
}
|
||||
|
||||
if (userData == null)
|
||||
if (userData is null)
|
||||
{
|
||||
userData = new UserItemData()
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace MediaBrowser.Controller.Session
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Capabilities == null)
|
||||
if (Capabilities is null)
|
||||
{
|
||||
return Array.Empty<string>();
|
||||
}
|
||||
@@ -182,7 +182,7 @@ namespace MediaBrowser.Controller.Session
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Capabilities == null || !Capabilities.SupportsMediaControl)
|
||||
if (Capabilities is null || !Capabilities.SupportsMediaControl)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -204,7 +204,7 @@ namespace MediaBrowser.Controller.Session
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Capabilities == null || !Capabilities.SupportsMediaControl)
|
||||
if (Capabilities is null || !Capabilities.SupportsMediaControl)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ namespace MediaBrowser.Controller.Session
|
||||
/// </summary>
|
||||
/// <value>The supported commands.</value>
|
||||
public IReadOnlyList<GeneralCommandType> SupportedCommands
|
||||
=> Capabilities == null ? Array.Empty<GeneralCommandType>() : Capabilities.SupportedCommands;
|
||||
=> Capabilities is null ? Array.Empty<GeneralCommandType>() : Capabilities.SupportedCommands;
|
||||
|
||||
public Tuple<ISessionController, bool> EnsureController<T>(Func<SessionInfo, ISessionController> factory)
|
||||
{
|
||||
@@ -296,7 +296,7 @@ namespace MediaBrowser.Controller.Session
|
||||
{
|
||||
_lastProgressInfo = progressInfo;
|
||||
|
||||
if (_progressTimer == null)
|
||||
if (_progressTimer is null)
|
||||
{
|
||||
_progressTimer = new Timer(OnProgressTimerCallback, null, 1000, 1000);
|
||||
}
|
||||
@@ -315,7 +315,7 @@ namespace MediaBrowser.Controller.Session
|
||||
}
|
||||
|
||||
var progressInfo = _lastProgressInfo;
|
||||
if (progressInfo == null)
|
||||
if (progressInfo is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user