add series descriptions #17

Merged
rudism merged 17 commits from series-descriptions into main 2023-04-05 15:32:30 -05:00
2 changed files with 25 additions and 2 deletions
Showing only changes of commit 1efb22fc1b - Show all commits

View File

@ -37,6 +37,22 @@ private class Series {
public string TitleEncoded {
get => WebUtility.HtmlEncode(Title);
}
public string HtmlDescription {
get {
var sb = new StringBuilder();
if (!string.IsNullOrEmpty(Description)) {
sb.AppendLine("<article><p>");
sb.AppendLine(string.Join("</p><p>",
Description.Split("\n")
.Where(l => !string.IsNullOrWhiteSpace(l))
.Select(l => WebUtility.HtmlEncode(l))));
sb.AppendLine("</p></article>");
}
return sb.ToString();
}
}
}
private class Episode {
@ -229,7 +245,8 @@ private void GenerateSeriesDetailsFragment(Series series) {
</aside>
</div>
</section>
<ol>");
<div class='detail'>
<ol>");
foreach (var episode in GetEpisodes(series.Slug)) {
sw.Write(
@ -245,7 +262,11 @@ private void GenerateSeriesDetailsFragment(Series series) {
</li>");
}
sw.Write("</ol></div>");
sw.Write(
@$"</ol>
{series.HtmlDescription}
</div>
</div>");
}
private void InjectGenreList(IEnumerable<string> genres) {

View File

@ -87,6 +87,8 @@
<p>Radiostasis is an <a href='https://code.sitosis.com/rudism/radiostasis' target='_blank'>open source</a> passion project by Rudis Muiznieks, a software engineer who happens to love Old Time Radio. Radiostasis is a constant work in progress, with many improvements planned for the future. Currently the site is completely free to use&mdash;Rudis foots all the bills to host this site on his own&mdash;but premium features may be introduced in future updates to help offset some of the costs.</p>
<p>If you have any questions, suggestions, or just want to say hello, feel free to email Rudis at <a href='mailto:support@radiostasis.com'>support@radiostasis.com</a>.</p>
<h3>Change Log</h3>
<h4>2023-04-05</h4>
<p>Added series descriptions to the details pages. Descriptions were generated by ChatGPT as summaries of available information on Wikipedia, <a href='https://otrr.org' target='_blank'>OTRR</a> write ups on <a href='https://archive.org/details/OTRR_Home_Page' target='_blank'>archive.org</a>, the <a href='https://otrcat.com' target='_blank'>Old Time Radio Catalog</a>, and other websites.</p>
<h4>2023-03-26</h4>
<p>Initial release with bare-bones series and episodes lists, plus the ability to stream individual episodes.</p>
</div>