feat: Add option to disable showing the version and option to prevent checking for updates

This commit is contained in:
Divyang Joshi 2023-04-28 19:28:23 -04:00
parent 4db26f9f79
commit d73aa1782e
No known key found for this signature in database
GPG key ID: 4155AEF0D685BA17
16 changed files with 91 additions and 8 deletions

View file

@ -139,7 +139,7 @@ export default {
return this.$store.state.versionData || {}
},
hasUpdate() {
return !!this.versionData.hasUpdate
return this.$store.getters['getServerSetting']('versionUpdateCheck') && !!this.versionData.hasUpdate
},
latestVersion() {
return this.versionData.latestVersion
@ -152,6 +152,9 @@ export default {
},
streamLibraryItem() {
return this.$store.state.streamLibraryItem
},
showVersion() {
return this.$store.getters['getServerSetting']('showVersion')
}
},
methods: {

View file

@ -105,7 +105,7 @@
</div>
</nuxt-link>
<div class="w-full h-12 px-1 py-2 border-t border-black border-opacity-20 absolute left-0" :style="{ bottom: streamLibraryItem ? '240px' : '65px' }">
<div v-if="shouldshowVersion" class="w-full h-12 px-1 py-2 border-t border-black border-opacity-20 absolute left-0" :style="{ bottom: streamLibraryItem ? '240px' : '65px' }">
<p class="underline font-mono text-xs text-center text-gray-300 leading-3 mb-1" @click="clickChangelog">v{{ $config.version }}</p>
<a v-if="hasUpdate" :href="githubTagUrl" target="_blank" class="text-warning text-xxs text-center block leading-3">Update</a>
<p v-else class="text-xxs text-gray-400 leading-3 text-center italic">{{ Source }}</p>
@ -214,6 +214,9 @@ export default {
},
showPlaylists() {
return this.$store.state.libraries.numUserPlaylists > 0
},
shouldshowVersion() {
return this.$store.getters['getServerSetting']('showVersion')
}
},
methods: {

View file

@ -67,6 +67,9 @@ export default {
},
appContentMarginLeft() {
return this.isShowingSideRail ? 80 : 0
},
shouldCheckVersion() {
return this.$store.getters['getServerSetting']('versionUpdateCheck')
}
},
methods: {
@ -529,12 +532,14 @@ export default {
this.$store.commit('globals/updateWindowSize', { width: window.innerWidth, height: window.innerHeight })
},
checkVersionUpdate() {
this.$store
.dispatch('checkForUpdate')
.then((res) => {
if (res && res.hasUpdate) this.showUpdateToast(res)
})
.catch((err) => console.error(err))
if (this.shouldCheckVersion) {
this.$store
.dispatch('checkForUpdate')
.then((res) => {
if (res && res.hasUpdate) this.showUpdateToast(res)
})
.catch((err) => console.error(err))
}
},
initLocalStorage() {
// If experimental features set in local storage

View file

@ -44,6 +44,26 @@
<p class="pl-4" id="settings-chromecast-support">{{ $strings.LabelSettingsChromecastSupport }}</p>
</div>
<div class="flex items-center py-2">
<ui-toggle-switch labeledBy="settings-show-version" v-model="newServerSettings.showVersion" :disabled="updatingServerSettings" @input="(val) => updateSettingsKey('showVersion', val)" />
<ui-tooltip :text="$strings.LabelSettingsVersionShowHelp">
<p class="pl-4">
<span id="settings-show-version">{{ $strings.LabelSettingsVersionShow }}</span>
<span class="material-icons icon-text">info_outlined</span>
</p>
</ui-tooltip>
</div>
<div class="flex items-center py-2">
<ui-toggle-switch labeledBy="settings-version-check" v-model="newServerSettings.versionUpdateCheck" :disabled="updatingServerSettings" @input="(val) => updateSettingsKey('versionUpdateCheck', val)" />
<ui-tooltip :text="$strings.LabelSettingsVersionUpdatesCheckHelp">
<p class="pl-4">
<span id="settings-version-check">{{ $strings.LabelSettingsVersionUpdatesCheck }}</span>
<span class="material-icons icon-text">info_outlined</span>
</p>
</ui-tooltip>
</div>
<div class="pt-4">
<h2 class="font-semibold">{{ $strings.HeaderSettingsDisplay }}</h2>
</div>

View file

@ -386,6 +386,10 @@
"LabelSettingsStoreMetadataWithItem": "Metadaten als OPF-Datei im Medienordner speichern",
"LabelSettingsStoreMetadataWithItemHelp": "Standardmäßig werden die Metadaten in /metadata/items gespeichert. Wenn diese Option aktiviert ist, werden die Metadaten als OPF-Datei (Textdatei) in dem gleichen Ordner gespeichert in welchem sich auch das Medium befindet. Es wird immer nur eine Datei mit dem Namen \"matadata.abs\" gespeichert.",
"LabelSettingsTimeFormat": "Zeitformat",
"LabelSettingsVersionUpdatesCheck": "Version Updates Check",
"LabelSettingsVersionUpdatesCheckHelp": "Disabling this will prevent making requests to external services to see if a new version is out. In turn, the update view in the sidebar is hidden.",
"LabelSettingsVersionShow": "Show Version",
"LabelSettingsVersionShowHelp": "Disabling this will hide the version section on the sidebar. This info is still vailable on the settings page.",
"LabelShowAll": "Alles anzeigen",
"LabelSize": "Größe",
"LabelSleepTimer": "Einschlaf-Timer",

View file

@ -386,6 +386,10 @@
"LabelSettingsStoreMetadataWithItem": "Store metadata with item",
"LabelSettingsStoreMetadataWithItemHelp": "By default metadata files are stored in /metadata/items, enabling this setting will store metadata files in your library item folders. Uses .abs file extension",
"LabelSettingsTimeFormat": "Time Format",
"LabelSettingsVersionUpdatesCheck": "Version Updates Check",
"LabelSettingsVersionUpdatesCheckHelp": "Disabling this will prevent making requests to external services to see if a new version is out. In turn, the update view in the sidebar is hidden.",
"LabelSettingsVersionShow": "Show Version",
"LabelSettingsVersionShowHelp": "Disabling this will hide the version section on the sidebar. This info is still vailable on the settings page.",
"LabelShowAll": "Show All",
"LabelSize": "Size",
"LabelSleepTimer": "Sleep timer",

View file

@ -386,6 +386,10 @@
"LabelSettingsStoreMetadataWithItem": "Guardar metadata con elemento",
"LabelSettingsStoreMetadataWithItemHelp": "Por defecto, los archivos de metadatos se almacenan en /metadata/items, si habilita esta configuración, los archivos de metadata se guardaran en la carpeta de elementos de tu biblioteca. Usa la extension .abs",
"LabelSettingsTimeFormat": "Format de Tiempo",
"LabelSettingsVersionUpdatesCheck": "Version Updates Check",
"LabelSettingsVersionUpdatesCheckHelp": "Disabling this will prevent making requests to external services to see if a new version is out. In turn, the update view in the sidebar is hidden.",
"LabelSettingsVersionShow": "Show Version",
"LabelSettingsVersionShowHelp": "Disabling this will hide the version section on the sidebar. This info is still vailable on the settings page.",
"LabelShowAll": "Mostrar Todos",
"LabelSize": "Tamaño",
"LabelSleepTimer": "Temporizador para Dormir",

View file

@ -386,6 +386,10 @@
"LabelSettingsStoreMetadataWithItem": "Enregistrer les Métadonnées avec les articles",
"LabelSettingsStoreMetadataWithItemHelp": "Par défaut, les métadonnées sont enregistrées dans /metadata/items. Activer ce paramètre enregistrera les métadonnées dans le dossier de larticle avec une extension « .abs ».",
"LabelSettingsTimeFormat": "Format dheure",
"LabelSettingsVersionUpdatesCheck": "Version Updates Check",
"LabelSettingsVersionUpdatesCheckHelp": "Disabling this will prevent making requests to external services to see if a new version is out. In turn, the update view in the sidebar is hidden.",
"LabelSettingsVersionShow": "Show Version",
"LabelSettingsVersionShowHelp": "Disabling this will hide the version section on the sidebar. This info is still vailable on the settings page.",
"LabelShowAll": "Afficher Tout",
"LabelSize": "Taille",
"LabelSleepTimer": "Minuterie",

View file

@ -386,6 +386,10 @@
"LabelSettingsStoreMetadataWithItem": "Store metadata with item",
"LabelSettingsStoreMetadataWithItemHelp": "By default metadata files are stored in /metadata/items, enabling this setting will store metadata files in your library item folders. Uses .abs file extension",
"LabelSettingsTimeFormat": "Time Format",
"LabelSettingsVersionUpdatesCheck": "Version Updates Check",
"LabelSettingsVersionUpdatesCheckHelp": "Disabling this will prevent making requests to external services to see if a new version is out. In turn, the update view in the sidebar is hidden.",
"LabelSettingsVersionShow": "Show Version",
"LabelSettingsVersionShowHelp": "Disabling this will hide the version section on the sidebar. This info is still vailable on the settings page.",
"LabelShowAll": "Show All",
"LabelSize": "Size",
"LabelSleepTimer": "Sleep timer",

View file

@ -386,6 +386,10 @@
"LabelSettingsStoreMetadataWithItem": "Store metadata with item",
"LabelSettingsStoreMetadataWithItemHelp": "By default metadata files are stored in /metadata/items, enabling this setting will store metadata files in your library item folders. Uses .abs file extension",
"LabelSettingsTimeFormat": "Time Format",
"LabelSettingsVersionUpdatesCheck": "Version Updates Check",
"LabelSettingsVersionUpdatesCheckHelp": "Disabling this will prevent making requests to external services to see if a new version is out. In turn, the update view in the sidebar is hidden.",
"LabelSettingsVersionShow": "Show Version",
"LabelSettingsVersionShowHelp": "Disabling this will hide the version section on the sidebar. This info is still vailable on the settings page.",
"LabelShowAll": "Show All",
"LabelSize": "Size",
"LabelSleepTimer": "Sleep timer",

View file

@ -386,6 +386,10 @@
"LabelSettingsStoreMetadataWithItem": "Spremi metapodatke uz stavku",
"LabelSettingsStoreMetadataWithItemHelp": "Po defaultu metapodatci su spremljeni u /metadata/items, uključujućite li ovu postavku, metapodatci će biti spremljeni u folderima od biblioteke. Koristi .abs ekstenziju.",
"LabelSettingsTimeFormat": "Time Format",
"LabelSettingsVersionUpdatesCheck": "Version Updates Check",
"LabelSettingsVersionUpdatesCheckHelp": "Disabling this will prevent making requests to external services to see if a new version is out. In turn, the update view in the sidebar is hidden.",
"LabelSettingsVersionShow": "Show Version",
"LabelSettingsVersionShowHelp": "Disabling this will hide the version section on the sidebar. This info is still vailable on the settings page.",
"LabelShowAll": "Prikaži sve",
"LabelSize": "Veličina",
"LabelSleepTimer": "Sleep timer",

View file

@ -386,6 +386,10 @@
"LabelSettingsStoreMetadataWithItem": "Archivia i metadata con il file",
"LabelSettingsStoreMetadataWithItemHelp": "Di default, i metadati sono salvati dentro /metadata/items, abilitando questa opzione si memorizzeranno i metadata nella cartella della libreria. I file avranno estensione .abs",
"LabelSettingsTimeFormat": "Formato Ora",
"LabelSettingsVersionUpdatesCheck": "Version Updates Check",
"LabelSettingsVersionUpdatesCheckHelp": "Disabling this will prevent making requests to external services to see if a new version is out. In turn, the update view in the sidebar is hidden.",
"LabelSettingsVersionShow": "Show Version",
"LabelSettingsVersionShowHelp": "Disabling this will hide the version section on the sidebar. This info is still vailable on the settings page.",
"LabelShowAll": "Mostra Tutto",
"LabelSize": "Dimensione",
"LabelSleepTimer": "Sleep timer",

View file

@ -386,6 +386,10 @@
"LabelSettingsStoreMetadataWithItem": "Przechowuj metadane w folderze książki",
"LabelSettingsStoreMetadataWithItemHelp": "Domyślnie metadane są przechowywane w folderze /metadata/items, włączenie tej opcji spowoduje, że okładka będzie przechowywana w folderze ksiązki. Tylko jedna okładka o nazwie pliku \"cover\" będzie przechowywana. Rozszerzenie pliku metadanych: .abs",
"LabelSettingsTimeFormat": "Time Format",
"LabelSettingsVersionUpdatesCheck": "Version Updates Check",
"LabelSettingsVersionUpdatesCheckHelp": "Disabling this will prevent making requests to external services to see if a new version is out. In turn, the update view in the sidebar is hidden.",
"LabelSettingsVersionShow": "Show Version",
"LabelSettingsVersionShowHelp": "Disabling this will hide the version section on the sidebar. This info is still vailable on the settings page.",
"LabelShowAll": "Pokaż wszystko",
"LabelSize": "Rozmiar",
"LabelSleepTimer": "Wyłącznik czasowy",

View file

@ -386,6 +386,10 @@
"LabelSettingsStoreMetadataWithItem": "Хранить метаинформацию с элементом",
"LabelSettingsStoreMetadataWithItemHelp": "По умолчанию метаинформация сохраняется в папке /metadata/items, при включении этой настройки метаинформация будет храниться в папке элемента. Используется расширение файла .abs",
"LabelSettingsTimeFormat": "Формат времени",
"LabelSettingsVersionUpdatesCheck": "Version Updates Check",
"LabelSettingsVersionUpdatesCheckHelp": "Disabling this will prevent making requests to external services to see if a new version is out. In turn, the update view in the sidebar is hidden.",
"LabelSettingsVersionShow": "Show Version",
"LabelSettingsVersionShowHelp": "Disabling this will hide the version section on the sidebar. This info is still vailable on the settings page.",
"LabelShowAll": "Показать все",
"LabelSize": "Размер",
"LabelSleepTimer": "Таймер сна",

View file

@ -386,6 +386,10 @@
"LabelSettingsStoreMetadataWithItem": "存储项目元数据",
"LabelSettingsStoreMetadataWithItemHelp": "默认情况下元数据文件存储在/metadata/items文件夹中, 启用此设置将存储元数据在你媒体项目文件夹中. 使 .abs 文件护展名",
"LabelSettingsTimeFormat": "时间格式",
"LabelSettingsVersionUpdatesCheck": "Version Updates Check",
"LabelSettingsVersionUpdatesCheckHelp": "Disabling this will prevent making requests to external services to see if a new version is out. In turn, the update view in the sidebar is hidden.",
"LabelSettingsVersionShow": "Show Version",
"LabelSettingsVersionShowHelp": "Disabling this will hide the version section on the sidebar. This info is still vailable on the settings page.",
"LabelShowAll": "全部显示",
"LabelSize": "文件大小",
"LabelSleepTimer": "睡眠定时",

View file

@ -54,6 +54,10 @@ class ServerSettings {
this.timeFormat = 'HH:mm'
this.language = 'en-us'
// Version
this.versionUpdateCheck = true
this.showVersion = true
this.logLevel = Logger.logLevel
this.version = null
@ -95,6 +99,8 @@ class ServerSettings {
this.sortingIgnorePrefix = !!settings.sortingIgnorePrefix
this.sortingPrefixes = settings.sortingPrefixes || ['the']
this.chromecastEnabled = !!settings.chromecastEnabled
this.versionUpdateCheck = !!settings.versionUpdateCheck
this.showVersion = !!settings.showVersion
this.enableEReader = !!settings.enableEReader
this.dateFormat = settings.dateFormat || 'MM/dd/yyyy'
this.timeFormat = settings.timeFormat || 'HH:mm'
@ -146,6 +152,8 @@ class ServerSettings {
sortingIgnorePrefix: this.sortingIgnorePrefix,
sortingPrefixes: [...this.sortingPrefixes],
chromecastEnabled: this.chromecastEnabled,
versionUpdateCheck: this.versionUpdateCheck,
showVersion: this.showVersion,
enableEReader: this.enableEReader,
dateFormat: this.dateFormat,
timeFormat: this.timeFormat,