added limit for browse/listen now requests, will now only request every 2 minutes

This commit is contained in:
booploops 2022-01-26 20:20:10 -08:00
parent 080259f254
commit 004d5a4f46

View file

@ -1988,6 +1988,10 @@ const app = new Vue({
this.library.albums.meta = response.data.meta this.library.albums.meta = response.data.meta
}, },
async getListenNow(attempt = 0) { async getListenNow(attempt = 0) {
if (this.listennow.timestamp > Date.now() - 120000) {
return
}
if (attempt > 3) { if (attempt > 3) {
return return
} }
@ -2018,6 +2022,7 @@ const app = new Vue({
includeResponseMeta: !0, includeResponseMeta: !0,
reload: !0 reload: !0
})).data; })).data;
this.listennow.timestamp = Date.now()
console.log(this.listennow) console.log(this.listennow)
} catch (e) { } catch (e) {
console.log(e) console.log(e)
@ -2025,6 +2030,9 @@ const app = new Vue({
} }
}, },
async getBrowsePage(attempt = 0) { async getBrowsePage(attempt = 0) {
if (this.browsepage.timestamp > Date.now() - 120000) {
return
}
if (attempt > 3) { if (attempt > 3) {
return return
} }
@ -2041,6 +2049,7 @@ const app = new Vue({
"art[url]": "f" "art[url]": "f"
}); });
this.browsepage = browse.data.data[0]; this.browsepage = browse.data.data[0];
this.browsepage.timestamp = Date.now()
console.log(this.browsepage) console.log(this.browsepage)
} catch (e) { } catch (e) {
console.log(e) console.log(e)