diff options
Diffstat (limited to 'public/assets/js/lib/views/stream/hootstream.js')
| -rw-r--r-- | public/assets/js/lib/views/stream/hootstream.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/public/assets/js/lib/views/stream/hootstream.js b/public/assets/js/lib/views/stream/hootstream.js index 47a3bd7..1153469 100644 --- a/public/assets/js/lib/views/stream/hootstream.js +++ b/public/assets/js/lib/views/stream/hootstream.js @@ -80,12 +80,15 @@ var HootStream = View.extend({ // $.get(`/api/stream?thread=${thread}`).then((response) => { console.log(response); - audio.index( - response.files - .map((file) => [file.filename.toLowerCase(), file]) - .sort((a, b) => a[0].localeCompare(b[0])) - .map(([, file]) => file) - ); + let sort; + try { + const settings = JSON.parse(response.threads[0].settings); + sort = settings.sort; + } catch (error) { + // console.error(error); + sort = null; + } + audio.index(this.sortFiles(response.files, sort)); audio.play(0); }); }, |
