Skip to content

Commit c9f4fdb

Browse files
authored
Merge pull request #450 from baozaodetudou/v2
2 parents 11d11b8 + d21f461 commit c9f4fdb

5 files changed

Lines changed: 39 additions & 7 deletions

File tree

src/components/cards/MediaServerCard.vue

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,12 @@ function openMediaServerInfoDialog() {
8585
mediaServerInfo.value = cloneDeep(props.mediaserver)
8686
if (mediaServerInfo.value.type === 'ugreen') {
8787
mediaServerInfo.value.config = mediaServerInfo.value.config || {}
88-
}
89-
if (mediaServerInfo.value.type === 'ugreen' && !mediaServerInfo.value.config.scan_mode) {
90-
mediaServerInfo.value.config.scan_mode = 'supplement_missing'
88+
if (!mediaServerInfo.value.config.scan_mode) {
89+
mediaServerInfo.value.config.scan_mode = 'supplement_missing'
90+
}
91+
if (mediaServerInfo.value.config.verify_ssl === undefined) {
92+
mediaServerInfo.value.config.verify_ssl = true
93+
}
9194
}
9295
mediaServerInfoDialog.value = true
9396
if (!props.mediaserver.sync_libraries) {
@@ -516,6 +519,16 @@ onMounted(() => {
516519
prepend-inner-icon="mdi-radar"
517520
/>
518521
</VCol>
522+
<VCol cols="12" md="6">
523+
<VSwitch
524+
v-model="mediaServerInfo.config.verify_ssl"
525+
:label="t('mediaserver.verifySsl')"
526+
:hint="t('mediaserver.verifySslHint')"
527+
persistent-hint
528+
color="primary"
529+
inset
530+
/>
531+
</VCol>
519532
</VRow>
520533
<VRow v-else-if="mediaServerInfo.type == 'plex'">
521534
<VCol cols="12" md="6">

src/locales/en-US.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2858,6 +2858,8 @@ export default {
28582858
syncLibrariesHint: 'Only selected libraries will be synchronized',
28592859
scanMode: 'Scan Mode',
28602860
scanModeHint: 'Applies to full-library and targeted refresh: New & Modified / Supplement Missing / Full Override',
2861+
verifySsl: 'Verify SSL Certificate',
2862+
verifySslHint: 'When enabled, HTTPS certificates are verified; disable for self-signed certificates',
28612863
scanModeOptions: {
28622864
newAndModified: 'New & Modified',
28632865
supplementMissing: 'Supplement Missing',

src/locales/zh-CN.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2821,6 +2821,8 @@ export default {
28212821
syncLibrariesHint: '只有选中的媒体库才会被同步',
28222822
scanMode: '扫描模式',
28232823
scanModeHint: '用于全库刷新和按库刷新:新添加和修改 / 补充缺失 / 覆盖扫描',
2824+
verifySsl: '校验 SSL 证书',
2825+
verifySslHint: '开启后会校验 HTTPS 证书;如使用自签名证书可关闭',
28242826
scanModeOptions: {
28252827
newAndModified: '新添加和修改',
28262828
supplementMissing: '补充缺失',

src/locales/zh-TW.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2827,6 +2827,8 @@ export default {
28272827
syncLibrariesHint: '只有選中的媒體庫才會被同步',
28282828
scanMode: '掃描模式',
28292829
scanModeHint: '用於全庫刷新和按庫刷新:新添加和修改 / 補充缺失 / 覆蓋掃描',
2830+
verifySsl: '校驗 SSL 憑證',
2831+
verifySslHint: '開啟後會校驗 HTTPS 憑證;如使用自簽憑證可關閉',
28302832
scanModeOptions: {
28312833
newAndModified: '新添加和修改',
28322834
supplementMissing: '補充缺失',

src/views/setup/MediaServerSettingsStep.vue

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ const ugreenScanModeOptions = computed(() => [
2121
{ title: t('mediaserver.scanModeOptions.fullOverride'), value: 'full_override' },
2222
])
2323
24-
function ensureUgreenScanMode() {
24+
function ensureUgreenConfig() {
2525
if (wizardData.value.mediaServer.type !== 'ugreen') return
2626
wizardData.value.mediaServer.config = wizardData.value.mediaServer.config || {}
2727
if (!wizardData.value.mediaServer.config.scan_mode) {
2828
wizardData.value.mediaServer.config.scan_mode = 'supplement_missing'
2929
}
30+
if (wizardData.value.mediaServer.config.verify_ssl === undefined) {
31+
wizardData.value.mediaServer.config.verify_ssl = true
32+
}
3033
}
3134
3235
// 调用API查询媒体库
@@ -56,7 +59,7 @@ async function loadLibrary(server: string) {
5659
// 选择媒体服务器并自动加载媒体库
5760
async function selectMediaServerWithLibrary(type: string) {
5861
selectMediaServer(type)
59-
ensureUgreenScanMode()
62+
ensureUgreenConfig()
6063
// 如果选择了媒体服务器类型,自动加载媒体库
6164
if (type && wizardData.value.mediaServer.name) {
6265
await loadLibrary(wizardData.value.mediaServer.name)
@@ -65,7 +68,7 @@ async function selectMediaServerWithLibrary(type: string) {
6568
6669
// 组件挂载时检查是否需要加载媒体库
6770
onMounted(async () => {
68-
ensureUgreenScanMode()
71+
ensureUgreenConfig()
6972
// 如果已经有媒体服务器配置,自动加载媒体库
7073
if (wizardData.value.mediaServer.type && wizardData.value.mediaServer.name) {
7174
await loadLibrary(wizardData.value.mediaServer.name)
@@ -76,7 +79,7 @@ onMounted(async () => {
7679
watch(
7780
() => [wizardData.value.mediaServer.type, wizardData.value.mediaServer.name],
7881
async ([type, name]) => {
79-
ensureUgreenScanMode()
82+
ensureUgreenConfig()
8083
console.log('Media server changed:', { type, name })
8184
if (type && name) {
8285
await loadLibrary(name)
@@ -500,6 +503,16 @@ watch(
500503
prepend-inner-icon="mdi-radar"
501504
/>
502505
</VCol>
506+
<VCol cols="12" md="6">
507+
<VSwitch
508+
v-model="wizardData.mediaServer.config.verify_ssl"
509+
:label="t('mediaserver.verifySsl')"
510+
:hint="t('mediaserver.verifySslHint')"
511+
persistent-hint
512+
color="primary"
513+
inset
514+
/>
515+
</VCol>
503516
</VRow>
504517
<VRow v-else-if="wizardData.mediaServer.type === 'plex'">
505518
<VCol cols="12" md="6">

0 commit comments

Comments
 (0)