mirror of
https://github.com/ViViDboarder/subsonic-csharp.git
synced 2024-11-22 19:26:37 +00:00
Added a few more API stubbs
This commit is contained in:
parent
c7f6639097
commit
2b297c0ab9
@ -31,7 +31,7 @@ namespace SubsonicAPI
|
|||||||
{
|
{
|
||||||
public enum SubsonicItemType
|
public enum SubsonicItemType
|
||||||
{
|
{
|
||||||
Folder, Song, Artist, Library
|
Folder, Song, Artist, Library, Playlist
|
||||||
}
|
}
|
||||||
|
|
||||||
public string name;
|
public string name;
|
||||||
@ -572,12 +572,15 @@ namespace SubsonicAPI
|
|||||||
StreamReader sr = new StreamReader(theStream);
|
StreamReader sr = new StreamReader(theStream);
|
||||||
string result = sr.ReadToEnd();
|
string result = sr.ReadToEnd();
|
||||||
|
|
||||||
|
/// TODO: Parse result to list
|
||||||
|
|
||||||
return nowPlaying;
|
return nowPlaying;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs a search valid for the current version of the subsonic server
|
/// Performs a search valid for the current version of the subsonic server
|
||||||
|
/// If version is >= 1.4.0 search2
|
||||||
|
/// Else search
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="query">The Term you want to search for</param>
|
/// <param name="query">The Term you want to search for</param>
|
||||||
/// <returns>A List of SubsonicItem objects</returns>
|
/// <returns>A List of SubsonicItem objects</returns>
|
||||||
@ -587,6 +590,7 @@ namespace SubsonicAPI
|
|||||||
Version apiV = new Version(apiVersion);
|
Version apiV = new Version(apiVersion);
|
||||||
Version Search2Min = new Version("1.4.0");
|
Version Search2Min = new Version("1.4.0");
|
||||||
string request = "";
|
string request = "";
|
||||||
|
// Use search for the server version
|
||||||
if (apiV >= Search2Min)
|
if (apiV >= Search2Min)
|
||||||
{
|
{
|
||||||
request = "search2";
|
request = "search2";
|
||||||
@ -643,6 +647,49 @@ namespace SubsonicAPI
|
|||||||
return searchResults;
|
return searchResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of all playlists on server
|
||||||
|
/// </summary>
|
||||||
|
public static List<SubsonicItem> GetPlaylists()
|
||||||
|
{
|
||||||
|
List<SubsonicItem> playlists = new List<SubsonicItem>();
|
||||||
|
|
||||||
|
Dictionary<string, string> theParameters = new Dictionary<string, string>();
|
||||||
|
Stream theStream = MakeGenericRequest("getPlaylists", theParameters);
|
||||||
|
StreamReader sr = new StreamReader(theStream);
|
||||||
|
string result = sr.ReadToEnd();
|
||||||
|
|
||||||
|
/// TODO: Parse result into list
|
||||||
|
|
||||||
|
return playlists;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of all SubsonicItems in playlist of given ID
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="playlistId">
|
||||||
|
/// ID of playlist to be fetched [retreive from GetPlaylists()]
|
||||||
|
/// </param>
|
||||||
|
/// <returns>
|
||||||
|
/// Returns list of SubsonicItems
|
||||||
|
/// </returns>
|
||||||
|
public static List<SubsonicItem> GetPlaylist(string playlistId)
|
||||||
|
{
|
||||||
|
List<SubsonicItem> playlist = new List<SubsonicItem>();
|
||||||
|
|
||||||
|
Dictionary<string, string> theParameters = new Dictionary<string, string>();
|
||||||
|
theParameters.Add("id", playlistId);
|
||||||
|
Stream theStream = MakeGenericRequest("getPlaylist", theParameters);
|
||||||
|
StreamReader sr = new StreamReader(theStream);
|
||||||
|
string result = sr.ReadToEnd();
|
||||||
|
|
||||||
|
/// TODO: Parse result into list
|
||||||
|
|
||||||
|
return playlist;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user