refactor(mikai,uaflix): explicitly declare voice info variables before assignment

Changed implicit variable declarations to explicit type declarations
for voiceForSeasons and tVoice variables to improve code clarity
and maintain consistent typing patterns in both controllers.
This commit is contained in:
baliasnyifeliks 2026-02-05 08:41:35 +02:00
parent f2b70fa95e
commit 6ea1a5febe
2 changed files with 4 additions and 2 deletions

View File

@ -57,7 +57,8 @@ namespace Mikai.Controllers
if (isSerial) if (isSerial)
{ {
bool restrictByVoice = !string.IsNullOrEmpty(t) && voices.TryGetValue(t, out var voiceForSeasons); MikaiVoiceInfo voiceForSeasons = null;
bool restrictByVoice = !string.IsNullOrEmpty(t) && voices.TryGetValue(t, out voiceForSeasons);
var seasonNumbers = restrictByVoice var seasonNumbers = restrictByVoice
? GetSeasonSet(voiceForSeasons).OrderBy(n => n).ToList() ? GetSeasonSet(voiceForSeasons).OrderBy(n => n).ToList()
: voices.Values : voices.Values

View File

@ -168,7 +168,8 @@ namespace Uaflix.Controllers
if (s == -1) if (s == -1)
{ {
List<int> allSeasons; List<int> allSeasons;
bool restrictByVoice = !string.IsNullOrEmpty(t) && structure.Voices.TryGetValue(t, out var tVoice) && IsAshdiVoice(tVoice); VoiceInfo tVoice = null;
bool restrictByVoice = !string.IsNullOrEmpty(t) && structure.Voices.TryGetValue(t, out tVoice) && IsAshdiVoice(tVoice);
if (restrictByVoice) if (restrictByVoice)
{ {
allSeasons = GetSeasonSet(tVoice).OrderBy(sn => sn).ToList(); allSeasons = GetSeasonSet(tVoice).OrderBy(sn => sn).ToList();