mirror of
https://github.com/imsyy/SPlayer.git
synced 2025-11-25 03:14:57 +08:00
🐞 fix: 修复文件导入
This commit is contained in:
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -51,7 +51,7 @@ jobs:
|
|||||||
}
|
}
|
||||||
# 构建 Electron App (x64)
|
# 构建 Electron App (x64)
|
||||||
- name: Build Electron App for Windows x64
|
- name: Build Electron App for Windows x64
|
||||||
run: pnpm run build:win || true
|
run: pnpm run build:win
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# 清理不必要的构建产物(保留 .exe 和 .blockmap 文件)
|
# 清理不必要的构建产物(保留 .exe 和 .blockmap 文件)
|
||||||
|
|||||||
@@ -68,9 +68,9 @@ import { songLevelData, getLevelsUpTo } from "@/utils/meta";
|
|||||||
import { formatSongsList } from "@/utils/format";
|
import { formatSongsList } from "@/utils/format";
|
||||||
import { cloneDeep, reduce } from "lodash-es";
|
import { cloneDeep, reduce } from "lodash-es";
|
||||||
import { formatFileSize, isElectron } from "@/utils/helper";
|
import { formatFileSize, isElectron } from "@/utils/helper";
|
||||||
|
import { getPlayerInfo } from "@/utils/player-utils/song";
|
||||||
import { openSetting } from "@/utils/modal";
|
import { openSetting } from "@/utils/modal";
|
||||||
import { saveAs } from "file-saver";
|
import { saveAs } from "file-saver";
|
||||||
import player from "@/utils/player";
|
|
||||||
|
|
||||||
const props = defineProps<{ id: number }>();
|
const props = defineProps<{ id: number }>();
|
||||||
const emit = defineEmits<{ close: [] }>();
|
const emit = defineEmits<{ close: [] }>();
|
||||||
@@ -156,7 +156,7 @@ const download = async () => {
|
|||||||
}
|
}
|
||||||
// 下载相关数据
|
// 下载相关数据
|
||||||
const { url, type = "mp3" } = result.data;
|
const { url, type = "mp3" } = result.data;
|
||||||
const songName = player.getPlayerInfo(songData.value) || "未知曲目";
|
const songName = getPlayerInfo(songData.value) || "未知曲目";
|
||||||
// 区分设备下载
|
// 区分设备下载
|
||||||
if (isElectron) {
|
if (isElectron) {
|
||||||
await electronDownload(url, songName, type.toLowerCase());
|
await electronDownload(url, songName, type.toLowerCase());
|
||||||
|
|||||||
@@ -279,9 +279,9 @@
|
|||||||
import type { SelectOption } from "naive-ui";
|
import type { SelectOption } from "naive-ui";
|
||||||
import { useDataStore, useMusicStore, useSettingStore, useStatusStore } from "@/stores";
|
import { useDataStore, useMusicStore, useSettingStore, useStatusStore } from "@/stores";
|
||||||
import { isDev, isElectron } from "@/utils/helper";
|
import { isDev, isElectron } from "@/utils/helper";
|
||||||
|
import { getCoverColor } from "@/utils/player-utils/song";
|
||||||
import { isEmpty } from "lodash-es";
|
import { isEmpty } from "lodash-es";
|
||||||
import themeColor from "@/assets/data/themeColor.json";
|
import themeColor from "@/assets/data/themeColor.json";
|
||||||
import player from "@/utils/player";
|
|
||||||
|
|
||||||
const dataStore = useDataStore();
|
const dataStore = useDataStore();
|
||||||
const musicStore = useMusicStore();
|
const musicStore = useMusicStore();
|
||||||
@@ -386,7 +386,7 @@ const modeChange = (val: boolean) => {
|
|||||||
|
|
||||||
// 全局着色更改
|
// 全局着色更改
|
||||||
const themeGlobalColorChange = (val: boolean) => {
|
const themeGlobalColorChange = (val: boolean) => {
|
||||||
if (val) player.getCoverColor(musicStore.songCover);
|
if (val) getCoverColor(musicStore.songCover);
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -179,15 +179,11 @@
|
|||||||
class="set"
|
class="set"
|
||||||
/>
|
/>
|
||||||
</n-card>
|
</n-card>
|
||||||
<n-card class="set-item">
|
<n-card v-if="isElectron" class="set-item">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
<n-text class="name">音乐频谱</n-text>
|
<n-text class="name">音乐频谱</n-text>
|
||||||
<n-text class="tip" :depth="3">
|
<n-text class="tip" :depth="3">
|
||||||
{{
|
开启音乐频谱会影响性能或音频输出切换等功能,如遇问题请关闭
|
||||||
isElectron
|
|
||||||
? "开启音乐频谱会影响性能或音频输出切换等功能,如遇问题请关闭"
|
|
||||||
: "开启可能会造成无法播放或其他问题,如遇任何问题请关闭"
|
|
||||||
}}
|
|
||||||
</n-text>
|
</n-text>
|
||||||
</div>
|
</div>
|
||||||
<n-switch
|
<n-switch
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ export const useSettingStore = defineStore("setting", {
|
|||||||
playerBackgroundType: "blur",
|
playerBackgroundType: "blur",
|
||||||
memoryLastSeek: true,
|
memoryLastSeek: true,
|
||||||
showPlaylistCount: true,
|
showPlaylistCount: true,
|
||||||
showSpectrums: true,
|
showSpectrums: false,
|
||||||
smtcOpen: true,
|
smtcOpen: true,
|
||||||
smtcOutputHighQualityCover: false,
|
smtcOutputHighQualityCover: false,
|
||||||
playSongDemo: false,
|
playSongDemo: false,
|
||||||
|
|||||||
@@ -1070,7 +1070,7 @@ class Player {
|
|||||||
*/
|
*/
|
||||||
initSpectrumData() {
|
initSpectrumData() {
|
||||||
try {
|
try {
|
||||||
if (this.audioContext) return;
|
if (this.audioContext || !isElectron) return;
|
||||||
// AudioContext
|
// AudioContext
|
||||||
this.audioContext = new (window.AudioContext || (window as any).webkitAudioContext)();
|
this.audioContext = new (window.AudioContext || (window as any).webkitAudioContext)();
|
||||||
// 获取音频元素
|
// 获取音频元素
|
||||||
|
|||||||
Reference in New Issue
Block a user