diff --git a/src/equicordplugins/elementHighlighter.dev/index.tsx b/src/equicordplugins/elementHighlighter.dev/index.tsx
index c466b1449..ecea642f2 100644
--- a/src/equicordplugins/elementHighlighter.dev/index.tsx
+++ b/src/equicordplugins/elementHighlighter.dev/index.tsx
@@ -227,14 +227,12 @@ function buildTooltipContent(el: Element, computed: CSSStyleDeclaration, rect: D
html += `
${colorVar}
`;
html += `${hex}
`;
- const { store } = settings;
-
- if (store.showId) {
+ if (settings.store.showId) {
const { id } = el;
if (id) html += `id: #${id}
`;
}
- if (store.showClasses) {
+ if (settings.store.showClasses) {
const classes = el.className;
if (classes && typeof classes === "string") {
const truncated = classes.length > 60 ? classes.slice(0, 60) + "…" : classes;
@@ -242,28 +240,28 @@ function buildTooltipContent(el: Element, computed: CSSStyleDeclaration, rect: D
}
}
- if (store.showFont) {
+ if (settings.store.showFont) {
const font = computed.fontFamily.split(",")[0].replace(/["']/g, "");
const size = computed.fontSize;
html += `font: ${font} ${size}
`;
}
- if (store.showPadding) {
+ if (settings.store.showPadding) {
const padding = formatBoxValue(computed.padding);
if (padding) html += `padding: ${padding}
`;
}
- if (store.showMargin) {
+ if (settings.store.showMargin) {
const margin = formatBoxValue(computed.margin);
if (margin) html += `margin: ${margin}
`;
}
- if (store.showBorderRadius) {
+ if (settings.store.showBorderRadius) {
const radius = formatBoxValue(computed.borderRadius);
if (radius) html += `radius: ${radius}
`;
}
- if (store.showPosition) {
+ if (settings.store.showPosition) {
const pos = computed.position;
if (pos !== "static") {
const zIndex = computed.zIndex !== "auto" ? ` z:${computed.zIndex}` : "";
@@ -271,7 +269,7 @@ function buildTooltipContent(el: Element, computed: CSSStyleDeclaration, rect: D
}
}
- if (store.showDisplay) {
+ if (settings.store.showDisplay) {
const { display } = computed;
let extra = "";
if (display === "flex" || display === "inline-flex") {
diff --git a/src/equicordplugins/fileUpload/settings.tsx b/src/equicordplugins/fileUpload/settings.tsx
index f59247958..74643650e 100644
--- a/src/equicordplugins/fileUpload/settings.tsx
+++ b/src/equicordplugins/fileUpload/settings.tsx
@@ -449,10 +449,9 @@ function ServicePicker(props: {
function FallbackOrderSettings() {
const update = useForceUpdater();
- const { store } = settings;
const [dragIndex, setDragIndex] = React.useState(null);
const [order, setOrder] = React.useState(() => {
- const configured = (store.fallbackOrder || defaultFallbackOrder)
+ const configured = (settings.store.fallbackOrder || defaultFallbackOrder)
.split(/[\n,]/)
.map(entry => entry.trim())
.filter((entry): entry is ServiceType => Object.values(ServiceType).includes(entry as ServiceType));
@@ -464,7 +463,7 @@ function FallbackOrderSettings() {
const commitOrder = (nextOrder: ServiceType[]) => {
setOrder(nextOrder);
- store.fallbackOrder = nextOrder.join(",");
+ settings.store.fallbackOrder = nextOrder.join(",");
update();
};
@@ -515,24 +514,12 @@ function FallbackOrderSettings() {
export function SettingsComponent() {
const update = useForceUpdater();
- const { store } = settings;
const sharexFileInputRef = React.useRef(null);
- const isNest = store.serviceType === ServiceType.NEST;
- const isEzHost = store.serviceType === ServiceType.EZHOST;
- const isEncryptingHost = store.serviceType === ServiceType.ENCRYPTINGHOST;
- const isS3 = store.serviceType === ServiceType.S3;
- const isZipline = store.serviceType === ServiceType.ZIPLINE;
- const isCatbox = store.serviceType === ServiceType.CATBOX;
- const isLitterbox = store.serviceType === ServiceType.LITTERBOX;
- const isGofile = store.serviceType === ServiceType.GOFILE;
- const isPixelVault = store.serviceType === ServiceType.PIXELVAULT;
- const isPixelDrain = store.serviceType === ServiceType.PIXELDRAIN;
- const isShareX = store.serviceType === ServiceType.SHAREX;
- const isWebdav = store.serviceType === ServiceType.WEBDAV;
+ const { serviceType } = settings.store;
const validateShareXConfig = () => {
try {
- parseShareXConfig(store.sharexConfig || "");
+ parseShareXConfig(settings.store.sharexConfig || "");
showToast("ShareX config is valid", Toasts.Type.SUCCESS);
} catch (error) {
const message = error instanceof Error ? error.message : "Invalid ShareX config";
@@ -553,7 +540,7 @@ export function SettingsComponent() {
try {
const content = String(e.target?.result || "");
const parsed = parseShareXConfig(content);
- store.sharexConfig = JSON.stringify(parsed, null, 2);
+ settings.store.sharexConfig = JSON.stringify(parsed, null, 2);
update();
showToast("Imported ShareX config", Toasts.Type.SUCCESS);
} catch (error) {
@@ -569,79 +556,79 @@ export function SettingsComponent() {
<>
{
- store.serviceType = service;
+ settings.store.serviceType = service;
update();
}}
/>
- {isZipline && (
+ {serviceType === ServiceType.ZIPLINE && (
store.serviceUrl = v}
+ value={settings.store.serviceUrl}
+ onChange={v => settings.store.serviceUrl = v}
placeholder="https://your-zipline-instance.com"
/>
store.ziplineToken = v}
+ value={settings.store.ziplineToken}
+ onChange={v => settings.store.ziplineToken = v}
placeholder="Your Zipline API token"
/>
store.folderId = v}
+ value={settings.store.folderId}
+ onChange={v => settings.store.folderId = v}
placeholder="Leave empty for no folder"
/>
)}
- {isEzHost && (
+ {serviceType === ServiceType.EZHOST && (
store.ezHostKey = v}
+ value={settings.store.ezHostKey}
+ onChange={v => settings.store.ezHostKey = v}
placeholder="Your E-Z Host API key"
/>
)}
- {isNest && (
+ {serviceType === ServiceType.NEST && (
store.nestToken = v}
+ value={settings.store.nestToken}
+ onChange={v => settings.store.nestToken = v}
placeholder="Your Nest API token"
/>
)}
- {isEncryptingHost && (
+ {serviceType === ServiceType.ENCRYPTINGHOST && (
(store as { encryptingHostKey?: string; }).encryptingHostKey = v}
+ value={(settings.store as { encryptingHostKey?: string; }).encryptingHostKey || ""}
+ onChange={v => (settings.store as { encryptingHostKey?: string; }).encryptingHostKey = v}
placeholder="Your Encrypting.host API key"
/>
v === (store as { encryptingHostUrlStyle?: string; }).encryptingHostUrlStyle}
+ isSelected={v => v === (settings.store as { encryptingHostUrlStyle?: string; }).encryptingHostUrlStyle}
select={v => {
- (store as { encryptingHostUrlStyle?: string; }).encryptingHostUrlStyle = v;
+ (settings.store as { encryptingHostUrlStyle?: string; }).encryptingHostUrlStyle = v;
update();
}}
serialize={v => v}
@@ -650,122 +637,122 @@ export function SettingsComponent() {
(store as { encryptingHostTitle?: string; }).encryptingHostTitle = v}
+ value={(settings.store as { encryptingHostTitle?: string; }).encryptingHostTitle || ""}
+ onChange={v => (settings.store as { encryptingHostTitle?: string; }).encryptingHostTitle = v}
placeholder="Optional title"
/>
(store as { encryptingHostColor?: string; }).encryptingHostColor = v}
+ value={(settings.store as { encryptingHostColor?: string; }).encryptingHostColor || ""}
+ onChange={v => (settings.store as { encryptingHostColor?: string; }).encryptingHostColor = v}
placeholder="Optional color"
/>
(store as { encryptingHostFakelink?: string; }).encryptingHostFakelink = v}
+ value={(settings.store as { encryptingHostFakelink?: string; }).encryptingHostFakelink || ""}
+ onChange={v => (settings.store as { encryptingHostFakelink?: string; }).encryptingHostFakelink = v}
placeholder="Optional fake link"
/>
)}
- {isS3 && (
+ {serviceType === ServiceType.S3 && (
store.s3Endpoint = v}
+ value={settings.store.s3Endpoint}
+ onChange={v => settings.store.s3Endpoint = v}
placeholder="https://your-endpoint.example.com"
/>
store.s3Bucket = v}
+ value={settings.store.s3Bucket}
+ onChange={v => settings.store.s3Bucket = v}
placeholder="my-bucket"
/>
store.s3Region = v}
+ value={settings.store.s3Region}
+ onChange={v => settings.store.s3Region = v}
placeholder="auto"
/>
store.s3AccessKeyId = v}
+ value={settings.store.s3AccessKeyId}
+ onChange={v => settings.store.s3AccessKeyId = v}
placeholder="Your access key ID"
/>
store.s3SecretAccessKey = v}
+ value={settings.store.s3SecretAccessKey}
+ onChange={v => settings.store.s3SecretAccessKey = v}
placeholder="Your secret access key"
/>
store.s3SessionToken = v}
+ value={settings.store.s3SessionToken}
+ onChange={v => settings.store.s3SessionToken = v}
placeholder="Optional session token"
/>
store.s3PublicUrl = v}
+ value={settings.store.s3PublicUrl}
+ onChange={v => settings.store.s3PublicUrl = v}
placeholder="https://cdn.example.com"
/>
store.s3Prefix = v}
+ value={settings.store.s3Prefix}
+ onChange={v => settings.store.s3Prefix = v}
placeholder="uploads/discord"
/>
store.s3ForcePathStyle = v}
+ checked={settings.store.s3ForcePathStyle}
+ onChange={v => settings.store.s3ForcePathStyle = v}
/>
)}
- {isCatbox && (
+ {serviceType === ServiceType.CATBOX && (
store.catboxUserhash = v}
+ value={settings.store.catboxUserhash}
+ onChange={v => settings.store.catboxUserhash = v}
placeholder="Your Catbox userhash"
/>
)}
- {isLitterbox && (
+ {serviceType === ServiceType.LITTERBOX && (
v === store.litterboxExpiry}
+ isSelected={v => v === settings.store.litterboxExpiry}
select={v => {
- store.litterboxExpiry = v;
+ settings.store.litterboxExpiry = v;
update();
}}
serialize={v => v}
@@ -774,43 +761,43 @@ export function SettingsComponent() {
)}
- {isGofile && (
+ {serviceType === ServiceType.GOFILE && (
store.gofileToken = v}
+ value={settings.store.gofileToken}
+ onChange={v => settings.store.gofileToken = v}
placeholder="Optional GoFile token"
/>
)}
- {isPixelVault && (
+ {serviceType === ServiceType.PIXELVAULT && (
store.pixelVaultKey = v}
+ value={settings.store.pixelVaultKey}
+ onChange={v => settings.store.pixelVaultKey = v}
placeholder="Your PixelVault upload key"
/>
)}
- {isPixelDrain && (
+ {serviceType === ServiceType.PIXELDRAIN && (
store.pixelDrainKey = v}
+ value={settings.store.pixelDrainKey}
+ onChange={v => settings.store.pixelDrainKey = v}
placeholder="Your PixelDrain API key"
/>
)}
- {isShareX && (
+ {serviceType === ServiceType.SHAREX && (
@@ -840,34 +827,34 @@ export function SettingsComponent() {
)}
- {isWebdav && (
+ {serviceType === ServiceType.WEBDAV && (
store.webdavUrl = v}
+ value={settings.store.webdavUrl}
+ onChange={v => settings.store.webdavUrl = v}
placeholder="https://nextcloud.example.com/remote.php/dav/files/username"
/>
store.webdavUsername = v}
+ value={settings.store.webdavUsername}
+ onChange={v => settings.store.webdavUsername = v}
placeholder="username"
/>
store.webdavPassword = v}
+ value={settings.store.webdavPassword}
+ onChange={v => settings.store.webdavPassword = v}
placeholder="password or app token"
/>
store.webdavDirectory = v}
+ value={settings.store.webdavDirectory}
+ onChange={v => settings.store.webdavDirectory = v}
placeholder="Leave empty for root directory"
/>
@@ -877,16 +864,16 @@ export function SettingsComponent() {
{ label: "ownCloud", value: "owncloud" },
{ label: "Generic WebDAV", value: "generic" }
]}
- isSelected={v => v === store.webdavServerType}
+ isSelected={v => v === settings.store.webdavServerType}
select={v => {
- store.webdavServerType = v;
+ settings.store.webdavServerType = v;
update();
}}
serialize={v => v}
placeholder="Select server type"
/>
- {store.webdavServerType !== "generic" && (
+ {settings.store.webdavServerType !== "generic" && (
v === store.webdavShareType}
+ isSelected={v => v === settings.store.webdavShareType}
select={v => {
- store.webdavShareType = v;
+ settings.store.webdavShareType = v;
update();
}}
serialize={v => v}
@@ -911,27 +898,27 @@ export function SettingsComponent() {
store.stripQueryParams = v}
+ checked={settings.store.stripQueryParams}
+ onChange={v => settings.store.stripQueryParams = v}
/>
{
- store.embedProxyEnabled = v;
+ settings.store.embedProxyEnabled = v;
update();
}}
/>
- {store.embedProxyEnabled && (
+ {settings.store.embedProxyEnabled && (
v === store.embedProxyService}
+ isSelected={v => v === settings.store.embedProxyService}
select={v => {
- store.embedProxyService = v;
+ settings.store.embedProxyService = v;
update();
}}
serialize={v => v}
@@ -943,43 +930,43 @@ export function SettingsComponent() {
store.apngToGif = v}
+ checked={settings.store.apngToGif}
+ onChange={v => settings.store.apngToGif = v}
/>
(store as { preserveOriginalFilename?: boolean; }).preserveOriginalFilename = v}
+ checked={Boolean((settings.store as { preserveOriginalFilename?: boolean; }).preserveOriginalFilename)}
+ onChange={v => (settings.store as { preserveOriginalFilename?: boolean; }).preserveOriginalFilename = v}
/>
store.autoCopy = v}
+ checked={settings.store.autoCopy}
+ onChange={v => settings.store.autoCopy = v}
/>
store.disableFallbacks = v}
+ checked={settings.store.disableFallbacks}
+ onChange={v => settings.store.disableFallbacks = v}
/>
store.autoSend = v}
+ checked={settings.store.autoSend}
+ onChange={v => settings.store.autoSend = v}
/>
store.autoFormat = v}
+ checked={settings.store.autoFormat}
+ onChange={v => settings.store.autoFormat = v}
/>
@@ -987,29 +974,29 @@ export function SettingsComponent() {
(store as { bypassDiscordUpload?: boolean; }).bypassDiscordUpload = v}
+ checked={Boolean((settings.store as { bypassDiscordUpload?: boolean; }).bypassDiscordUpload)}
+ onChange={v => (settings.store as { bypassDiscordUpload?: boolean; }).bypassDiscordUpload = v}
/>
store.autoUploadPastedFiles = v}
+ checked={settings.store.autoUploadPastedFiles}
+ onChange={v => settings.store.autoUploadPastedFiles = v}
/>
store.bypassDiscordUploadOnlyOverLimit = v}
+ checked={settings.store.bypassDiscordUploadOnlyOverLimit}
+ onChange={v => settings.store.bypassDiscordUploadOnlyOverLimit = v}
/>
store.uploadAllowedFileTypes = v}
+ value={settings.store.uploadAllowedFileTypes}
+ onChange={v => settings.store.uploadAllowedFileTypes = v}
placeholder="png,jpg,gif,mp4,webp"
/>
@@ -1018,8 +1005,8 @@ export function SettingsComponent() {
store.corsProxyUrl = v}
+ value={settings.store.corsProxyUrl || ""}
+ onChange={v => settings.store.corsProxyUrl = v}
placeholder="https://your-cors-proxy.example.com"
/>
@@ -1036,9 +1023,9 @@ export function SettingsComponent() {
{ label: "5 minutes", value: 300000, default: true },
{ label: "10 minutes", value: 600000 }
]}
- isSelected={v => v === (store.uploadTimeoutMs || 300000)}
+ isSelected={v => v === (settings.store.uploadTimeoutMs || 300000)}
select={v => {
- store.uploadTimeoutMs = v;
+ settings.store.uploadTimeoutMs = v;
update();
}}
serialize={v => v}
diff --git a/src/equicordplugins/musicControls/settings.tsx b/src/equicordplugins/musicControls/settings.tsx
index 566c3ff57..e5fb7ccd6 100644
--- a/src/equicordplugins/musicControls/settings.tsx
+++ b/src/equicordplugins/musicControls/settings.tsx
@@ -39,8 +39,6 @@ function InstallInstructions() {
}
function LyricsProviderSettings() {
- const { store } = settings;
-
return (
<>
@@ -49,14 +47,14 @@ function LyricsProviderSettings() {
{ value: Provider.Lrclib, label: "LRCLIB", default: true },
{ value: Provider.Spotify, label: "Spotify (Musixmatch)" },
]}
- isSelected={v => v === store.lyricsProvider}
- select={v => { store.lyricsProvider = v as Provider; }}
+ isSelected={v => v === settings.store.lyricsProvider}
+ select={v => { settings.store.lyricsProvider = v as Provider; }}
serialize={v => v}
placeholder="Select a lyrics provider"
/>
- {store.lyricsProvider === Provider.Spotify && (
+ {settings.store.lyricsProvider === Provider.Spotify && (
{
- store.spotifyLyricsApiUrl = v;
+ settings.store.spotifyLyricsApiUrl = v;
void clearLyricsCache();
showToast("Lyrics cache purged", Toasts.Type.SUCCESS);
}}
diff --git a/src/equicordplugins/randomVoice/index.tsx b/src/equicordplugins/randomVoice/index.tsx
index 4d9854e70..184ae2645 100644
--- a/src/equicordplugins/randomVoice/index.tsx
+++ b/src/equicordplugins/randomVoice/index.tsx
@@ -605,24 +605,23 @@ async function joinRandomVoice() {
return;
}
- const { store } = settings;
ChannelActions.selectVoiceChannel(channelId);
- if (store.autoNavigate) {
+ if (settings.store.autoNavigate) {
ChannelRouter.transitionToChannel(channelId);
}
const postJoinActions: PostJoinAction[] = [];
- if (store.selfMute && !MediaEngineStore.isSelfMute()) {
+ if (settings.store.selfMute && !MediaEngineStore.isSelfMute()) {
postJoinActions.push(() => VoiceActions.toggleSelfMute());
}
- if (store.selfDeafen && !MediaEngineStore.isSelfDeaf()) {
+ if (settings.store.selfDeafen && !MediaEngineStore.isSelfDeaf()) {
postJoinActions.push(() => VoiceActions.toggleSelfDeaf());
}
- if (store.autoCamera) {
+ if (settings.store.autoCamera) {
postJoinActions.push(enableCamera);
}
- if (store.autoStream) {
+ if (settings.store.autoStream) {
postJoinActions.push(() => startChannelStream(channel));
}
@@ -646,16 +645,15 @@ function RandomVoiceButton({ iconForeground, hideTooltips, nameplate }: UserArea
function RandomVoiceMenu({ onClose }: { onClose(): void; }) {
const [, rerender] = React.useReducer(value => value + 1, 0);
- const { store } = settings;
const guilds = getRenderableGuilds();
const allServerIds = guilds.map(guild => guild.id);
- const selectedServerIds = getSelectedServerIds(store) ?? allServerIds;
+ const selectedServerIds = getSelectedServerIds(settings.store) ?? allServerIds;
- const update = (key: K, value: typeof store[K]) => {
- store[key] = value;
+ const update = (key: K, value: typeof settings.store[K]) => {
+ settings.store[key] = value;
rerender();
};
- const toggle = (key: K) => update(key, !store[key]);
+ const toggle = (key: K) => update(key, !settings.store[key]);
const selectAllServers = () => {
setServerIds(guilds.map(guild => guild.id));
rerender();
@@ -675,7 +673,7 @@ function RandomVoiceMenu({ onClose }: { onClose(): void; }) {
const setSlider = (key: K) =>
debounce((value: number) => {
- store[key] = Math.round(value);
+ settings.store[key] = Math.round(value);
rerender();
}, 50);
@@ -717,7 +715,7 @@ function RandomVoiceMenu({ onClose }: { onClose(): void; }) {
key={key}
id={`random-voice-filter-${key}`}
label={label}
- checked={store[key]}
+ checked={settings.store[key]}
action={() => toggle(key)}
/>
))}
@@ -725,15 +723,15 @@ function RandomVoiceMenu({ onClose }: { onClose(): void; }) {
toggle("includeStates")}
/>
toggle("avoidStates")}
/>
>
@@ -746,8 +744,8 @@ function RandomVoiceMenu({ onClose }: { onClose(): void; }) {
label: "User Amount",
sliderKey: "UserAmount",
operationKey: "UserAmountOperation",
- sliderValue: store.UserAmount,
- operationValue: store.UserAmountOperation,
+ sliderValue: settings.store.UserAmount,
+ operationValue: settings.store.UserAmountOperation,
onOperationChange: value => update("UserAmountOperation", value),
onSliderChange: setSlider("UserAmount"),
})}
@@ -759,8 +757,8 @@ function RandomVoiceMenu({ onClose }: { onClose(): void; }) {
label: "Spaces Left",
sliderKey: "spacesLeft",
operationKey: "spacesLeftOperation",
- sliderValue: store.spacesLeft,
- operationValue: store.spacesLeftOperation,
+ sliderValue: settings.store.spacesLeft,
+ operationValue: settings.store.spacesLeftOperation,
onOperationChange: value => update("spacesLeftOperation", value),
onSliderChange: setSlider("spacesLeft"),
})}
@@ -772,8 +770,8 @@ function RandomVoiceMenu({ onClose }: { onClose(): void; }) {
label: "Voice Limit",
sliderKey: "vcLimit",
operationKey: "vcLimitOperation",
- sliderValue: store.vcLimit,
- operationValue: store.vcLimitOperation,
+ sliderValue: settings.store.vcLimit,
+ operationValue: settings.store.vcLimitOperation,
onOperationChange: value => update("vcLimitOperation", value),
onSliderChange: setSlider("vcLimit"),
})}
@@ -787,7 +785,7 @@ function RandomVoiceMenu({ onClose }: { onClose(): void; }) {
key={key}
id={`random-voice-setting-${key}`}
label={label}
- checked={store[key]}
+ checked={settings.store[key]}
action={() => toggle(key)}
/>
))}
diff --git a/src/equicordplugins/richPresence/services/jellyfin.ts b/src/equicordplugins/richPresence/services/jellyfin.ts
index a8cf83ebe..894f3bad7 100644
--- a/src/equicordplugins/richPresence/services/jellyfin.ts
+++ b/src/equicordplugins/richPresence/services/jellyfin.ts
@@ -45,11 +45,11 @@ async function fetchMediaData(): Promise {
const contentType = res.headers.get("content-type") ?? "";
if (!contentType.includes("application/json")) {
- if (!hasShownError) {
- logger.error("Jellyfin returned non-JSON response. Check your server URL and API key.");
- showToast("Jellyfin returned an invalid response. Your API key may be wrong.", "failure", { duration: 15000 });
- hasShownError = true;
- }
+ if (!hasShownError) {
+ logger.error("Jellyfin returned non-JSON response. Check your server URL and API key.");
+ showToast("Jellyfin returned an invalid response. Your API key may be wrong.", "failure", { duration: 15000 });
+ hasShownError = true;
+ }
return null;
}
@@ -89,13 +89,12 @@ async function fetchMediaData(): Promise {
}
async function getActivity(): Promise {
- const { store } = settings;
const mediaData = await fetchMediaData();
if (!mediaData) return null;
let richPresenceType: number;
- if (store.jf_overrideType !== "off") {
- richPresenceType = parseInt(store.jf_overrideType as string, 10);
+ if (settings.store.jf_overrideType !== "off") {
+ richPresenceType = parseInt(settings.store.jf_overrideType as string, 10);
} else {
richPresenceType = mediaData.type === "Audio" ? 2 : 3;
}
@@ -111,25 +110,25 @@ async function getActivity(): Promise {
.replace(/\{year\}/g, mediaData.year?.toString() || "");
let appName: string;
- const nameSetting = store.jf_nameDisplay || "default";
+ const nameSetting = settings.store.jf_nameDisplay || "default";
switch (nameSetting) {
case "full":
if (mediaData.type === "Episode" && mediaData.seriesName) {
- appName = store.jf_privacyMode
+ appName = settings.store.jf_privacyMode
? `${mediaData.seriesName} - [Episode Hidden]`
: `${mediaData.seriesName} - ${mediaData.name}`;
} else if (mediaData.type === "Audio") {
- appName = store.jf_privacyMode
+ appName = settings.store.jf_privacyMode
? "[Track Hidden]"
: `${mediaData.artist || "Unknown Artist"} - ${mediaData.name}`;
} else {
- appName = store.jf_privacyMode ? "[Movie Hidden]" : mediaData.name || "Jellyfin";
+ appName = settings.store.jf_privacyMode ? "[Movie Hidden]" : mediaData.name || "Jellyfin";
}
break;
case "custom":
- appName = templateReplace(store.jf_customName || "{name} on Jellyfin");
- if (store.jf_privacyMode) {
+ appName = templateReplace(settings.store.jf_customName || "{name} on Jellyfin");
+ if (settings.store.jf_privacyMode) {
appName = appName
.replace(mediaData.name || "", "[Title Hidden]")
.replace(mediaData.seriesName || "", "[Series Hidden]")
@@ -141,13 +140,13 @@ async function getActivity(): Promise {
if (mediaData.type === "Episode" && mediaData.seriesName) {
appName = mediaData.seriesName;
} else {
- appName = store.jf_privacyMode ? "[Media Hidden]" : mediaData.name || "Jellyfin";
+ appName = settings.store.jf_privacyMode ? "[Media Hidden]" : mediaData.name || "Jellyfin";
}
break;
}
const assets = {
- large_image: !store.jf_privacyMode && mediaData.imageUrl
+ large_image: !settings.store.jf_privacyMode && mediaData.imageUrl
? await getAsset(mediaData.imageUrl) : undefined,
large_text: mediaData.seriesName || mediaData.album || undefined,
};
@@ -155,9 +154,9 @@ async function getActivity(): Promise {
const getDetails = () => {
let details: string;
if (mediaData.type === "Episode" && mediaData.seriesName)
- details = store.jf_privacyMode ? "Watching a TV Show" : mediaData.seriesName;
+ details = settings.store.jf_privacyMode ? "Watching a TV Show" : mediaData.seriesName;
else
- details = store.jf_privacyMode ? "Watching Something" : mediaData.name;
+ details = settings.store.jf_privacyMode ? "Watching Something" : mediaData.name;
if (mediaData.isPaused) details += " - Paused";
return details;
};
@@ -169,7 +168,7 @@ async function getActivity(): Promise {
let episodeFormat = "";
const season = mediaData.seasonNumber;
const episode = mediaData.episodeNumber;
- const format = store.jf_episodeFormat || "long";
+ const format = settings.store.jf_episodeFormat || "long";
if (season != null && episode != null) {
switch (format) {
@@ -189,10 +188,10 @@ async function getActivity(): Promise {
episodeFormat = format === "fulltext" ? `Episode ${episode}` : `E${episode.toString().padStart(2, "0")}`;
}
- state = (store.jf_showEpisodeName && mediaData.name && !store.jf_privacyMode)
+ state = (settings.store.jf_showEpisodeName && mediaData.name && !settings.store.jf_privacyMode)
? `${episodeFormat} - ${mediaData.name}`
: episodeFormat;
- } else if (store.jf_privacyMode) {
+ } else if (settings.store.jf_privacyMode) {
state = mediaData.type === "Audio" ? "Listening to music" : (mediaData.year ? "(????)" : undefined);
} else {
state = mediaData.artist || (mediaData.year ? `(${mediaData.year})` : undefined);
diff --git a/src/equicordplugins/streamingCodecDisabler/index.ts b/src/equicordplugins/streamingCodecDisabler/index.ts
index a575d41ca..3e47e9d55 100644
--- a/src/equicordplugins/streamingCodecDisabler/index.ts
+++ b/src/equicordplugins/streamingCodecDisabler/index.ts
@@ -55,13 +55,12 @@ export default definePlugin({
],
filterCodecs(codecs: CodecInfo[]) {
- const { store } = settings;
const disabled: Record = {
- AV1: store.disableAv1Codec,
- H265: store.disableH265Codec,
- H264: store.disableH264Codec,
- VP8: store.disableVP8Codec,
- VP9: store.disableVP9Codec,
+ AV1: settings.store.disableAv1Codec,
+ H265: settings.store.disableH265Codec,
+ H264: settings.store.disableH264Codec,
+ VP8: settings.store.disableVP8Codec,
+ VP9: settings.store.disableVP9Codec,
};
return codecs.map(c => disabled[c.name] ? { ...c, encode: false } : c);
},