Skip to content

Commit 152dcc4

Browse files
committed
✨ feat: 更换为 DB 默认地址
1 parent e14b7d9 commit 152dcc4

5 files changed

Lines changed: 20 additions & 32 deletions

File tree

electron/main/utils/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export const port = Number(import.meta.env["VITE_SERVER_PORT"] || 25884);
3636
* 默认 AMLL TTML DB Server
3737
* @returns string
3838
*/
39-
export const defaultAMLLDbServer = "https://amlldb.bikonoo.com/ncm-lyrics/%s.ttml";
39+
export const defaultAMLLDbServer =
40+
"https://raw.githubusercontent.com/Steve-xmh/amll-ttml-db/refs/heads/main/ncm-lyrics/%s.ttml";
4041

4142
/**
4243
* 主窗口加载地址

electron/server/netease/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { FastifyInstance, FastifyRequest, FastifyReply } from "fastify";
22
import { pathCase } from "change-case";
33
import { serverLog } from "../../main/logger";
44
import { useStore } from "../../main/store";
5-
import NeteaseCloudMusicApi from "@neteasecloudmusicapienhanced/api";
65
import { defaultAMLLDbServer } from "../../main/utils/config";
6+
import NeteaseCloudMusicApi from "@neteasecloudmusicapienhanced/api";
77

88
// 获取数据
99
const getHandler = (name: string, neteaseApi: (params: any) => any) => {

src/components/Modal/AMLLServer.vue

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
placeholder="请输入 AMLL TTML DB 地址"
1616
/>
1717

18-
<n-collapse class="servers-collapse">
18+
<n-text depth="3">
19+
更多信息可前往
20+
<n-a @click="openLink('https://github.com/Steve-xmh/amll-ttml-db')"> AMLL TTML DB </n-a>
21+
仓库查看
22+
</n-text>
23+
24+
<!-- <n-collapse class="servers-collapse">
1925
<n-collapse-item title="推荐服务器" name="servers">
2026
<n-flex vertical size="medium">
2127
<n-card
@@ -33,7 +39,7 @@
3339
</n-card>
3440
</n-flex>
3541
</n-collapse-item>
36-
</n-collapse>
42+
</n-collapse> -->
3743

3844
<n-flex justify="end">
3945
<n-button @click="props.onClose()">取消</n-button>
@@ -45,8 +51,9 @@
4551
<script setup lang="ts">
4652
import { ref, watch } from "vue";
4753
import { isValidURL } from "@/utils/validate";
48-
import { amllDbServers } from "@/utils/meta";
54+
// import { amllDbServers } from "@/utils/meta";
4955
import { useSettingStore } from "@/stores";
56+
import { openLink } from "@/utils/helper";
5057
5158
const props = defineProps<{ onClose: () => void }>();
5259
@@ -58,15 +65,6 @@ const noSideSpace = (value: string) => value.trim() === value;
5865
5966
const isValidServer = (url: string) => isValidURL(url) && url.includes("%s");
6067
61-
/**
62-
* 渲染高亮
63-
* @param text 文本
64-
* @returns 高亮文本
65-
*/
66-
const renderHighlight = (text: string): string => {
67-
return text.replace("%s", "<span class='replace-part'>%s</span>");
68-
};
69-
7068
// 点击确认
7169
const handleConfirm = async () => {
7270
const url = serverUrl.value;
@@ -85,18 +83,6 @@ const handleConfirm = async () => {
8583
watch(serverUrl, (url: string) => {
8684
inputStatus.value = isValidServer(url) ? "success" : "error";
8785
});
88-
89-
/**
90-
* 选择服务器
91-
* @param url 服务器 URL
92-
*/
93-
const selectServer = (url: string) => {
94-
serverUrl.value = url;
95-
inputStatus.value = "success";
96-
useTimeoutFn(() => {
97-
inputStatus.value = isValidServer(url) ? "success" : "error";
98-
}, 300);
99-
};
10086
</script>
10187

10288
<style scoped lang="scss">

src/stores/migrations/settingMigrations.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { defaultAMLLDbServer } from "@/utils/meta";
44
/**
55
* 当前设置 Schema 版本号
66
*/
7-
export const CURRENT_SETTING_SCHEMA_VERSION = 1;
7+
export const CURRENT_SETTING_SCHEMA_VERSION = 2;
88

99
/**
1010
* 迁移函数类型
@@ -19,12 +19,13 @@ export type MigrationFunction = (state: Partial<SettingState>) => Partial<Settin
1919
*/
2020
export const settingMigrations: Record<number, MigrationFunction> = {
2121
/**
22-
* 迁移到版本 1
22+
* 迁移到版本 2
2323
*/
24-
1: () => {
24+
2: () => {
2525
return {
26-
schemaVersion: 1,
27-
// amllDbServer 同步为新的默认值
26+
schemaVersion: 2,
27+
// ttml 同步
28+
enableTTMLLyric: false,
2829
amllDbServer: defaultAMLLDbServer,
2930
};
3031
},

src/utils/meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,4 @@ export const amllDbServers = [
179179
* 感谢 HelloZGY 提供镜像源
180180
* @returns 默认 AMLL TTML DB Server
181181
*/
182-
export const defaultAMLLDbServer = amllDbServers[2].value;
182+
export const defaultAMLLDbServer = amllDbServers[0].value;

0 commit comments

Comments
 (0)