From 29483abc62232ff38b725e28ceb59a2d2390ecc2 Mon Sep 17 00:00:00 2001 From: "Petrus.Z" Date: Wed, 17 Nov 2021 13:52:54 +0800 Subject: [PATCH 1/5] Add AutoCollection option to libraryoptionseditor Signed-off-by: Petrus.Z --- .../libraryoptionseditor/libraryoptionseditor.js | 7 +++++++ .../libraryoptionseditor.template.html | 8 ++++++++ src/strings/en-gb.json | 2 ++ src/strings/en-us.json | 2 ++ src/strings/zh-cn.json | 2 ++ 5 files changed, 21 insertions(+) diff --git a/src/components/libraryoptionseditor/libraryoptionseditor.js b/src/components/libraryoptionseditor/libraryoptionseditor.js index 743bf7dc39..717e3f5c96 100644 --- a/src/components/libraryoptionseditor/libraryoptionseditor.js +++ b/src/components/libraryoptionseditor/libraryoptionseditor.js @@ -410,6 +410,11 @@ import template from './libraryoptionseditor.template.html'; } else { parent.querySelector('.chkEnableEmbeddedEpisodeInfosContainer').classList.add('hide'); } + if (contentType === 'movies') { + parent.querySelector('.chkAutoCollectionContainer').classList.remove('hide'); + } else { + parent.querySelector('.chkAutoCollectionContainer').classList.add('hide'); + } return populateMetadataSettings(parent, contentType); } @@ -511,6 +516,7 @@ import template from './libraryoptionseditor.template.html'; SkipSubtitlesIfAudioTrackMatches: parent.querySelector('#chkSkipIfAudioTrackPresent').checked, SaveSubtitlesWithMedia: parent.querySelector('#chkSaveSubtitlesLocally').checked, RequirePerfectSubtitleMatch: parent.querySelector('#chkRequirePerfectMatch').checked, + AutoCollection: parent.querySelector('#chkAutoCollection').checked, MetadataSavers: Array.prototype.map.call(Array.prototype.filter.call(parent.querySelectorAll('.chkMetadataSaver'), elem => { return elem.checked; }), elem => { @@ -562,6 +568,7 @@ import template from './libraryoptionseditor.template.html'; parent.querySelector('#chkSaveSubtitlesLocally').checked = options.SaveSubtitlesWithMedia; parent.querySelector('#chkSkipIfAudioTrackPresent').checked = options.SkipSubtitlesIfAudioTrackMatches; parent.querySelector('#chkRequirePerfectMatch').checked = options.RequirePerfectSubtitleMatch; + parent.querySelector('#chkAutoCollection').checked = options.AutoCollection; Array.prototype.forEach.call(parent.querySelectorAll('.chkMetadataSaver'), elem => { elem.checked = options.MetadataSavers ? options.MetadataSavers.includes(elem.getAttribute('data-pluginname')) : elem.getAttribute('data-defaultenabled') === 'true'; }); diff --git a/src/components/libraryoptionseditor/libraryoptionseditor.template.html b/src/components/libraryoptionseditor/libraryoptionseditor.template.html index bd70bcb54e..148927654f 100644 --- a/src/components/libraryoptionseditor/libraryoptionseditor.template.html +++ b/src/components/libraryoptionseditor/libraryoptionseditor.template.html @@ -39,6 +39,14 @@
${LabelEnableRealtimeMonitorHelp}
+
+ +
${LabelAutoCollectionHelp}
+
+
diff --git a/src/strings/en-gb.json b/src/strings/en-gb.json index 826b885a2b..f411e76e48 100644 --- a/src/strings/en-gb.json +++ b/src/strings/en-gb.json @@ -995,6 +995,8 @@ "LabelBirthYear": "Birth year:", "LabelBirthDate": "Birth date:", "LabelBindToLocalNetworkAddress": "Bind to local network address:", + "LabelAutoCollection": "Auto create collection", + "LabelAutoCollectionHelp": "When at least 2 movies in the library have the same collection name, the collection will be automatically created", "LabelAutomaticallyRefreshInternetMetadataEvery": "Automatically refresh metadata from the internet:", "LabelAuthProvider": "Authentication Provider:", "LabelAudioLanguagePreference": "Preferred audio language:", diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 430fd78fdf..a513b7de1a 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -533,6 +533,8 @@ "LabelAudioLanguagePreference": "Preferred audio language:", "LabelAudioSampleRate": "Audio sample rate:", "LabelAuthProvider": "Authentication Provider:", + "LabelAutoCollection": "Auto create collection", + "LabelAutoCollectionHelp": "When at least 2 movies in the library have the same collection name, the collection will be automatically created", "LabelAutoDiscoveryTracing": "Enable Auto Discovery tracing.", "LabelAutoDiscoveryTracingHelp": "When enabled, packets received on the auto discovery port will be logged.", "LabelAutomaticallyRefreshInternetMetadataEvery": "Automatically refresh metadata from the internet:", diff --git a/src/strings/zh-cn.json b/src/strings/zh-cn.json index 5bd1cbc253..280a10e2b1 100644 --- a/src/strings/zh-cn.json +++ b/src/strings/zh-cn.json @@ -402,6 +402,8 @@ "LabelArtists": "艺术家:", "LabelArtistsHelp": "将多个艺术家用分号分隔。", "LabelAudioLanguagePreference": "首选音频语言:", + "LabelAutoCollection": "自动创建合集", + "LabelAutoCollectionHelp": "当库中至少有2个电影拥有相同的合集名称时,将自动创建合集", "LabelAutomaticallyRefreshInternetMetadataEvery": "自动从互联网获取元数据并刷新:", "LabelBindToLocalNetworkAddress": "监听的本地网络地址:", "LabelBindToLocalNetworkAddressHelp": "覆盖 HTTP 服务器绑定的本地 IP 地址。如果留空,服务器将会监听所有可用的地址。重启后生效。", From 562fd6887a27d337652d27cf0c375c67a6e07a52 Mon Sep 17 00:00:00 2001 From: "Petrus.Z" Date: Wed, 17 Nov 2021 16:52:57 +0800 Subject: [PATCH 2/5] using toggle instead of if else Signed-off-by: Petrus.Z --- .../libraryoptionseditor/libraryoptionseditor.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/libraryoptionseditor/libraryoptionseditor.js b/src/components/libraryoptionseditor/libraryoptionseditor.js index 717e3f5c96..5e9ca5dbc9 100644 --- a/src/components/libraryoptionseditor/libraryoptionseditor.js +++ b/src/components/libraryoptionseditor/libraryoptionseditor.js @@ -410,11 +410,8 @@ import template from './libraryoptionseditor.template.html'; } else { parent.querySelector('.chkEnableEmbeddedEpisodeInfosContainer').classList.add('hide'); } - if (contentType === 'movies') { - parent.querySelector('.chkAutoCollectionContainer').classList.remove('hide'); - } else { - parent.querySelector('.chkAutoCollectionContainer').classList.add('hide'); - } + + parent.querySelector('.chkAutoCollectionContainer').classList.toggle('hide', contentType !== 'movies'); return populateMetadataSettings(parent, contentType); } From 213fe8fb174e6655f333b34536a8caf0528998ea Mon Sep 17 00:00:00 2001 From: "Petrus.Z" Date: Wed, 17 Nov 2021 18:22:33 +0800 Subject: [PATCH 3/5] remove changes in en-gb.json Signed-off-by: Petrus.Z --- src/strings/en-gb.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/strings/en-gb.json b/src/strings/en-gb.json index f411e76e48..826b885a2b 100644 --- a/src/strings/en-gb.json +++ b/src/strings/en-gb.json @@ -995,8 +995,6 @@ "LabelBirthYear": "Birth year:", "LabelBirthDate": "Birth date:", "LabelBindToLocalNetworkAddress": "Bind to local network address:", - "LabelAutoCollection": "Auto create collection", - "LabelAutoCollectionHelp": "When at least 2 movies in the library have the same collection name, the collection will be automatically created", "LabelAutomaticallyRefreshInternetMetadataEvery": "Automatically refresh metadata from the internet:", "LabelAuthProvider": "Authentication Provider:", "LabelAudioLanguagePreference": "Preferred audio language:", From 0a57d9358f3887228cb3b9f55f5783ad871f6472 Mon Sep 17 00:00:00 2001 From: "Petrus.Z" Date: Thu, 18 Nov 2021 16:16:00 +0800 Subject: [PATCH 4/5] Replace library option to AutomaticallyAddToCollection Signed-off-by: Petrus.Z --- .../libraryoptionseditor/libraryoptionseditor.js | 6 +++--- .../libraryoptionseditor.template.html | 8 ++++---- src/strings/en-us.json | 4 ++-- src/strings/zh-cn.json | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/libraryoptionseditor/libraryoptionseditor.js b/src/components/libraryoptionseditor/libraryoptionseditor.js index 5e9ca5dbc9..b122e6f83b 100644 --- a/src/components/libraryoptionseditor/libraryoptionseditor.js +++ b/src/components/libraryoptionseditor/libraryoptionseditor.js @@ -411,7 +411,7 @@ import template from './libraryoptionseditor.template.html'; parent.querySelector('.chkEnableEmbeddedEpisodeInfosContainer').classList.add('hide'); } - parent.querySelector('.chkAutoCollectionContainer').classList.toggle('hide', contentType !== 'movies'); + parent.querySelector('.chkAutomaticallyAddToCollectionContainer').classList.toggle('hide', contentType !== 'movies'); return populateMetadataSettings(parent, contentType); } @@ -513,7 +513,7 @@ import template from './libraryoptionseditor.template.html'; SkipSubtitlesIfAudioTrackMatches: parent.querySelector('#chkSkipIfAudioTrackPresent').checked, SaveSubtitlesWithMedia: parent.querySelector('#chkSaveSubtitlesLocally').checked, RequirePerfectSubtitleMatch: parent.querySelector('#chkRequirePerfectMatch').checked, - AutoCollection: parent.querySelector('#chkAutoCollection').checked, + AutoCollection: parent.querySelector('#chkAutomaticallyAddToCollection').checked, MetadataSavers: Array.prototype.map.call(Array.prototype.filter.call(parent.querySelectorAll('.chkMetadataSaver'), elem => { return elem.checked; }), elem => { @@ -565,7 +565,7 @@ import template from './libraryoptionseditor.template.html'; parent.querySelector('#chkSaveSubtitlesLocally').checked = options.SaveSubtitlesWithMedia; parent.querySelector('#chkSkipIfAudioTrackPresent').checked = options.SkipSubtitlesIfAudioTrackMatches; parent.querySelector('#chkRequirePerfectMatch').checked = options.RequirePerfectSubtitleMatch; - parent.querySelector('#chkAutoCollection').checked = options.AutoCollection; + parent.querySelector('#chkAutomaticallyAddToCollection').checked = options.AutomaticallyAddToCollection; Array.prototype.forEach.call(parent.querySelectorAll('.chkMetadataSaver'), elem => { elem.checked = options.MetadataSavers ? options.MetadataSavers.includes(elem.getAttribute('data-pluginname')) : elem.getAttribute('data-defaultenabled') === 'true'; }); diff --git a/src/components/libraryoptionseditor/libraryoptionseditor.template.html b/src/components/libraryoptionseditor/libraryoptionseditor.template.html index 148927654f..bb94e0ee20 100644 --- a/src/components/libraryoptionseditor/libraryoptionseditor.template.html +++ b/src/components/libraryoptionseditor/libraryoptionseditor.template.html @@ -39,12 +39,12 @@
${LabelEnableRealtimeMonitorHelp}
-
+
-
${LabelAutoCollectionHelp}
+
${LabelAutomaticallyAddToCollectionHelp}
diff --git a/src/strings/en-us.json b/src/strings/en-us.json index a513b7de1a..d5589945a3 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -533,8 +533,8 @@ "LabelAudioLanguagePreference": "Preferred audio language:", "LabelAudioSampleRate": "Audio sample rate:", "LabelAuthProvider": "Authentication Provider:", - "LabelAutoCollection": "Auto create collection", - "LabelAutoCollectionHelp": "When at least 2 movies in the library have the same collection name, the collection will be automatically created", + "LabelAutomaticallyAddToCollection": "Automatically add to collection", + "LabelAutomaticallyAddToCollectionHelp": "When at least 2 movies have the same collection name, they will be automatically added to the collection", "LabelAutoDiscoveryTracing": "Enable Auto Discovery tracing.", "LabelAutoDiscoveryTracingHelp": "When enabled, packets received on the auto discovery port will be logged.", "LabelAutomaticallyRefreshInternetMetadataEvery": "Automatically refresh metadata from the internet:", diff --git a/src/strings/zh-cn.json b/src/strings/zh-cn.json index 280a10e2b1..5acc4c20d2 100644 --- a/src/strings/zh-cn.json +++ b/src/strings/zh-cn.json @@ -402,8 +402,8 @@ "LabelArtists": "艺术家:", "LabelArtistsHelp": "将多个艺术家用分号分隔。", "LabelAudioLanguagePreference": "首选音频语言:", - "LabelAutoCollection": "自动创建合集", - "LabelAutoCollectionHelp": "当库中至少有2个电影拥有相同的合集名称时,将自动创建合集", + "LabelAutomaticallyAddToCollection": "自动添加到合集", + "LabelAutomaticallyAddToCollectionHelp": "当至少有2个电影拥有相同的合集名称时,它们将会自动添加到合集中", "LabelAutomaticallyRefreshInternetMetadataEvery": "自动从互联网获取元数据并刷新:", "LabelBindToLocalNetworkAddress": "监听的本地网络地址:", "LabelBindToLocalNetworkAddressHelp": "覆盖 HTTP 服务器绑定的本地 IP 地址。如果留空,服务器将会监听所有可用的地址。重启后生效。", From 06362ce2597c7e2486a69d64a08ecc656bb48559 Mon Sep 17 00:00:00 2001 From: "Petrus.Z" Date: Thu, 18 Nov 2021 18:16:10 +0800 Subject: [PATCH 5/5] Replace AutoCollection to AutomaticallyAddToCollection Signed-off-by: Petrus.Z --- src/components/libraryoptionseditor/libraryoptionseditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/libraryoptionseditor/libraryoptionseditor.js b/src/components/libraryoptionseditor/libraryoptionseditor.js index b122e6f83b..252b8b6dfc 100644 --- a/src/components/libraryoptionseditor/libraryoptionseditor.js +++ b/src/components/libraryoptionseditor/libraryoptionseditor.js @@ -513,7 +513,7 @@ import template from './libraryoptionseditor.template.html'; SkipSubtitlesIfAudioTrackMatches: parent.querySelector('#chkSkipIfAudioTrackPresent').checked, SaveSubtitlesWithMedia: parent.querySelector('#chkSaveSubtitlesLocally').checked, RequirePerfectSubtitleMatch: parent.querySelector('#chkRequirePerfectMatch').checked, - AutoCollection: parent.querySelector('#chkAutomaticallyAddToCollection').checked, + AutomaticallyAddToCollection: parent.querySelector('#chkAutomaticallyAddToCollection').checked, MetadataSavers: Array.prototype.map.call(Array.prototype.filter.call(parent.querySelectorAll('.chkMetadataSaver'), elem => { return elem.checked; }), elem => {