Skip to content

Commit

Permalink
chore: fix deepsource alert
Browse files Browse the repository at this point in the history
Signed-off-by: 陳鈞 <[email protected]>
  • Loading branch information
jim60105 committed Apr 25, 2024
1 parent d6729f9 commit 45f2fc6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ScopedServices/PlatformService/PlatformService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public bool StepInterval(int elapsedTime)
{
if (!File.Exists(_ytdlPath) || !File.Exists(_ffmpegPath))
{
(var ytdlPath, var fFmpegPath) = YoutubeDL.WhereIs();
var (ytdlPath, fFmpegPath) = YoutubeDL.WhereIs();
_ytdlPath = ytdlPath ?? throw new ConfigurationErrorsException("Yt-dlp is missing.");
_ffmpegPath = fFmpegPath ?? throw new ConfigurationErrorsException("FFmpeg is missing.");
}
Expand Down
5 changes: 5 additions & 0 deletions ScopedServices/PlatformService/YoutubeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ public override async Task UpdateVideoDataAsync(Video video, CancellationToken c

video.Thumbnail = await DownloadThumbnailAsync(videoData.Thumbnail, video.id, cancellation);
break;

// ReSharper disable once RedundantEmptySwitchSection
default:
// Don't modify status.
break;
}

goto case "_live";
Expand Down
1 change: 1 addition & 0 deletions SingletonServices/DiscordService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ private ComponentBuilder GetComponentBuilder(Video video)

#pragma warning disable CS0162 // 偵測到執行不到的程式碼
// ReSharper disable HeuristicUnreachableCode
// skipcq: CS-W1016
componentBuilder.WithButton(label: "Recorder.moe",
style: ButtonStyle.Link,
url: $"https://{_discordOption.FrontEndHost}/channels/{video.ChannelId}/videos/{video.id}",
Expand Down
8 changes: 6 additions & 2 deletions SingletonServices/Kubernetes/KubernetesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@ public KubernetesService(

if (!CheckPersistentVolumeClaimExists())
{
_logger.LogCritical("PresistentVolumeClaim {name} does not exist!", PersistentVolumeClaimName);
throw new ConfigurationErrorsException($"PresistentVolumeClaim {PersistentVolumeClaimName} does not exist!");
_logger.LogCritical("PersistentVolumeClaim {name} does not exist!", PersistentVolumeClaimName);
throw new ConfigurationErrorsException($"PersistentVolumeClaim {PersistentVolumeClaimName} does not exist!");
}

break;
}
case ServiceName.DockerVolume:
throw new NotImplementedException("Docker volume is not implemented yet.");
default:
throw new InvalidOperationException($"The SharedVolumeService {serviceOption.SharedVolumeService} is not defined.");
}
}

Expand Down

0 comments on commit 45f2fc6

Please sign in to comment.