Skip to content

Commit 45f2fc6

Browse files
committed
chore: fix deepsource alert
Signed-off-by: 陳鈞 <[email protected]>
1 parent d6729f9 commit 45f2fc6

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

ScopedServices/PlatformService/PlatformService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public bool StepInterval(int elapsedTime)
7878
{
7979
if (!File.Exists(_ytdlPath) || !File.Exists(_ffmpegPath))
8080
{
81-
(var ytdlPath, var fFmpegPath) = YoutubeDL.WhereIs();
81+
var (ytdlPath, fFmpegPath) = YoutubeDL.WhereIs();
8282
_ytdlPath = ytdlPath ?? throw new ConfigurationErrorsException("Yt-dlp is missing.");
8383
_ffmpegPath = fFmpegPath ?? throw new ConfigurationErrorsException("FFmpeg is missing.");
8484
}

ScopedServices/PlatformService/YoutubeService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ public override async Task UpdateVideoDataAsync(Video video, CancellationToken c
259259

260260
video.Thumbnail = await DownloadThumbnailAsync(videoData.Thumbnail, video.id, cancellation);
261261
break;
262+
263+
// ReSharper disable once RedundantEmptySwitchSection
264+
default:
265+
// Don't modify status.
266+
break;
262267
}
263268

264269
goto case "_live";

SingletonServices/DiscordService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ private ComponentBuilder GetComponentBuilder(Video video)
190190

191191
#pragma warning disable CS0162 // 偵測到執行不到的程式碼
192192
// ReSharper disable HeuristicUnreachableCode
193+
// skipcq: CS-W1016
193194
componentBuilder.WithButton(label: "Recorder.moe",
194195
style: ButtonStyle.Link,
195196
url: $"https://{_discordOption.FrontEndHost}/channels/{video.ChannelId}/videos/{video.id}",

SingletonServices/Kubernetes/KubernetesService.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,16 @@ public KubernetesService(
4646

4747
if (!CheckPersistentVolumeClaimExists())
4848
{
49-
_logger.LogCritical("PresistentVolumeClaim {name} does not exist!", PersistentVolumeClaimName);
50-
throw new ConfigurationErrorsException($"PresistentVolumeClaim {PersistentVolumeClaimName} does not exist!");
49+
_logger.LogCritical("PersistentVolumeClaim {name} does not exist!", PersistentVolumeClaimName);
50+
throw new ConfigurationErrorsException($"PersistentVolumeClaim {PersistentVolumeClaimName} does not exist!");
5151
}
5252

5353
break;
5454
}
55+
case ServiceName.DockerVolume:
56+
throw new NotImplementedException("Docker volume is not implemented yet.");
57+
default:
58+
throw new InvalidOperationException($"The SharedVolumeService {serviceOption.SharedVolumeService} is not defined.");
5559
}
5660
}
5761

0 commit comments

Comments
 (0)