Fixed artists split in DB layer. Services sorted most recent first.

This commit is contained in:
Jonathan Bernard
2015-07-22 09:26:53 -05:00
parent 0e16d42eaf
commit 5e81284220
5 changed files with 25 additions and 9 deletions

View File

@ -315,7 +315,7 @@ public class NLSongsDB {
return buildToken(row, user) }
public static List<String> unwrapArtists(String artists) {
return artists.split(';') as List<String> }
return artists.split(':') as List<String> }
public static String wrapArtists(List<String> artists) {
return artists.join(':') }

View File

@ -142,11 +142,26 @@ Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
in with the request will be ignored.
<p><h4>Reponse</h4>
The newly-created song record.
The newly-created song record. If a value is given in the
request for the <tt>id</tt> attribute it is ignored. The
attribute for new records is determined by the service and
returned as part of the response.
<p><h4>Example</h4>
<pre>
</pre></li>
POST http://newlifesongs.jdbernard.com/api/v1/songs
Content-Length: 60
Content-Type: application/json
{"id":22,"name":"This is How We Praise Him","artists":[""]}
</pre>
<p><pre>
HTTP/1.1 201 Created
Content-Length:
Content-Type: application/json
</pre></li>
<li><h3><code>GET /songs/&lt;songId&gt;</code></h3>

View File

@ -57,7 +57,8 @@ songsDB = NLSongsContext.songsDB
<script type="application/javascript">
window.onload = function() { \$("#services-table").
dataTable({ "paging": false }); };
dataTable({ "paging": false,
"order": [[0, "desc"]]}); };
</script>
</body>
</html>