diff options
Diffstat (limited to 'src/js/arching-kaos-modules-mixtapes.js')
-rw-r--r-- | src/js/arching-kaos-modules-mixtapes.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/js/arching-kaos-modules-mixtapes.js b/src/js/arching-kaos-modules-mixtapes.js index ac23ed4..bf11d9d 100644 --- a/src/js/arching-kaos-modules-mixtapes.js +++ b/src/js/arching-kaos-modules-mixtapes.js @@ -5,8 +5,11 @@ * @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 * */ +import { makeElement } from "./arching-kaos-generator.js"; +import { getIPFSURL } from "./url-generators.js"; +import { addMixtapeID, setMixtape, getMixtapes } from "./environment-setup.js"; -function akModuleMixtapes(zblockIPFSHash, zblockObject, blockObject, json){ +export function akModuleMixtapes(zblockIPFSHash, zblockObject, blockObject, json){ if(!document.querySelector('#mixtape-'+zblockIPFSHash)){ var divs = document.querySelector('#mixtapes-section'); var art = { @@ -37,10 +40,10 @@ function akModuleMixtapes(zblockIPFSHash, zblockObject, blockObject, json){ makeElement(art, divs); var audio = document.querySelector('#mixtape-player-'+zblockIPFSHash); audio.setAttribute('controls',''); - mixtapeIds.push('mixtape-player-'+zblockIPFSHash); + addMixtapeID(zblockIPFSHash); audio.addEventListener( "loadedmetadata", ()=>{ - if ( mixtapes[zblockIPFSHash] === undefined ){ - mixtapes[zblockIPFSHash]={ + if ( getMixtapes()[zblockIPFSHash] === undefined ){ + setMixtape(zblockIPFSHash, { zblock:zblockIPFSHash, block:zblockObject.block, block_signature:zblockObject.block_signature, @@ -52,7 +55,7 @@ function akModuleMixtapes(zblockIPFSHash, zblockObject, blockObject, json){ gpg:blockObject.gpg, timestamp:blockObject.timestamp, audioDuration:audio.duration - }; + }); } /* console.log( zblockIPFSHash+"'s duration is: "+ |