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>
master
Map1en_ 4 years ago committed by GitHub
parent 9ae15c198d
commit 9708064d26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

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

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

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

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

@ -233,6 +233,23 @@
</div> </div>
</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="item">
<div class="left"> <div class="left">
<div class="title"> <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: { cacheLimit: {
get() { get() {
return this.settings.cacheLimit || false; return this.settings.cacheLimit || false;

Loading…
Cancel
Save