mirror of
https://github.com/lampame/lampac-ukraine.git
synced 2026-04-16 17:32:20 +00:00
All planned tasks have been executed and documented. The Uaflix module now correctly provides a selection of search results for TV series when multiple results are found, similar to how it works for movies. The fix addresses the issue where the system would automatically select the first result (e.g., "Сотня спогадів" instead of "Сотня / The 100") without giving the user a choice. Additionally, UI/UX improvements have been implemented:
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")
This commit is contained in:
parent
5142543a3e
commit
a3d6a294b8
@ -202,7 +202,7 @@ namespace Uaflix.Controllers
|
|||||||
foreach (var season in seasonsWithValidEpisodes)
|
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)}";
|
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");
|
OnLog($"Added season {season} to template");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -109,17 +109,33 @@ namespace Uaflix
|
|||||||
|
|
||||||
string playerPrefix = playerType == "ashdi-serial" ? "Ashdi" : "Zetvideo";
|
string playerPrefix = playerType == "ashdi-serial" ? "Ashdi" : "Zetvideo";
|
||||||
|
|
||||||
|
// Для формування унікальних назв озвучок
|
||||||
|
var voiceCounts = new Dictionary<string, int>();
|
||||||
|
|
||||||
foreach (var voiceObj in voicesArray)
|
foreach (var voiceObj in voicesArray)
|
||||||
{
|
{
|
||||||
string voiceName = voiceObj["title"]?.ToString().Trim();
|
string voiceName = voiceObj["title"]?.ToString().Trim();
|
||||||
if (string.IsNullOrEmpty(voiceName))
|
if (string.IsNullOrEmpty(voiceName))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Перевіряємо, чи вже існує така назва озвучки
|
||||||
|
if (voiceCounts.ContainsKey(voiceName))
|
||||||
|
{
|
||||||
|
voiceCounts[voiceName]++;
|
||||||
|
// Якщо є дублікат, додаємо номер
|
||||||
|
voiceName = $"{voiceName} {voiceCounts[voiceName]}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Ініціалізуємо лічильник для нової озвучки
|
||||||
|
voiceCounts[voiceObj["title"]?.ToString().Trim()] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
var voiceInfo = new VoiceInfo
|
var voiceInfo = new VoiceInfo
|
||||||
{
|
{
|
||||||
Name = voiceName,
|
Name = voiceObj["title"]?.ToString().Trim(), // Зберігаємо оригінальну назву для внутрішнього використання
|
||||||
PlayerType = playerType,
|
PlayerType = playerType,
|
||||||
DisplayName = $"[{playerPrefix}] {voiceName}",
|
DisplayName = voiceName, // Відображаємо унікальну назву
|
||||||
Seasons = new Dictionary<int, List<EpisodeInfo>>()
|
Seasons = new Dictionary<int, List<EpisodeInfo>>()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user