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\BuyLink.cs" />
|
||||
<Compile Include="Objects\CountryCode.cs" />
|
||||
<Compile Include="Objects\ILastFmObject.cs" />
|
||||
<Compile Include="Objects\LastImageCollection.cs" />
|
||||
<Compile Include="Objects\Shout.cs" />
|
||||
<Compile Include="Objects\Station.cs" />
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
namespace IF.Lastfm.Core.Objects
|
||||
{
|
||||
public class Album
|
||||
public class Album : ILastFmObject
|
||||
{
|
||||
#region Properties
|
||||
|
||||
|
@ -10,7 +10,7 @@ namespace IF.Lastfm.Core.Objects
|
||||
/// <summary>
|
||||
/// Todo bio, tour, similar, stats, streamable
|
||||
/// </summary>
|
||||
public class Artist
|
||||
public class Artist : ILastFmObject
|
||||
{
|
||||
#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
|
||||
{
|
||||
|
||||
public class Station
|
||||
public class Station : ILastFmObject
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public Uri Url { get; set; }
|
||||
|
@ -9,7 +9,7 @@ namespace IF.Lastfm.Core.Objects
|
||||
/// <summary>
|
||||
/// TODO Wiki, Stream availability
|
||||
/// </summary>
|
||||
public class Track
|
||||
public class Track : ILastFmObject
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@ -17,6 +17,7 @@ public class Track
|
||||
public TimeSpan Duration { get; set; }
|
||||
public string Mbid { get; set; }
|
||||
public string ArtistName { get; set; }
|
||||
public string ArtistMbid { get; set; }
|
||||
public Uri Url { get; set; }
|
||||
public LastImageCollection Images { get; set; }
|
||||
|
||||
@ -48,6 +49,7 @@ internal static Track ParseJToken(JToken token)
|
||||
if (artistToken != null)
|
||||
{
|
||||
t.ArtistName = Artist.GetNameFromJToken(artistToken);
|
||||
t.ArtistMbid = artistToken.Value<string>("mbid");
|
||||
}
|
||||
|
||||
var albumToken = token.SelectToken("album");
|
||||
|
Loading…
Reference in New Issue
Block a user