mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-23 21:52:45 -05:00
fix(player): add ICY support to probe and suppress false-alarm radio metadata warnings
- Add -icy 1 and -analyzeduration flags to probe.mjs for Shoutcast/Icecast HTTP streams - Silently fall back to station display without logging logger.warn when stream metadata is unavailable
This commit is contained in:
1 parent
c007bb93f8
commit
91e7812c30
2 files changed
+4
-3
No files matched your search
@@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
import { EmbedBuilder } from "@fluxerjs/core";
|
||||
import { getGlobalColor } from "../../ui/index.mjs";
|
||||
import { Utils } from "../../utils/Utils.mjs";
|
||||
import { logger } from "../../core/Logger.mjs";
|
||||
import meta from "../probe.mjs";
|
||||
@@ -219,8 +218,8 @@ const DisplayMixin = {
|
||||
const data = await meta(current.url);
|
||||
radioLiveTitle = data?.title || null;
|
||||
textMsg = `${vcLine}📻 **[${current.title}](${current.author?.url || current.url})**\n${current.description || ""}\n\n🎵 Now playing: ${radioLiveTitle || "Unknown"}\n\n🔉 ${vol} │ ${loopqueue} Queue │ ${songloop} Song │ ${autoplay} Autoplay`;
|
||||
} catch (e) {
|
||||
logger.warn("[Player] Error:", e?.message);
|
||||
} catch (_) {
|
||||
/* Radio live metadata probe is optional — gracefully fall back to station display */
|
||||
textMsg = `${vcLine}📻 **[${current.title}](${current.author?.url || current.url})**\n\n🔉 ${vol} │ ${loopqueue} Queue │ ${songloop} Song │ ${autoplay} Autoplay`;
|
||||
}
|
||||
} else if (current.type === "external" || current.type === "stream") {
|
||||
|
||||
@@ -16,8 +16,10 @@ const PROBE_TIMEOUT_MS = 15_000;
|
||||
*/
|
||||
export default function probe(file) {
|
||||
return new Promise((res, rej) => {
|
||||
const isHttp = typeof file === "string" && file.startsWith("http");
|
||||
const args = [
|
||||
"-hide_banner",
|
||||
...(isHttp ? ["-icy", "1", "-analyzeduration", "1000000"] : []),
|
||||
"-show_entries", "format_tags:format=duration",
|
||||
"-print_format", "json",
|
||||
"-i", file,
|
||||
|
||||
Reference in new issue
Block a user