mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-24 23:16:28 +00:00
50 lines
32 KiB
HTML
50 lines
32 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en-US">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
<title>Library | SpotifyAPI-NET</title>
|
||
<meta name="description" content="🔉 An API for the Spotify-Client and the Spotify Web API, written in C#/.NET">
|
||
|
||
|
||
<link rel="preload" href="/SpotifyAPI-NET/assets/css/0.styles.70d78a90.css" as="style"><link rel="preload" href="/SpotifyAPI-NET/assets/js/app.b4d9e10b.js" as="script"><link rel="preload" href="/SpotifyAPI-NET/assets/js/2.db6f1a12.js" as="script"><link rel="preload" href="/SpotifyAPI-NET/assets/js/17.a281444b.js" as="script"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/10.29899bd4.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/11.71e8ae3b.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/12.aa6c4bc3.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/13.1731261a.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/14.5c5c08c0.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/15.a0fc535e.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/16.427ccfec.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/18.1f840ba3.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/19.c6343cc0.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/20.f7f0836a.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/21.700cbb77.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/22.312dbfd1.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/23.d5043e4d.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/24.07659c28.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/25.81029a65.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/26.3876e2f9.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/3.e41cd288.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/4.d34ebd53.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/5.85e9957e.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/6.a0836589.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/7.6ce7959d.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/8.5d6e674a.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/9.2255e63f.js">
|
||
<link rel="stylesheet" href="/SpotifyAPI-NET/assets/css/0.styles.70d78a90.css">
|
||
</head>
|
||
<body>
|
||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/SpotifyAPI-NET/" class="home-link router-link-active"><!----> <span class="site-name">SpotifyAPI-NET</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/SpotifyAPI-NET/" class="nav-link">Home</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">SpotifyAPI.Web</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/getting_started.html" class="nav-link">Getting Started</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/examples.html" class="nav-link">Examples</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/proxy.html" class="nav-link">Proxy</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/albums.html" class="nav-link">- Albums</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/artists.html" class="nav-link">- Artists</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/browse.html" class="nav-link">- Browse</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/follow.html" class="nav-link">- Follow</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/library.html" class="nav-link router-link-exact-active router-link-active">- Library</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/personalization.html" class="nav-link">- Personalization</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/player.html" class="nav-link">- Player</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/playlists.html" class="nav-link">- Playlists</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/profiles.html" class="nav-link">- Profiles</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/search.html" class="nav-link">- Search</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/tracks.html" class="nav-link">- Tracks</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/utils.html" class="nav-link">Utilities</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">SpotifyAPI.Auth</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/getting_started.html" class="nav-link">Getting Started</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/implicit_grant.html" class="nav-link">- ImplicitGrantAuth</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/token_swap.html" class="nav-link">- TokenSwapAuth</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/authorization_code.html" class="nav-link">- AutorizationCodeAuth</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/client_credentials.html" class="nav-link">- ClientCredentialsAuth</a></li></ul></div></div> <a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET" target="_blank" rel="noopener noreferrer" class="repo-link">
|
||
🚀 GitHub
|
||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/SpotifyAPI-NET/" class="nav-link">Home</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">SpotifyAPI.Web</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/getting_started.html" class="nav-link">Getting Started</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/examples.html" class="nav-link">Examples</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/proxy.html" class="nav-link">Proxy</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/albums.html" class="nav-link">- Albums</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/artists.html" class="nav-link">- Artists</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/browse.html" class="nav-link">- Browse</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/follow.html" class="nav-link">- Follow</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/library.html" class="nav-link router-link-exact-active router-link-active">- Library</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/personalization.html" class="nav-link">- Personalization</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/player.html" class="nav-link">- Player</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/playlists.html" class="nav-link">- Playlists</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/profiles.html" class="nav-link">- Profiles</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/search.html" class="nav-link">- Search</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/tracks.html" class="nav-link">- Tracks</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/utils.html" class="nav-link">Utilities</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">SpotifyAPI.Auth</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/getting_started.html" class="nav-link">Getting Started</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/implicit_grant.html" class="nav-link">- ImplicitGrantAuth</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/token_swap.html" class="nav-link">- TokenSwapAuth</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/authorization_code.html" class="nav-link">- AutorizationCodeAuth</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/client_credentials.html" class="nav-link">- ClientCredentialsAuth</a></li></ul></div></div> <a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET" target="_blank" rel="noopener noreferrer" class="repo-link">
|
||
🚀 GitHub
|
||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>Library</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/SpotifyAPI-NET/web/library.html#savetracks" class="sidebar-link">SaveTracks</a></li><li><a href="/SpotifyAPI-NET/web/library.html#savetrack" class="sidebar-link">SaveTrack</a></li><li><a href="/SpotifyAPI-NET/web/library.html#getsavedtracks" class="sidebar-link">GetSavedTracks</a></li><li><a href="/SpotifyAPI-NET/web/library.html#removesavedtracks" class="sidebar-link">RemoveSavedTracks</a></li><li><a href="/SpotifyAPI-NET/web/library.html#checksavedtracks" class="sidebar-link">CheckSavedTracks</a></li><li><a href="/SpotifyAPI-NET/web/library.html#savealbums" class="sidebar-link">SaveAlbums</a></li><li><a href="/SpotifyAPI-NET/web/library.html#savealbum" class="sidebar-link">SaveAlbum</a></li><li><a href="/SpotifyAPI-NET/web/library.html#getsavedalbums" class="sidebar-link">GetSavedAlbums</a></li><li><a href="/SpotifyAPI-NET/web/library.html#removesavedalbums" class="sidebar-link">RemoveSavedAlbums</a></li><li><a href="/SpotifyAPI-NET/web/library.html#checksavedalbums" class="sidebar-link">CheckSavedAlbums</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="library"><a href="#library" aria-hidden="true" class="header-anchor">#</a> Library</h1> <h2 id="savetracks"><a href="#savetracks" aria-hidden="true" class="header-anchor">#</a> SaveTracks</h2> <blockquote><p>Save one or more tracks to the current user’s “Your Music” library.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>ids</td> <td>A list of the Spotify IDs</td> <td><code>new List<String> { "3Hvu1pq89D4R0lyPBoujSv" }</code></td></tr></tbody></table> <p>Returns a <code>ErrorResponse</code> which just contains a possible error. (<code>response.HasError()</code> and <code>response.Error</code>)</p> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> response <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">SaveTracks</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">List</span><span class="token operator"><</span><span class="token keyword">string</span><span class="token operator">></span> <span class="token punctuation">{</span> <span class="token string">"3Hvu1pq89D4R0lyPBoujSv"</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span>response<span class="token punctuation">.</span><span class="token function">HasError</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
|
||
Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span><span class="token string">"success"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre></div><hr> <h2 id="savetrack"><a href="#savetrack" aria-hidden="true" class="header-anchor">#</a> SaveTrack</h2> <blockquote><p>Save one track to the current user’s “Your Music” library.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>id</td> <td>A Spotify ID</td> <td><code>"3Hvu1pq89D4R0lyPBoujSv"</code></td></tr></tbody></table> <p>Returns a <code>ErrorResponse</code> which just contains a possible error. (<code>response.HasError()</code> and <code>response.Error</code>)</p> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> response <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">SaveTrack</span><span class="token punctuation">(</span><span class="token string">"3Hvu1pq89D4R0lyPBoujSv"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span>response<span class="token punctuation">.</span><span class="token function">HasError</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
|
||
Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span><span class="token string">"success"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre></div><hr> <h2 id="getsavedtracks"><a href="#getsavedtracks" aria-hidden="true" class="header-anchor">#</a> GetSavedTracks</h2> <blockquote><p>Get a list of the songs saved in the current Spotify user’s “Your Music” library.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>[limit]</td> <td>The maximum number of objects to return. Default: 20. Minimum: 1. Maximum: 50.</td> <td><code>20</code></td></tr> <tr><td>[offset]</td> <td>The index of the first object to return. Default: 0 (i.e., the first object)</td> <td><code>0</code></td></tr> <tr><td>[market]</td> <td>An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking.</td> <td><code>DE</code></td></tr></tbody></table> <p>Returns a <code>Paging<SavedTrack>**, **SavedTrack</code> contains 2 properties, <code>DateTime AddedAt</code> and <code>FullTrack Track</code></p> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code>Paging<span class="token operator"><</span>SavedTrack<span class="token operator">></span> savedTracks <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">GetSavedTracks</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
savedTracks<span class="token punctuation">.</span>Items<span class="token punctuation">.</span><span class="token function">ForEach</span><span class="token punctuation">(</span>track <span class="token operator">=></span> Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span>track<span class="token punctuation">.</span>Track<span class="token punctuation">.</span>Name<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre></div><hr> <h2 id="removesavedtracks"><a href="#removesavedtracks" aria-hidden="true" class="header-anchor">#</a> RemoveSavedTracks</h2> <blockquote><p>Remove one or more tracks from the current user’s “Your Music” library.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>ids</td> <td>A list of the Spotify IDs.</td> <td><code>new List<String> { "3Hvu1pq89D4R0lyPBoujSv" }</code></td></tr></tbody></table> <p>Returns a <code>ErrorResponse</code> which just contains a possible error. (<code>response.HasError()</code> and <code>response.Error</code>)</p> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> response <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">RemoveSavedTracks</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">List</span><span class="token operator"><</span><span class="token keyword">string</span><span class="token operator">></span> <span class="token punctuation">{</span> <span class="token string">"3Hvu1pq89D4R0lyPBoujSv"</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span>response<span class="token punctuation">.</span><span class="token function">HasError</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
|
||
Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span><span class="token string">"success"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre></div><hr> <h2 id="checksavedtracks"><a href="#checksavedtracks" aria-hidden="true" class="header-anchor">#</a> CheckSavedTracks</h2> <blockquote><p>Check if one or more tracks is already saved in the current Spotify user’s “Your Music” library.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>ids</td> <td>A list of the Spotify IDs.</td> <td><code>new List<String> { "3Hvu1pq89D4R0lyPBoujSv" }</code></td></tr></tbody></table> <p>Returns a <code>ListResponse<bool></code> which contains a property, <code>List<bool> List</code></p> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code>ListResponse<span class="token operator"><</span><span class="token keyword">bool</span><span class="token operator">></span> tracksSaved <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">CheckSavedTracks</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">List</span><span class="token operator"><</span>String<span class="token operator">></span> <span class="token punctuation">{</span> <span class="token string">"3Hvu1pq89D4R0lyPBoujSv"</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
<span class="token keyword">if</span><span class="token punctuation">(</span>tracksSaved<span class="token punctuation">.</span>List<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
|
||
Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span><span class="token string">"The track is in your library!"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre></div><hr> <h2 id="savealbums"><a href="#savealbums" aria-hidden="true" class="header-anchor">#</a> SaveAlbums</h2> <blockquote><p>Save one or more albums to the current user’s “Your Music” library.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>ids</td> <td>A list of the Spotify IDs</td> <td><code>new List<String> { "1cq06d0kTUnFmJHixz1RaF" }</code></td></tr></tbody></table> <p>Returns a <code>ErrorResponse</code> which just contains a possible error. (<code>response.HasError()</code> and <code>response.Error</code>)</p> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> response <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">SaveAlbums</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">List</span><span class="token operator"><</span><span class="token keyword">string</span><span class="token operator">></span> <span class="token punctuation">{</span> <span class="token string">"1cq06d0kTUnFmJHixz1RaF"</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span>response<span class="token punctuation">.</span><span class="token function">HasError</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
|
||
Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span><span class="token string">"success"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre></div><hr> <h2 id="savealbum"><a href="#savealbum" aria-hidden="true" class="header-anchor">#</a> SaveAlbum</h2> <blockquote><p>Save one album to the current user’s “Your Music” library.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>id</td> <td>A Spotify ID</td> <td><code>"1cq06d0kTUnFmJHixz1RaF"</code></td></tr></tbody></table> <p>Returns a <code>ErrorResponse</code> which just contains a possible error. (<code>response.HasError()</code> and <code>response.Error</code>)</p> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> response <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">SaveAlbum</span><span class="token punctuation">(</span><span class="token string">"1cq06d0kTUnFmJHixz1RaF"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span>response<span class="token punctuation">.</span><span class="token function">HasError</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
|
||
Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span><span class="token string">"success"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre></div><hr> <h2 id="getsavedalbums"><a href="#getsavedalbums" aria-hidden="true" class="header-anchor">#</a> GetSavedAlbums</h2> <blockquote><p>Get a list of the albums saved in the current Spotify user’s “Your Music” library.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>[limit]</td> <td>The maximum number of objects to return. Default: 20. Minimum: 1. Maximum: 50.</td> <td><code>20</code></td></tr> <tr><td>[offset]</td> <td>The index of the first object to return. Default: 0 (i.e., the first object)</td> <td><code>0</code></td></tr> <tr><td>[market]</td> <td>An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking.</td> <td><code>DE</code></td></tr></tbody></table> <p>Returns a <code>Paging<SavedAlbum></code>, <strong>SavedAlbum</strong> contains 2 properties, <code>DateTime AddedAt</code> and <code>FullAlbum Album</code></p> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code>Paging<span class="token operator"><</span>SavedAlbum<span class="token operator">></span> savedAlbums <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">GetSavedAlbums</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
savedAlbums<span class="token punctuation">.</span>Items<span class="token punctuation">.</span><span class="token function">ForEach</span><span class="token punctuation">(</span>album <span class="token operator">=></span> Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span>album<span class="token punctuation">.</span>Album<span class="token punctuation">.</span>Name<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre></div><hr> <h2 id="removesavedalbums"><a href="#removesavedalbums" aria-hidden="true" class="header-anchor">#</a> RemoveSavedAlbums</h2> <blockquote><p>Remove one or more albums from the current user’s “Your Music” library.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>ids</td> <td>A list of the Spotify IDs.</td> <td><code>new List<String> { "1cq06d0kTUnFmJHixz1RaF" }</code></td></tr></tbody></table> <p>Returns a <code>ErrorResponse</code> which just contains a possible error. (<code>response.HasError()</code> and <code>response.Error</code>)</p> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> response <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">RemoveSavedAlbums</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">List</span><span class="token operator"><</span><span class="token keyword">string</span><span class="token operator">></span> <span class="token punctuation">{</span> <span class="token string">"1cq06d0kTUnFmJHixz1RaF"</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span>response<span class="token punctuation">.</span><span class="token function">HasError</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
|
||
Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span><span class="token string">"success"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre></div><hr> <h2 id="checksavedalbums"><a href="#checksavedalbums" aria-hidden="true" class="header-anchor">#</a> CheckSavedAlbums</h2> <blockquote><p>Check if one or more albums is already saved in the current Spotify user’s “Your Music” library.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>ids</td> <td>A list of the Spotify IDs.</td> <td><code>new List<String> { "1cq06d0kTUnFmJHixz1RaF" }</code></td></tr></tbody></table> <p>Returns a <code>ListResponse<bool></code> which contains a property, <code>List<bool> List</code></p> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code>ListResponse<span class="token operator"><</span><span class="token keyword">bool</span><span class="token operator">></span> albumsSaved <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">CheckSavedAlbums</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">List</span><span class="token operator"><</span>String<span class="token operator">></span> <span class="token punctuation">{</span> <span class="token string">"1cq06d0kTUnFmJHixz1RaF"</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
<span class="token keyword">if</span><span class="token punctuation">(</span>albumsSaved<span class="token punctuation">.</span>List<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
|
||
Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span><span class="token string">"The album is in your library!"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre></div><hr></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/web/library.md" target="_blank" rel="noopener noreferrer">Help us improve this page!</a> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></div> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/19/2019, 12:23:34 PM</span></div></footer> <!----> </main></div><div class="global-ui"></div></div>
|
||
<script src="/SpotifyAPI-NET/assets/js/app.b4d9e10b.js" defer></script><script src="/SpotifyAPI-NET/assets/js/2.db6f1a12.js" defer></script><script src="/SpotifyAPI-NET/assets/js/17.a281444b.js" defer></script>
|
||
</body>
|
||
</html>
|