mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-24 23:16:28 +00:00
Formatted and beautified code via codemaid
Organised using statements alphabetically
This commit is contained in:
parent
e4f30cb736
commit
49441bba95
@ -1,5 +1,5 @@
|
|||||||
using System;
|
using SpotifyAPI.Local.Models;
|
||||||
using SpotifyAPI.Local.Models;
|
using System;
|
||||||
|
|
||||||
namespace SpotifyAPI.Local
|
namespace SpotifyAPI.Local
|
||||||
{
|
{
|
||||||
@ -11,6 +11,7 @@ namespace SpotifyAPI.Local
|
|||||||
public Track OldTrack { get; set; }
|
public Track OldTrack { get; set; }
|
||||||
public Track NewTrack { get; set; }
|
public Track NewTrack { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event gets triggered, when the Playin-state is changed (e.g Play --> Pause)
|
/// Event gets triggered, when the Playin-state is changed (e.g Play --> Pause)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -18,6 +19,7 @@ namespace SpotifyAPI.Local
|
|||||||
{
|
{
|
||||||
public Boolean Playing { get; set; }
|
public Boolean Playing { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event gets triggered, when the volume changes
|
/// Event gets triggered, when the volume changes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -26,6 +28,7 @@ namespace SpotifyAPI.Local
|
|||||||
public double OldVolume { get; set; }
|
public double OldVolume { get; set; }
|
||||||
public double NewVolume { get; set; }
|
public double NewVolume { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event gets triggered, when the tracktime changes
|
/// Event gets triggered, when the tracktime changes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -5,7 +5,7 @@ namespace SpotifyAPI.Local.Models
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// JSON Response, used internaly
|
/// JSON Response, used internaly
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class Cfid
|
internal class Cfid
|
||||||
{
|
{
|
||||||
public Error Error { get; set; }
|
public Error Error { get; set; }
|
||||||
public String Token { get; set; }
|
public String Token { get; set; }
|
||||||
@ -17,7 +17,7 @@ namespace SpotifyAPI.Local.Models
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// JSON Response, used internaly
|
/// JSON Response, used internaly
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class Error
|
internal class Error
|
||||||
{
|
{
|
||||||
public String Type { get; set; }
|
public String Type { get; set; }
|
||||||
public String Message { get; set; }
|
public String Message { get; set; }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json;
|
using System;
|
||||||
|
|
||||||
namespace SpotifyAPI.Local.Models
|
namespace SpotifyAPI.Local.Models
|
||||||
{
|
{
|
||||||
@ -7,6 +7,7 @@ namespace SpotifyAPI.Local.Models
|
|||||||
{
|
{
|
||||||
[JsonProperty("private_session")]
|
[JsonProperty("private_session")]
|
||||||
public Boolean PrivateSession { get; set; }
|
public Boolean PrivateSession { get; set; }
|
||||||
|
|
||||||
[JsonProperty("posting_disabled")]
|
[JsonProperty("posting_disabled")]
|
||||||
public Boolean PostingDisabled { get; set; }
|
public Boolean PostingDisabled { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json;
|
using System;
|
||||||
|
|
||||||
namespace SpotifyAPI.Local.Models
|
namespace SpotifyAPI.Local.Models
|
||||||
{
|
{
|
||||||
@ -7,8 +7,10 @@ namespace SpotifyAPI.Local.Models
|
|||||||
{
|
{
|
||||||
[JsonProperty("name")]
|
[JsonProperty("name")]
|
||||||
public String Name { get; set; }
|
public String Name { get; set; }
|
||||||
|
|
||||||
[JsonProperty("uri")]
|
[JsonProperty("uri")]
|
||||||
public String Uri { get; set; }
|
public String Uri { get; set; }
|
||||||
|
|
||||||
[JsonProperty("location")]
|
[JsonProperty("location")]
|
||||||
public TrackResourceLocation Location { get; set; }
|
public TrackResourceLocation Location { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -6,30 +6,43 @@ namespace SpotifyAPI.Local.Models
|
|||||||
{
|
{
|
||||||
[JsonProperty("version")]
|
[JsonProperty("version")]
|
||||||
public int Version { get; set; }
|
public int Version { get; set; }
|
||||||
|
|
||||||
[JsonProperty("client_version")]
|
[JsonProperty("client_version")]
|
||||||
public string ClientVersion { get; set; }
|
public string ClientVersion { get; set; }
|
||||||
|
|
||||||
[JsonProperty("playing")]
|
[JsonProperty("playing")]
|
||||||
public bool Playing { get; set; }
|
public bool Playing { get; set; }
|
||||||
|
|
||||||
[JsonProperty("schuffle")]
|
[JsonProperty("schuffle")]
|
||||||
public bool Shuffle { get; set; }
|
public bool Shuffle { get; set; }
|
||||||
|
|
||||||
[JsonProperty("repeat")]
|
[JsonProperty("repeat")]
|
||||||
public bool Repeat { get; set; }
|
public bool Repeat { get; set; }
|
||||||
|
|
||||||
[JsonProperty("play_enabled")]
|
[JsonProperty("play_enabled")]
|
||||||
public bool PlayEnabled { get; set; }
|
public bool PlayEnabled { get; set; }
|
||||||
|
|
||||||
[JsonProperty("prev_enabled")]
|
[JsonProperty("prev_enabled")]
|
||||||
public bool PrevEnabled { get; set; }
|
public bool PrevEnabled { get; set; }
|
||||||
|
|
||||||
[JsonProperty("next_enabled")]
|
[JsonProperty("next_enabled")]
|
||||||
public bool NextEnabled { get; set; }
|
public bool NextEnabled { get; set; }
|
||||||
|
|
||||||
[JsonProperty("track")]
|
[JsonProperty("track")]
|
||||||
public Track Track { get; set; }
|
public Track Track { get; set; }
|
||||||
|
|
||||||
[JsonProperty("playing_position")]
|
[JsonProperty("playing_position")]
|
||||||
public double PlayingPosition { get; set; }
|
public double PlayingPosition { get; set; }
|
||||||
|
|
||||||
[JsonProperty("server_time")]
|
[JsonProperty("server_time")]
|
||||||
public int ServerTime { get; set; }
|
public int ServerTime { get; set; }
|
||||||
|
|
||||||
[JsonProperty("volume")]
|
[JsonProperty("volume")]
|
||||||
public double Volume { get; set; }
|
public double Volume { get; set; }
|
||||||
|
|
||||||
[JsonProperty("online")]
|
[JsonProperty("online")]
|
||||||
public bool Online { get; set; }
|
public bool Online { get; set; }
|
||||||
|
|
||||||
[JsonProperty("running")]
|
[JsonProperty("running")]
|
||||||
public bool Running { get; set; }
|
public bool Running { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using SpotifyAPI.Local.Enums;
|
||||||
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using SpotifyAPI.Local.Enums;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Local.Models
|
namespace SpotifyAPI.Local.Models
|
||||||
{
|
{
|
||||||
@ -12,12 +12,16 @@ namespace SpotifyAPI.Local.Models
|
|||||||
{
|
{
|
||||||
[JsonProperty("track_resource")]
|
[JsonProperty("track_resource")]
|
||||||
public SpotifyResource TrackResource { get; set; }
|
public SpotifyResource TrackResource { get; set; }
|
||||||
|
|
||||||
[JsonProperty("artist_resource")]
|
[JsonProperty("artist_resource")]
|
||||||
public SpotifyResource ArtistResource { get; set; }
|
public SpotifyResource ArtistResource { get; set; }
|
||||||
|
|
||||||
[JsonProperty("album_resource")]
|
[JsonProperty("album_resource")]
|
||||||
public SpotifyResource AlbumResource { get; set; }
|
public SpotifyResource AlbumResource { get; set; }
|
||||||
|
|
||||||
[JsonProperty("length")]
|
[JsonProperty("length")]
|
||||||
public int Length { get; set; }
|
public int Length { get; set; }
|
||||||
|
|
||||||
[JsonProperty("track_type")]
|
[JsonProperty("track_type")]
|
||||||
public string TrackType { get; set; }
|
public string TrackType { get; set; }
|
||||||
|
|
||||||
@ -50,9 +54,11 @@ namespace SpotifyAPI.Local.Models
|
|||||||
case AlbumArtSize.Size160:
|
case AlbumArtSize.Size160:
|
||||||
albumsize = 160;
|
albumsize = 160;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AlbumArtSize.Size320:
|
case AlbumArtSize.Size320:
|
||||||
albumsize = 320;
|
albumsize = 320;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AlbumArtSize.Size640:
|
case AlbumArtSize.Size640:
|
||||||
albumsize = 640;
|
albumsize = 640;
|
||||||
break;
|
break;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json;
|
using System;
|
||||||
|
|
||||||
namespace SpotifyAPI.Local.Models
|
namespace SpotifyAPI.Local.Models
|
||||||
{
|
{
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using SpotifyAPI.Local.Models;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using SpotifyAPI.Local.Models;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Local
|
namespace SpotifyAPI.Local
|
||||||
{
|
{
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
using System;
|
using SpotifyAPI.Local.Models;
|
||||||
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
using SpotifyAPI.Local.Models;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Local
|
namespace SpotifyAPI.Local
|
||||||
{
|
{
|
||||||
@ -12,10 +12,12 @@ namespace SpotifyAPI.Local
|
|||||||
{
|
{
|
||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
private static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);
|
private static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);
|
||||||
|
|
||||||
[DllImport("nircmd.dll", CharSet = CharSet.Auto)]
|
[DllImport("nircmd.dll", CharSet = CharSet.Auto)]
|
||||||
private static extern bool DoNirCmd(String nirCmdStr);
|
private static extern bool DoNirCmd(String nirCmdStr);
|
||||||
|
|
||||||
private bool _listenForEvents;
|
private bool _listenForEvents;
|
||||||
|
|
||||||
public bool ListenForEvents
|
public bool ListenForEvents
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -30,6 +32,7 @@ namespace SpotifyAPI.Local
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ISynchronizeInvoke _synchronizingObject;
|
private ISynchronizeInvoke _synchronizingObject;
|
||||||
|
|
||||||
public ISynchronizeInvoke SynchronizingObject
|
public ISynchronizeInvoke SynchronizingObject
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -43,22 +46,29 @@ namespace SpotifyAPI.Local
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const byte VkMediaNextTrack = 0xb0;
|
private const byte VkMediaNextTrack = 0xb0;
|
||||||
const byte VkMediaPrevTrack = 0xb1;
|
private const byte VkMediaPrevTrack = 0xb1;
|
||||||
const int KeyeventfExtendedkey = 0x1;
|
private const int KeyeventfExtendedkey = 0x1;
|
||||||
const int KeyeventfKeyup = 0x2;
|
private const int KeyeventfKeyup = 0x2;
|
||||||
|
|
||||||
readonly RemoteHandler _rh;
|
private readonly RemoteHandler _rh;
|
||||||
private readonly Timer _eventTimer;
|
private readonly Timer _eventTimer;
|
||||||
private StatusResponse _eventStatusResponse;
|
private StatusResponse _eventStatusResponse;
|
||||||
|
|
||||||
public delegate void TrackChangeEventHandler(TrackChangeEventArgs e);
|
public delegate void TrackChangeEventHandler(TrackChangeEventArgs e);
|
||||||
|
|
||||||
public delegate void PlayStateEventHandler(PlayStateEventArgs e);
|
public delegate void PlayStateEventHandler(PlayStateEventArgs e);
|
||||||
|
|
||||||
public delegate void VolumeChangeEventHandler(VolumeChangeEventArgs e);
|
public delegate void VolumeChangeEventHandler(VolumeChangeEventArgs e);
|
||||||
|
|
||||||
public delegate void TrackTimeChangeEventHandler(TrackTimeChangeEventArgs e);
|
public delegate void TrackTimeChangeEventHandler(TrackTimeChangeEventArgs e);
|
||||||
|
|
||||||
public event TrackChangeEventHandler OnTrackChange;
|
public event TrackChangeEventHandler OnTrackChange;
|
||||||
|
|
||||||
public event PlayStateEventHandler OnPlayStateChange;
|
public event PlayStateEventHandler OnPlayStateChange;
|
||||||
|
|
||||||
public event VolumeChangeEventHandler OnVolumeChange;
|
public event VolumeChangeEventHandler OnVolumeChange;
|
||||||
|
|
||||||
public event TrackTimeChangeEventHandler OnTrackTimeChange;
|
public event TrackTimeChangeEventHandler OnTrackTimeChange;
|
||||||
|
|
||||||
public SpotifyLocalAPI()
|
public SpotifyLocalAPI()
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using SpotifyAPI.Web.Enums;
|
||||||
|
using SpotifyAPI.Web.Models;
|
||||||
|
using System;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using SpotifyAPI.Web.Enums;
|
|
||||||
using SpotifyAPI.Web.Models;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Auth
|
namespace SpotifyAPI.Web.Auth
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using SpotifyAPI.Web.Enums;
|
||||||
|
using SpotifyAPI.Web.Models;
|
||||||
|
using System;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using SpotifyAPI.Web.Enums;
|
|
||||||
using SpotifyAPI.Web.Models;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Auth
|
namespace SpotifyAPI.Web.Auth
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
using System;
|
using SpotifyAPI.Web.Enums;
|
||||||
|
using SpotifyAPI.Web.Models;
|
||||||
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using SpotifyAPI.Web.Enums;
|
|
||||||
using SpotifyAPI.Web.Models;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Auth
|
namespace SpotifyAPI.Web.Auth
|
||||||
{
|
{
|
||||||
@ -18,6 +18,7 @@ namespace SpotifyAPI.Web.Auth
|
|||||||
public String State { get; set; }
|
public String State { get; set; }
|
||||||
public Scope Scope { get; set; }
|
public Scope Scope { get; set; }
|
||||||
public Boolean ShowDialog { get; set; }
|
public Boolean ShowDialog { get; set; }
|
||||||
|
|
||||||
public event OnResponseReceived OnResponseReceivedEvent;
|
public event OnResponseReceived OnResponseReceivedEvent;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -5,10 +5,19 @@ namespace SpotifyAPI.Web.Enums
|
|||||||
[Flags]
|
[Flags]
|
||||||
public enum AlbumType
|
public enum AlbumType
|
||||||
{
|
{
|
||||||
[String("album")] Album = 1,
|
[String("album")]
|
||||||
[String("single")] Single = 2,
|
Album = 1,
|
||||||
[String("compilation")] Compilation = 4,
|
|
||||||
[String("appears_on")] AppearsOn = 8,
|
[String("single")]
|
||||||
[String("album,single,compilation,appears_on")] All = 16
|
Single = 2,
|
||||||
|
|
||||||
|
[String("compilation")]
|
||||||
|
Compilation = 4,
|
||||||
|
|
||||||
|
[String("appears_on")]
|
||||||
|
AppearsOn = 8,
|
||||||
|
|
||||||
|
[String("album,single,compilation,appears_on")]
|
||||||
|
All = 16
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,7 +5,10 @@ namespace SpotifyAPI.Web.Enums
|
|||||||
[Flags]
|
[Flags]
|
||||||
public enum FollowType
|
public enum FollowType
|
||||||
{
|
{
|
||||||
[String("artist")] Artist = 1,
|
[String("artist")]
|
||||||
[String("user")] User = 2
|
Artist = 1,
|
||||||
|
|
||||||
|
[String("user")]
|
||||||
|
User = 2
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,17 +5,40 @@ namespace SpotifyAPI.Web.Enums
|
|||||||
[Flags]
|
[Flags]
|
||||||
public enum Scope
|
public enum Scope
|
||||||
{
|
{
|
||||||
[String("")] None = 1,
|
[String("")]
|
||||||
[String("playlist-modify-public")] PlaylistModifyPublic = 2,
|
None = 1,
|
||||||
[String("playlist-modify-private")] PlaylistModifyPrivate = 4,
|
|
||||||
[String("playlist-read-private")] PlaylistReadPrivate = 8,
|
[String("playlist-modify-public")]
|
||||||
[String("streaming")] Streaming = 16,
|
PlaylistModifyPublic = 2,
|
||||||
[String("user-read-private")] UserReadPrivate = 32,
|
|
||||||
[String("user-read-email")] UserReadEmail = 64,
|
[String("playlist-modify-private")]
|
||||||
[String("user-library-read")] UserLibrarayRead = 128,
|
PlaylistModifyPrivate = 4,
|
||||||
[String("user-library-modify")] UserLibraryModify = 256,
|
|
||||||
[String("user-follow-modify")] UserFollowModify = 512,
|
[String("playlist-read-private")]
|
||||||
[String("user-follow-read")] UserFollowRead = 1024,
|
PlaylistReadPrivate = 8,
|
||||||
[String("user-read-birthdate")] UserReadBirthdate = 2048
|
|
||||||
|
[String("streaming")]
|
||||||
|
Streaming = 16,
|
||||||
|
|
||||||
|
[String("user-read-private")]
|
||||||
|
UserReadPrivate = 32,
|
||||||
|
|
||||||
|
[String("user-read-email")]
|
||||||
|
UserReadEmail = 64,
|
||||||
|
|
||||||
|
[String("user-library-read")]
|
||||||
|
UserLibrarayRead = 128,
|
||||||
|
|
||||||
|
[String("user-library-modify")]
|
||||||
|
UserLibraryModify = 256,
|
||||||
|
|
||||||
|
[String("user-follow-modify")]
|
||||||
|
UserFollowModify = 512,
|
||||||
|
|
||||||
|
[String("user-follow-read")]
|
||||||
|
UserFollowRead = 1024,
|
||||||
|
|
||||||
|
[String("user-read-birthdate")]
|
||||||
|
UserReadBirthdate = 2048
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,9 +5,16 @@ namespace SpotifyAPI.Web.Enums
|
|||||||
[Flags]
|
[Flags]
|
||||||
public enum SearchType
|
public enum SearchType
|
||||||
{
|
{
|
||||||
[String("artist")] Artist = 1,
|
[String("artist")]
|
||||||
[String("album")] Album = 2,
|
Artist = 1,
|
||||||
[String("track")] Track = 4,
|
|
||||||
[String("track,album,artist")] All = 8
|
[String("album")]
|
||||||
|
Album = 2,
|
||||||
|
|
||||||
|
[String("track")]
|
||||||
|
Track = 4,
|
||||||
|
|
||||||
|
[String("track,album,artist")]
|
||||||
|
All = 8
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web
|
namespace SpotifyAPI.Web
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json;
|
using System;
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json;
|
using System;
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json;
|
using System;
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json;
|
using System;
|
||||||
|
|
||||||
namespace SpotifyAPI.Web.Models
|
namespace SpotifyAPI.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -230,6 +230,7 @@ namespace SpotifyAPI.Web
|
|||||||
}
|
}
|
||||||
|
|
||||||
public abstract void HandleGetRequest(HttpProcessor p);
|
public abstract void HandleGetRequest(HttpProcessor p);
|
||||||
|
|
||||||
public abstract void HandlePostRequest(HttpProcessor p, StreamReader inputData);
|
public abstract void HandlePostRequest(HttpProcessor p, StreamReader inputData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,6 +238,7 @@ namespace SpotifyAPI.Web
|
|||||||
{
|
{
|
||||||
//Code can be an AccessToken or an Exchange Code
|
//Code can be an AccessToken or an Exchange Code
|
||||||
public String Code { get; set; }
|
public String Code { get; set; }
|
||||||
|
|
||||||
public String TokenType { get; set; }
|
public String TokenType { get; set; }
|
||||||
public String State { get; set; }
|
public String State { get; set; }
|
||||||
public String Error { get; set; }
|
public String Error { get; set; }
|
||||||
@ -262,7 +264,6 @@ namespace SpotifyAPI.Web
|
|||||||
if (p.HttpUrl == "/favicon.ico")
|
if (p.HttpUrl == "/favicon.ico")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
Thread t;
|
Thread t;
|
||||||
if (_type == AuthType.Authorization)
|
if (_type == AuthType.Authorization)
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using SpotifyAPI.Web.Enums;
|
using SpotifyAPI.Web.Enums;
|
||||||
using SpotifyAPI.Web.Models;
|
using SpotifyAPI.Web.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
namespace SpotifyAPI.Web
|
namespace SpotifyAPI.Web
|
||||||
{
|
{
|
||||||
@ -62,7 +62,7 @@ namespace SpotifyAPI.Web
|
|||||||
return DownloadData<SearchItem>(builder.ToString());
|
return DownloadData<SearchItem>(builder.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Search
|
||||||
|
|
||||||
#region Albums
|
#region Albums
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ namespace SpotifyAPI.Web
|
|||||||
return DownloadData<SeveralAlbums>(APIBase + "/albums?market=" + market + "&ids=" + string.Join(",", ids.Take(20)));
|
return DownloadData<SeveralAlbums>(APIBase + "/albums?market=" + market + "&ids=" + string.Join(",", ids.Take(20)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Albums
|
||||||
|
|
||||||
#region Artists
|
#region Artists
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ namespace SpotifyAPI.Web
|
|||||||
return DownloadData<SeveralArtists>(APIBase + "/artists?ids=" + string.Join(",", ids.Take(50)));
|
return DownloadData<SeveralArtists>(APIBase + "/artists?ids=" + string.Join(",", ids.Take(50)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Artists
|
||||||
|
|
||||||
#region Browse
|
#region Browse
|
||||||
|
|
||||||
@ -314,7 +314,7 @@ namespace SpotifyAPI.Web
|
|||||||
return DownloadData<CategoryPlaylist>(builder.ToString());
|
return DownloadData<CategoryPlaylist>(builder.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Browse
|
||||||
|
|
||||||
#region Follow
|
#region Follow
|
||||||
|
|
||||||
@ -489,7 +489,7 @@ namespace SpotifyAPI.Web
|
|||||||
return IsFollowingPlaylist(ownerId, playlistId, new List<string> { id });
|
return IsFollowingPlaylist(ownerId, playlistId, new List<string> { id });
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Follow
|
||||||
|
|
||||||
#region Library
|
#region Library
|
||||||
|
|
||||||
@ -565,7 +565,7 @@ namespace SpotifyAPI.Web
|
|||||||
return new ListResponse<Boolean> { List = null, Error = res["error"].ToObject<Error>() };
|
return new ListResponse<Boolean> { List = null, Error = res["error"].ToObject<Error>() };
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Library
|
||||||
|
|
||||||
#region Playlists
|
#region Playlists
|
||||||
|
|
||||||
@ -791,7 +791,7 @@ namespace SpotifyAPI.Web
|
|||||||
return UploadData<Snapshot>(APIBase + "/users/" + userId + "/playlists/" + playlistId + "/tracks", body.ToString(Formatting.None), "PUT");
|
return UploadData<Snapshot>(APIBase + "/users/" + userId + "/playlists/" + playlistId + "/tracks", body.ToString(Formatting.None), "PUT");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Playlists
|
||||||
|
|
||||||
#region Profiles
|
#region Profiles
|
||||||
|
|
||||||
@ -817,7 +817,7 @@ namespace SpotifyAPI.Web
|
|||||||
return DownloadData<PublicProfile>(APIBase + "/users/" + userId);
|
return DownloadData<PublicProfile>(APIBase + "/users/" + userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Profiles
|
||||||
|
|
||||||
#region Tracks
|
#region Tracks
|
||||||
|
|
||||||
@ -847,7 +847,7 @@ namespace SpotifyAPI.Web
|
|||||||
return DownloadData<FullTrack>(APIBase + "/tracks/" + id + "?market=" + market);
|
return DownloadData<FullTrack>(APIBase + "/tracks/" + id + "?market=" + market);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Tracks
|
||||||
|
|
||||||
#region Util
|
#region Util
|
||||||
|
|
||||||
@ -869,6 +869,6 @@ namespace SpotifyAPI.Web
|
|||||||
return WebClient.DownloadJson<T>(url);
|
return WebClient.DownloadJson<T>(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Util
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,10 +1,10 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace SpotifyAPI.Web
|
namespace SpotifyAPI.Web
|
||||||
{
|
{
|
||||||
|
@ -27,6 +27,7 @@ namespace SpotifyAPI.Web
|
|||||||
public sealed class StringAttribute : Attribute
|
public sealed class StringAttribute : Attribute
|
||||||
{
|
{
|
||||||
public String Text { get; set; }
|
public String Text { get; set; }
|
||||||
|
|
||||||
public StringAttribute(String text)
|
public StringAttribute(String text)
|
||||||
{
|
{
|
||||||
Text = text;
|
Text = text;
|
||||||
|
Loading…
Reference in New Issue
Block a user