Skip to content

Commit

Permalink
🐛 修复导入重复的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Dec 14, 2022
1 parent 5d64aea commit 0ec4cc6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/app/service/synchronize/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ export default class SynchronizeManager extends Manager {
name: script.name,
// NOTE: tm会对同名的uuid校验,先屏蔽了
// uuid: script.uuid,
sc_uuid: script.uuid,
modified: script.updatetime,
file_url: script.downloadUrl,
subscribe_url: script.subscribeUrl,
Expand Down
7 changes: 4 additions & 3 deletions src/pages/import/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ function App() {
item.script = await prepareScriptByCode(
item.code,
item.options?.meta.file_url || "",
item.options?.meta.file_url
? undefined
: item.options?.meta.uuid || undefined
item.options?.meta.sc_uuid ||
item.options?.meta.uuid ||
undefined
);
} catch (e: any) {
item.error = e.toString();
Expand All @@ -80,6 +80,7 @@ function App() {
meta: {
name: item.script.name,
uuid: item.script.uuid,
sc_uuid: item.script.uuid,
file_url: item.script.downloadUrl || "",
modified: item.script.createtime,
subscribe_url: item.script.subscribeUrl,
Expand Down
3 changes: 2 additions & 1 deletion src/pkg/backup/struct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export type ScriptOptions = {

export type ScriptMeta = {
name: string;
uuid?: string;
uuid?: string; // tm会对同名的uuid校验,先屏蔽了
sc_uuid: string; // 脚本猫uuid
modified: number;
file_url: string;
subscribe_url?: string;
Expand Down

0 comments on commit 0ec4cc6

Please sign in to comment.