mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-15 18:53:27 +01:00
Replace != null with is not null
This commit is contained in:
@@ -49,7 +49,7 @@ namespace MediaBrowser.Controller.BaseItemManager
|
||||
return !baseItem.EnableMediaSourceDisplay;
|
||||
}
|
||||
|
||||
if (libraryTypeOptions != null)
|
||||
if (libraryTypeOptions is not null)
|
||||
{
|
||||
return libraryTypeOptions.MetadataFetchers.Contains(name.AsSpan(), StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
@@ -74,7 +74,7 @@ namespace MediaBrowser.Controller.BaseItemManager
|
||||
return !baseItem.EnableMediaSourceDisplay;
|
||||
}
|
||||
|
||||
if (libraryTypeOptions != null)
|
||||
if (libraryTypeOptions is not null)
|
||||
{
|
||||
return libraryTypeOptions.ImageFetchers.Contains(name.AsSpan(), StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
return list;
|
||||
}
|
||||
|
||||
return _childrenIds.Select(LibraryManager.GetItemById).Where(i => i != null).ToList();
|
||||
return _childrenIds.Select(LibraryManager.GetItemById).Where(i => i is not null).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,8 +81,8 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
/// <returns>System.String.</returns>
|
||||
protected override string CreateSortName()
|
||||
{
|
||||
return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("0000 - ", CultureInfo.InvariantCulture) : string.Empty)
|
||||
+ (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ", CultureInfo.InvariantCulture) : string.Empty) + Name;
|
||||
return (ParentIndexNumber is not null ? ParentIndexNumber.Value.ToString("0000 - ", CultureInfo.InvariantCulture) : string.Empty)
|
||||
+ (IndexNumber is not null ? IndexNumber.Value.ToString("0000 - ", CultureInfo.InvariantCulture) : string.Empty) + Name;
|
||||
}
|
||||
|
||||
public override List<string> GetUserDataKeys()
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
|
||||
var artist = GetMusicArtist(new DtoOptions(false));
|
||||
|
||||
if (artist != null)
|
||||
if (artist is not null)
|
||||
{
|
||||
id.ArtistProviderIds = artist.ProviderIds;
|
||||
}
|
||||
|
||||
@@ -658,7 +658,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
var parent = DisplayParent;
|
||||
if (parent != null)
|
||||
if (parent is not null)
|
||||
{
|
||||
return parent.OfficialRatingForComparison;
|
||||
}
|
||||
@@ -679,7 +679,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
var parent = DisplayParent;
|
||||
if (parent != null)
|
||||
if (parent is not null)
|
||||
{
|
||||
return parent.CustomRatingForComparison;
|
||||
}
|
||||
@@ -976,7 +976,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var parent = GetParent();
|
||||
|
||||
while (parent != null)
|
||||
while (parent is not null)
|
||||
{
|
||||
yield return parent;
|
||||
|
||||
@@ -1114,7 +1114,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
var video = item as Video;
|
||||
if (video != null)
|
||||
if (video is not null)
|
||||
{
|
||||
info.IsoType = video.IsoType;
|
||||
info.VideoType = video.VideoType;
|
||||
@@ -1153,7 +1153,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
info.SupportsDirectStream = MediaSourceManager.SupportsDirectStream(info.Path, info.Protocol);
|
||||
}
|
||||
|
||||
if (video != null && video.VideoType != VideoType.VideoFile)
|
||||
if (video is not null && video.VideoType != VideoType.VideoFile)
|
||||
{
|
||||
info.SupportsDirectStream = false;
|
||||
}
|
||||
@@ -1692,7 +1692,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
var itemById = LibraryManager.GetItemById(info.ItemId.Value);
|
||||
|
||||
if (itemById != null)
|
||||
if (itemById is not null)
|
||||
{
|
||||
return itemById;
|
||||
}
|
||||
@@ -2060,7 +2060,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var artist = FindParent<MusicArtist>();
|
||||
|
||||
if (artist != null)
|
||||
if (artist is not null)
|
||||
{
|
||||
return artist.GetImages(imageType).ElementAtOrDefault(imageIndex);
|
||||
}
|
||||
@@ -2274,14 +2274,14 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var userdata = UserDataManager.GetUserData(user, this);
|
||||
|
||||
return userdata != null && userdata.Played;
|
||||
return userdata is not null && userdata.Played;
|
||||
}
|
||||
|
||||
public bool IsFavoriteOrLiked(User user)
|
||||
{
|
||||
var userdata = UserDataManager.GetUserData(user, this);
|
||||
|
||||
return userdata != null && (userdata.IsFavorite || (userdata.Likes ?? false));
|
||||
return userdata is not null && (userdata.IsFavorite || (userdata.Likes ?? false));
|
||||
}
|
||||
|
||||
public virtual bool IsUnplayed(User user)
|
||||
@@ -2565,7 +2565,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
return ExtraIds
|
||||
.Select(LibraryManager.GetItemById)
|
||||
.Where(i => i != null)
|
||||
.Where(i => i is not null)
|
||||
.OrderBy(i => i.SortName);
|
||||
}
|
||||
|
||||
@@ -2578,7 +2578,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
return ExtraIds
|
||||
.Select(LibraryManager.GetItemById)
|
||||
.Where(i => i != null)
|
||||
.Where(i => i is not null)
|
||||
.Where(i => i.ExtraType.HasValue && extraTypes.Contains(i.ExtraType.Value))
|
||||
.OrderBy(i => i.SortName);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
var p = destProps.Find(x => x.Name == sourceProp.Name);
|
||||
if (p != null)
|
||||
if (p is not null)
|
||||
{
|
||||
p.SetValue(dest, v);
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
});
|
||||
|
||||
if (container != null)
|
||||
if (container is not null)
|
||||
{
|
||||
await RefreshAllMetadataForContainer(container, refreshOptions, innerProgress, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
@@ -515,7 +515,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
async () =>
|
||||
{
|
||||
var series = container as Series;
|
||||
if (series != null)
|
||||
if (series is not null)
|
||||
{
|
||||
await series.RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
@@ -529,7 +529,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var container = child as IMetadataContainer;
|
||||
|
||||
if (container != null)
|
||||
if (container is not null)
|
||||
{
|
||||
await RefreshAllMetadataForContainer(container, refreshOptions, progress, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
@@ -741,7 +741,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
IEnumerable<BaseItem> itemsList = LibraryManager.GetItemList(query);
|
||||
var user = query.User;
|
||||
|
||||
if (user != null)
|
||||
if (user is not null)
|
||||
{
|
||||
// needed for boxsets
|
||||
itemsList = itemsList.Where(i => i.IsVisibleStandalone(query.User));
|
||||
@@ -984,7 +984,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
var user = query.User;
|
||||
|
||||
// Check recursive - don't substitute in plain folder views
|
||||
if (user != null)
|
||||
if (user is not null)
|
||||
{
|
||||
items = CollapseBoxSetItemsIfNeeded(items, query, this, user, ConfigurationManager, CollectionManager);
|
||||
}
|
||||
@@ -1069,7 +1069,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
if (!param.HasValue)
|
||||
{
|
||||
if (user != null && !configurationManager.Configuration.EnableGroupingIntoCollections)
|
||||
if (user is not null && !configurationManager.Configuration.EnableGroupingIntoCollections)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -1441,7 +1441,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var child = GetLinkedChild(i);
|
||||
|
||||
if (child != null)
|
||||
if (child is not null)
|
||||
{
|
||||
list.Add(child);
|
||||
}
|
||||
@@ -1467,7 +1467,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
var child = GetLinkedChild(i);
|
||||
|
||||
if (child != null && child.Id.Equals(itemId))
|
||||
if (child is not null && child.Id.Equals(itemId))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1547,7 +1547,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
return LinkedChildren
|
||||
.Select(i => new Tuple<LinkedChild, BaseItem>(i, GetLinkedChild(i)))
|
||||
.Where(i => i.Item2 != null);
|
||||
.Where(i => i.Item2 is not null);
|
||||
}
|
||||
|
||||
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, IReadOnlyList<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
|
||||
@@ -1605,7 +1605,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.Where(i => i != null)
|
||||
.Where(i => i is not null)
|
||||
.ToList();
|
||||
|
||||
var currentShortcutLinks = LinkedChildren.Where(i => i.Type == LinkedChildType.Shortcut).ToList();
|
||||
@@ -1662,7 +1662,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
// The querying doesn't support virtual unaired
|
||||
var episode = item as Episode;
|
||||
if (episode != null && episode.IsUnaired)
|
||||
if (episode is not null && episode.IsUnaired)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -1719,7 +1719,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
return;
|
||||
}
|
||||
|
||||
if (itemDto != null)
|
||||
if (itemDto is not null)
|
||||
{
|
||||
if (fields.ContainsField(ItemFields.RecursiveItemCount))
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
public InternalItemsQuery(User? user)
|
||||
: this()
|
||||
{
|
||||
if (user != null)
|
||||
if (user is not null)
|
||||
{
|
||||
SetUser(user);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||
/// <inheritdoc />
|
||||
[JsonIgnore]
|
||||
public IReadOnlyList<Guid> SpecialFeatureIds => GetExtras()
|
||||
.Where(extra => extra.ExtraType != null && extra is Video)
|
||||
.Where(extra => extra.ExtraType is not null && extra is Video)
|
||||
.Select(extra => extra.Id)
|
||||
.ToArray();
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var existing = people.FirstOrDefault(p => p.Name.Equals(person.Name, StringComparison.OrdinalIgnoreCase) && p.Type.Equals(PersonType.Actor, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (existing != null)
|
||||
if (existing is not null)
|
||||
{
|
||||
existing.Type = PersonType.GuestStar;
|
||||
MergeExisting(existing, person);
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
var list = base.GetUserDataKeys();
|
||||
|
||||
var series = Series;
|
||||
if (series != null && ParentIndexNumber.HasValue && IndexNumber.HasValue)
|
||||
if (series is not null && ParentIndexNumber.HasValue && IndexNumber.HasValue)
|
||||
{
|
||||
var seriesUserDataKeys = series.GetUserDataKeys();
|
||||
var take = seriesUserDataKeys.Count;
|
||||
@@ -216,7 +216,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
{
|
||||
var series = Series;
|
||||
|
||||
if (series != null && ParentIndexNumber.HasValue)
|
||||
if (series is not null && ParentIndexNumber.HasValue)
|
||||
{
|
||||
var findNumber = ParentIndexNumber.Value;
|
||||
|
||||
@@ -235,8 +235,8 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
/// <returns>System.String.</returns>
|
||||
protected override string CreateSortName()
|
||||
{
|
||||
return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("000 - ", CultureInfo.InvariantCulture) : string.Empty)
|
||||
+ (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ", CultureInfo.InvariantCulture) : string.Empty) + Name;
|
||||
return (ParentIndexNumber is not null ? ParentIndexNumber.Value.ToString("000 - ", CultureInfo.InvariantCulture) : string.Empty)
|
||||
+ (IndexNumber is not null ? IndexNumber.Value.ToString("0000 - ", CultureInfo.InvariantCulture) : string.Empty) + Name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -302,7 +302,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
var series = Series;
|
||||
|
||||
if (series != null)
|
||||
if (series is not null)
|
||||
{
|
||||
id.SeriesProviderIds = series.ProviderIds;
|
||||
id.SeriesDisplayOrder = series.DisplayOrder;
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
{
|
||||
var series = Series;
|
||||
|
||||
if (series != null)
|
||||
if (series is not null)
|
||||
{
|
||||
return series.Path;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
var list = base.GetUserDataKeys();
|
||||
|
||||
var series = Series;
|
||||
if (series != null)
|
||||
if (series is not null)
|
||||
{
|
||||
var newList = series.GetUserDataKeys();
|
||||
var suffix = (IndexNumber ?? 0).ToString("000", CultureInfo.InvariantCulture);
|
||||
@@ -129,7 +129,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
if (IndexNumber.HasValue)
|
||||
{
|
||||
var series = Series;
|
||||
if (series != null)
|
||||
if (series is not null)
|
||||
{
|
||||
return series.PresentationUniqueKey + "-" + (IndexNumber ?? 0).ToString("000", CultureInfo.InvariantCulture);
|
||||
}
|
||||
@@ -144,7 +144,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
/// <returns>System.String.</returns>
|
||||
protected override string CreateSortName()
|
||||
{
|
||||
return IndexNumber != null ? IndexNumber.Value.ToString("0000", CultureInfo.InvariantCulture) : Name;
|
||||
return IndexNumber is not null ? IndexNumber.Value.ToString("0000", CultureInfo.InvariantCulture) : Name;
|
||||
}
|
||||
|
||||
protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query)
|
||||
@@ -233,7 +233,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
var series = Series;
|
||||
|
||||
if (series != null)
|
||||
if (series is not null)
|
||||
{
|
||||
id.SeriesProviderIds = series.ProviderIds;
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
query.IncludeItemTypes = new[] { BaseItemKind.Season };
|
||||
query.OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) };
|
||||
|
||||
if (user != null && !user.DisplayMissingEpisodes)
|
||||
if (user is not null && !user.DisplayMissingEpisodes)
|
||||
{
|
||||
query.IsMissing = false;
|
||||
}
|
||||
@@ -369,7 +369,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) },
|
||||
DtoOptions = options
|
||||
};
|
||||
if (user != null)
|
||||
if (user is not null)
|
||||
{
|
||||
if (!user.DisplayMissingEpisodes)
|
||||
{
|
||||
@@ -426,7 +426,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
}
|
||||
|
||||
var season = episodeItem.Season;
|
||||
return season != null && string.Equals(GetUniqueSeriesKey(season), seasonPresentationKey, StringComparison.OrdinalIgnoreCase);
|
||||
return season is not null && string.Equals(GetUniqueSeriesKey(season), seasonPresentationKey, StringComparison.OrdinalIgnoreCase);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
{
|
||||
var episode = i;
|
||||
|
||||
if (episode != null)
|
||||
if (episode is not null)
|
||||
{
|
||||
var currentSeasonNumber = episode.AiredSeasonNumber;
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Rating != null)
|
||||
if (Rating is not null)
|
||||
{
|
||||
return Rating >= MinLikeValue;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
return list;
|
||||
}
|
||||
|
||||
return _childrenIds.Select(LibraryManager.GetItemById).Where(i => i != null).ToList();
|
||||
return _childrenIds.Select(LibraryManager.GetItemById).Where(i => i is not null).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var user = query.User;
|
||||
|
||||
// if (query.IncludeItemTypes != null &&
|
||||
// if (query.IncludeItemTypes is not null &&
|
||||
// query.IncludeItemTypes.Length == 1 &&
|
||||
// string.Equals(query.IncludeItemTypes[0], "Playlist", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
@@ -263,7 +263,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.Where(i => i != null)
|
||||
.Where(i => i is not null)
|
||||
.Select(i => GetUserViewWithName(SpecialFolder.MovieGenre, i.SortName, parent));
|
||||
|
||||
return GetResult(genres, query);
|
||||
@@ -391,7 +391,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.Where(i => i != null)
|
||||
.Where(i => i is not null)
|
||||
.Select(i => GetUserViewWithName(SpecialFolder.TvGenre, i.SortName, parent));
|
||||
|
||||
return GetResult(genres, query);
|
||||
@@ -791,7 +791,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
if (query.StudioIds.Length > 0 && !query.StudioIds.Any(id =>
|
||||
{
|
||||
var studioItem = libraryManager.GetItemById(id);
|
||||
return studioItem != null && item.Studios.Contains(studioItem.Name, StringComparison.OrdinalIgnoreCase);
|
||||
return studioItem is not null && item.Studios.Contains(studioItem.Name, StringComparison.OrdinalIgnoreCase);
|
||||
}))
|
||||
{
|
||||
return false;
|
||||
@@ -801,7 +801,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
if (query.GenreIds.Count > 0 && !query.GenreIds.Any(id =>
|
||||
{
|
||||
var genreItem = libraryManager.GetItemById(id);
|
||||
return genreItem != null && item.Genres.Contains(genreItem.Name, StringComparison.OrdinalIgnoreCase);
|
||||
return genreItem is not null && item.Genres.Contains(genreItem.Name, StringComparison.OrdinalIgnoreCase);
|
||||
}))
|
||||
{
|
||||
return false;
|
||||
@@ -952,7 +952,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var folder = i as ICollectionFolder;
|
||||
|
||||
return folder != null && viewTypes.Contains(folder.CollectionType ?? string.Empty, StringComparison.OrdinalIgnoreCase);
|
||||
return folder is not null && viewTypes.Contains(folder.CollectionType ?? string.Empty, StringComparison.OrdinalIgnoreCase);
|
||||
}).ToArray();
|
||||
}
|
||||
|
||||
@@ -961,7 +961,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var folder = i as ICollectionFolder;
|
||||
|
||||
return folder != null && viewTypes.Contains(folder.CollectionType ?? string.Empty, StringComparison.OrdinalIgnoreCase);
|
||||
return folder is not null && viewTypes.Contains(folder.CollectionType ?? string.Empty, StringComparison.OrdinalIgnoreCase);
|
||||
}).ToArray();
|
||||
}
|
||||
|
||||
|
||||
@@ -373,7 +373,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
return LinkedAlternateVersions
|
||||
.Select(GetLinkedChild)
|
||||
.Where(i => i != null)
|
||||
.Where(i => i is not null)
|
||||
.OfType<Video>()
|
||||
.OrderBy(i => i.SortName);
|
||||
}
|
||||
@@ -386,7 +386,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
return GetAdditionalPartIds()
|
||||
.Select(i => LibraryManager.GetItemById(i))
|
||||
.Where(i => i != null)
|
||||
.Where(i => i is not null)
|
||||
.OfType<Video>()
|
||||
.OrderBy(i => i.SortName);
|
||||
}
|
||||
@@ -469,7 +469,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
var localAlternates = GetLocalAlternateVersionIds()
|
||||
.Select(i => LibraryManager.GetItemById(i))
|
||||
.Where(i => i != null);
|
||||
.Where(i => i is not null);
|
||||
|
||||
foreach (var item in localAlternates)
|
||||
{
|
||||
@@ -542,7 +542,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
return i.Item1 is Video video ? video.GetLocalAlternateVersionIds() : Enumerable.Empty<Guid>();
|
||||
})
|
||||
.Select(LibraryManager.GetItemById)
|
||||
.Where(i => i != null)
|
||||
.Where(i => i is not null)
|
||||
.ToList();
|
||||
|
||||
list.AddRange(localAlternates.Select(i => (i, MediaSourceType.Default)));
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace MediaBrowser.Controller.Library
|
||||
{
|
||||
var parent = Parent;
|
||||
|
||||
if (parent != null)
|
||||
if (parent is not null)
|
||||
{
|
||||
var item = parent as T;
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace MediaBrowser.Controller.Library
|
||||
}
|
||||
}
|
||||
|
||||
return item != null;
|
||||
return item is not null;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -287,14 +287,14 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <returns><c>true</c> if the arguments are the same, <c>false</c> otherwise.</returns>
|
||||
protected bool Equals(ItemResolveArgs args)
|
||||
{
|
||||
if (args != null)
|
||||
if (args is not null)
|
||||
{
|
||||
if (args.Path is null && Path is null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return args.Path != null && BaseItem.FileSystem.AreEqual(args.Path, Path);
|
||||
return args.Path is not null && BaseItem.FileSystem.AreEqual(args.Path, Path);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
|
||||
var listings = GetListingsProviderInfo();
|
||||
|
||||
if (listings != null)
|
||||
if (listings is not null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(listings.MoviePrefix) && name.StartsWith(listings.MoviePrefix, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
||||
@@ -682,7 +682,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
public string GetGraphicalSubCanvasSize(EncodingJobInfo state)
|
||||
{
|
||||
if (state.SubtitleStream != null
|
||||
if (state.SubtitleStream is not null
|
||||
&& state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode
|
||||
&& !state.SubtitleStream.IsTextSubtitleStream)
|
||||
{
|
||||
@@ -932,7 +932,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
.Append(GetInputPathArgument(state));
|
||||
|
||||
// sub2video for external graphical subtitles
|
||||
if (state.SubtitleStream != null
|
||||
if (state.SubtitleStream is not null
|
||||
&& state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode
|
||||
&& !state.SubtitleStream.IsTextSubtitleStream
|
||||
&& state.SubtitleStream.IsExternal)
|
||||
@@ -963,7 +963,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
arg.Append(" -i file:\"").Append(subtitlePath).Append('\"');
|
||||
}
|
||||
|
||||
if (state.AudioStream != null && state.AudioStream.IsExternal)
|
||||
if (state.AudioStream is not null && state.AudioStream.IsExternal)
|
||||
{
|
||||
// Also seek the external audio stream.
|
||||
var seekAudioParam = GetFastSeekCommandLineParameter(state, options, segmentContainer);
|
||||
@@ -1231,7 +1231,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
var maxrate = request.MaxFramerate;
|
||||
|
||||
if (maxrate.HasValue && state.VideoStream != null)
|
||||
if (maxrate.HasValue && state.VideoStream is not null)
|
||||
{
|
||||
var contentRate = state.VideoStream.AverageFrameRate ?? state.VideoStream.RealFrameRate;
|
||||
|
||||
@@ -1981,7 +1981,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
{
|
||||
var bitrate = request.VideoBitRate;
|
||||
|
||||
if (videoStream != null)
|
||||
if (videoStream is not null)
|
||||
{
|
||||
var isUpscaling = request.Height.HasValue
|
||||
&& videoStream.Height.HasValue
|
||||
@@ -2130,7 +2130,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
// Boost volume to 200% when downsampling from 6ch to 2ch
|
||||
if (channels.HasValue
|
||||
&& channels.Value <= 2
|
||||
&& state.AudioStream != null
|
||||
&& state.AudioStream is not null
|
||||
&& state.AudioStream.Channels.HasValue
|
||||
&& state.AudioStream.Channels.Value > 5
|
||||
&& !encodingOptions.DownMixAudioBoost.Equals(1))
|
||||
@@ -2139,7 +2139,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
}
|
||||
|
||||
var isCopyingTimestamps = state.CopyTimestamps || state.TranscodingType != TranscodingJobType.Progressive;
|
||||
if (state.SubtitleStream != null && state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode && !isCopyingTimestamps)
|
||||
if (state.SubtitleStream is not null && state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode && !isCopyingTimestamps)
|
||||
{
|
||||
var seconds = TimeSpan.FromTicks(state.StartTimeTicks ?? 0).TotalSeconds;
|
||||
|
||||
@@ -2326,20 +2326,20 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
}
|
||||
|
||||
// We have media info, but we don't know the stream index
|
||||
if (state.VideoStream != null && state.VideoStream.Index == -1)
|
||||
if (state.VideoStream is not null && state.VideoStream.Index == -1)
|
||||
{
|
||||
return "-sn";
|
||||
}
|
||||
|
||||
// We have media info, but we don't know the stream index
|
||||
if (state.AudioStream != null && state.AudioStream.Index == -1)
|
||||
if (state.AudioStream is not null && state.AudioStream.Index == -1)
|
||||
{
|
||||
return state.IsInputVideo ? "-sn" : string.Empty;
|
||||
}
|
||||
|
||||
var args = string.Empty;
|
||||
|
||||
if (state.VideoStream != null)
|
||||
if (state.VideoStream is not null)
|
||||
{
|
||||
int videoStreamIndex = FindIndex(state.MediaSource.MediaStreams, state.VideoStream);
|
||||
|
||||
@@ -2354,12 +2354,12 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
args += "-vn";
|
||||
}
|
||||
|
||||
if (state.AudioStream != null)
|
||||
if (state.AudioStream is not null)
|
||||
{
|
||||
int audioStreamIndex = FindIndex(state.MediaSource.MediaStreams, state.AudioStream);
|
||||
if (state.AudioStream.IsExternal)
|
||||
{
|
||||
bool hasExternalGraphicsSubs = state.SubtitleStream != null
|
||||
bool hasExternalGraphicsSubs = state.SubtitleStream is not null
|
||||
&& state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode
|
||||
&& state.SubtitleStream.IsExternal
|
||||
&& !state.SubtitleStream.IsTextSubtitleStream;
|
||||
@@ -2427,7 +2427,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
{
|
||||
var stream = streams.FirstOrDefault(s => s.Index == desiredIndex.Value);
|
||||
|
||||
if (stream != null)
|
||||
if (stream is not null)
|
||||
{
|
||||
return stream;
|
||||
}
|
||||
@@ -2875,7 +2875,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var doDeintHevc = state.DeInterlace("h265", true) || state.DeInterlace("hevc", true);
|
||||
var doDeintH2645 = doDeintH264 || doDeintHevc;
|
||||
|
||||
var hasSubs = state.SubtitleStream != null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasSubs = state.SubtitleStream is not null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasTextSubs = hasSubs && state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasGraphicalSubs = hasSubs && !state.SubtitleStream.IsTextSubtitleStream;
|
||||
|
||||
@@ -2990,7 +2990,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var doDeintH2645 = doDeintH264 || doDeintHevc;
|
||||
var doCuTonemap = IsHwTonemapAvailable(state, options);
|
||||
|
||||
var hasSubs = state.SubtitleStream != null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasSubs = state.SubtitleStream is not null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasTextSubs = hasSubs && state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasGraphicalSubs = hasSubs && !state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasAssSubs = hasSubs
|
||||
@@ -3180,7 +3180,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var doDeintH2645 = doDeintH264 || doDeintHevc;
|
||||
var doOclTonemap = IsHwTonemapAvailable(state, options);
|
||||
|
||||
var hasSubs = state.SubtitleStream != null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasSubs = state.SubtitleStream is not null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasTextSubs = hasSubs && state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasGraphicalSubs = hasSubs && !state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasAssSubs = hasSubs
|
||||
@@ -3402,7 +3402,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var doDeintH2645 = doDeintH264 || doDeintHevc;
|
||||
var doOclTonemap = IsHwTonemapAvailable(state, options);
|
||||
|
||||
var hasSubs = state.SubtitleStream != null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasSubs = state.SubtitleStream is not null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasTextSubs = hasSubs && state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasGraphicalSubs = hasSubs && !state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasAssSubs = hasSubs
|
||||
@@ -3605,7 +3605,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var doTonemap = doVaVppTonemap || doOclTonemap;
|
||||
var doDeintH2645 = doDeintH264 || doDeintHevc;
|
||||
|
||||
var hasSubs = state.SubtitleStream != null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasSubs = state.SubtitleStream is not null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasTextSubs = hasSubs && state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasGraphicalSubs = hasSubs && !state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasAssSubs = hasSubs
|
||||
@@ -3882,7 +3882,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var doTonemap = doVaVppTonemap || doOclTonemap;
|
||||
var doDeintH2645 = doDeintH264 || doDeintHevc;
|
||||
|
||||
var hasSubs = state.SubtitleStream != null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasSubs = state.SubtitleStream is not null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasTextSubs = hasSubs && state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasGraphicalSubs = hasSubs && !state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasAssSubs = hasSubs
|
||||
@@ -4078,7 +4078,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var doVkTonemap = IsVulkanHwTonemapAvailable(state, options);
|
||||
var doDeintH2645 = doDeintH264 || doDeintHevc;
|
||||
|
||||
var hasSubs = state.SubtitleStream != null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasSubs = state.SubtitleStream is not null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasTextSubs = hasSubs && state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasGraphicalSubs = hasSubs && !state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasAssSubs = hasSubs
|
||||
@@ -4277,7 +4277,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var doDeintH2645 = doDeintH264 || doDeintHevc;
|
||||
var doOclTonemap = IsHwTonemapAvailable(state, options);
|
||||
|
||||
var hasSubs = state.SubtitleStream != null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasSubs = state.SubtitleStream is not null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasTextSubs = hasSubs && state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasGraphicalSubs = hasSubs && !state.SubtitleStream.IsTextSubtitleStream;
|
||||
|
||||
@@ -4445,7 +4445,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
var hasSubs = state.SubtitleStream != null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasSubs = state.SubtitleStream is not null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasTextSubs = hasSubs && state.SubtitleStream.IsTextSubtitleStream;
|
||||
var hasGraphicalSubs = hasSubs && !state.SubtitleStream.IsTextSubtitleStream;
|
||||
|
||||
@@ -4495,7 +4495,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
if (overlayFilters?.Count > 0
|
||||
&& subFilters?.Count > 0
|
||||
&& state.SubtitleStream != null)
|
||||
&& state.SubtitleStream is not null)
|
||||
{
|
||||
// overlay graphical/text subtitles
|
||||
var subStr = string.Format(
|
||||
@@ -4582,7 +4582,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
public static int GetVideoColorBitDepth(EncodingJobInfo state)
|
||||
{
|
||||
var videoStream = state.VideoStream;
|
||||
if (videoStream != null)
|
||||
if (videoStream is not null)
|
||||
{
|
||||
if (videoStream.BitDepth.HasValue)
|
||||
{
|
||||
@@ -5196,7 +5196,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
#nullable disable
|
||||
public void TryStreamCopy(EncodingJobInfo state)
|
||||
{
|
||||
if (state.VideoStream != null && CanStreamCopyVideo(state, state.VideoStream))
|
||||
if (state.VideoStream is not null && CanStreamCopyVideo(state, state.VideoStream))
|
||||
{
|
||||
state.OutputVideoCodec = "copy";
|
||||
}
|
||||
@@ -5205,13 +5205,13 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var user = state.User;
|
||||
|
||||
// If the user doesn't have access to transcoding, then force stream copy, regardless of whether it will be compatible or not
|
||||
if (user != null && !user.HasPermission(PermissionKind.EnableVideoPlaybackTranscoding))
|
||||
if (user is not null && !user.HasPermission(PermissionKind.EnableVideoPlaybackTranscoding))
|
||||
{
|
||||
state.OutputVideoCodec = "copy";
|
||||
}
|
||||
}
|
||||
|
||||
if (state.AudioStream != null
|
||||
if (state.AudioStream is not null
|
||||
&& CanStreamCopyAudio(state, state.AudioStream, state.SupportedAudioCodecs))
|
||||
{
|
||||
state.OutputAudioCodec = "copy";
|
||||
@@ -5221,7 +5221,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var user = state.User;
|
||||
|
||||
// If the user doesn't have access to transcoding, then force stream copy, regardless of whether it will be compatible or not
|
||||
if (user != null && !user.HasPermission(PermissionKind.EnableAudioPlaybackTranscoding))
|
||||
if (user is not null && !user.HasPermission(PermissionKind.EnableAudioPlaybackTranscoding))
|
||||
{
|
||||
state.OutputAudioCodec = "copy";
|
||||
}
|
||||
@@ -5418,7 +5418,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
state.SubtitleDeliveryMethod = videoRequest.SubtitleMethod;
|
||||
state.AudioStream = GetMediaStream(mediaStreams, videoRequest.AudioStreamIndex, MediaStreamType.Audio);
|
||||
|
||||
if (state.SubtitleStream != null && !state.SubtitleStream.IsExternal)
|
||||
if (state.SubtitleStream is not null && !state.SubtitleStream.IsExternal)
|
||||
{
|
||||
state.InternalSubtitleStreamOffset = mediaStreams.Where(i => i.Type == MediaStreamType.Subtitle && !i.IsExternal).ToList().IndexOf(state.SubtitleStream);
|
||||
}
|
||||
@@ -5436,7 +5436,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
var request = state.BaseRequest;
|
||||
var supportedAudioCodecs = state.SupportedAudioCodecs;
|
||||
if (request != null && supportedAudioCodecs != null && supportedAudioCodecs.Length > 0)
|
||||
if (request is not null && supportedAudioCodecs is not null && supportedAudioCodecs.Length > 0)
|
||||
{
|
||||
var supportedAudioCodecsList = supportedAudioCodecs.ToList();
|
||||
|
||||
@@ -5449,7 +5449,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
}
|
||||
|
||||
var supportedVideoCodecs = state.SupportedVideoCodecs;
|
||||
if (request != null && supportedVideoCodecs != null && supportedVideoCodecs.Length > 0)
|
||||
if (request is not null && supportedVideoCodecs is not null && supportedVideoCodecs.Length > 0)
|
||||
{
|
||||
var supportedVideoCodecsList = supportedVideoCodecs.ToList();
|
||||
|
||||
@@ -5617,7 +5617,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
if (IsCopyCodec(videoCodec))
|
||||
{
|
||||
if (state.VideoStream != null
|
||||
if (state.VideoStream is not null
|
||||
&& string.Equals(state.OutputContainer, "ts", StringComparison.OrdinalIgnoreCase)
|
||||
&& !string.Equals(state.VideoStream.NalLengthSize, "0", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -5647,7 +5647,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
args += keyFrameArg;
|
||||
|
||||
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
var hasGraphicalSubs = state.SubtitleStream is not null && !state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||
|
||||
var hasCopyTs = false;
|
||||
|
||||
@@ -5667,7 +5667,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
args += " -avoid_negative_ts disabled";
|
||||
|
||||
if (!(state.SubtitleStream != null && state.SubtitleStream.IsExternal && !state.SubtitleStream.IsTextSubtitleStream))
|
||||
if (!(state.SubtitleStream is not null && state.SubtitleStream.IsExternal && !state.SubtitleStream.IsTextSubtitleStream))
|
||||
{
|
||||
args += " -start_at_zero";
|
||||
}
|
||||
@@ -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 is null && state.VideoStream != null)
|
||||
if (state.AudioStream is null && state.VideoStream is not null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
{
|
||||
get
|
||||
{
|
||||
if (VideoStream != null && VideoStream.Width.HasValue && VideoStream.Height.HasValue)
|
||||
if (VideoStream is not null && VideoStream.Width.HasValue && VideoStream.Height.HasValue)
|
||||
{
|
||||
var size = new ImageDimensions(VideoStream.Width.Value, VideoStream.Height.Value);
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
{
|
||||
get
|
||||
{
|
||||
if (VideoStream != null && VideoStream.Width.HasValue && VideoStream.Height.HasValue)
|
||||
if (VideoStream is not null && VideoStream.Width.HasValue && VideoStream.Height.HasValue)
|
||||
{
|
||||
var size = new ImageDimensions(VideoStream.Width.Value, VideoStream.Height.Value);
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
if (BaseRequest.Static
|
||||
|| EncodingHelper.IsCopyCodec(OutputAudioCodec))
|
||||
{
|
||||
if (AudioStream != null)
|
||||
if (AudioStream is not null)
|
||||
{
|
||||
return AudioStream.SampleRate;
|
||||
}
|
||||
@@ -227,7 +227,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
if (BaseRequest.Static
|
||||
|| EncodingHelper.IsCopyCodec(OutputAudioCodec))
|
||||
{
|
||||
if (AudioStream != null)
|
||||
if (AudioStream is not null)
|
||||
{
|
||||
return AudioStream.BitDepth;
|
||||
}
|
||||
@@ -556,7 +556,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
public bool DeInterlace(string videoCodec, bool forceDeinterlaceIfSourceIsInterlaced)
|
||||
{
|
||||
var videoStream = VideoStream;
|
||||
var isInputInterlaced = videoStream != null && videoStream.IsInterlaced;
|
||||
var isInputInterlaced = videoStream is not null && videoStream.IsInterlaced;
|
||||
|
||||
if (!isInputInterlaced)
|
||||
{
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace MediaBrowser.Controller.Net
|
||||
|
||||
var data = await GetDataToSend().ConfigureAwait(false);
|
||||
|
||||
if (data != null)
|
||||
if (data is not null)
|
||||
{
|
||||
await connection.SendAsync(
|
||||
new WebSocketMessage<TReturnDataType>
|
||||
@@ -204,7 +204,7 @@ namespace MediaBrowser.Controller.Net
|
||||
{
|
||||
var connection = _activeConnections.FirstOrDefault(c => c.Item1 == message.Connection);
|
||||
|
||||
if (connection != null)
|
||||
if (connection is not null)
|
||||
{
|
||||
DisposeConnection(connection);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace MediaBrowser.Controller.Playlists
|
||||
|
||||
public static List<BaseItem> GetPlaylistItems(string playlistMediaType, IEnumerable<BaseItem> inputItems, User user, DtoOptions options)
|
||||
{
|
||||
if (user != null)
|
||||
if (user is not null)
|
||||
{
|
||||
inputItems = inputItems.Where(i => i.IsVisible(user));
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
SearchResult = copy.SearchResult;
|
||||
RemoveOldMetadata = copy.RemoveOldMetadata;
|
||||
|
||||
if (copy.RefreshPaths != null && copy.RefreshPaths.Length > 0)
|
||||
if (copy.RefreshPaths is not null && copy.RefreshPaths.Length > 0)
|
||||
{
|
||||
RefreshPaths ??= Array.Empty<string>();
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
|
||||
public bool RefreshItem(BaseItem item)
|
||||
{
|
||||
if (RefreshPaths != null && RefreshPaths.Length > 0)
|
||||
if (RefreshPaths is not null && RefreshPaths.Length > 0)
|
||||
{
|
||||
return RefreshPaths.Contains(item.Path ?? string.Empty, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace MediaBrowser.Controller.Resolvers
|
||||
{
|
||||
var item = Resolve(args);
|
||||
|
||||
if (item != null)
|
||||
if (item is not null)
|
||||
{
|
||||
SetInitialItemValues(item, args);
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ namespace MediaBrowser.Controller.Session
|
||||
{
|
||||
lock (_progressLock)
|
||||
{
|
||||
if (_progressTimer != null)
|
||||
if (_progressTimer is not null)
|
||||
{
|
||||
_progressTimer.Dispose();
|
||||
_progressTimer = null;
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
|
||||
_shuffledPlaylist.Clear();
|
||||
LastChange = DateTime.UtcNow;
|
||||
|
||||
if (!clearPlayingItem && playingItem != null)
|
||||
if (!clearPlayingItem && playingItem is not null)
|
||||
{
|
||||
_sortedPlaylist.Add(playingItem);
|
||||
if (ShuffleMode.Equals(GroupShuffleMode.Shuffle))
|
||||
@@ -298,7 +298,7 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
|
||||
|
||||
LastChange = DateTime.UtcNow;
|
||||
|
||||
if (playingItem != null)
|
||||
if (playingItem is not null)
|
||||
{
|
||||
if (playlistItemIds.Contains(playingItem.PlaylistItemId))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user