formatting pass
This commit is contained in:
+4
-1
@@ -23,7 +23,10 @@ const lookup = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Retrieve existing IDs from Stream
|
// Retrieve existing IDs from Stream
|
||||||
const existingIds = db.prepare('SELECT id FROM Stream').all().map(row => row.id);
|
const existingIds = db
|
||||||
|
.prepare('SELECT id FROM Stream')
|
||||||
|
.all()
|
||||||
|
.map((row) => row.id);
|
||||||
// Create a set of existing IDs for efficient lookup
|
// Create a set of existing IDs for efficient lookup
|
||||||
const idSet = new Set(existingIds);
|
const idSet = new Set(existingIds);
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@ const db = new Database(dbName);
|
|||||||
export function getStreams(): StreamSummary[] {
|
export function getStreams(): StreamSummary[] {
|
||||||
const indexData = db
|
const indexData = db
|
||||||
.prepare(
|
.prepare(
|
||||||
'SELECT id, stream_date, filename, title, tags, length_seconds ' + 'FROM Stream ORDER BY id DESC'
|
'SELECT id, stream_date, filename, title, tags, length_seconds ' +
|
||||||
|
'FROM Stream ORDER BY id DESC'
|
||||||
)
|
)
|
||||||
.all() as Record<string, unknown>[];
|
.all() as Record<string, unknown>[];
|
||||||
return indexData.map((stream) => ({
|
return indexData.map((stream) => ({
|
||||||
|
|||||||
@@ -13,10 +13,13 @@
|
|||||||
<div class="description-bubble">
|
<div class="description-bubble">
|
||||||
<p>Hello, there, welcome to V1.6.</p>
|
<p>Hello, there, welcome to V1.6.</p>
|
||||||
<p>
|
<p>
|
||||||
<u>2026-03-16 update:</u> you can now cache streams offline for playback in low-connectivity environments (and to prevent buffering)!<br>
|
<u>2026-03-16 update:</u> you can now cache streams offline for playback in low-connectivity
|
||||||
Simply click on the download icon in the stream list (and click again to remove them from cache). You can also filter by cached streams at the top. This all goes into your browser storage, and a stream is generally 100~250MB depending on its length.
|
environments (and to prevent buffering)!<br />
|
||||||
|
Simply click on the download icon in the stream list (and click again to remove them from cache).
|
||||||
|
You can also filter by cached streams at the top. This all goes into your browser storage, and
|
||||||
|
a stream is generally 100~250MB depending on its length.
|
||||||
</p>
|
</p>
|
||||||
<hr>
|
<hr />
|
||||||
<p>
|
<p>
|
||||||
Still in construction. The design is responsive now, so phones should work well enough!
|
Still in construction. The design is responsive now, so phones should work well enough!
|
||||||
Needs touch events though.
|
Needs touch events though.
|
||||||
|
|||||||
@@ -46,9 +46,7 @@ export function load({ params }) {
|
|||||||
error(404);
|
error(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
result.descriptionHtml = Bun.markdown.html(
|
result.descriptionHtml = Bun.markdown.html(result.description || 'No description available.');
|
||||||
result.description || 'No description available.'
|
|
||||||
);
|
|
||||||
|
|
||||||
if (dev) {
|
if (dev) {
|
||||||
// pass raw JSON for metadata editor
|
// pass raw JSON for metadata editor
|
||||||
|
|||||||
@@ -230,7 +230,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:window
|
<svelte:window
|
||||||
@@ -263,15 +262,20 @@
|
|||||||
</button>
|
</button>
|
||||||
<progress
|
<progress
|
||||||
bind:this={songBar}
|
bind:this={songBar}
|
||||||
value={seeking && pendingSeekTime != null ? pendingSeekTime : (currentTime || 0)}
|
value={seeking && pendingSeekTime != null ? pendingSeekTime : currentTime || 0}
|
||||||
max={duration}
|
max={duration}
|
||||||
onmousedown={(e) => { seeking = true; updateSeekVisual(e); }}
|
onmousedown={(e) => {
|
||||||
|
seeking = true;
|
||||||
|
updateSeekVisual(e);
|
||||||
|
}}
|
||||||
onmouseenter={() => (showTooltip = true)}
|
onmouseenter={() => (showTooltip = true)}
|
||||||
onmouseleave={() => (showTooltip = false)}
|
onmouseleave={() => (showTooltip = false)}
|
||||||
style="--primary-color:{barPrimaryColor}; --secondary-color:{barSecondaryColor}"
|
style="--primary-color:{barPrimaryColor}; --secondary-color:{barSecondaryColor}"
|
||||||
class="song-progress"
|
class="song-progress"
|
||||||
></progress>
|
></progress>
|
||||||
<div class="control-times">{formatSeconds(currentTime, duration >= 3600)}/{formatSeconds(duration)}</div>
|
<div class="control-times">
|
||||||
|
{formatSeconds(currentTime, duration >= 3600)}/{formatSeconds(duration)}
|
||||||
|
</div>
|
||||||
<button
|
<button
|
||||||
style="--icon-color:{iconColor}"
|
style="--icon-color:{iconColor}"
|
||||||
class="material-icons"
|
class="material-icons"
|
||||||
|
|||||||
@@ -5,9 +5,7 @@
|
|||||||
|
|
||||||
const ctx = getStreamContext();
|
const ctx = getStreamContext();
|
||||||
|
|
||||||
let formattedStreamDate = $derived(
|
let formattedStreamDate = $derived(ctx.current ? formatDate(ctx.current.stream_date) : '');
|
||||||
ctx.current ? formatDate(ctx.current.stream_date) : ''
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
|||||||
Reference in New Issue
Block a user