mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2329bc77d8 | |||
| 8869278898 | |||
| 16c9e6cc1b |
@@ -24,6 +24,7 @@ jobs:
|
||||
|
||||
- name: Build and Publish releases
|
||||
env:
|
||||
NODE_OPTIONS: --max-old-space-size=4096
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
uses: nick-invision/retry@v3.0.2
|
||||
with:
|
||||
|
||||
@@ -1,2 +1,9 @@
|
||||
import './core';
|
||||
import(`./${process.platform}`);
|
||||
|
||||
if (process.platform === 'linux') {
|
||||
import('./linux');
|
||||
} else if (process.platform === 'darwin') {
|
||||
import('./darwin');
|
||||
} else if (process.platform === 'win32') {
|
||||
import('./win32');
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export {};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { SetActivity } from '@xhayper/discord-rpc';
|
||||
import type { SetActivity } from '@xhayper/discord-rpc';
|
||||
|
||||
import { ipcRenderer } from 'electron';
|
||||
|
||||
const initialize = (clientId: string) => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { initClient, initContract } from '@ts-rest/core';
|
||||
import axios, { AxiosError, AxiosRequestConfig, AxiosResponse, isAxiosError } from 'axios';
|
||||
import omitBy from 'lodash/omitBy';
|
||||
import qs from 'qs';
|
||||
import { z } from 'zod';
|
||||
|
||||
@@ -380,8 +379,26 @@ axiosClient.interceptors.response.use(
|
||||
const parsePath = (fullPath: string) => {
|
||||
const [path, params] = fullPath.split('?');
|
||||
|
||||
const parsedParams = qs.parse(params, { arrayLimit: 99999, parameterLimit: 99999 });
|
||||
const notNilParams = omitBy(parsedParams, (value) => value === 'undefined' || value === 'null');
|
||||
const url = new URLSearchParams(params);
|
||||
const notNilParams: Record<string, string[]> = {};
|
||||
|
||||
for (const [key, value] of url) {
|
||||
if (value === 'undefined' || value === 'null') {
|
||||
continue;
|
||||
}
|
||||
|
||||
let realKey = key;
|
||||
|
||||
if (key.includes('[') && key.includes(']')) {
|
||||
realKey = key.split('[')[0];
|
||||
}
|
||||
|
||||
if (realKey in notNilParams) {
|
||||
notNilParams[realKey].push(value);
|
||||
} else {
|
||||
notNilParams[realKey] = [value];
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
params: notNilParams,
|
||||
|
||||
@@ -22,12 +22,7 @@ import { WebAudio } from '/@/shared/types/types';
|
||||
import '/@/shared/styles/global.css';
|
||||
import { PlayerProvider } from '/@/renderer/features/player/context/player-context';
|
||||
import { AudioPlayers } from '/@/renderer/features/player/components/audio-players';
|
||||
|
||||
const ReleaseNotesModal = lazy(() =>
|
||||
import('./release-notes-modal').then((module) => ({
|
||||
default: module.ReleaseNotesModal,
|
||||
})),
|
||||
);
|
||||
import { ReleaseNotesModal } from '/@/renderer/release-notes-modal';
|
||||
|
||||
const UpdateAvailableDialog = lazy(() =>
|
||||
import('./update-available-dialog').then((module) => ({
|
||||
@@ -82,8 +77,8 @@ const AppShell = memo(function AppShell() {
|
||||
<AppRouter />
|
||||
</PlayerProvider>
|
||||
</WebAudioContext.Provider>
|
||||
<ReleaseNotesModal />
|
||||
<Suspense fallback={null}>
|
||||
<ReleaseNotesModal />
|
||||
<UpdateAvailableDialog />
|
||||
</Suspense>
|
||||
</>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { SetActivity, StatusDisplayType } from '@xhayper/discord-rpc';
|
||||
import type { SetActivity } from '@xhayper/discord-rpc';
|
||||
|
||||
import isElectron from 'is-electron';
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
@@ -27,6 +28,13 @@ import { LibraryItem, QueueSong, ServerType } from '/@/shared/types/domain-types
|
||||
import { PlayerStatus } from '/@/shared/types/types';
|
||||
|
||||
const discordRpc = isElectron() ? window.api.discordRpc : null;
|
||||
|
||||
const DiscordStatusDisplayType = {
|
||||
DETAILS: 2,
|
||||
NAME: 0,
|
||||
STATE: 1,
|
||||
} as const;
|
||||
|
||||
type ActivityState = [QueueSong | undefined, number, PlayerStatus];
|
||||
|
||||
const MAX_FIELD_LENGTH = 127;
|
||||
@@ -122,7 +130,7 @@ export const useDiscordRpc = () => {
|
||||
: undefined
|
||||
: sentenceCase(current[2]),
|
||||
state: truncate(artist),
|
||||
statusDisplayType: StatusDisplayType.STATE,
|
||||
statusDisplayType: DiscordStatusDisplayType.STATE,
|
||||
type: discordSettings.showAsListening ? 2 : 0,
|
||||
};
|
||||
|
||||
@@ -196,9 +204,9 @@ export const useDiscordRpc = () => {
|
||||
const artists = song?.artists.map((artist) => artist.name).join(', ');
|
||||
|
||||
const statusDisplayMap = {
|
||||
[DiscordDisplayType.ARTIST_NAME]: StatusDisplayType.STATE,
|
||||
[DiscordDisplayType.FEISHIN]: StatusDisplayType.NAME,
|
||||
[DiscordDisplayType.SONG_NAME]: StatusDisplayType.DETAILS,
|
||||
[DiscordDisplayType.ARTIST_NAME]: DiscordStatusDisplayType.STATE,
|
||||
[DiscordDisplayType.FEISHIN]: DiscordStatusDisplayType.NAME,
|
||||
[DiscordDisplayType.SONG_NAME]: DiscordStatusDisplayType.DETAILS,
|
||||
};
|
||||
|
||||
const activity: SetActivity = {
|
||||
|
||||
@@ -146,6 +146,7 @@ export const ThemeSettings = memo(() => {
|
||||
}
|
||||
}}
|
||||
renderOption={renderThemeOption}
|
||||
searchable
|
||||
width={240}
|
||||
/>
|
||||
),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import clsx from 'clsx';
|
||||
import { AnimatePresence } from 'motion/react';
|
||||
import { lazy, Suspense } from 'react';
|
||||
import { Suspense } from 'react';
|
||||
import { Outlet } from 'react-router';
|
||||
|
||||
import styles from './mobile-layout.module.css';
|
||||
@@ -10,6 +10,7 @@ import { FullScreenVisualizer } from '/@/renderer/features/player/components/ful
|
||||
import { MobileFullscreenPlayer } from '/@/renderer/features/player/components/mobile-fullscreen-player';
|
||||
import { MobileSidebar } from '/@/renderer/features/sidebar/components/mobile-sidebar';
|
||||
import { PlayerBar } from '/@/renderer/layouts/default-layout/player-bar';
|
||||
import { WindowBar } from '/@/renderer/layouts/window-bar';
|
||||
import { useFullScreenPlayerOverlayState, useWindowBarStyle } from '/@/renderer/store';
|
||||
import { ActionIcon } from '/@/shared/components/action-icon/action-icon';
|
||||
import { Drawer } from '/@/shared/components/drawer/drawer';
|
||||
@@ -17,12 +18,6 @@ import { Spinner } from '/@/shared/components/spinner/spinner';
|
||||
import { useDisclosure } from '/@/shared/hooks/use-disclosure';
|
||||
import { Platform } from '/@/shared/types/types';
|
||||
|
||||
const WindowBar = lazy(() =>
|
||||
import('/@/renderer/layouts/window-bar').then((module) => ({
|
||||
default: module.WindowBar,
|
||||
})),
|
||||
);
|
||||
|
||||
interface MobileLayoutProps {
|
||||
shell?: boolean;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { lazy, Suspense } from 'react';
|
||||
import { HashRouter, Route, Routes } from 'react-router';
|
||||
|
||||
import { ShuffleAllContextModal } from '/@/renderer/features/player/components/shuffle-all-modal';
|
||||
import { RouterErrorBoundary } from '/@/renderer/features/shared/components/router-error-boundary';
|
||||
import { AuthenticationOutlet } from '/@/renderer/layouts/authentication-outlet';
|
||||
import { ResponsiveLayout } from '/@/renderer/layouts/responsive-layout';
|
||||
@@ -96,18 +97,6 @@ const LyricsSettingsContextModal = (props: any) => (
|
||||
</Suspense>
|
||||
);
|
||||
|
||||
const LazyShuffleAllContextModal = lazy(() =>
|
||||
import('/@/renderer/features/player/components/shuffle-all-modal').then((module) => ({
|
||||
default: module.ShuffleAllContextModal,
|
||||
})),
|
||||
);
|
||||
|
||||
const ShuffleAllContextModal = (props: any) => (
|
||||
<Suspense fallback={<Spinner container />}>
|
||||
<LazyShuffleAllContextModal {...props} />
|
||||
</Suspense>
|
||||
);
|
||||
|
||||
const LazyAddToPlaylistContextModal = lazy(() =>
|
||||
import('/@/renderer/features/playlists/components/add-to-playlist-context-modal').then(
|
||||
(module) => ({
|
||||
|
||||
Reference in New Issue
Block a user