diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2026-07-22 08:09:33 +0200 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2026-07-22 08:09:33 +0200 |
| commit | 6382563440b69d816639abc2b4d03fca1d35eca2 (patch) | |
| tree | 21e102865fcfd24cb778dfe54e634a10b4e8d36f /src | |
| parent | 733b4ba73a439aae2c2fe03c6084e2cbdfb22a39 (diff) | |
Prefer null checks over HasValue everywhere
Diffstat (limited to 'src')
| -rw-r--r-- | src/Jellyfin.LiveTv/Recordings/RecordingsManager.cs | 6 | ||||
| -rw-r--r-- | src/Jellyfin.LiveTv/Recordings/RecordingsMetadataManager.cs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/Jellyfin.LiveTv/Recordings/RecordingsManager.cs b/src/Jellyfin.LiveTv/Recordings/RecordingsManager.cs index 846f9baf71..62a06370da 100644 --- a/src/Jellyfin.LiveTv/Recordings/RecordingsManager.cs +++ b/src/Jellyfin.LiveTv/Recordings/RecordingsManager.cs @@ -497,7 +497,7 @@ public sealed class RecordingsManager : IRecordingsManager, IDisposable // trim trailing period from the folder name var folderName = _fileSystem.GetValidFilename(timer.Name).Trim().TrimEnd('.').Trim(); - if (metadata is not null && metadata.ProductionYear.HasValue) + if (metadata is not null && metadata.ProductionYear is not null) { folderName += " (" + metadata.ProductionYear.Value.ToString(CultureInfo.InvariantCulture) + ")"; } @@ -532,7 +532,7 @@ public sealed class RecordingsManager : IRecordingsManager, IDisposable } var folderName = _fileSystem.GetValidFilename(timer.Name).Trim(); - if (timer.ProductionYear.HasValue) + if (timer.ProductionYear is not null) { folderName += " (" + timer.ProductionYear.Value.ToString(CultureInfo.InvariantCulture) + ")"; } @@ -550,7 +550,7 @@ public sealed class RecordingsManager : IRecordingsManager, IDisposable } var folderName = _fileSystem.GetValidFilename(timer.Name).Trim(); - if (timer.ProductionYear.HasValue) + if (timer.ProductionYear is not null) { folderName += " (" + timer.ProductionYear.Value.ToString(CultureInfo.InvariantCulture) + ")"; } diff --git a/src/Jellyfin.LiveTv/Recordings/RecordingsMetadataManager.cs b/src/Jellyfin.LiveTv/Recordings/RecordingsMetadataManager.cs index 7e68dbb547..e0e5a00fb9 100644 --- a/src/Jellyfin.LiveTv/Recordings/RecordingsMetadataManager.cs +++ b/src/Jellyfin.LiveTv/Recordings/RecordingsMetadataManager.cs @@ -290,7 +290,7 @@ public class RecordingsMetadataManager null, DateTime.UtcNow.ToString(DateAddedFormat, CultureInfo.InvariantCulture)).ConfigureAwait(false); - if (item.ProductionYear.HasValue) + if (item.ProductionYear is not null) { await writer.WriteElementStringAsync(null, "year", null, item.ProductionYear.Value.ToString(CultureInfo.InvariantCulture)).ConfigureAwait(false); } |
