Enable nullable for more files

This commit is contained in:
Bond_009 2021-10-26 13:56:30 +02:00
parent dc72d90703
commit 1b6eb2ff2d
11 changed files with 24 additions and 34 deletions

View File

@ -586,7 +586,7 @@ namespace Emby.Server.Implementations.Channels
{
var supportsLatest = provider is ISupportsLatestMedia;
return new ChannelFeatures
return new ChannelFeatures(channel.Name, channel.Id)
{
CanFilter = !features.MaxPageSize.HasValue,
CanSearch = provider is ISearchableChannel,
@ -596,8 +596,6 @@ namespace Emby.Server.Implementations.Channels
MediaTypes = features.MediaTypes.ToArray(),
SupportsSortOrderToggle = features.SupportsSortOrderToggle,
SupportsLatestMedia = supportsLatest,
Name = channel.Name,
Id = channel.Id.ToString("N", CultureInfo.InvariantCulture),
SupportsContentDownloading = features.SupportsContentDownloading,
AutoRefreshLevels = features.AutoRefreshLevels
};

View File

@ -530,11 +530,7 @@ namespace Jellyfin.Server.Implementations.Users
}
}
return new PinRedeemResult
{
Success = false,
UsersReset = Array.Empty<string>()
};
return new PinRedeemResult();
}
/// <inheritdoc />

View File

@ -1,4 +1,3 @@
#nullable disable
#pragma warning disable CS1591
using System;
@ -7,11 +6,14 @@ namespace MediaBrowser.Model.Channels
{
public class ChannelFeatures
{
public ChannelFeatures()
public ChannelFeatures(string name, Guid id)
{
MediaTypes = Array.Empty<ChannelMediaType>();
ContentTypes = Array.Empty<ChannelMediaContentType>();
DefaultSortFields = Array.Empty<ChannelItemSortField>();
Name = name;
Id = id;
}
/// <summary>
@ -24,7 +26,7 @@ namespace MediaBrowser.Model.Channels
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
public string Id { get; set; }
public Guid Id { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance can search.

View File

@ -1,4 +1,3 @@
#nullable disable
#pragma warning disable CS1591
using System;
@ -13,13 +12,13 @@ namespace MediaBrowser.Model.Channels
/// Gets or sets the fields to return within the items, in addition to basic information.
/// </summary>
/// <value>The fields.</value>
public ItemFields[] Fields { get; set; }
public ItemFields[]? Fields { get; set; }
public bool? EnableImages { get; set; }
public int? ImageTypeLimit { get; set; }
public ImageType[] EnableImageTypes { get; set; }
public ImageType[]? EnableImageTypes { get; set; }
/// <summary>
/// Gets or sets the user identifier.

View File

@ -1,4 +1,3 @@
#nullable disable
using System;
using System.Xml.Serialization;
@ -35,21 +34,21 @@ namespace MediaBrowser.Model.Configuration
/// Gets or sets the cache path.
/// </summary>
/// <value>The cache path.</value>
public string CachePath { get; set; }
public string? CachePath { get; set; }
/// <summary>
/// Gets or sets the last known version that was ran using the configuration.
/// </summary>
/// <value>The version from previous run.</value>
[XmlIgnore]
public Version PreviousVersion { get; set; }
public Version? PreviousVersion { get; set; }
/// <summary>
/// Gets or sets the stringified PreviousVersion to be stored/loaded,
/// because System.Version itself isn't xml-serializable.
/// </summary>
/// <value>String value of PreviousVersion.</value>
public string PreviousVersionStr
public string? PreviousVersionStr
{
get => PreviousVersion?.ToString();
set

View File

@ -1,4 +1,3 @@
#nullable disable
#pragma warning disable CS1591
using System;
@ -52,21 +51,21 @@ namespace MediaBrowser.Model.Configuration
/// Gets or sets the preferred metadata language.
/// </summary>
/// <value>The preferred metadata language.</value>
public string PreferredMetadataLanguage { get; set; }
public string? PreferredMetadataLanguage { get; set; }
/// <summary>
/// Gets or sets the metadata country code.
/// </summary>
/// <value>The metadata country code.</value>
public string MetadataCountryCode { get; set; }
public string? MetadataCountryCode { get; set; }
public string SeasonZeroDisplayName { get; set; }
public string[] MetadataSavers { get; set; }
public string[]? MetadataSavers { get; set; }
public string[] DisabledLocalMetadataReaders { get; set; }
public string[] LocalMetadataReaderOrder { get; set; }
public string[]? LocalMetadataReaderOrder { get; set; }
public string[] DisabledSubtitleFetchers { get; set; }
@ -76,7 +75,7 @@ namespace MediaBrowser.Model.Configuration
public bool SkipSubtitlesIfAudioTrackMatches { get; set; }
public string[] SubtitleDownloadLanguages { get; set; }
public string[]? SubtitleDownloadLanguages { get; set; }
public bool RequirePerfectSubtitleMatch { get; set; }
@ -84,7 +83,7 @@ namespace MediaBrowser.Model.Configuration
public TypeOptions[] TypeOptions { get; set; }
public TypeOptions GetTypeOptions(string type)
public TypeOptions? GetTypeOptions(string type)
{
foreach (var options in TypeOptions)
{

View File

@ -1,4 +1,3 @@
#nullable disable
#pragma warning disable CS1591
using System;
@ -33,7 +32,7 @@ namespace MediaBrowser.Model.Configuration
/// Gets or sets the audio language preference.
/// </summary>
/// <value>The audio language preference.</value>
public string AudioLanguagePreference { get; set; }
public string? AudioLanguagePreference { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [play default audio track].
@ -45,7 +44,7 @@ namespace MediaBrowser.Model.Configuration
/// Gets or sets the subtitle language preference.
/// </summary>
/// <value>The subtitle language preference.</value>
public string SubtitleLanguagePreference { get; set; }
public string? SubtitleLanguagePreference { get; set; }
public bool DisplayMissingEpisodes { get; set; }

View File

@ -1,4 +1,3 @@
#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Configuration
@ -13,7 +12,7 @@ namespace MediaBrowser.Model.Configuration
EnablePathSubstitution = true;
}
public string UserId { get; set; }
public string? UserId { get; set; }
public string ReleaseDateFormat { get; set; }

View File

@ -1,4 +1,3 @@
#nullable disable
#pragma warning disable CS1591
using System;

View File

@ -1,4 +1,3 @@
#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Dlna

View File

@ -1,6 +1,7 @@
#nullable disable
#pragma warning disable CS1591
using System;
namespace MediaBrowser.Model.Users
{
public class PinRedeemResult
@ -15,6 +16,6 @@ namespace MediaBrowser.Model.Users
/// Gets or sets the users reset.
/// </summary>
/// <value>The users reset.</value>
public string[] UsersReset { get; set; }
public string[] UsersReset { get; set; } = Array.Empty<string>();
}
}