Commit 4d0cb09e authored by Andreas Heimann's avatar Andreas Heimann

added playlist api documentation

parent d0983707
...@@ -86,6 +86,17 @@ class APIDocsController extends AbstractController ...@@ -86,6 +86,17 @@ class APIDocsController extends AbstractController
return $this->render('apidocs/open/songs.html.twig', $data); return $this->render('apidocs/open/songs.html.twig', $data);
} }
/**
* @Route("/api/docs/open/playlists", name="api.docs.open.playlists")
*/
public function openPlaylists(Request $request)
{
$em = $this->getDoctrine()->getManager();
$data = [];
return $this->render('apidocs/open/playlists.html.twig', $data);
}
/** /**
* @Route("/api/docs/open/users", name="api.docs.open.users") * @Route("/api/docs/open/users", name="api.docs.open.users")
*/ */
......
...@@ -84,6 +84,12 @@ ...@@ -84,6 +84,12 @@
</span> </span>
Songs Songs
</a> </a>
<a href="{{ path('api.docs.open.playlists') }}" class="sidebar-link sidebar-link-with-icon {% if app.request.attributes.get('_route') == 'api.docs.open.playlists' %}active{% endif %}">
<span class="sidebar-icon">
<i class="mdi mdi-playlist-music" aria-hidden="true"></i>
</span>
Playlists
</a>
<a href="{{ path('api.docs.open.users') }}" class="sidebar-link sidebar-link-with-icon {% if app.request.attributes.get('_route') == 'api.docs.open.users' %}active{% endif %}"> <a href="{{ path('api.docs.open.users') }}" class="sidebar-link sidebar-link-with-icon {% if app.request.attributes.get('_route') == 'api.docs.open.users' %}active{% endif %}">
<span class="sidebar-icon"> <span class="sidebar-icon">
<i class="mdi mdi-account-circle" aria-hidden="true"></i> <i class="mdi mdi-account-circle" aria-hidden="true"></i>
......
...@@ -26,7 +26,15 @@ ...@@ -26,7 +26,15 @@
<div class="alert alert-primary" role="alert"> <div class="alert alert-primary" role="alert">
<h4 class="alert-heading">Last Update</h4> <h4 class="alert-heading">Last Update</h4>
This documentation was last updated on 09/09/2020 at 19:50 CEST This documentation was last updated on 10/14/2020 at 15:59 CEST
</div>
<div class="card">
<h2 class="card-title">10/14/2020</h2>
<ul>
<li>Updated Tournament output</li>
<lI>Added Playlists</lI>
</ul>
</div> </div>
<div class="card"> <div class="card">
......
{% extends 'apidocs/base.html.twig' %}
{% block title %}Playlists{% endblock %}
{% block content %}
<div class="row justify-content-center">
<div class="col-lg-7">
<div class="content">
<h1 class="content-title">
Playlists
</h1>
<div class="card" id="detail">
<h2 class="card-title">Detail</h2>
<p>Returns more detailled information about a playlist.</p>
<table class="table table-bordered">
<tr>
<th>Method</th>
<td>GET</td>
</tr>
<tr>
<th>Endpoint</th>
<td>/playlist/<code class="code">playlistID</code></td>
</tr>
</table>
<br />
<div class="alert alert-primary" role="alert">
<h4 class="alert-heading">Information</h4>
Do not display user information, if <code class="code">isOfficial</code> is set to true as it indicates an official SpinShare playlist instead of a user playlist.
</div>
<br />
<strong>Output Body</strong>
<pre class="code">
{
"version": 1,
"status": 200,
"data": {
"id": 2,
"title": "Test Playlist",
"description": "Test Description",
"fileReference": "playlist_5f86ea264a93b",
"user": {
"id": 1,
"username": "taw.moe",
"coverReference": "5f86d761933e1.png",
"isVerified": null,
"isPatreon": null
},
"songs": [
{
"id": 6,
"title": "Delete",
"subtitle": "from Technokinesis\r\n",
"artist": "Meganeko",
"charter": "Stride and Juch.",
"uploader": 1,
"fileReference": "spinshare_5f86d7f1e46e1",
"tags": [
""
],
"views": 8,
"downloads": null,
"isExplicit": false,
"hasEasyDifficulty": false,
"hasNormalDifficulty": false,
"hasHardDifficulty": false,
"hasExtremeDifficulty": false,
"hasXDDifficulty": true,
"uploadDate": {
"date": "2020-10-14 12:50:25.000000",
"timezone_type": 3,
"timezone": "Europe\/Berlin"
},
"description": null
}
],
"isOfficial": true,
"paths": {
"cover": "http:\/\/spinsha.re\/uploads\/cover\/playlist_5f86ea264a93b.png"
}
}
}
</pre>
<br />
<strong>Output Body (Not Found)</strong>
<pre class="code">
{
"version":1,
"status":404,
"data":[]
}
</pre>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="content">
<div class="on-this-page-nav">
<div class="title">On this page</div>
<a href="#detail">Detail</a>
</div>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<div class="alert alert-secondary" role="alert"> <div class="alert alert-secondary" role="alert">
<h4 class="alert-heading">Attention</h4> <h4 class="alert-heading">Attention</h4>
The Tournaments API was created as a last minute addition to the SpinShare SpeenOpen Summer 2020. It's usecase is very limited and will likely change after the tournament. The Tournaments API is still in its early development stage. It's usecase is very limited and will likely change after the SpinShare SpeenOpen Autumn 2020.
</div> </div>
<div class="card" id="mappool"> <div class="card" id="mappool">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment