2020-02-16 18:30:00 +00:00
|
|
|
import Vue from 'vue'
|
2020-03-24 13:22:29 +00:00
|
|
|
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'
|
|
|
|
import SideNavMoreOptions from '../side-nav-more-options/side-nav-more-options.vue'
|
2020-02-16 18:30:00 +00:00
|
|
|
import router from '../../router/index.js'
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
name: 'SideNav',
|
2020-03-24 13:22:29 +00:00
|
|
|
components: {
|
|
|
|
'ft-flex-box': FtFlexBox,
|
|
|
|
'side-nav-more-options': SideNavMoreOptions
|
|
|
|
},
|
2020-02-16 18:30:00 +00:00
|
|
|
computed: {
|
|
|
|
isOpen: function () {
|
|
|
|
return this.$store.getters.getIsSideNavOpen
|
2020-08-31 21:35:22 +00:00
|
|
|
},
|
2020-10-13 15:06:04 +00:00
|
|
|
backendPreference: function () {
|
|
|
|
return this.$store.getters.getBackendPreference
|
|
|
|
},
|
|
|
|
invidiousInstance: function () {
|
|
|
|
return this.$store.getters.getInvidiousInstance
|
|
|
|
},
|
2020-08-31 21:35:22 +00:00
|
|
|
profileList: function () {
|
|
|
|
return this.$store.getters.getProfileList
|
|
|
|
},
|
|
|
|
activeProfile: function () {
|
|
|
|
return this.$store.getters.getActiveProfile
|
|
|
|
},
|
|
|
|
activeSubscriptions: function () {
|
|
|
|
const profile = JSON.parse(JSON.stringify(this.profileList[this.activeProfile]))
|
|
|
|
return profile.subscriptions.sort((a, b) => {
|
|
|
|
const nameA = a.name.toLowerCase()
|
|
|
|
const nameB = b.name.toLowerCase()
|
|
|
|
if (nameA < nameB) {
|
|
|
|
return -1
|
|
|
|
}
|
|
|
|
if (nameA > nameB) {
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
return 0
|
2020-10-13 15:06:04 +00:00
|
|
|
}).map((channel) => {
|
|
|
|
if (this.backendPreference === 'invidious') {
|
|
|
|
channel.thumbnail = channel.thumbnail.replace('https://yt3.ggpht.com', `${this.invidiousInstance}/ggpht/`)
|
|
|
|
}
|
|
|
|
|
|
|
|
return channel
|
2020-08-31 21:35:22 +00:00
|
|
|
})
|
2020-10-06 02:27:32 +00:00
|
|
|
},
|
|
|
|
hidePopularVideos: function () {
|
|
|
|
return this.$store.getters.getHidePopularVideos
|
|
|
|
},
|
2021-03-06 16:21:22 +00:00
|
|
|
hidePlaylists: function () {
|
|
|
|
return this.$store.getters.getHidePlaylists
|
|
|
|
},
|
2020-10-06 02:27:32 +00:00
|
|
|
hideTrendingVideos: function () {
|
|
|
|
return this.$store.getters.getHideTrendingVideos
|
2021-01-10 03:11:42 +00:00
|
|
|
},
|
|
|
|
hideActiveSubscriptions: function () {
|
|
|
|
return this.$store.getters.getHideActiveSubscriptions
|
2020-02-16 18:30:00 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
navigate: function (route) {
|
|
|
|
router.push('/' + route)
|
2020-08-31 21:35:22 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
goToChannel: function (id) {
|
|
|
|
this.$router.push({ path: `/channel/${id}` })
|
2020-02-16 18:30:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|