mirror of
https://github.com/Sarsoo/IF.Lastfm.git
synced 2024-10-17 07:13:09 +01:00
Added ILastFmObject interface to simplify some object management scenarios. YEAH
Also added ArtistMbid property to Track.cs
This commit is contained in:
parent
08411cd7ac
commit
6c3e6d25ac
@ -70,6 +70,7 @@
|
|||||||
<Compile Include="Objects\Artist.cs" />
|
<Compile Include="Objects\Artist.cs" />
|
||||||
<Compile Include="Objects\BuyLink.cs" />
|
<Compile Include="Objects\BuyLink.cs" />
|
||||||
<Compile Include="Objects\CountryCode.cs" />
|
<Compile Include="Objects\CountryCode.cs" />
|
||||||
|
<Compile Include="Objects\ILastFmObject.cs" />
|
||||||
<Compile Include="Objects\LastImageCollection.cs" />
|
<Compile Include="Objects\LastImageCollection.cs" />
|
||||||
<Compile Include="Objects\Shout.cs" />
|
<Compile Include="Objects\Shout.cs" />
|
||||||
<Compile Include="Objects\Station.cs" />
|
<Compile Include="Objects\Station.cs" />
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
namespace IF.Lastfm.Core.Objects
|
namespace IF.Lastfm.Core.Objects
|
||||||
{
|
{
|
||||||
public class Album
|
public class Album : ILastFmObject
|
||||||
{
|
{
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ namespace IF.Lastfm.Core.Objects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Todo bio, tour, similar, stats, streamable
|
/// Todo bio, tour, similar, stats, streamable
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Artist
|
public class Artist : ILastFmObject
|
||||||
{
|
{
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
|
7
IF.Lastfm.Core/Objects/ILastFmObject.cs
Normal file
7
IF.Lastfm.Core/Objects/ILastFmObject.cs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
namespace IF.Lastfm.Core.Objects
|
||||||
|
{
|
||||||
|
public interface ILastFmObject
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
namespace IF.Lastfm.Core.Objects
|
namespace IF.Lastfm.Core.Objects
|
||||||
{
|
{
|
||||||
|
public class Station : ILastFmObject
|
||||||
public class Station
|
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public Uri Url { get; set; }
|
public Uri Url { get; set; }
|
||||||
|
@ -9,7 +9,7 @@ namespace IF.Lastfm.Core.Objects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// TODO Wiki, Stream availability
|
/// TODO Wiki, Stream availability
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Track
|
public class Track : ILastFmObject
|
||||||
{
|
{
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
@ -17,6 +17,7 @@ public class Track
|
|||||||
public TimeSpan Duration { get; set; }
|
public TimeSpan Duration { get; set; }
|
||||||
public string Mbid { get; set; }
|
public string Mbid { get; set; }
|
||||||
public string ArtistName { get; set; }
|
public string ArtistName { get; set; }
|
||||||
|
public string ArtistMbid { get; set; }
|
||||||
public Uri Url { get; set; }
|
public Uri Url { get; set; }
|
||||||
public LastImageCollection Images { get; set; }
|
public LastImageCollection Images { get; set; }
|
||||||
|
|
||||||
@ -48,6 +49,7 @@ internal static Track ParseJToken(JToken token)
|
|||||||
if (artistToken != null)
|
if (artistToken != null)
|
||||||
{
|
{
|
||||||
t.ArtistName = Artist.GetNameFromJToken(artistToken);
|
t.ArtistName = Artist.GetNameFromJToken(artistToken);
|
||||||
|
t.ArtistMbid = artistToken.Value<string>("mbid");
|
||||||
}
|
}
|
||||||
|
|
||||||
var albumToken = token.SelectToken("album");
|
var albumToken = token.SelectToken("album");
|
||||||
|
Loading…
Reference in New Issue
Block a user