Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
628 changes: 314 additions & 314 deletions auto-eslint.mjs

Large diffs are not rendered by default.

22 changes: 0 additions & 22 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,47 +19,32 @@ declare module 'vue' {
AutoClose: typeof import('./src/components/Modal/AutoClose.vue')['default']
BackgroundRender: typeof import('./src/components/AMLL/BackgroundRender.vue')['default']
BatchList: typeof import('./src/components/Modal/BatchList.vue')['default']
CacheDirectory: typeof import('./src/components/Setting/components/CacheDirectory.vue')['default']
CacheLimitConfig: typeof import('./src/components/Setting/components/CacheLimitConfig.vue')['default']
CacheSizeLimit: typeof import('./src/components/Setting/components/CacheSizeLimit.vue')['default']
ChangeRate: typeof import('./src/components/Modal/ChangeRate.vue')['default']
CloudMatch: typeof import('./src/components/Modal/CloudMatch.vue')['default']
CommentFilter: typeof import('./src/components/Modal/CommentFilter.vue')['default']
CommentList: typeof import('./src/components/List/CommentList.vue')['default']
ConfigurableInputNumber: typeof import('./src/components/Setting/items/ConfigurableInputNumber.vue')['default']
ContextMenuManager: typeof import('./src/components/Modal/Setting/ContextMenuManager.vue')['default']
copy: typeof import('./src/components/Global/Provider copy.vue')['default']
CopyLyrics: typeof import('./src/components/Modal/CopyLyrics.vue')['default']
CoverList: typeof import('./src/components/List/CoverList.vue')['default']
CoverManager: typeof import('./src/components/Modal/Setting/CoverManager.vue')['default']
CoverMenu: typeof import('./src/components/Menu/CoverMenu.vue')['default']
CreatePlaylist: typeof import('./src/components/Modal/CreatePlaylist.vue')['default']
CustomCode: typeof import('./src/components/Modal/Setting/CustomCode.vue')['default']
DefaultLyric: typeof import('./src/components/Player/PlayerLyric/DefaultLyric.vue')['default']
DiscordRpcConfig: typeof import('./src/components/Setting/components/DiscordRpcConfig.vue')['default']
DownloadDirectory: typeof import('./src/components/Setting/components/DownloadDirectory.vue')['default']
DownloadModal: typeof import('./src/components/Modal/DownloadModal.vue')['default']
DownloadPathButtons: typeof import('./src/components/Setting/components/DownloadPathButtons.vue')['default']
Equalizer: typeof import('./src/components/Modal/Equalizer.vue')['default']
ExcludeComment: typeof import('./src/components/Modal/Setting/ExcludeComment.vue')['default']
ExcludeLyrics: typeof import('./src/components/Modal/Setting/ExcludeLyrics.vue')['default']
FontManager: typeof import('./src/components/Modal/Setting/FontManager.vue')['default']
FullPlayer: typeof import('./src/components/Player/FullPlayer.vue')['default']
FullPlayerMobile: typeof import('./src/components/Player/FullPlayerMobile.vue')['default']
FullscreenPlayerManager: typeof import('./src/components/Modal/Setting/FullscreenPlayerManager.vue')['default']
GeneralSetting: typeof import('./src/components/Setting/old/GeneralSetting.vue')['default']
HomePageSectionManager: typeof import('./src/components/Modal/Setting/HomePageSectionManager.vue')['default']
JumpArtist: typeof import('./src/components/Modal/JumpArtist.vue')['default']
KeyboardSetting: typeof import('./src/components/Setting/old/KeyboardSetting.vue')['default']
LastfmConfig: typeof import('./src/components/Setting/components/LastfmConfig.vue')['default']
ListComment: typeof import('./src/components/List/ListComment.vue')['default']
ListDetail: typeof import('./src/components/List/ListDetail.vue')['default']
LocalLyricDirectories: typeof import('./src/components/Setting/components/LocalLyricDirectories.vue')['default']
LocalMusicDirectories: typeof import('./src/components/Setting/components/LocalMusicDirectories.vue')['default']
LocalMusicDirectory: typeof import('./src/components/Modal/Setting/LocalMusicDirectory.vue')['default']
LocalMusicDirectoryModal: typeof import('./src/components/Modal/Setting/LocalMusicDirectoryModal.vue')['default']
LocalPathConfig: typeof import('./src/components/Setting/components/LocalPathConfig.vue')['default']
LocalSetting: typeof import('./src/components/Setting/old/LocalSetting.vue')['default']
Login: typeof import('./src/components/Modal/Login/Login.vue')['default']
LoginCookie: typeof import('./src/components/Modal/Login/LoginCookie.vue')['default']
LoginPhone: typeof import('./src/components/Modal/Login/LoginPhone.vue')['default']
Expand All @@ -68,7 +53,6 @@ declare module 'vue' {
Logo: typeof import('./src/components/Layout/Logo.vue')['default']
LyricPlayer: typeof import('./src/components/AMLL/LyricPlayer.vue')['default']
LyricPreview: typeof import('./src/components/Setting/components/LyricPreview.vue')['default']
LyricsSetting: typeof import('./src/components/Setting/old/LyricsSetting.vue')['default']
MainPlayer: typeof import('./src/components/Player/MainPlayer.vue')['default']
MainSetting: typeof import('./src/components/Setting/MainSetting.vue')['default']
Menu: typeof import('./src/components/Layout/Menu.vue')['default']
Expand Down Expand Up @@ -151,7 +135,6 @@ declare module 'vue' {
NText: typeof import('naive-ui')['NText']
NThing: typeof import('naive-ui')['NThing']
NTree: typeof import('naive-ui')['NTree']
OtherSetting: typeof import('./src/components/Setting/old/OtherSetting.vue')['default']
PersonalFM: typeof import('./src/components/Player/PlayerComponents/PersonalFM.vue')['default']
PlayerBackground: typeof import('./src/components/Player/PlayerMeta/PlayerBackground.vue')['default']
PlayerComment: typeof import('./src/components/Player/PlayerComponents/PlayerComment.vue')['default']
Expand All @@ -166,9 +149,7 @@ declare module 'vue' {
PlayerSpectrum: typeof import('./src/components/Player/PlayerComponents/PlayerSpectrum.vue')['default']
PlaylistAdd: typeof import('./src/components/Modal/PlaylistAdd.vue')['default']
PlaylistPageManager: typeof import('./src/components/Modal/Setting/PlaylistPageManager.vue')['default']
PlaySetting: typeof import('./src/components/Setting/old/PlaySetting.vue')['default']
Provider: typeof import('./src/components/Global/Provider.vue')['default']
ProxyConfig: typeof import('./src/components/Setting/components/ProxyConfig.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
ScalingModal: typeof import('./src/components/Modal/ScalingModal.vue')['default']
Expand All @@ -193,17 +174,14 @@ declare module 'vue' {
SongUnlockManager: typeof import('./src/components/Modal/Setting/SongUnlockManager.vue')['default']
StreamingServerConfig: typeof import('./src/components/Modal/Setting/StreamingServerConfig.vue')['default']
StreamingServerList: typeof import('./src/components/Setting/components/StreamingServerList.vue')['default']
StreamingSetting: typeof import('./src/components/Setting/old/StreamingSetting.vue')['default']
SvgIcon: typeof import('./src/components/Global/SvgIcon.vue')['default']
TextContainer: typeof import('./src/components/Global/TextContainer.vue')['default']
ThemeConfig: typeof import('./src/components/Modal/ThemeConfig.vue')['default']
ThirdSetting: typeof import('./src/components/Setting/old/ThirdSetting.vue')['default']
UniversalSetting: typeof import('./src/components/Setting/UniversalSetting.vue')['default']
UpdateApp: typeof import('./src/components/Modal/UpdateApp.vue')['default']
UpdatePlaylist: typeof import('./src/components/Modal/UpdatePlaylist.vue')['default']
User: typeof import('./src/components/Layout/User.vue')['default']
UserAgreement: typeof import('./src/components/Modal/UserAgreement.vue')['default']
VirtualScroll: typeof import('./src/components/UI/VirtualScroll.vue')['default']
WebsocketConfig: typeof import('./src/components/Setting/components/WebsocketConfig.vue')['default']
}
}
6 changes: 3 additions & 3 deletions electron/main/ipc/ipc-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ const initStoreIpc = (): void => {
if (filePaths && filePaths.length > 0) {
console.log("[IPC] Importing from:", filePaths[0]);
const fileContent = await readFile(filePaths[0], "utf-8");

let settings;
try {
settings = JSON.parse(fileContent);
} catch (e) {
} catch {
return { success: false, error: "invalid_json" };
}

// 基础结构验证
if (!settings || typeof settings !== "object") {
return { success: false, error: "invalid_format" };
return { success: false, error: "invalid_format" };
}

// 恢复 Electron Store 配置
Expand Down
95 changes: 48 additions & 47 deletions native/external-media-integration/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* auto-generated by NAPI-RS */
/* eslint-disable */
/** 关闭 Discord RPC */
export declare function disableDiscordRpc(): void;
export declare function disableDiscordRpc(): void

/**
* 禁用媒体控件
Expand All @@ -10,7 +10,7 @@ export declare function disableDiscordRpc(): void;
*
* 会在调用 API 失败时抛出错误
*/
export declare function disableSystemMedia(): void;
export declare function disableSystemMedia(): void

/** Discord 配置参数 */
export interface DiscordConfigPayload {
Expand All @@ -19,23 +19,22 @@ export interface DiscordConfigPayload {
*
* 注意暂停时进度会固定为 0
*/
showWhenPaused: boolean;
showWhenPaused: boolean
/** 显示模式,参考 [`DiscordDisplayMode`] */
displayMode?: DiscordDisplayMode;
displayMode?: DiscordDisplayMode
}

/**
* Discord 显示模式枚举
*
* 不打开详细信息面板时,在用户名下方显示的小字
*/
export type DiscordDisplayMode =
/** Listening to SPlayer */
| "Name"
/** Listening to Rick Astley */
| "State"
/** Listening to Never Gonna Give You Up */
| "Details";
export type DiscordDisplayMode = /** Listening to SPlayer */
'Name'|
/** Listening to Rick Astley */
'State'|
/** Listening to Never Gonna Give You Up */
'Details';

/**
* 启用 Discord RPC
Expand All @@ -44,7 +43,7 @@ export type DiscordDisplayMode =
*
* 启用后会立刻尝试连接,如果 Discord 未启动,或因为其他未知原因连接失败,会每 5 秒尝试连接一次
*/
export declare function enableDiscordRpc(): void;
export declare function enableDiscordRpc(): void

/**
* 启用媒体控件
Expand All @@ -53,7 +52,7 @@ export declare function enableDiscordRpc(): void;
*
* 会在调用 API 失败时抛出错误
*/
export declare function enableSystemMedia(): void;
export declare function enableSystemMedia(): void

/**
* 初始化插件
Expand All @@ -70,20 +69,20 @@ export declare function enableSystemMedia(): void;
*
* 如果其他 API 调用失败,则只会打印日志并静默失败
*/
export declare function initialize(logDir: string): void;
export declare function initialize(logDir: string): void

export interface MetadataParam {
songName: string;
authorName: string;
albumName: string;
songName: string
authorName: string
albumName: string
/** 封面的原始字节数据,适用于除 Discord RPC 之外的其他平台 */
coverData?: Buffer;
coverData?: Buffer
/**
* 封面的 HTTP URL,更新 Discord RPC 时必传,其他平台可不传
*
* Linux 平台在没有提供 `cover_data` 时会使用它
*/
originalCoverUrl?: string;
originalCoverUrl?: string
/**
* 网易云音乐中对应的曲目 ID
*
Expand All @@ -92,25 +91,26 @@ export interface MetadataParam {
* - 生成 Discord RPC 的按钮链接
* - MacOS 和 Linux 会使用此值来填充唯一的曲目 ID
*/
ncmId?: number;
ncmId?: number
/**
* 当前歌曲时长,单位是毫秒
*
* 用于 Linux、MacOS、Discord RPC 的元数据更新。Windows 使用 [`TimelinePayload`] 的
* `total_time` 字段。
*/
duration?: number;
duration?: number
}

export type PlaybackStatus = "Playing" | "Paused";
export type PlaybackStatus = 'Playing'|
'Paused';

export interface PlayModePayload {
isShuffling: boolean;
repeatMode: RepeatMode;
isShuffling: boolean
repeatMode: RepeatMode
}

export interface PlayStatePayload {
status: PlaybackStatus;
status: PlaybackStatus
}

/**
Expand All @@ -124,34 +124,35 @@ export interface PlayStatePayload {
*
* 如果 N-API 创建线程安全函数失败,会抛出错误。通常不应该发生,除非 JS 环境已经销毁了
*/
export declare function registerEventHandler(callback: (arg: SystemMediaEvent) => void): void;
export declare function registerEventHandler(callback: (arg: SystemMediaEvent) => void): void

export type RepeatMode = "None" | "Track" | "List";
export type RepeatMode = 'None'|
'Track'|
'List';

/** 关闭插件,清理资源 */
export declare function shutdown(): void;
export declare function shutdown(): void

export interface SystemMediaEvent {
type: SystemMediaEventType;
positionMs?: number;
type: SystemMediaEventType
positionMs?: number
}

export type SystemMediaEventType =
| "Play"
| "Pause"
| "Stop"
| "NextSong"
| "PreviousSong"
| "ToggleShuffle"
| "ToggleRepeat"
/** 绝对位置,毫秒 */
| "Seek";
export type SystemMediaEventType = 'Play'|
'Pause'|
'Stop'|
'NextSong'|
'PreviousSong'|
'ToggleShuffle'|
'ToggleRepeat'|
/** 绝对位置,毫秒 */
'Seek';

export interface TimelinePayload {
/** 单位是毫秒 */
currentTime: number;
currentTime: number
/** 单位是毫秒 */
totalTime: number;
totalTime: number
}

/**
Expand All @@ -162,7 +163,7 @@ export interface TimelinePayload {
* * `payload` - 配置信息,可以配置是否在暂停后也显示 Discord Activity 和 状态显示风格。详情请查看
* [`DiscordConfigPayload`]
*/
export declare function updateDiscordConfig(payload: DiscordConfigPayload): void;
export declare function updateDiscordConfig(payload: DiscordConfigPayload): void

/**
* 更新歌曲元数据
Expand All @@ -173,7 +174,7 @@ export declare function updateDiscordConfig(payload: DiscordConfigPayload): void
*
* 更新 Discord RPC 的元数据时,必须提供 `original_cover_url`
*/
export declare function updateMetadata(payload: MetadataParam): void;
export declare function updateMetadata(payload: MetadataParam): void

/**
* 更新播放模式
Expand All @@ -182,14 +183,14 @@ export declare function updateMetadata(payload: MetadataParam): void;
*
* 只会更新媒体控件的信息,不会更新 Discord RPC 上的信息
*/
export declare function updatePlayMode(payload: PlayModePayload): void;
export declare function updatePlayMode(payload: PlayModePayload): void

/**
* 更新播放状态 (播放/暂停)
*
* 同时也会更新 Discord 的播放状态 (如果启用了 Discord RPC)
*/
export declare function updatePlayState(payload: PlayStatePayload): void;
export declare function updatePlayState(payload: PlayStatePayload): void

/**
* 更新进度信息
Expand All @@ -200,4 +201,4 @@ export declare function updatePlayState(payload: PlayStatePayload): void;
*
* Discord RPC 实现的进度更新有节流,调用此函数无需担心 Discord RPC 的速率限制
*/
export declare function updateTimeline(payload: TimelinePayload): void;
export declare function updateTimeline(payload: TimelinePayload): void
6 changes: 5 additions & 1 deletion src/components/Card/SongListCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<SvgIcon :size="36" name="Play" class="play" />
</div>
<!-- 信息 -->
<div v-if="size === 'small'" class="info">
<div v-if="size === 'small'" class="info" :class="{ center: hiddenCover }">
<n-text v-if="typeof title === 'string'" class="name text-hidden">
{{ title }}
</n-text>
Expand Down Expand Up @@ -127,6 +127,10 @@ const songList = computed(() => sampleSize(props.data, 3));
display: flex;
flex-direction: column;
justify-content: space-evenly;
&.center {
align-items: center;
text-align: center;
}
.name {
font-size: 18px;
font-weight: bold;
Expand Down
Loading