refactor(animeon, mikai): consolidate template output

This commit is contained in:
baliasnyifeliks 2026-02-01 18:17:04 +02:00
parent 3576932089
commit 764bee0405
2 changed files with 6 additions and 4 deletions

View File

@ -168,10 +168,11 @@ namespace AnimeON.Controllers
// Повертаємо озвучки + епізоди разом
OnLog($"AnimeON: return episodes count={selectedVoiceInfo.Episodes.Count} for voice='{t}' season={selectedAnime.Season}");
episode_tpl.Append(voice_tpl);
if (rjson)
return Content(episode_tpl.ToJson(voice_tpl), "application/json; charset=utf-8");
return Content(episode_tpl.ToJson(), "application/json; charset=utf-8");
return Content(voice_tpl.ToHtml() + episode_tpl.ToHtml(), "text/html; charset=utf-8");
return Content(episode_tpl.ToHtml(), "text/html; charset=utf-8");
}
}
else // Фільм

View File

@ -121,10 +121,11 @@ namespace Mikai.Controllers
}
}
episodeTpl.Append(voiceTpl);
if (rjson)
return Content(episodeTpl.ToJson(voiceTpl), "application/json; charset=utf-8");
return Content(episodeTpl.ToJson(), "application/json; charset=utf-8");
return Content(voiceTpl.ToHtml() + episodeTpl.ToHtml(), "text/html; charset=utf-8");
return Content(episodeTpl.ToHtml(), "text/html; charset=utf-8");
}
var movieTpl = new MovieTpl(displayTitle, original_title);