Fix various profile issues and allow videos to repeat if save progress is finished

This commit is contained in:
Preston 2020-09-24 18:33:21 -04:00
parent f7f118f761
commit ff5d2f9b86
4 changed files with 15 additions and 12 deletions

View File

@ -35,11 +35,14 @@ export default Vue.extend({
selectedText: function () {
const localeText = this.$t('Profile.$ selected')
return localeText.replace('$', this.selectedLength)
},
primaryProfile: function () {
return JSON.parse(JSON.stringify(this.profileList[0]))
}
},
watch: {
profile: function () {
this.channels = [].concat(this.profileList[0].subscriptions).sort((a, b) => {
this.channels = [].concat(this.primaryProfile.subscriptions).sort((a, b) => {
const nameA = a.name.toLowerCase()
const nameB = b.name.toLowerCase()
if (nameA < nameB) {

View File

@ -46,6 +46,9 @@ export default Vue.extend({
profileInitial: function () {
return this.profileName.slice(0, 1).toUpperCase()
},
profileList: function () {
return this.$store.getters.getProfileList
},
activeProfile: function () {
return this.$store.getters.getActiveProfile
},
@ -72,7 +75,6 @@ export default Vue.extend({
this.profileName = this.profile.name
this.profileBgColor = this.profile.bgColor
this.profileTextColor = this.profile.textColor
this.profileSubscriptions = this.profile.subscriptions
},
methods: {
openDeletePrompt: function () {
@ -98,7 +100,7 @@ export default Vue.extend({
name: this.profileName,
bgColor: this.profileBgColor,
textColor: this.profileTextColor,
subscriptions: this.profileSubscriptions
subscriptions: this.profile.subscriptions
}
if (!this.isNew) {
@ -143,8 +145,8 @@ export default Vue.extend({
message: this.$t('Profile.Your default profile has been changed to your primary profile')
})
}
if (this.activeProfile._id === this.profileId) {
this.updateActiveProfile('allChannels')
if (this.profileList[this.activeProfile]._id === this.profileId) {
this.updateActiveProfile(0)
}
this.$router.push({
path: '/settings/profile/'

View File

@ -257,11 +257,6 @@ export default Vue.extend({
this.player.on('ready', function () {
v.$emit('ready')
if (this.captionList.length > 0) {
this.player.caption({
data: this.captionList
})
}
})
this.player.on('ended', function () {

View File

@ -127,6 +127,7 @@ export default Vue.extend({
this.firstLoad = true
this.activeFormat = this.defaultVideoFormat
this.videoStoryboardSrc = ''
this.captionSourceList = []
this.checkIfPlaylist()
@ -498,9 +499,11 @@ export default Vue.extend({
console.log(historyIndex)
if (historyIndex !== -1 && !this.isLive) {
console.log(this.historyCache[historyIndex])
const watchProgress = this.historyCache[historyIndex].watchProgress
this.$refs.videoPlayer.player.currentTime(watchProgress)
if (watchProgress < (this.videoLengthSeconds - 10)) {
this.$refs.videoPlayer.player.currentTime(watchProgress)
}
}
if (this.rememberHistory && historyIndex !== -1) {