mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-23 21:52:45 -05:00
feat(docs): update README with playback history and instant replay features
refactor(commands): remove unused imports from various command files refactor(src): clean up imports in multiple source files for better organization (#21)
This commit is contained in:
1 parent
e33fbb2fdb
commit
5dc286e364
19 files changed
+32
-39
No files matched your search
@@ -11,14 +11,9 @@
|
||||
* conversion helpers in Serializers.mjs — both are attached at the bottom of this file.
|
||||
*/
|
||||
|
||||
import { CommandBuilder, CommandHandler, Option } from "../commands/index.mjs";
|
||||
import { PermissionFlags } from "@fluxerjs/core";
|
||||
import Player from "../music/player/index.mjs";
|
||||
import { Utils, cleanId } from "../utils/Utils.mjs";
|
||||
import { DatabaseManager } from "../db/DatabaseManager.mjs";
|
||||
import { RedisHandler } from "./RedisHandler.mjs";
|
||||
import { logger } from "../core/Logger.mjs";
|
||||
import { iterateVoiceStates } from "../voice/VoiceStateResolver.mjs";
|
||||
import { applyMixins } from "../utils/mixins.mjs";
|
||||
import RpcHandlersMixin from "./RpcHandlersMixin.mjs";
|
||||
import Serializers from "./Serializers.mjs";
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
*/
|
||||
|
||||
import { compare, genSalt, hash } from "bcryptjs";
|
||||
import { createPool } from "mysql2/promise";
|
||||
import { logger } from "../core/Logger.mjs";
|
||||
import { MYSQL_POOL_DEFAULTS, attachMysqlPoolGuard } from "./MysqlGuard.mjs";
|
||||
import { attachMysqlPoolGuard } from "./MysqlGuard.mjs";
|
||||
import { getSharedPromisePool } from "./PoolManager.mjs";
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
import fs from "node:fs";
|
||||
import mysql from "mysql2";
|
||||
import { EventEmitter } from "node:events";
|
||||
import { MYSQL_POOL_DEFAULTS, attachMysqlPoolGuard } from "./MysqlGuard.mjs";
|
||||
import { attachMysqlPoolGuard } from "./MysqlGuard.mjs";
|
||||
import { getSharedMysqlPool } from "./PoolManager.mjs";
|
||||
import { logger } from "../core/Logger.mjs";
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
import Player from "./player/index.mjs";
|
||||
import { Utils, cleanId } from "../utils/Utils.mjs";
|
||||
import { cleanId } from "../utils/Utils.mjs";
|
||||
import { logger } from "../core/Logger.mjs";
|
||||
import { getMessageGuildId } from "../ui/index.mjs";
|
||||
import { applyMixins } from "../utils/mixins.mjs";
|
||||
|
||||
@@ -163,16 +163,13 @@ export class FluxerAudioBridge extends EventEmitter {
|
||||
// this point get the explicit error below instead of fetching their
|
||||
// source page.
|
||||
if (!trackInfo.encoded && trackInfo.url && trackInfo.url.startsWith("http")) {
|
||||
logger.player("[AudioBridge] Route 3: Fetching directly: " + trackInfo.url.substring(0, 80) + "...");
|
||||
const response = await fetch(trackInfo.url, {
|
||||
logger.player("[AudioBridge] Route 3: Fetching directly via SafeHttp: " + trackInfo.url.substring(0, 80) + "...");
|
||||
const { openPublicStream } = await import("./SafeHttp.mjs");
|
||||
const { stream, req } = await openPublicStream(trackInfo.url, {
|
||||
headers: { "User-Agent": "Mozilla/5.0 (compatible; Bot/1.0)" },
|
||||
redirect: "follow",
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error("HTTP " + response.status + " for " + trackInfo.url);
|
||||
}
|
||||
const stream = Readable.fromWeb(response.body);
|
||||
this._sourceStream = stream;
|
||||
this._sourceReq = req || null;
|
||||
|
||||
const routed = await this._routeByMagic(stream);
|
||||
if (routed.kind === "webm") {
|
||||
|
||||
@@ -9,13 +9,10 @@
|
||||
*/
|
||||
|
||||
import { EmbedBuilder } from "@fluxerjs/core";
|
||||
import { getGlobalColor } from "../../ui/index.mjs";
|
||||
import { ERROR_COLOR } from "../../utils/UI.mjs";
|
||||
import { Utils, cleanId } from "../../utils/Utils.mjs";
|
||||
import { logger } from "../../core/Logger.mjs";
|
||||
import meta from "../probe.mjs";
|
||||
import { getBilibiliStreamUrl } from "../bilibili/index.mjs";
|
||||
import { isLoadstreamEnabled } from "../audio/AudioSettings.mjs";
|
||||
|
||||
/**
|
||||
* @type {object}
|
||||
|
||||
@@ -11,8 +11,7 @@ import { getVoiceManager } from "@fluxerjs/voice";
|
||||
import { EventEmitter } from "node:events";
|
||||
import http from "node:http";
|
||||
import https from "node:https";
|
||||
import { EmbedBuilder, PermissionFlags } from "@fluxerjs/core";
|
||||
import { getGlobalColor } from "../../ui/index.mjs";
|
||||
import { PermissionFlags } from "@fluxerjs/core";
|
||||
import { Utils, cleanId } from "../../utils/Utils.mjs";
|
||||
import { logger } from "../../core/Logger.mjs";
|
||||
import { get247ChannelMode, detachPlayerFromManager } from "../../utils/Helpers247.mjs";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** @module src/services/TrackOptionsManager @description Per-user track options (start/end timestamps) stored in MySQL. Provides caching, matching, and CRUD for track segments. */
|
||||
import mysql from "mysql2";
|
||||
import { logger } from "../core/Logger.mjs";
|
||||
import { MYSQL_POOL_DEFAULTS, attachMysqlPoolGuard } from "../db/MysqlGuard.mjs";
|
||||
import { attachMysqlPoolGuard } from "../db/MysqlGuard.mjs";
|
||||
import { getSharedMysqlPool } from "../db/PoolManager.mjs";
|
||||
|
||||
const DEFAULT_ALIAS = "default";
|
||||
|
||||
@@ -14,7 +14,7 @@ import { logger } from "../../core/Logger.mjs";
|
||||
import { normalizeTrackText } from "./constants.mjs";
|
||||
import { applyMixins } from "../../utils/mixins.mjs";
|
||||
import { parseLastFmUrl, isLastFmUrl } from "./urlUtils.mjs";
|
||||
import { MYSQL_POOL_DEFAULTS, attachMysqlPoolGuard } from "../../db/MysqlGuard.mjs";
|
||||
import { attachMysqlPoolGuard } from "../../db/MysqlGuard.mjs";
|
||||
import { getSharedPromisePool } from "../../db/PoolManager.mjs";
|
||||
import UserStoreMixin from "./UserStoreMixin.mjs";
|
||||
import ScrobblingMixin from "./ScrobblingMixin.mjs";
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
/** @module src/utils/Utils @description General-purpose utility functions for formatting, validation, string manipulation, and ID cleaning. */
|
||||
|
||||
import { escapeMarkdown as _escapeMarkdown, truncate as _truncate } from "@fluxerjs/util";
|
||||
import { logger } from "../core/Logger.mjs";
|
||||
import { escapeMarkdown as _escapeMarkdown } from "@fluxerjs/util";
|
||||
|
||||
/**
|
||||
* Strip all non-digit characters from a value to extract a Snowflake/numeric ID.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/** @module src/voice/VoiceStateCache */
|
||||
|
||||
import { logger } from "../core/Logger.mjs";
|
||||
import { cleanId } from "../utils/Utils.mjs";
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
import { Events, GatewayOpcodes } from "@fluxerjs/core";
|
||||
import { logger, _wsErrorCooldown } from "../../core/Logger.mjs";
|
||||
import { ServerSettings } from "../../db/Settings.mjs";
|
||||
import { get247ChannelMode, remove247ChannelMode } from "../../utils/Helpers247.mjs";
|
||||
import { get247ChannelMode } from "../../utils/Helpers247.mjs";
|
||||
import { cleanId } from "../../utils/Utils.mjs";
|
||||
import * as ShardingUtils from "../../utils/ShardingUtils.mjs";
|
||||
import { iterateVoiceStates, hasHumansInChannel, getChannelsWithHumans, resolveIsBotUser } from "../VoiceStateResolver.mjs";
|
||||
import { iterateVoiceStates, resolveIsBotUser } from "../VoiceStateResolver.mjs";
|
||||
import { applyMixins } from "../../utils/mixins.mjs";
|
||||
import VoiceStateRouting from "./VoiceStateRouting.mjs";
|
||||
import GuildSync from "./GuildSync.mjs";
|
||||
|
||||
Reference in new issue
Block a user