#48 more image information for poem

This commit is contained in:
Hamid Reza Mohammadi 2020-12-17 17:13:31 +03:30
parent fe38acc26c
commit 6d5cb93742
3 changed files with 42 additions and 3 deletions

View File

@ -0,0 +1,24 @@
using RMuseum.Models.GanjoorAudio.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace RMuseum.Models.Ganjoor.ViewModels
{
/// <summary>
/// a more complete GanjoorPoem View Model
/// </summary>
public class GanjoorPoemCompleteViewModel
{
/// <summary>
/// basic poem info
/// </summary>
public GanjoorPoem Poem { get; set; }
/// <summary>
/// Recitations
/// </summary>
public PublicRecitationViewModel[] Recitations { get; set; }
}
}

View File

@ -3403,6 +3403,21 @@
Non-poem paragraph
</summary>
</member>
<member name="T:RMuseum.Models.Ganjoor.ViewModels.GanjoorPoemCompleteViewModel">
<summary>
a more complete GanjoorPoem View Model
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorPoemCompleteViewModel.Poem">
<summary>
basic poem info
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorPoemCompleteViewModel.Recitations">
<summary>
Recitations
</summary>
</member>
<member name="T:RMuseum.Models.ImportJob.ImportJob">
<summary>
Import Job

View File

@ -105,7 +105,7 @@ namespace RMuseum.Services.Implementation
try
{
var source =
from link in _context.GanjoorLinks.Include(l => l.Item).ThenInclude(i => i.Images)
from link in _context.GanjoorLinks.Include(l => l.Artifact).Include(l => l.Item).ThenInclude(i => i.Images)
join poem in _context.GanjoorPoems
on link.GanjoorPostId equals poem.Id
where
@ -119,8 +119,8 @@ namespace RMuseum.Services.Implementation
GanjoorPostId = link.GanjoorPostId,
GanjoorUrl = $"https://ganjoor.net{poem.FullUrl}",
GanjoorTitle = poem.FullTitle,
EntityName = "", //intentional
EntityFriendlyUrl = "", //intentional
EntityName = $"{link.Artifact.Name} » {link.Item.Name}",
EntityFriendlyUrl = $"https://museum.ganjoor.net/items/{link.Artifact.FriendlyUrl}/{link.Item.FriendlyUrl}",
EntityImageId = link.Item.Images.First().Id,//the most important data field, image url is https://ganjgah.ir/api/images/thumb/{EntityImageId}.jpg
ReviewResult = link.ReviewResult,
Synchronized = link.Synchronized,