From a3d6a294b841e09e63284edb8037e3df63da74a6 Mon Sep 17 00:00:00 2001 From: Felix Date: Sat, 18 Oct 2025 10:32:37 +0300 Subject: [PATCH] =?UTF-8?q?All=20planned=20tasks=20have=20been=20executed?= =?UTF-8?q?=20and=20documented.=20The=20Uaflix=20module=20now=20correctly?= =?UTF-8?q?=20provides=20a=20selection=20of=20search=20results=20for=20TV?= =?UTF-8?q?=20series=20when=20multiple=20results=20are=20found,=20similar?= =?UTF-8?q?=20to=20how=20it=20works=20for=20movies.=20The=20fix=20addresse?= =?UTF-8?q?s=20the=20issue=20where=20the=20system=20would=20automatically?= =?UTF-8?q?=20select=20the=20first=20result=20(e.g.,=20"=D0=A1=D0=BE=D1=82?= =?UTF-8?q?=D0=BD=D1=8F=20=D1=81=D0=BF=D0=BE=D0=B3=D0=B0=D0=B4=D1=96=D0=B2?= =?UTF-8?q?"=20instead=20of=20"=D0=A1=D0=BE=D1=82=D0=BD=D1=8F=20/=20The=20?= =?UTF-8?q?100")=20without=20giving=20the=20user=20a=20choice.=20Additiona?= =?UTF-8?q?lly,=20UI/UX=20improvements=20have=20been=20implemented:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unique voice names when duplicates exist (e.g., "Uaflix" and "Uaflix 2" instead of "[Ashdi] Uaflix" and "[Zetvideo] Uaflix") Season numbers displayed without the word "Сезон" (e.g., "1" instead of "Сезон 1") --- Uaflix/Controller.cs | 2 +- Uaflix/UaflixInvoke.cs | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Uaflix/Controller.cs b/Uaflix/Controller.cs index 3f32f36..fb73002 100644 --- a/Uaflix/Controller.cs +++ b/Uaflix/Controller.cs @@ -202,7 +202,7 @@ namespace Uaflix.Controllers foreach (var season in seasonsWithValidEpisodes) { string link = $"{host}/uaflix?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={season}&href={HttpUtility.UrlEncode(filmUrl)}"; - season_tpl.Append($"Сезон {season}", link, season.ToString()); + season_tpl.Append($"{season}", link, season.ToString()); OnLog($"Added season {season} to template"); } diff --git a/Uaflix/UaflixInvoke.cs b/Uaflix/UaflixInvoke.cs index 7c25c98..d3db7b8 100644 --- a/Uaflix/UaflixInvoke.cs +++ b/Uaflix/UaflixInvoke.cs @@ -109,17 +109,33 @@ namespace Uaflix string playerPrefix = playerType == "ashdi-serial" ? "Ashdi" : "Zetvideo"; + // Для формування унікальних назв озвучок + var voiceCounts = new Dictionary(); + foreach (var voiceObj in voicesArray) { string voiceName = voiceObj["title"]?.ToString().Trim(); if (string.IsNullOrEmpty(voiceName)) continue; + // Перевіряємо, чи вже існує така назва озвучки + if (voiceCounts.ContainsKey(voiceName)) + { + voiceCounts[voiceName]++; + // Якщо є дублікат, додаємо номер + voiceName = $"{voiceName} {voiceCounts[voiceName]}"; + } + else + { + // Ініціалізуємо лічильник для нової озвучки + voiceCounts[voiceObj["title"]?.ToString().Trim()] = 1; + } + var voiceInfo = new VoiceInfo { - Name = voiceName, + Name = voiceObj["title"]?.ToString().Trim(), // Зберігаємо оригінальну назву для внутрішнього використання PlayerType = playerType, - DisplayName = $"[{playerPrefix}] {voiceName}", + DisplayName = voiceName, // Відображаємо унікальну назву Seasons = new Dictionary>() };