mirror of
https://github.com/lampame/lampac-ukraine.git
synced 2026-04-16 17:32:20 +00:00
fix(makhno): handle season filtering when requested season is unavailable
When a requested season is not available in the selected voice, redirect to season list instead of showing foreign seasons. This prevents displaying seasons from other voices that the user may not have access to.
This commit is contained in:
parent
e2bc12b009
commit
e9a4d19d8c
@ -266,11 +266,17 @@ namespace Makhno
|
|||||||
if (seasonsForVoice.Count == 0)
|
if (seasonsForVoice.Count == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int seasonNumber = seasonsForVoice.Any(s => s.Number == requestedSeason)
|
bool hasRequestedSeason = seasonsForVoice.Any(s => s.Number == requestedSeason);
|
||||||
? requestedSeason
|
string voiceLink;
|
||||||
: seasonsForVoice.Min(s => s.Number);
|
if (hasRequestedSeason)
|
||||||
|
{
|
||||||
string voiceLink = $"{host}/makhno?imdb_id={imdb_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&season={seasonNumber}&t={i}";
|
voiceLink = $"{host}/makhno?imdb_id={imdb_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&season={requestedSeason}&t={i}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Force season list for this voice to avoid showing чужі сезони
|
||||||
|
voiceLink = $"{host}/makhno?imdb_id={imdb_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&season=-1&t={i}";
|
||||||
|
}
|
||||||
bool isActive = selectedVoice == i.ToString();
|
bool isActive = selectedVoice == i.ToString();
|
||||||
voice_tpl.Append(voiceName, isActive, voiceLink);
|
voice_tpl.Append(voiceName, isActive, voiceLink);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user