diff options
Diffstat (limited to 'src/connector.js')
| -rw-r--r-- | src/connector.js | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/connector.js b/src/connector.js index 6c557a8..03e6f3d 100644 --- a/src/connector.js +++ b/src/connector.js @@ -6,16 +6,14 @@ class APIConnector { this.socket = io(url) this.asset_index = 0 - this.asset = null - this.prevAssets = null - this.nextAssets = null + this.movement = 0 + this.assets = null this.seekCallbacks = [] this.socket.on("seek", e => { - this.asset_index = e.asset_index - this.asset = e.asset - this.prevAssets = e.prev_assets - this.nextAssets = e.next_assets + this.assetIndex = e.asset_index + this.movement = e.movement + this.assets = e.assets for (const cb of this.seekCallbacks) cb() }) @@ -46,12 +44,11 @@ class APIConnector { } fetchAlbums() { - return this.fetch("/albums/get") + return this.fetch("/albums") } - albumThumbSrc(key) { - return `${this.url}/api/albums/thumb/${key}` - } + assetSrc(key) { return `${this.url}/api/asset/${key}` } + assetThumbnailSrc(key) { return `${this.url}/api/asset/${key}/thumbnail` } } const apiConnector = new APIConnector("http://localhost:5000") |
