feat(settings): add show music library default setting (#549)

* feat(settings): add show music library default setting

resolve #301

* adj zh-cn text

Co-authored-by: qier222 <qier2222@gmail.com>
This commit is contained in:
Map1en_ 2021-04-19 10:44:59 +08:00 committed by GitHub
parent 9ae15c198d
commit 9708064d26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 0 deletions

View File

@ -70,6 +70,8 @@ export default {
},
},
created() {
this.$store.state.settings.showLibraryDefault &&
this.$router.push("/library");
if (this.isElectron) {
ipcRenderer(this);
}

View File

@ -154,6 +154,7 @@ export default {
showPlaylistsByAppleMusic: "Show playlists by Apple Music",
enableDiscordRichPresence: "Enable Discord Rich Presence",
enableGlobalShortcut: "Enable Global Shortcut",
showLibraryDefault: "Show library default",
},
contextMenu: {
play: "Play",

View File

@ -153,6 +153,7 @@ export default {
showUnavailableSongInGreyStyle: "Erişilemeyen müzikleri gri stilde göster",
showPlaylistsByAppleMusic: "Apple Music'in Çalma Listelerini Göster",
enableDiscordRichPresence: "Discord gösterimini aktifleştir",
showLibraryDefault: "Kitaplık Varsayılanını göster",
},
contextMenu: {
play: "Oynat",

View File

@ -155,6 +155,7 @@ export default {
showPlaylistsByAppleMusic: "首页显示来自 Apple Music 的歌单",
enableDiscordRichPresence: "启用 Discord Rich Presence",
enableGlobalShortcut: "启用全局快捷键",
showLibraryDefault: "启动后显示音乐库",
},
contextMenu: {
play: "播放",

View File

@ -19,6 +19,7 @@ let localStorage = {
minimizeToTray: false,
enableDiscordRichPresence: false,
enableGlobalShortcut: true,
showLibraryDefault: false,
},
data: {
user: {},

View File

@ -233,6 +233,23 @@
</div>
</div>
<div class="item">
<div class="left">
<div class="title"> {{ $t("settings.showLibraryDefault") }}</div>
</div>
<div class="right">
<div class="toggle">
<input
type="checkbox"
name="show-library-default"
id="show-library-default"
v-model="showLibraryDefault"
/>
<label for="show-library-default"></label>
</div>
</div>
</div>
<div class="item">
<div class="left">
<div class="title">
@ -538,6 +555,13 @@ export default {
});
},
},
showLibraryDefault: {
get() {
return this.settings.showLibraryDefault || false;
},
set(value) {
this.$store.commit("updateSettings", {
key: "showLibraryDefault",
cacheLimit: {
get() {
return this.settings.cacheLimit || false;