Skip if unauthenticated

This commit is contained in:
root
2023-04-16 11:36:14 +05:30
parent 9f718dc238
commit ade762efe5
2 changed files with 16 additions and 7 deletions
+2 -1
View File
@@ -383,7 +383,8 @@ export default {
.replaceAll('\n', '<br>')
)
try {
if (!this.$store.getters['prefs/getPreference']('disableDuplicateHistoryEntries', false) && false) {
// eslint-disable-next-line no-constant-condition
if (!this.$store.getters['prefs/getPreference']('disableDuplicateHistoryEntries', false) || true) {
this.dbID = await addWatchedVideo(this.$store, video)
this.lastWatch = await findLastWatch(this.videoId)
} else {
+14 -6
View File
@@ -12,12 +12,17 @@ export const WatchedVideosPlaylist = {
},
actions: {
async resolvePlaylistID ({ dispatch, commit }) {
const playlists = await dispatch('auth/makeRequest', {
method: 'GET',
path: '/user/playlists'
}, {
root: true
})
let playlists
try {
playlists = await dispatch('auth/makeRequest', {
method: 'GET',
path: '/user/playlists'
}, {
root: true
})
} catch (e) {
return
}
let found = false; let pl
for (const _pl of playlists) {
const sdp = _pl.shortDescription ?? ''
@@ -45,6 +50,9 @@ export const WatchedVideosPlaylist = {
commit('replaceID', pl.id)
},
async addVideo ({ state, dispatch }, videoID) {
if (state.playlistID === '') {
return
}
await dispatch('auth/makeRequest', {
method: 'POST',
path: '/user/playlists/add',