divan/DiwanRazor/Pages/Partials/DiwanPage/_AudioPlayerPartial.cshtml.cs
Anas Rashid 020b010483 Urdu public pages, batch 2 (#2): auth, errors, map, FAQ, similar poems, people pages, page titles
- translate remaining public views and page-model strings (titles, messages, relation names)
- Urdu stopword list for word-frequency stats (replaces Persian list)
- error pages: drop list of alternative Ganjoor services

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 00:22:09 +02:00

49 lines
1.7 KiB
C#

using Microsoft.AspNetCore.Mvc.RazorPages;
using RMuseum.Models.DiwanAudio;
using RMuseum.Models.DiwanAudio.ViewModels;
namespace DiwanRazor.Pages
{
public class _AudioPlayerPartialModel : PageModel
{
public bool LoggedIn { get; set; }
public bool IsAdmin { get; set; }
public PublicRecitationViewModel[] Recitations { get; set; }
public bool ShowAllRecitaions { get; set; }
public bool CategoryMode { get; set; }
public RecitationType RecitationType { get; set; }
public string getAudioDesc(PublicRecitationViewModel recitation, bool contributionLink = false)
{
string audiodesc = "قرأت ";
if (!string.IsNullOrEmpty(recitation.AudioArtistUrl) && recitation.AudioArtistUrl.StartsWith("http"))
{
audiodesc += $"<a href='{recitation.AudioArtistUrl}'>{recitation.AudioArtist}</a>";
}
else
{
audiodesc += $"{recitation.AudioArtist}";
}
if (!string.IsNullOrEmpty(recitation.AudioSrc) && !string.IsNullOrEmpty(recitation.AudioSrcUrl) && recitation.AudioSrcUrl.StartsWith("http"))
{
audiodesc += $" منقول از <a href='{recitation.AudioSrcUrl}'>{recitation.AudioSrc}</a>";
}
if (contributionLink)
{
audiodesc += "<br> <small>کیا آپ پڑھنا چاہیں گے؟ <a href='http://ava.ganjoor.net/about/'>یہاں</a> دیکھیں.</small>";
}
return audiodesc;
}
public string CSSClass(int recitationIndex)
{
return ShowAllRecitaions || (recitationIndex < 5) ? "audio-player" : "hidden-recitation";
}
}
}