[Media UI] Added more permalinks.

- `channel`
- `playlist`
This commit is contained in:
Fabio Manganiello 2024-07-16 01:19:29 +02:00
parent c5ac02d133
commit c95381cead
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774
5 changed files with 68 additions and 7 deletions

View file

@ -165,6 +165,16 @@ export default {
title: channel.name,
})
},
initView() {
const args = this.getUrlArgs()
if (args.section)
this.selectedView = args.section
if (this.selectedView)
this.selectView(this.selectedView)
},
},
watch: {
@ -172,16 +182,35 @@ export default {
this.onPlaylistSelected(this.selectedPlaylist)
},
selectedPlaylist_(value) {
if (value == null)
this.setUrlArgs({playlist: null})
},
selectedChannel() {
this.onChannelSelected(this.selectedChannel)
},
selectedChannel_(value) {
if (value == null)
this.setUrlArgs({channel: null})
},
selectedView() {
this.setUrlArgs({section: this.selectedView})
},
},
mounted() {
this.loadYoutubeConfig()
this.initView()
this.onPlaylistSelected(this.selectedPlaylist)
this.onChannelSelected(this.selectedChannel)
},
unmounted() {
this.setUrlArgs({section: null})
},
}
</script>

View file

@ -162,8 +162,13 @@ export default {
},
},
mounted() {
this.loadChannel()
async mounted() {
this.setUrlArgs({channel: this.id})
await this.loadChannel()
},
unmounted() {
this.setUrlArgs({channel: null})
},
}
</script>
@ -187,7 +192,7 @@ export default {
.actions {
display: flex;
flex-direction: column;
align-items: center;
align-items: flex-end;
button {
background: $default-bg-7;

View file

@ -132,8 +132,13 @@ export default {
},
mounted() {
this.setUrlArgs({playlist: this.id})
this.loadItems()
},
unmounted() {
this.setUrlArgs({playlist: null})
},
}
</script>

View file

@ -234,8 +234,22 @@ export default {
},
},
mounted() {
this.loadPlaylists()
async mounted() {
await this.loadPlaylists()
const args = this.getUrlArgs()
if (args.playlist) {
const playlist = this.playlistsById[args.playlist]
if (playlist) {
this.$emit('select', playlist)
} else {
this.$emit('select', {id: args.playlist})
}
}
},
unmouted() {
this.setUrlArgs({section: null})
},
}
</script>

View file

@ -91,10 +91,18 @@ export default {
this.loading = false
}
},
initView() {
const args = this.getUrlArgs()
if (args.channel) {
this.$emit('select', {id: args.channel})
}
},
},
mounted() {
this.loadSubscriptions()
async mounted() {
await this.loadSubscriptions()
this.initView()
},
}
</script>