Fix feed naming, embed tidal links

This commit is contained in:
Jon Staab 2024-06-28 11:36:31 -07:00
parent 670402ebfb
commit a2f68c0c74
3 changed files with 22 additions and 3 deletions

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta
http-equiv="Content-Security-Policy"
content="script-src 'self' plausible.io; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; frame-src open.spotify.com; child-src 'none'; form-action 'none';" />
content="script-src 'self' plausible.io; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; frame-src open.spotify.com embed.tidal.com; child-src 'none'; form-action 'none';" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body class="w-full">

View File

@ -32,16 +32,19 @@
}
const closeSave = () => {
draft = {...feed}
shouldClone = false
saveIsOpen = false
}
const startClone = () => {
draft = makeFeed({definition: feed.definition})
shouldClone = true
saveIsOpen = true
}
const stopClone = () => {
draft = {...feed}
shouldClone = false
}
@ -85,8 +88,7 @@
let deleteIsOpen = false
let saveIsOpen = showSave
let listDeleteIsOpen = false
$: draft = shouldClone ? makeFeed({definition: feed.definition}) : feed
let draft = {...feed}
walkFeed(feed.definition, subFeed => {
if (isAuthorFeed(subFeed)) {

View File

@ -52,6 +52,23 @@
frameBorder="0"
allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"
loading="lazy" />
{:else if url.match(/tidal.com/)}
{@const {pathname} = new URL(url)}
{@const id = last(pathname.split('/'))}
{@const name = pathname.includes('album') ? 'albums' : 'tracks'}
{@const src = `https://embed.tidal.com/${name}/${id}`}
<iframe
{src}
allowfullscreen
style="border-radius:12px"
width="100%"
height="100%"
scrolling="no"
frameBorder="0"
allow="encrypted-media"
sandbox="allow-same-origin allow-scripts allow-forms allow-popups"
title="TIDAL Embed Player"
loading="lazy" />
{:else if url.match(/\.(mov|webm|mp4)$/)}
<video controls src={url} class="max-h-96 object-contain object-center" />
{:else if url.match(/\.(jpe?g|png|gif|webp)$/)}