docs: #342 bring up user voted recitations for himself/herself
This commit is contained in:
parent
c9c5856060
commit
ebd52738dc
@ -371,9 +371,13 @@ namespace GanjooRazor.Pages
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
var upVotedIds = JsonConvert.DeserializeObject<int[]>(await response.Content.ReadAsStringAsync());
|
||||
foreach (var recitation in GanjoorPage.Poem.Recitations)
|
||||
if(upVotedIds.Length > 0)
|
||||
{
|
||||
recitation.UpVotedByUser = upVotedIds.Contains(recitation.Id);
|
||||
foreach (var recitation in GanjoorPage.Poem.Recitations)
|
||||
{
|
||||
recitation.UpVotedByUser = upVotedIds.Contains(recitation.Id);
|
||||
}
|
||||
Array.Sort(GanjoorPage.Poem.Recitations, (a, b) => b.UpVotedByUser == a.UpVotedByUser ? a.AudioOrder.CompareTo(b.AudioOrder) : b.UpVotedByUser.CompareTo(a.UpVotedByUser));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -81,6 +81,9 @@
|
||||
<p>
|
||||
* رأی ثبت شده توسط کاربر مالک خوانش در محاسبه لحاظ نمیشود.
|
||||
</p>
|
||||
<p>
|
||||
* خوانشهایی که یک کاربر به آنها رأی داده (آنها را نشان کرده) در بازدید مجدد از شعر برای خود او فارغ از رتبهبندی گنجور بالاتر از بقیهٔ خوانشها نمایش داده میشود.
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@ -102,6 +102,11 @@ namespace RMuseum.Models.GanjoorAudio.ViewModels
|
||||
/// </summary>
|
||||
public RecitationMistakeViewModel[] Mistakes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This determines where an audio is displayed between a list of sounds related to a specfic poem
|
||||
/// </summary>
|
||||
public int AudioOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// upvoted by current user (filled at client)
|
||||
/// </summary>
|
||||
|
||||
@ -4861,6 +4861,11 @@
|
||||
mistakes
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.GanjoorAudio.ViewModels.PublicRecitationViewModel.AudioOrder">
|
||||
<summary>
|
||||
This determines where an audio is displayed between a list of sounds related to a specfic poem
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.GanjoorAudio.ViewModels.PublicRecitationViewModel.UpVotedByUser">
|
||||
<summary>
|
||||
upvoted by current user (filled at client)
|
||||
|
||||
@ -643,6 +643,8 @@ namespace RMuseum.Services.Implementation
|
||||
XmlText = $"{WebServiceUrl.Url}/api/audio/xml/{audio.Id}",
|
||||
PlainText = "", //poem.PlainText
|
||||
HtmlText = "",//poem.HtmlText
|
||||
AudioOrder = audio.AudioOrder,
|
||||
UpVotedByUser = false,
|
||||
};
|
||||
var recitations = await source.AsNoTracking().ToArrayAsync();
|
||||
foreach (var recitation in recitations)
|
||||
|
||||
@ -149,7 +149,9 @@ namespace RMuseum.Services.Implementationa
|
||||
Mp3Url = $"{WebServiceUrl.Url}/api/audio/file/{audio.Id}.mp3",
|
||||
XmlText = $"{WebServiceUrl.Url}/api/audio/xml/{audio.Id}",
|
||||
PlainText = poem.PlainText,
|
||||
HtmlText = poem.HtmlText
|
||||
HtmlText = poem.HtmlText,
|
||||
AudioOrder = audio.AudioOrder,
|
||||
UpVotedByUser = false,
|
||||
};
|
||||
|
||||
(PaginationMetadata PagingMeta, PublicRecitationViewModel[] Items) paginatedResult =
|
||||
@ -204,7 +206,9 @@ namespace RMuseum.Services.Implementationa
|
||||
Mp3Url = $"{WebServiceUrl.Url}/api/audio/file/{audio.Id}.mp3",
|
||||
XmlText = $"{WebServiceUrl.Url}/api/audio/xml/{audio.Id}",
|
||||
PlainText = poem.PlainText,
|
||||
HtmlText = poem.HtmlText
|
||||
HtmlText = poem.HtmlText,
|
||||
AudioOrder = audio.AudioOrder,
|
||||
UpVotedByUser = false,
|
||||
};
|
||||
|
||||
(PaginationMetadata PagingMeta, PublicRecitationViewModel[] Items) paginatedResult =
|
||||
@ -258,7 +262,9 @@ namespace RMuseum.Services.Implementationa
|
||||
Mp3Url = $"{WebServiceUrl.Url}/api/audio/file/{audio.Id}.mp3",
|
||||
XmlText = $"{WebServiceUrl.Url}/api/audio/xml/{audio.Id}",
|
||||
PlainText = poem.PlainText,
|
||||
HtmlText = poem.HtmlText
|
||||
HtmlText = poem.HtmlText,
|
||||
AudioOrder = audio.AudioOrder,
|
||||
UpVotedByUser = false,
|
||||
};
|
||||
|
||||
(PaginationMetadata PagingMeta, PublicRecitationViewModel[] Items) paginatedResult =
|
||||
@ -300,7 +306,9 @@ namespace RMuseum.Services.Implementationa
|
||||
Mp3Url = $"{WebServiceUrl.Url}/api/audio/file/{audio.Id}.mp3",
|
||||
XmlText = $"{WebServiceUrl.Url}/api/audio/xml/{audio.Id}",
|
||||
PlainText = poem.PlainText,
|
||||
HtmlText = poem.HtmlText
|
||||
HtmlText = poem.HtmlText,
|
||||
AudioOrder = audio.AudioOrder,
|
||||
UpVotedByUser = false,
|
||||
};
|
||||
|
||||
return new RServiceResult<PublicRecitationViewModel>(await source.SingleOrDefaultAsync());
|
||||
@ -2172,7 +2180,9 @@ namespace RMuseum.Services.Implementationa
|
||||
Mp3Url = $"{WebServiceUrl.Url}/api/audio/file/{upvote.Recitation.Id}.mp3",
|
||||
XmlText = $"{WebServiceUrl.Url}/api/audio/xml/{upvote.Recitation.Id}",
|
||||
PlainText = poem.PlainText,
|
||||
HtmlText = poem.HtmlText
|
||||
HtmlText = poem.HtmlText,
|
||||
AudioOrder = upvote.Recitation.AudioOrder,
|
||||
UpVotedByUser = true,
|
||||
};
|
||||
|
||||
(PaginationMetadata PagingMeta, PublicRecitationViewModel[] Items) paginatedResult =
|
||||
|
||||
Loading…
Reference in New Issue
Block a user