aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-03-22 15:41:11 +0100
committermetamuffin <metamuffin@disroot.org>2026-03-22 15:41:11 +0100
commitd7099ef522123840c8726b6c3f0ffab249fae0f6 (patch)
tree3431e8c1d06f23ad5d96b68251947651b541f6a0
parent3e8e4f8496425a08427a73a0f93652f5f739ab15 (diff)
downloadjellything-d7099ef522123840c8726b6c3f0ffab249fae0f6.tar
jellything-d7099ef522123840c8726b6c3f0ffab249fae0f6.tar.bz2
jellything-d7099ef522123840c8726b6c3f0ffab249fae0f6.tar.zst
minor adjustments here and there
-rw-r--r--common/src/lib.rs2
-rw-r--r--common/src/node.rs2
-rw-r--r--import/src/source_rank.rs4
-rw-r--r--stream/src/stream_info.rs3
-rw-r--r--ui/client-scripts/src/player/mediacaps.ts6
-rw-r--r--ui/client-scripts/src/player/mod.ts4
-rw-r--r--ui/client-scripts/src/player/player.ts2
-rw-r--r--ui/client-scripts/src/player/track/mse.ts10
-rw-r--r--ui/client-scripts/src/player/types_stream.ts2
-rw-r--r--ui/src/components/node_page.rs16
10 files changed, 25 insertions, 26 deletions
diff --git a/common/src/lib.rs b/common/src/lib.rs
index d94c72c..5ade59d 100644
--- a/common/src/lib.rs
+++ b/common/src/lib.rs
@@ -1,7 +1,7 @@
/*
This file is part of jellything (https://codeberg.org/metamuffin/jellything)
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
- Copyright (C) 2025 metamuffin <metamuffin.org>
+ Copyright (C) 2026 metamuffin <metamuffin.org>
*/
pub mod api;
pub mod internal;
diff --git a/common/src/node.rs b/common/src/node.rs
index c5311cf..787f6a0 100644
--- a/common/src/node.rs
+++ b/common/src/node.rs
@@ -1,7 +1,7 @@
/*
This file is part of jellything (https://codeberg.org/metamuffin/jellything)
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
- Copyright (C) 2025 metamuffin <metamuffin.org>
+ Copyright (C) 2026 metamuffin <metamuffin.org>
*/
use jellyobject::{Object, Tag, enums, fields};
diff --git a/import/src/source_rank.rs b/import/src/source_rank.rs
index 56c8eaf..0ac399f 100644
--- a/import/src/source_rank.rs
+++ b/import/src/source_rank.rs
@@ -53,16 +53,16 @@ impl Default for SourceRanks {
list: [
MSOURCE_EXPLICIT,
MSOURCE_FILENAME_PATTERN,
+ MSOURCE_INFOJSON,
MSOURCE_TRAKT,
MSOURCE_MUSICBRAINZ,
MSOURCE_MEDIA,
MSOURCE_TAGS,
- MSOURCE_IMAGE_ATT,
MSOURCE_TMDB,
+ MSOURCE_IMAGE_ATT,
MSOURCE_WIKIDATA,
MSOURCE_VGMDB,
MSOURCE_ACOUSTID,
- MSOURCE_INFOJSON,
MSOURCE_OMDB,
]
.to_vec(),
diff --git a/stream/src/stream_info.rs b/stream/src/stream_info.rs
index 71ccb1f..66be110 100644
--- a/stream/src/stream_info.rs
+++ b/stream/src/stream_info.rs
@@ -110,9 +110,6 @@ fn stream_formats(
if w > sw {
continue;
}
- if br > remux_bitrate {
- continue;
- }
// most codecs use chroma subsampling that requires even dims
let h = ((w * sh) / sw) & !1; // clear last bit to ensure even height.
for (cid, enable) in [
diff --git a/ui/client-scripts/src/player/mediacaps.ts b/ui/client-scripts/src/player/mediacaps.ts
index 4393fe9..ef39602 100644
--- a/ui/client-scripts/src/player/mediacaps.ts
+++ b/ui/client-scripts/src/player/mediacaps.ts
@@ -16,7 +16,7 @@ export async function test_media_capability(format: FormatInfo, container: Strea
const cached = cache.get(cache_key);
if (cached !== undefined) return cached
const r = await test_media_capability_inner(format, container)
- console.log(`media caps: codec=${format.codec} sup=${r}`);
+ console.log(`media caps: ${format.codec_param} -> ${r}`);
cache.set(cache_key, r)
return r
}
@@ -40,7 +40,7 @@ async function test_media_capability_inner(format: FormatInfo, container: Stream
type: "media-source",
video: {
contentType: track_to_content_type(format, container),
- framerate: format.samplerate ?? 60,
+ framerate: format.samplerate ?? 30,
width: format.width ?? 1920,
height: format.height ?? 1080,
bitrate: format.bitrate
@@ -62,6 +62,6 @@ const CONTAINER_TO_MIME_TYPE: { [key in StreamContainer]: string } = {
webvtt: "text/webvtt",
webm: "video/webm",
matroska: "video/x-matroska",
- mpeg4: "video/mp4",
+ mp4: "video/mp4",
jvtt: "application/jellything-vtt+json"
}
diff --git a/ui/client-scripts/src/player/mod.ts b/ui/client-scripts/src/player/mod.ts
index bb615dd..f46bf63 100644
--- a/ui/client-scripts/src/player/mod.ts
+++ b/ui/client-scripts/src/player/mod.ts
@@ -53,7 +53,7 @@ type Chapter = { time_start: number, time_end: number, labels: string[][] }
function initialize_player(node_id: string, video: HTMLVideoElement): HTMLElement {
const logger = new Logger<string>(s => e("p", s))
const start_time = get_query_start_time() ?? 0 // TODO get_continue_time(ndata.userdata.watched);
- const player = new Player(video, `/n/${node_id}/stream`, start_time, logger)
+ const player = new Player(video, `/n/${node_id}/media`, start_time, logger)
const show_stats = new OVar(false);
const idle_inhibit = new OVar(false)
const sync_state = new OVar<Playersync | undefined>(undefined)
@@ -64,13 +64,13 @@ function initialize_player(node_id: string, video: HTMLVideoElement): HTMLElemen
if (!res.ok) throw "a"
return res.json()
})
- .catch(() => logger.log_persistent("Node data failed to download"))
.then(view => {
console.log("got node page view", view);
// const ndata = ndata_ as { node: NodePublic, userdata: NodeUserData }
// console.log(ndata.node.media!.chapters);
// chapters.value = ndata.node.media!.chapters
})
+ .catch(() => logger.log_persistent("Node data failed to download"))
//@ts-ignore for debugging
globalThis.player = player;
diff --git a/ui/client-scripts/src/player/player.ts b/ui/client-scripts/src/player/player.ts
index ab0313f..232b043 100644
--- a/ui/client-scripts/src/player/player.ts
+++ b/ui/client-scripts/src/player/player.ts
@@ -97,7 +97,7 @@ export class Player {
async fetch_meta() {
this.set_pers("Loading stream metadata...")
- const res = await fetch(`${this.base_url}?info`, { headers: { "Accept": "application/json" } })
+ const res = await fetch(`${this.base_url}/formats.json`, { headers: { "Accept": "application/json" } })
if (!res.ok) return this.error.value = "Cannot download stream info."
let streaminfo!: StreamInfo & { error: string }
diff --git a/ui/client-scripts/src/player/track/mse.ts b/ui/client-scripts/src/player/track/mse.ts
index efcd0d5..faee825 100644
--- a/ui/client-scripts/src/player/track/mse.ts
+++ b/ui/client-scripts/src/player/track/mse.ts
@@ -35,7 +35,7 @@ export class MSEPlayerTrack extends PlayerTrack {
async init() {
this.buffered.value = [{ start: 0, end: this.player.duration.value, status: "loading" }]
try {
- const res = await fetch(`${this.base_url}?fragmentindex&t=${this.track_index}`, { headers: { "Accept": "application/json" } });
+ const res = await fetch(`${this.base_url}/${this.track_index}/fragindex.json`, { headers: { "Accept": "application/json" } });
if (!res.ok) return this.player.error.value = "Cannot download index.", undefined;
let index!: FragmentIndex & { error: string; };
try { index = await res.json(); }
@@ -54,7 +54,7 @@ export class MSEPlayerTrack extends PlayerTrack {
for (let i = 0; i < this.trackinfo.formats.length; i++) {
const format = this.trackinfo.formats[i];
for (const container of format.containers) {
- if (container != "webm" && container != "mpeg4") continue;
+ if (container != "webm" && container != "mp4") continue;
if (await test_media_capability(format, container))
this.usable_formats.push({ container, format, format_index: i, usable_index: this.usable_formats.length })
}
@@ -163,7 +163,7 @@ export class MSEPlayerTrack extends PlayerTrack {
this.loading.add(index);
this.update_buf_ranges()
// TODO update format selection
- const url = `${this.base_url}?fragment&t=${this.track_index}&f=${this.active_format.value!.format_index}&i=${index}&c=${this.active_format.value!.container}`;
+ const url = `${this.base_url}/${this.track_index}/${this.active_format.value!.format_index}/frag${index}.${this.active_format.value!.container}`;
const buf = await this.player.downloader.download(url);
await new Promise<void>(cb => {
if (!this.index) return;
@@ -180,10 +180,10 @@ export class MSEPlayerTrack extends PlayerTrack {
this.current_load = frag;
// TODO why is appending so unreliable?! sometimes it does not add it
this.source_buffer.changeType(track_to_content_type(this.active_format.value!.format, this.active_format.value!.container));
- this.source_buffer.timestampOffset = this.active_format.value?.container == "mpeg4" ? frag.start : 0
+ // this.source_buffer.timestampOffset = this.active_format.value?.container == "mpeg4" ? frag.start : 0
// this.source_buffer.timestampOffset = this.trackinfo.kind == "video" && !this.active_format.value!.format.remux ? frag.start : 0
// this.source_buffer.timestampOffset = this.active_format.value?.format.remux ? 0 : frag.start
- // this.source_buffer.timestampOffset = 0
+ this.source_buffer.timestampOffset = 0
this.source_buffer.appendBuffer(frag.buf);
}
}
diff --git a/ui/client-scripts/src/player/types_stream.ts b/ui/client-scripts/src/player/types_stream.ts
index 4719335..038b1ff 100644
--- a/ui/client-scripts/src/player/types_stream.ts
+++ b/ui/client-scripts/src/player/types_stream.ts
@@ -20,7 +20,7 @@ export interface TrackInfo {
kind: TrackKind,
formats: FormatInfo[]
}
-export type StreamContainer = "webm" | "matroska" | "mpeg4" | "jvtt" | "webvtt"
+export type StreamContainer = "webm" | "matroska" | "mp4" | "jvtt" | "webvtt"
export interface FormatInfo {
codec: string,
codec_param: string,
diff --git a/ui/src/components/node_page.rs b/ui/src/components/node_page.rs
index 45a8ffd..c637b89 100644
--- a/ui/src/components/node_page.rs
+++ b/ui/src/components/node_page.rs
@@ -178,13 +178,15 @@ markup::define! {
li { @NodeCard { ri, nku } }
}}
}
- details[open=children.items.is_empty()] {
- summary { "Full Credits" }
- @for (cat, items) in credits.iter().skip(1) {
- h2 { @tr(ri.lang, &format!("tag.cred.kind.{cat}")) }
- ul.nl.inline { @for nku in items {
- li { @NodeCard { ri, nku } }
- }}
+ @if credits.len() >= 2 {
+ details[open=children.items.is_empty()] {
+ summary { "Full Credits" }
+ @for (cat, items) in credits.iter().skip(1) {
+ h2 { @tr(ri.lang, &format!("tag.cred.kind.{cat}")) }
+ ul.nl.inline { @for nku in items {
+ li { @NodeCard { ri, nku } }
+ }}
+ }
}
}
@if !credited.is_empty() {