mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 16:16:42 +08:00
fix(plugin): retain bound source during updates (#726)
This commit is contained in:
@@ -307,7 +307,7 @@ async function resetPlugin() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 更新插件
|
// 更新插件
|
||||||
async function updatePlugin(releaseVersion?: string) {
|
async function updatePlugin(releaseVersion?: string, repoUrl?: string) {
|
||||||
if (!releaseVersion && props.plugin?.system_version_compatible === false) {
|
if (!releaseVersion && props.plugin?.system_version_compatible === false) {
|
||||||
$toast.error(props.plugin?.system_version_message || t('plugin.incompatibleSystemVersion'))
|
$toast.error(props.plugin?.system_version_message || t('plugin.incompatibleSystemVersion'))
|
||||||
return
|
return
|
||||||
@@ -338,6 +338,7 @@ async function updatePlugin(releaseVersion?: string) {
|
|||||||
params: {
|
params: {
|
||||||
release_version: releaseVersion,
|
release_version: releaseVersion,
|
||||||
force: true,
|
force: true,
|
||||||
|
...(repoUrl ? { repo_url: repoUrl } : {}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -189,6 +189,7 @@ describe('PluginCard lifecycle actions', () => {
|
|||||||
params: {
|
params: {
|
||||||
force: true,
|
force: true,
|
||||||
release_version: '0.9.0',
|
release_version: '0.9.0',
|
||||||
|
repo_url: 'https://github.com/example/releases',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
expect(mocks.confirm).toHaveBeenCalledWith(expect.objectContaining({ content: expect.stringContaining('v0.9.0') }))
|
expect(mocks.confirm).toHaveBeenCalledWith(expect.objectContaining({ content: expect.stringContaining('v0.9.0') }))
|
||||||
|
|||||||
@@ -369,6 +369,7 @@ async function installPlugin(releaseVersion?: string, repoUrl?: string) {
|
|||||||
params: {
|
params: {
|
||||||
release_version: releaseVersion,
|
release_version: releaseVersion,
|
||||||
force: isInstalled.value || props.plugin?.has_update || Boolean(releaseVersion),
|
force: isInstalled.value || props.plugin?.has_update || Boolean(releaseVersion),
|
||||||
|
...(selectedRepoUrl ? { repo_url: selectedRepoUrl } : {}),
|
||||||
},
|
},
|
||||||
feedback: 'silent',
|
feedback: 'silent',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -655,6 +655,7 @@ describe('PluginMarketDetailDialog', () => {
|
|||||||
params: {
|
params: {
|
||||||
force: true,
|
force: true,
|
||||||
release_version: undefined,
|
release_version: undefined,
|
||||||
|
repo_url: 'https://github.com/example/releases',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
expect(mocks.toastSuccess).toHaveBeenCalledWith('插件 演示插件 更新成功!')
|
expect(mocks.toastSuccess).toHaveBeenCalledWith('插件 演示插件 更新成功!')
|
||||||
|
|||||||
Reference in New Issue
Block a user