#61 adding related poem songs to poem by url api
This commit is contained in:
parent
fa141bc96d
commit
f8e1cd243e
@ -155,10 +155,10 @@ namespace RMuseum.Controllers
|
||||
/// <param name="id"></param>
|
||||
/// <param name="catInfo"></param>
|
||||
/// <param name="catPoems"></param>
|
||||
/// <param name="rhymes">not implemented yet</param>
|
||||
/// <param name="rhymes"></param>
|
||||
/// <param name="recitations"></param>
|
||||
/// <param name="images"></param>
|
||||
/// <param name="songs">not implemented yet</param>
|
||||
/// <param name="songs"></param>
|
||||
/// <param name="comments">not implemented yet</param>
|
||||
/// <param name="verseDetails"></param>
|
||||
/// <param name="navigation">next/previous</param>
|
||||
|
||||
@ -42,7 +42,6 @@ namespace RMuseum.Models.Ganjoor.ViewModels
|
||||
/// </summary>
|
||||
public string HtmlText { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// metre
|
||||
/// </summary>
|
||||
@ -92,5 +91,10 @@ namespace RMuseum.Models.Ganjoor.ViewModels
|
||||
/// Images
|
||||
/// </summary>
|
||||
public PoemRelatedImage[] Images { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Songs
|
||||
/// </summary>
|
||||
public PoemMusicTrackViewModel[] Songs { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
58
RMuseum/Models/Ganjoor/ViewModels/PoemMusicTrackViewModel.cs
Normal file
58
RMuseum/Models/Ganjoor/ViewModels/PoemMusicTrackViewModel.cs
Normal file
@ -0,0 +1,58 @@
|
||||
namespace RMuseum.Models.Ganjoor.ViewModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Ganjoor Poem related music track model
|
||||
/// </summary>
|
||||
public class PoemMusicTrackViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// track type
|
||||
/// </summary>
|
||||
public PoemMusicTrackType TrackType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// artist name
|
||||
/// </summary>
|
||||
public string ArtistName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// artist url
|
||||
/// </summary>
|
||||
public string ArtistUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// album name
|
||||
/// </summary>
|
||||
public string AlbumName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// album url
|
||||
/// </summary>
|
||||
public string AlbumUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// track name
|
||||
/// </summary>
|
||||
public string TrackName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// track url
|
||||
/// </summary>
|
||||
public string TrackUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// description
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// broken link
|
||||
/// </summary>
|
||||
public bool BrokenLink { get; set; }
|
||||
}
|
||||
}
|
||||
@ -668,10 +668,10 @@
|
||||
<param name="id"></param>
|
||||
<param name="catInfo"></param>
|
||||
<param name="catPoems"></param>
|
||||
<param name="rhymes">not implemented yet</param>
|
||||
<param name="rhymes"></param>
|
||||
<param name="recitations"></param>
|
||||
<param name="images"></param>
|
||||
<param name="songs">not implemented yet</param>
|
||||
<param name="songs"></param>
|
||||
<param name="comments">not implemented yet</param>
|
||||
<param name="verseDetails"></param>
|
||||
<param name="navigation">next/previous</param>
|
||||
@ -4101,6 +4101,11 @@
|
||||
Images
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorPoemCompleteViewModel.Songs">
|
||||
<summary>
|
||||
Songs
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:RMuseum.Models.Ganjoor.ViewModels.GanjoorPoemSummaryViewModel">
|
||||
<summary>
|
||||
poem summary
|
||||
@ -4196,6 +4201,61 @@
|
||||
text
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:RMuseum.Models.Ganjoor.ViewModels.PoemMusicTrackViewModel">
|
||||
<summary>
|
||||
Ganjoor Poem related music track model
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.ViewModels.PoemMusicTrackViewModel.Id">
|
||||
<summary>
|
||||
id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.ViewModels.PoemMusicTrackViewModel.TrackType">
|
||||
<summary>
|
||||
track type
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.ViewModels.PoemMusicTrackViewModel.ArtistName">
|
||||
<summary>
|
||||
artist name
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.ViewModels.PoemMusicTrackViewModel.ArtistUrl">
|
||||
<summary>
|
||||
artist url
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.ViewModels.PoemMusicTrackViewModel.AlbumName">
|
||||
<summary>
|
||||
album name
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.ViewModels.PoemMusicTrackViewModel.AlbumUrl">
|
||||
<summary>
|
||||
album url
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.ViewModels.PoemMusicTrackViewModel.TrackName">
|
||||
<summary>
|
||||
track name
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.ViewModels.PoemMusicTrackViewModel.TrackUrl">
|
||||
<summary>
|
||||
track url
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.ViewModels.PoemMusicTrackViewModel.Description">
|
||||
<summary>
|
||||
description
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.ViewModels.PoemMusicTrackViewModel.BrokenLink">
|
||||
<summary>
|
||||
broken link
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:RMuseum.Models.Ganjoor.ViewModels.PoemRelatedImageType">
|
||||
<summary>
|
||||
Related Image Type
|
||||
|
||||
@ -664,6 +664,32 @@ namespace RMuseum.Services.Implementation
|
||||
};
|
||||
|
||||
|
||||
PoemMusicTrackViewModel[] tracks = null;
|
||||
if(songs)
|
||||
{
|
||||
tracks = await _context.GanjoorPoemMusicTracks
|
||||
.Where(t => t.PoemId == id && t.Approved)
|
||||
.OrderBy(t => t.Id)
|
||||
.Select
|
||||
(
|
||||
t => new PoemMusicTrackViewModel()
|
||||
{
|
||||
Id = t.Id,
|
||||
TrackType = t.TrackType,
|
||||
ArtistName = t.ArtistName,
|
||||
ArtistUrl = t.ArtistUrl,
|
||||
AlbumName = t.AlbumName,
|
||||
AlbumUrl = t.AlbumUrl,
|
||||
TrackName = t.TrackName,
|
||||
TrackUrl = t.TrackUrl,
|
||||
Description = t.Description,
|
||||
BrokenLink = t.BrokenLink
|
||||
|
||||
}
|
||||
).ToArrayAsync();
|
||||
}
|
||||
|
||||
|
||||
return new RServiceResult<GanjoorPoemCompleteViewModel>
|
||||
(
|
||||
new GanjoorPoemCompleteViewModel()
|
||||
@ -684,7 +710,8 @@ namespace RMuseum.Services.Implementation
|
||||
Previous = previous,
|
||||
Recitations = rc,
|
||||
Images = imgs,
|
||||
Verses = verses
|
||||
Verses = verses,
|
||||
Songs = tracks
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user