mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-08-28 19:47:49 +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) {
|
||||
$toast.error(props.plugin?.system_version_message || t('plugin.incompatibleSystemVersion'))
|
||||
return
|
||||
@@ -338,6 +338,7 @@ async function updatePlugin(releaseVersion?: string) {
|
||||
params: {
|
||||
release_version: releaseVersion,
|
||||
force: true,
|
||||
...(repoUrl ? { repo_url: repoUrl } : {}),
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -189,6 +189,7 @@ describe('PluginCard lifecycle actions', () => {
|
||||
params: {
|
||||
force: true,
|
||||
release_version: '0.9.0',
|
||||
repo_url: 'https://github.com/example/releases',
|
||||
},
|
||||
})
|
||||
expect(mocks.confirm).toHaveBeenCalledWith(expect.objectContaining({ content: expect.stringContaining('v0.9.0') }))
|
||||
|
||||
@@ -369,6 +369,7 @@ async function installPlugin(releaseVersion?: string, repoUrl?: string) {
|
||||
params: {
|
||||
release_version: releaseVersion,
|
||||
force: isInstalled.value || props.plugin?.has_update || Boolean(releaseVersion),
|
||||
...(selectedRepoUrl ? { repo_url: selectedRepoUrl } : {}),
|
||||
},
|
||||
feedback: 'silent',
|
||||
})
|
||||
|
||||
@@ -655,6 +655,7 @@ describe('PluginMarketDetailDialog', () => {
|
||||
params: {
|
||||
force: true,
|
||||
release_version: undefined,
|
||||
repo_url: 'https://github.com/example/releases',
|
||||
},
|
||||
})
|
||||
expect(mocks.toastSuccess).toHaveBeenCalledWith('插件 演示插件 更新成功!')
|
||||
|
||||
Reference in New Issue
Block a user