🐞 fix: fix some bugs #275

This commit is contained in:
imsyy
2024-10-18 15:50:24 +08:00
parent 18113d94e9
commit 2b8eb93404
15 changed files with 298 additions and 312 deletions

View File

@@ -6,13 +6,13 @@ on:
push:
tags:
- v*
workflow_dispatch:
jobs:
# Windows
build-windows:
name: Build for Windows
runs-on: windows-latest
timeout-minutes: 30
steps:
# 检出 Git 仓库
- name: Check out git repository
@@ -50,7 +50,6 @@ jobs:
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: false
files: dist/*.*
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
@@ -58,7 +57,6 @@ jobs:
build-macos:
name: Build for macOS
runs-on: macos-latest
timeout-minutes: 30
steps:
# 检出 Git 仓库
- name: Check out git repository
@@ -97,7 +95,6 @@ jobs:
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: false
files: dist/*.*
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
@@ -105,7 +102,6 @@ jobs:
build-linux:
name: Build for Linux
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
# 检出 Git 仓库
- name: Check out git repository
@@ -124,6 +120,11 @@ jobs:
sudo apt-get install --no-install-recommends -y rpm &&
sudo apt-get install --no-install-recommends -y libarchive-tools &&
sudo apt-get install --no-install-recommends -y libopenjp2-tools
# 安装 Snapcraft
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2
with:
snapcraft_token: ${{ secrets.SNAPCRAFT_TOKEN }}
# 复制环境变量文件
- name: Copy .env.example
run: |
@@ -141,6 +142,11 @@ jobs:
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# 上传 Snap 包到 Snapcraft 商店
- name: Publish Snap to Snap Store
run: snapcraft upload dist/*.snap --release stable
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
# 上传构建产物
- name: Upload Linux artifact
uses: actions/upload-artifact@v4
@@ -153,7 +159,6 @@ jobs:
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: false
files: dist/*.*
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

View File

@@ -117,6 +117,10 @@
[Dev Workflow](https://github.com/imsyy/SPlayer/actions/workflows/build.yml)
## Snap Store
[![Get it from the Snap Store](https://snapcraft.io/en/dark/install.svg)](https://snapcraft.io/splayer)
## ⚙️ Docker 部署
> 安装及配置 `Docker` 将不在此处说明,请自行解决

View File

@@ -93,6 +93,7 @@ linux:
- AppImage
- deb
- rpm
- snap
- tar.gz
# 维护者信息
maintainer: imsyy.top

View File

@@ -48,7 +48,7 @@
"@pixi/filter-color-matrix": "^7.4.2",
"@pixi/sprite": "^7.4.2",
"@vueuse/core": "^10.11.1",
"NeteaseCloudMusicApi": "^4.23.1",
"NeteaseCloudMusicApi": "^4.23.3",
"axios": "^1.7.7",
"change-case": "^5.4.4",
"dayjs": "^1.11.13",
@@ -64,12 +64,12 @@
"jss-preset-default": "^10.10.0",
"localforage": "^1.10.0",
"lodash-es": "^4.17.21",
"marked": "^14.1.2",
"marked": "^14.1.3",
"music-metadata": "7.14.0",
"pinia": "^2.2.4",
"pinia-plugin-persistedstate": "^3.2.3",
"plyr": "^3.7.8",
"vue-virt-list": "^1.5.2"
"vue-virt-list": "^1.5.3"
},
"devDependencies": {
"@electron-toolkit/preload": "^3.0.1",
@@ -82,14 +82,14 @@
"@types/file-saver": "^2.0.7",
"@types/howler": "^2.2.12",
"@types/js-cookie": "^3.0.6",
"@types/node": "^22.7.5",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.1",
"@types/node": "^22.7.6",
"@typescript-eslint/eslint-plugin": "^8.10.0",
"@typescript-eslint/parser": "^8.10.0",
"@vitejs/plugin-vue": "^5.1.4",
"ajv": "^8.17.1",
"crypto-js": "^4.2.0",
"electron": "^28.3.3",
"electron-builder": "^25.1.7",
"electron": "^31.7.1",
"electron-builder": "^25.1.8",
"electron-log": "^5.2.0",
"electron-vite": "^2.3.0",
"eslint": "^9.12.0",
@@ -99,12 +99,12 @@
"naive-ui": "^2.40.1",
"node-taglib-sharp": "^5.2.3",
"prettier": "^3.3.3",
"sass": "^1.79.5",
"terser": "^5.34.1",
"sass": "^1.80.2",
"terser": "^5.36.0",
"typescript": "^5.6.3",
"unplugin-auto-import": "^0.18.3",
"unplugin-vue-components": "^0.27.4",
"vite": "^5.4.8",
"vite": "^5.4.9",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-wasm": "^3.3.0",
"vue": "3.5.10",

498
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

BIN
public/icons/logo-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -98,7 +98,7 @@
<n-text class="ar"> {{ song.artists || "未知艺术家" }} </n-text>
</div>
<!-- 别名 -->
<n-text v-if="song.alia" class="alia" depth="3">{{ song.alia }}</n-text>
<n-text v-if="song.alia" class="alia text-hidden" depth="3">{{ song.alia }}</n-text>
</div>
</div>
<!-- 专辑 -->
@@ -204,10 +204,10 @@ const localCover = async (show: boolean) => {
border-radius: 12px;
border: 2px solid rgba(var(--primary), 0.12);
background-color: var(--surface-container-hex);
transition:
transform 0.1s,
background-color 0.3s var(--n-bezier),
border-color 0.3s var(--n-bezier);
// transition:
// transform 0.1s,
// background-color 0.3s var(--n-bezier),
// border-color 0.3s var(--n-bezier);
&.play {
border-color: rgba(var(--primary), 0.58);
background-color: rgba(var(--primary), 0.28);
@@ -253,6 +253,9 @@ const localCover = async (show: boolean) => {
transition:
opacity 0.3s,
transform 0.3s;
:deep(.svg-container) {
color: var(--primary-hex);
}
}
.status,
.play {

View File

@@ -281,9 +281,11 @@ onBeforeUnmount(() => {
<style lang="scss" scoped>
.song-list {
height: 100%;
border-radius: 12px 0 0 12px;
overflow: hidden;
.song-card {
padding-bottom: 12px;
padding-right: 4px;
// padding-right: 4px;
}
// 悬浮顶栏
.list-header {
@@ -293,8 +295,8 @@ onBeforeUnmount(() => {
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 8px 18px 8px 12px;
margin-right: 4px;
padding: 8px 12px;
// margin-right: 4px;
border: 1px solid transparent;
background-color: var(--background-hex);
.n-text {

View File

@@ -138,7 +138,7 @@ const instantLyrics = computed(() => {
const content = isYrc
? musicStore.songLyric.yrcData[statusStore.lyricIndex]
: musicStore.songLyric.lrcData[statusStore.lyricIndex];
return { content: content?.content, tran: content?.tran };
return { content: content?.content, tran: settingStore.showTran && content?.tran };
});
// 播放器主色

View File

@@ -67,9 +67,9 @@
</div>
</div>
<!-- 翻译 -->
<span v-if="item.tran" class="tran">{{ item.tran }}</span>
<span v-if="item.tran && settingStore.showTran" class="tran">{{ item.tran }}</span>
<!-- 音译 -->
<span v-if="item.roma" class="roma">{{ item.roma }}</span>
<span v-if="item.roma && settingStore.showRoma" class="roma">{{ item.roma }}</span>
<!-- 倒计时 -->
<div
v-if="
@@ -115,9 +115,9 @@
<!-- 歌词 -->
<span class="content">{{ item.content }}</span>
<!-- 翻译 -->
<span v-if="item.tran" class="tran">{{ item.tran }}</span>
<span v-if="item.tran && settingStore.showTran" class="tran">{{ item.tran }}</span>
<!-- 音译 -->
<span v-if="item.roma" class="roma">{{ item.roma }}</span>
<span v-if="item.roma && settingStore.showRoma" class="roma">{{ item.roma }}</span>
</div>
<div class="placeholder" />
</template>

View File

@@ -344,7 +344,9 @@ const instantLyrics = computed(() => {
const content = isYrc
? musicStore.songLyric.yrcData[statusStore.lyricIndex]
: musicStore.songLyric.lrcData[statusStore.lyricIndex];
return content?.tran ? `${content?.content} ${content?.tran} ` : content?.content;
return content?.tran && settingStore.showTran
? `${content?.content} ${content?.tran} `
: content?.content;
});
// 音量条鼠标滚动
@@ -553,6 +555,8 @@ const changeVolume = (e: WheelEvent) => {
font-size: 12px;
margin-right: 8px;
.n-text {
color: var(--primary-hex);
opacity: 0.8;
&:nth-of-type(1) {
&::after {
content: "/";
@@ -573,6 +577,7 @@ const changeVolume = (e: WheelEvent) => {
cursor: pointer;
.n-icon {
font-size: 22px;
color: var(--primary-hex);
}
&:hover {
transform: scale(1.1);

View File

@@ -195,6 +195,7 @@ onMounted(player.initPersonalFM);
--n-width: 46px;
--n-height: 46px;
.n-icon {
color: var(--primary-hex);
transition: opacity 0.1s ease-in-out;
}
}
@@ -205,6 +206,7 @@ onMounted(player.initPersonalFM);
width: 38px;
height: 38px;
border-radius: 50%;
color: var(--primary-hex);
transition:
background-color 0.3s,
transform 0.3s;

View File

@@ -1,6 +1,6 @@
import type { SongType, CoverType, ArtistType, CommentType, MetaData, CatType } from "@/types/main";
import { msToTime } from "./time";
import { isArray } from "lodash-es";
import { flatMap, isArray, uniqBy } from "lodash-es";
type CoverDataType = {
cover: string;
@@ -81,7 +81,10 @@ export const formatCoverList = (data: any[]): CoverType[] => {
const creator = isArray(item.creator) ? item.creator[0] : item.creator;
// 获取歌手信息
const artists = (): string | MetaData[] => {
const artistData = [item.artist, item.artists, item.ar].flat().filter(Boolean);
const artistData = uniqBy(
flatMap([item.artist, item.artists, item.ar]).filter(Boolean),
"id",
);
if (artistData.length === 0) return "";
return artistData.map((artist) => ({
id: artist?.id,

View File

@@ -1028,8 +1028,12 @@ class Player {
window.$message.success("已退出心动模式");
return;
}
if (!isLogin()) {
openUserLogin(true);
if (isLogin() !== 1) {
if (isLogin() === 0) {
openUserLogin(true);
} else {
window.$message.warning("该登录模式暂不支持该操作");
}
return;
}
if (statusStore.playHeartbeatMode) {

View File

@@ -49,7 +49,11 @@
<n-flex class="meta">
<div class="item">
<SvgIcon name="Person" :depth="3" />
<div v-if="Array.isArray(albumDetailData.artists)" class="artists text-hidden">
<div
v-if="Array.isArray(albumDetailData.artists)"
class="artists text-hidden"
@click="openJumpArtist(albumDetailData.artists)"
>
<n-text
v-for="(ar, arIndex) in albumDetailData.artists"
:key="arIndex"
@@ -58,7 +62,11 @@
{{ ar.name || "未知艺术家" }}
</n-text>
</div>
<div v-else class="artists text-hidden">
<div
v-else
class="artists text-hidden"
@click="openJumpArtist(albumDetailData.artists || '')"
>
<n-text class="ar"> {{ albumDetailData.artists || "未知艺术家" }} </n-text>
</div>
</div>
@@ -169,6 +177,7 @@ import { renderToolbar } from "@/utils/meta";
import { useDataStore, useStatusStore } from "@/stores";
import { debounce } from "lodash-es";
import { formatTimestamp } from "@/utils/time";
import { openJumpArtist } from "@/utils/modal";
import player from "@/utils/player";
const router = useRouter();