mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-10-31 18:47:18 -04:00 
			
		
		
		
	Merge pull request #9381 from Bond-009/nullable
This commit is contained in:
		
						commit
						47b9a01efe
					
				| @ -172,12 +172,9 @@ public class GenresController : BaseJellyfinApiController | |||||||
| 
 | 
 | ||||||
|         item ??= new Genre(); |         item ??= new Genre(); | ||||||
| 
 | 
 | ||||||
|         if (userId.Value.Equals(default)) |         var user = userId.Value.Equals(default) | ||||||
|         { |             ? null | ||||||
|             return _dtoService.GetBaseItemDto(item, dtoOptions); |             : _userManager.GetUserById(userId.Value); | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         var user = _userManager.GetUserById(userId.Value); |  | ||||||
| 
 | 
 | ||||||
|         return _dtoService.GetBaseItemDto(item, dtoOptions, user); |         return _dtoService.GetBaseItemDto(item, dtoOptions, user); | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| #nullable disable |  | ||||||
| 
 |  | ||||||
| #pragma warning disable CS1591 | #pragma warning disable CS1591 | ||||||
| 
 | 
 | ||||||
| using System; | using System; | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| #nullable disable |  | ||||||
| 
 |  | ||||||
| using System; | using System; | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
| using System.Globalization; | using System.Globalization; | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| #nullable disable |  | ||||||
| 
 |  | ||||||
| using System; | using System; | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
| using System.Globalization; | using System.Globalization; | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| #nullable disable |  | ||||||
| 
 |  | ||||||
| using System; | using System; | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
| using System.Globalization; | using System.Globalization; | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| #nullable disable |  | ||||||
| 
 |  | ||||||
| using System; | using System; | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
| using System.Globalization; | using System.Globalization; | ||||||
| @ -63,7 +61,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV | |||||||
| 
 | 
 | ||||||
|             var seriesTmdbId = Convert.ToInt32(series?.GetProviderId(MetadataProvider.Tmdb), CultureInfo.InvariantCulture); |             var seriesTmdbId = Convert.ToInt32(series?.GetProviderId(MetadataProvider.Tmdb), CultureInfo.InvariantCulture); | ||||||
| 
 | 
 | ||||||
|             if (seriesTmdbId <= 0) |             if (series is null || seriesTmdbId <= 0) | ||||||
|             { |             { | ||||||
|                 return Enumerable.Empty<RemoteImageInfo>(); |                 return Enumerable.Empty<RemoteImageInfo>(); | ||||||
|             } |             } | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| #nullable disable |  | ||||||
| 
 |  | ||||||
| using System; | using System; | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
| using System.Globalization; | using System.Globalization; | ||||||
| @ -87,7 +85,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV | |||||||
|                 return metadataResult; |                 return metadataResult; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             info.SeriesProviderIds.TryGetValue(MetadataProvider.Tmdb.ToString(), out string tmdbId); |             info.SeriesProviderIds.TryGetValue(MetadataProvider.Tmdb.ToString(), out string? tmdbId); | ||||||
| 
 | 
 | ||||||
|             var seriesTmdbId = Convert.ToInt32(tmdbId, CultureInfo.InvariantCulture); |             var seriesTmdbId = Convert.ToInt32(tmdbId, CultureInfo.InvariantCulture); | ||||||
|             if (seriesTmdbId <= 0) |             if (seriesTmdbId <= 0) | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| #nullable disable |  | ||||||
| 
 |  | ||||||
| using System; | using System; | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
| using System.Globalization; | using System.Globalization; | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| #nullable disable |  | ||||||
| 
 |  | ||||||
| #pragma warning disable CS1591 | #pragma warning disable CS1591 | ||||||
| 
 | 
 | ||||||
| using System; | using System; | ||||||
| @ -56,7 +54,7 @@ namespace MediaBrowser.Providers.Subtitles | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         /// <inheritdoc /> |         /// <inheritdoc /> | ||||||
|         public event EventHandler<SubtitleDownloadFailureEventArgs> SubtitleDownloadFailure; |         public event EventHandler<SubtitleDownloadFailureEventArgs>? SubtitleDownloadFailure; | ||||||
| 
 | 
 | ||||||
|         /// <inheritdoc /> |         /// <inheritdoc /> | ||||||
|         public async Task<RemoteSubtitleInfo[]> SearchSubtitles(SubtitleSearchRequest request, CancellationToken cancellationToken) |         public async Task<RemoteSubtitleInfo[]> SearchSubtitles(SubtitleSearchRequest request, CancellationToken cancellationToken) | ||||||
| @ -235,7 +233,7 @@ namespace MediaBrowser.Providers.Subtitles | |||||||
| 
 | 
 | ||||||
|         private async Task TrySaveToFiles(Stream stream, List<string> savePaths) |         private async Task TrySaveToFiles(Stream stream, List<string> savePaths) | ||||||
|         { |         { | ||||||
|             List<Exception> exs = null; |             List<Exception>? exs = null; | ||||||
| 
 | 
 | ||||||
|             foreach (var savePath in savePaths) |             foreach (var savePath in savePaths) | ||||||
|             { |             { | ||||||
| @ -245,7 +243,7 @@ namespace MediaBrowser.Providers.Subtitles | |||||||
| 
 | 
 | ||||||
|                 try |                 try | ||||||
|                 { |                 { | ||||||
|                     Directory.CreateDirectory(Path.GetDirectoryName(savePath)); |                     Directory.CreateDirectory(Path.GetDirectoryName(savePath) ?? throw new InvalidOperationException("Path can't be a root directory.")); | ||||||
| 
 | 
 | ||||||
|                     var fileOptions = AsyncFile.WriteOptions; |                     var fileOptions = AsyncFile.WriteOptions; | ||||||
|                     fileOptions.Mode = FileMode.CreateNew; |                     fileOptions.Mode = FileMode.CreateNew; | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| #nullable disable |  | ||||||
| 
 |  | ||||||
| #pragma warning disable CS1591 | #pragma warning disable CS1591 | ||||||
| 
 | 
 | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user