diff --git a/RMuseum/Controllers/RecitationController.cs b/RMuseum/Controllers/RecitationController.cs index cb67a628..af4fe509 100644 --- a/RMuseum/Controllers/RecitationController.cs +++ b/RMuseum/Controllers/RecitationController.cs @@ -50,7 +50,7 @@ namespace RMuseum.Controllers } /// - /// create an RSS file from recent published recitations + /// creates an RSS file from recent published recitations /// /// /// diff --git a/RMuseum/Services/Implementation/RecitationsRssBuilder.cs b/RMuseum/Services/Implementation/RecitationsRssBuilder.cs index c2673517..5586d6fd 100644 --- a/RMuseum/Services/Implementation/RecitationsRssBuilder.cs +++ b/RMuseum/Services/Implementation/RecitationsRssBuilder.cs @@ -61,21 +61,39 @@ namespace RMuseum.Services.Implementation foreach (PublicRecitationViewModel recitation in recitations) { + string poemDescription = recitation.PoemFullTitle; + if (recitation.PoemFullTitle.IndexOf("»") != -1) + { + string poemCat = recitation.PoemFullTitle.Substring(0, recitation.PoemFullTitle.LastIndexOf("»")).Trim(); + string poemTitle = recitation.PoemFullTitle.Substring(recitation.PoemFullTitle.LastIndexOf("»") + 1).Trim(); + + poemDescription = $"{poemTitle} از ({poemCat})"; + } + + string artist = recitation.AudioArtist; + if(!string.IsNullOrEmpty(recitation.AudioArtistUrl)) + { + artist = $"{recitation.AudioArtist}"; + } + builder.AppendLine(" "); builder.AppendLine($" {recitation.PoemFullTitle} با خوانش {recitation.AudioArtist}"); builder.AppendLine($" https://ganjoor.net{recitation.PoemFullUrl}"); builder.AppendLine($" {recitation.PublishDate:r}"); builder.AppendLine($" {recitation.LegacyAudioGuid}"); builder.AppendLine($" {recitation.AudioArtist}"); - builder.AppendLine($" "); + builder.AppendLine($" "); string htmlText = recitation.HtmlText == null ? "" : recitation.HtmlText - .Replace("", "") + .Replace("", $"{Environment.NewLine}") .Replace("
", "") .Replace("
", "") .Replace("
", "") .Replace("
", "") .Replace("
", ""); - builder.AppendLine($" "); + builder.AppendLine($" {poemDescription} را با خوانش {artist} بشنوید.

{Environment.NewLine}" + + $"

فایل صوتی متناظر را می‌توانید در قالب mp3 از این نشانی (اندازه {(recitation.Mp3SizeInBytes / (1024 * 1024.0f)) : 0.00} مگابایت) دریافت کنید.

{Environment.NewLine}" + + $"

متن خوانش:

{Environment.NewLine}" + + $" {htmlText}]]>
"); builder.AppendLine($" "); builder.AppendLine(" "); }