mirror of
https://github.com/lampame/lampac-ukraine.git
synced 2026-04-16 09:22:21 +00:00
refactor(bamboo, uakino, uatut, uaflix): consolidate template output
This commit is contained in:
parent
708d708f2a
commit
92948d66cb
@ -94,10 +94,11 @@ namespace Bamboo.Controllers
|
||||
index++;
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
|
||||
@ -94,10 +94,11 @@ namespace UAKino.Controllers
|
||||
index++;
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
|
||||
@ -204,10 +204,11 @@ namespace UaTUT
|
||||
|
||||
OnLog($"UaTUT: generated {voiceCount} voices, {episodeCount} episodes");
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -306,15 +306,16 @@ namespace Uaflix.Controllers
|
||||
OnLog($"Created EpisodeTpl with {episodes.Count} episodes");
|
||||
|
||||
// Повертаємо VoiceTpl + EpisodeTpl разом
|
||||
episode_tpl.Append(voice_tpl);
|
||||
if (rjson)
|
||||
{
|
||||
OnLog($"=== RETURN: episode template with voices JSON ({episodes.Count} episodes) ===");
|
||||
return Content(episode_tpl.ToJson(voice_tpl), "application/json; charset=utf-8");
|
||||
return Content(episode_tpl.ToJson(), "application/json; charset=utf-8");
|
||||
}
|
||||
else
|
||||
{
|
||||
OnLog($"=== RETURN: voice + episode template HTML ({episodes.Count} episodes) ===");
|
||||
return Content(voice_tpl.ToHtml() + episode_tpl.ToHtml(), "text/html; charset=utf-8");
|
||||
return Content(episode_tpl.ToHtml(), "text/html; charset=utf-8");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user