mirror of
https://github.com/lampame/lampac-ukraine.git
synced 2026-04-16 09:22:21 +00:00
fix(makhno): correct season link generation for multi-season voices
The logic for generating voice links was incorrect - it was checking for requested season availability instead of checking if there are multiple seasons available. This caused season lists to not show properly for multi-season voices. The fix ensures that: - Multi-season voices always show the season list to keep filters correct - Single-season voices link directly to that season - The season parameter is correctly set based on the actual number of seasons
This commit is contained in:
parent
5348f3a9a9
commit
f189357447
@ -273,16 +273,16 @@ namespace Makhno
|
|||||||
if (seasonsForVoice.Count == 0)
|
if (seasonsForVoice.Count == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool hasRequestedSeason = seasonsForVoice.Any(s => s.Number == requestedSeason);
|
|
||||||
string voiceLink;
|
string voiceLink;
|
||||||
if (hasRequestedSeason)
|
if (seasonsForVoice.Count > 1)
|
||||||
{
|
{
|
||||||
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}";
|
// Always show season list for multi-season voices to keep filter correct
|
||||||
|
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}";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Force season list for this voice to avoid showing чужі сезони
|
int onlySeason = seasonsForVoice[0].Number;
|
||||||
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}";
|
voiceLink = $"{host}/makhno?imdb_id={imdb_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&season={onlySeason}&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