Enable nullable for Jellyfin.Server.Implementations

This commit is contained in:
Patrick Barron 2020-12-12 11:20:48 -05:00
parent b3caa51173
commit d9263dacd5
11 changed files with 9 additions and 15 deletions

View File

@ -27,7 +27,7 @@ namespace Jellyfin.Server.Implementations.Activity
} }
/// <inheritdoc/> /// <inheritdoc/>
public event EventHandler<GenericEventArgs<ActivityLogEntry>> EntryCreated; public event EventHandler<GenericEventArgs<ActivityLogEntry>>? EntryCreated;
/// <inheritdoc/> /// <inheritdoc/>
public async Task CreateAsync(ActivityLog entry) public async Task CreateAsync(ActivityLog entry)

View File

@ -86,7 +86,7 @@ namespace Jellyfin.Server.Implementations.Events.Consumers.Session
return name; return name;
} }
private static string GetPlaybackNotificationType(string mediaType) private static string? GetPlaybackNotificationType(string mediaType)
{ {
if (string.Equals(mediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase)) if (string.Equals(mediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase))
{ {

View File

@ -94,7 +94,7 @@ namespace Jellyfin.Server.Implementations.Events.Consumers.Session
return name; return name;
} }
private static string GetPlaybackStoppedNotificationType(string mediaType) private static string? GetPlaybackStoppedNotificationType(string mediaType)
{ {
if (string.Equals(mediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase)) if (string.Equals(mediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase))
{ {

View File

@ -5,6 +5,7 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">

View File

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

View File

@ -1,5 +1,3 @@
#nullable enable
using System; using System;
using System.Linq; using System.Linq;
using System.Text; using System.Text;

View File

@ -1,5 +1,3 @@
#nullable enable
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;

View File

@ -1,5 +1,4 @@
#nullable enable #pragma warning disable CS1591
#pragma warning disable CS1591
using System.Threading.Tasks; using System.Threading.Tasks;
using Jellyfin.Data.Entities; using Jellyfin.Data.Entities;

View File

@ -1,5 +1,3 @@
#nullable enable
using System.Threading.Tasks; using System.Threading.Tasks;
using Jellyfin.Data.Entities; using Jellyfin.Data.Entities;
using MediaBrowser.Controller.Authentication; using MediaBrowser.Controller.Authentication;

View File

@ -1,5 +1,4 @@
#nullable enable #pragma warning disable CA1307
#pragma warning disable CA1307
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;

View File

@ -13,7 +13,7 @@ namespace Jellyfin.Server.Implementations.ValueConverters
/// </summary> /// </summary>
/// <param name="kind">The kind to specify.</param> /// <param name="kind">The kind to specify.</param>
/// <param name="mappingHints">The mapping hints.</param> /// <param name="mappingHints">The mapping hints.</param>
public DateTimeKindValueConverter(DateTimeKind kind, ConverterMappingHints mappingHints = null) public DateTimeKindValueConverter(DateTimeKind kind, ConverterMappingHints? mappingHints = null)
: base(v => v.ToUniversalTime(), v => DateTime.SpecifyKind(v, kind), mappingHints) : base(v => v.ToUniversalTime(), v => DateTime.SpecifyKind(v, kind), mappingHints)
{ {
} }