Merge pull request #450 from baozaodetudou/v2

This commit is contained in:
jxxghp
2026-03-01 08:08:35 +08:00
committed by GitHub
5 changed files with 39 additions and 7 deletions

View File

@@ -85,9 +85,12 @@ function openMediaServerInfoDialog() {
mediaServerInfo.value = cloneDeep(props.mediaserver)
if (mediaServerInfo.value.type === 'ugreen') {
mediaServerInfo.value.config = mediaServerInfo.value.config || {}
}
if (mediaServerInfo.value.type === 'ugreen' && !mediaServerInfo.value.config.scan_mode) {
mediaServerInfo.value.config.scan_mode = 'supplement_missing'
if (!mediaServerInfo.value.config.scan_mode) {
mediaServerInfo.value.config.scan_mode = 'supplement_missing'
}
if (mediaServerInfo.value.config.verify_ssl === undefined) {
mediaServerInfo.value.config.verify_ssl = true
}
}
mediaServerInfoDialog.value = true
if (!props.mediaserver.sync_libraries) {
@@ -516,6 +519,16 @@ onMounted(() => {
prepend-inner-icon="mdi-radar"
/>
</VCol>
<VCol cols="12" md="6">
<VSwitch
v-model="mediaServerInfo.config.verify_ssl"
:label="t('mediaserver.verifySsl')"
:hint="t('mediaserver.verifySslHint')"
persistent-hint
color="primary"
inset
/>
</VCol>
</VRow>
<VRow v-else-if="mediaServerInfo.type == 'plex'">
<VCol cols="12" md="6">

View File

@@ -2858,6 +2858,8 @@ export default {
syncLibrariesHint: 'Only selected libraries will be synchronized',
scanMode: 'Scan Mode',
scanModeHint: 'Applies to full-library and targeted refresh: New & Modified / Supplement Missing / Full Override',
verifySsl: 'Verify SSL Certificate',
verifySslHint: 'When enabled, HTTPS certificates are verified; disable for self-signed certificates',
scanModeOptions: {
newAndModified: 'New & Modified',
supplementMissing: 'Supplement Missing',

View File

@@ -2821,6 +2821,8 @@ export default {
syncLibrariesHint: '只有选中的媒体库才会被同步',
scanMode: '扫描模式',
scanModeHint: '用于全库刷新和按库刷新:新添加和修改 / 补充缺失 / 覆盖扫描',
verifySsl: '校验 SSL 证书',
verifySslHint: '开启后会校验 HTTPS 证书;如使用自签名证书可关闭',
scanModeOptions: {
newAndModified: '新添加和修改',
supplementMissing: '补充缺失',

View File

@@ -2827,6 +2827,8 @@ export default {
syncLibrariesHint: '只有選中的媒體庫才會被同步',
scanMode: '掃描模式',
scanModeHint: '用於全庫刷新和按庫刷新:新添加和修改 / 補充缺失 / 覆蓋掃描',
verifySsl: '校驗 SSL 憑證',
verifySslHint: '開啟後會校驗 HTTPS 憑證;如使用自簽憑證可關閉',
scanModeOptions: {
newAndModified: '新添加和修改',
supplementMissing: '補充缺失',

View File

@@ -21,12 +21,15 @@ const ugreenScanModeOptions = computed(() => [
{ title: t('mediaserver.scanModeOptions.fullOverride'), value: 'full_override' },
])
function ensureUgreenScanMode() {
function ensureUgreenConfig() {
if (wizardData.value.mediaServer.type !== 'ugreen') return
wizardData.value.mediaServer.config = wizardData.value.mediaServer.config || {}
if (!wizardData.value.mediaServer.config.scan_mode) {
wizardData.value.mediaServer.config.scan_mode = 'supplement_missing'
}
if (wizardData.value.mediaServer.config.verify_ssl === undefined) {
wizardData.value.mediaServer.config.verify_ssl = true
}
}
// 调用API查询媒体库
@@ -56,7 +59,7 @@ async function loadLibrary(server: string) {
// 选择媒体服务器并自动加载媒体库
async function selectMediaServerWithLibrary(type: string) {
selectMediaServer(type)
ensureUgreenScanMode()
ensureUgreenConfig()
// 如果选择了媒体服务器类型,自动加载媒体库
if (type && wizardData.value.mediaServer.name) {
await loadLibrary(wizardData.value.mediaServer.name)
@@ -65,7 +68,7 @@ async function selectMediaServerWithLibrary(type: string) {
// 组件挂载时检查是否需要加载媒体库
onMounted(async () => {
ensureUgreenScanMode()
ensureUgreenConfig()
// 如果已经有媒体服务器配置,自动加载媒体库
if (wizardData.value.mediaServer.type && wizardData.value.mediaServer.name) {
await loadLibrary(wizardData.value.mediaServer.name)
@@ -76,7 +79,7 @@ onMounted(async () => {
watch(
() => [wizardData.value.mediaServer.type, wizardData.value.mediaServer.name],
async ([type, name]) => {
ensureUgreenScanMode()
ensureUgreenConfig()
console.log('Media server changed:', { type, name })
if (type && name) {
await loadLibrary(name)
@@ -500,6 +503,16 @@ watch(
prepend-inner-icon="mdi-radar"
/>
</VCol>
<VCol cols="12" md="6">
<VSwitch
v-model="wizardData.mediaServer.config.verify_ssl"
:label="t('mediaserver.verifySsl')"
:hint="t('mediaserver.verifySslHint')"
persistent-hint
color="primary"
inset
/>
</VCol>
</VRow>
<VRow v-else-if="wizardData.mediaServer.type === 'plex'">
<VCol cols="12" md="6">