Verify check

This commit is contained in:
Luca 2021-03-26 19:30:44 +01:00
parent 24af7a8631
commit 4e11233f3e
4 changed files with 156 additions and 149 deletions

View File

@ -85,7 +85,8 @@ export default Vue.extend({
}
},
mounted: function () {
this.$store.dispatch('grabUserSettings').then(() => {
this.$store.dispatch('grabUserSettings').then((result) => {
console.log('AFTER GRABBING', result)
this.$store.dispatch('grabHistory')
this.$store.dispatch('grabAllProfiles', this.$t('Profile.All Channels'))
this.$store.dispatch('grabAllPlaylists')

View File

@ -27,7 +27,7 @@ const profileDb = new Datastore({
const state = {
profileList: [{
_id: 'allChannels',
name: 'Brudi Channels',
name: 'All Channels',
bgColor: '#000000',
textColor: '#FFFFFF',
subscriptions: []

View File

@ -264,153 +264,157 @@ const getters = {
const actions = {
grabUserSettings ({ dispatch, commit, rootState }) {
settingsDb.find({}, (err, results) => {
if (!err) {
console.log(results)
results.forEach((result) => {
switch (result._id) {
case 'invidiousInstance':
if (result.value === '') {
dispatch('updateInvidiousInstance', 'https://invidious.snopyta.org')
} else {
commit('setInvidiousInstance', result.value)
}
break
case 'backendFallback':
commit('setBackendFallback', result.value)
break
case 'defaultProfile':
console.log("IN SETTING DEFAULT:", result.value)
commit('setDefaultProfile', result.value)
break
case 'checkForUpdates':
commit('setCheckForUpdates', result.value)
break
case 'checkForBlogPosts':
commit('setCheckForBlogPosts', result.value)
break
case 'enableSearchSuggestions':
commit('setEnableSearchSuggestions', result.value)
break
case 'backendPreference':
commit('setBackendPreference', result.value)
break
case 'landingPage':
commit('setLandingPage', result.value)
break
case 'region':
commit('setRegion', result.value)
break
case 'listType':
commit('setListType', result.value)
break
case 'thumbnailPreference':
commit('setThumbnailPreference', result.value)
break
case 'barColor':
commit('setBarColor', result.value)
break
case 'uiScale':
webframe.setZoomFactor(parseInt(result.value) / 100)
commit('setUiScale', result.value)
break
case 'disableSmoothScrolling':
commit('setDisableSmoothScrolling', result.value)
break
case 'hideWatchedSubs':
commit('setHideWatchedSubs', result.value)
break
case 'useRssFeeds':
commit('setUseRssFeeds', result.value)
break
case 'rememberHistory':
commit('setRememberHistory', result.value)
break
case 'saveWatchedProgress':
commit('setSaveWatchedProgress', result.value)
break
case 'autoplayVideos':
commit('setAutoplayVideos', result.value)
break
case 'autoplayPlaylists':
commit('setAutoplayPlaylists', result.value)
break
case 'playNextVideo':
commit('setPlayNextVideo', result.value)
break
case 'enableSubtitles':
commit('setEnableSubtitles', result.value)
break
case 'forceLocalBackendForLegacy':
commit('setForceLocalBackendForLegacy', result.value)
break
case 'proxyVideos':
commit('setProxyVideos', result.value)
break
case 'useProxy':
commit('setUseProxy', result.value)
break
case 'proxyProtocol':
commit('setProxyProtocol', result.value)
break
case 'proxyHostname':
commit('setProxyHostname', result.value)
break
case 'proxyPort':
commit('setProxyPort', result.value)
break
case 'defaultTheatreMode':
commit('setDefaultTheatreMode', result.value)
break
case 'defaultInterval':
commit('setDefaultInterval', result.value)
break
case 'defaultVolume':
commit('setDefaultVolume', result.value)
sessionStorage.setItem('volume', result.value)
break
case 'defaultPlayback':
commit('setDefaultPlayback', result.value)
break
case 'defaultVideoFormat':
commit('setDefaultVideoFormat', result.value)
break
case 'defaultQuality':
commit('setDefaultQuality', result.value)
break
case 'hideVideoViews':
commit('setHideVideoViews', result.value)
break
case 'hideVideoLikesAndDislikes':
commit('setHideVideoLikesAndDislikes', result.value)
break
case 'hideChannelSubscriptions':
commit('setHideChannelSubscriptions', result.value)
break
case 'hideCommentLikes':
commit('setHideCommentLikes', result.value)
break
case 'hideRecommendedVideos':
commit('setHideRecommendedVideos', result.value)
break
case 'hideTrendingVideos':
commit('setHideTrendingVideos', result.value)
break
case 'hidePopularVideos':
commit('setHidePopularVideos', result.value)
break
case 'hidePlaylists':
commit('setHidePlaylists', result.value)
break
case 'hideLiveChat':
commit('setHideLiveChat', result.value)
break
case 'hideActiveSubscriptions':
commit('setHideActiveSubscriptions', result.value)
break
}
})
}
return new Promise((resolve, reject) => {
settingsDb.find({}, (err, results) => {
if (!err) {
console.log(results)
results.forEach((result) => {
switch (result._id) {
case 'invidiousInstance':
if (result.value === '') {
dispatch('updateInvidiousInstance', 'https://invidious.snopyta.org')
} else {
commit('setInvidiousInstance', result.value)
}
break
case 'backendFallback':
commit('setBackendFallback', result.value)
break
case 'defaultProfile':
console.log('IN SETTING DEFAULT:', result.value)
commit('setDefaultProfile', result.value)
break
case 'checkForUpdates':
commit('setCheckForUpdates', result.value)
break
case 'checkForBlogPosts':
commit('setCheckForBlogPosts', result.value)
break
case 'enableSearchSuggestions':
commit('setEnableSearchSuggestions', result.value)
break
case 'backendPreference':
commit('setBackendPreference', result.value)
break
case 'landingPage':
commit('setLandingPage', result.value)
break
case 'region':
commit('setRegion', result.value)
break
case 'listType':
commit('setListType', result.value)
break
case 'thumbnailPreference':
commit('setThumbnailPreference', result.value)
break
case 'barColor':
commit('setBarColor', result.value)
break
case 'uiScale':
webframe.setZoomFactor(parseInt(result.value) / 100)
commit('setUiScale', result.value)
break
case 'disableSmoothScrolling':
commit('setDisableSmoothScrolling', result.value)
break
case 'hideWatchedSubs':
commit('setHideWatchedSubs', result.value)
break
case 'useRssFeeds':
commit('setUseRssFeeds', result.value)
break
case 'rememberHistory':
commit('setRememberHistory', result.value)
break
case 'saveWatchedProgress':
commit('setSaveWatchedProgress', result.value)
break
case 'autoplayVideos':
commit('setAutoplayVideos', result.value)
break
case 'autoplayPlaylists':
commit('setAutoplayPlaylists', result.value)
break
case 'playNextVideo':
commit('setPlayNextVideo', result.value)
break
case 'enableSubtitles':
commit('setEnableSubtitles', result.value)
break
case 'forceLocalBackendForLegacy':
commit('setForceLocalBackendForLegacy', result.value)
break
case 'proxyVideos':
commit('setProxyVideos', result.value)
break
case 'useProxy':
commit('setUseProxy', result.value)
break
case 'proxyProtocol':
commit('setProxyProtocol', result.value)
break
case 'proxyHostname':
commit('setProxyHostname', result.value)
break
case 'proxyPort':
commit('setProxyPort', result.value)
break
case 'defaultTheatreMode':
commit('setDefaultTheatreMode', result.value)
break
case 'defaultInterval':
commit('setDefaultInterval', result.value)
break
case 'defaultVolume':
commit('setDefaultVolume', result.value)
sessionStorage.setItem('volume', result.value)
break
case 'defaultPlayback':
commit('setDefaultPlayback', result.value)
break
case 'defaultVideoFormat':
commit('setDefaultVideoFormat', result.value)
break
case 'defaultQuality':
commit('setDefaultQuality', result.value)
break
case 'hideVideoViews':
commit('setHideVideoViews', result.value)
break
case 'hideVideoLikesAndDislikes':
commit('setHideVideoLikesAndDislikes', result.value)
break
case 'hideChannelSubscriptions':
commit('setHideChannelSubscriptions', result.value)
break
case 'hideCommentLikes':
commit('setHideCommentLikes', result.value)
break
case 'hideRecommendedVideos':
commit('setHideRecommendedVideos', result.value)
break
case 'hideTrendingVideos':
commit('setHideTrendingVideos', result.value)
break
case 'hidePopularVideos':
commit('setHidePopularVideos', result.value)
break
case 'hidePlaylists':
commit('setHidePlaylists', result.value)
break
case 'hideLiveChat':
commit('setHideLiveChat', result.value)
break
case 'hideActiveSubscriptions':
commit('setHideActiveSubscriptions', result.value)
break
}
})
resolve()
}
reject(err)
})
})
},

View File

@ -252,6 +252,7 @@ const actions = {
},
ytGetPlaylistInfo ({ rootState }, playlistId) {
console.log("PALYLIST INTOFOF")
return new Promise((resolve, reject) => {
console.log(playlistId)
console.log('Getting playlist info please wait...')
@ -297,6 +298,7 @@ const actions = {
limit: 'Infinity',
requestOptions: { agent }
}).then((result) => {
console.log("RESULT PLAYLIST", result)
resolve(result)
}).catch((err) => {
reject(err)