From 616e9d760cd5dca68d2b17510191a461f8022ba4 Mon Sep 17 00:00:00 2001 From: Steven Vandevelde Date: Sun, 4 Sep 2022 17:59:52 +0200 Subject: [PATCH] transformUrl when storing tracks in cache --- src/Javascript/Brain/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Javascript/Brain/index.js b/src/Javascript/Brain/index.js index 557e1566..31d7dd8c 100644 --- a/src/Javascript/Brain/index.js +++ b/src/Javascript/Brain/index.js @@ -13,6 +13,7 @@ import * as user from "./user" import { fromCache, removeCache, reportError } from "./common" import { sendData, storageCallback, toCache } from "./common" import { identity } from "../common" +import { transformUrl } from "../urls" importScripts("brain.elm.js") importScripts("subworkers.js") @@ -179,7 +180,8 @@ app.ports.storeTracksInCache.subscribe(list => { list.reduce( (acc, item) => { return acc - .then(_ => fetch(item.url)) + .then(_ => transformUrl(item.url)) + .then(fetch) .then(r => r.blob()) .then(b => db.setInIndex({ key: item.trackId, data: b, store: db.storeNames.tracks })) }, -- knotmirror 0.0.1