Compare commits

..

No commits in common. "6cc7a44a22c917184177b886a8f4918e3ac344aa" and "691f291843e8b09fbf607d66915990be6c4f0470" have entirely different histories.

20 changed files with 29 additions and 31 deletions

View file

@ -198,7 +198,7 @@ export default {
return this.store.getters['user/getSizeMultiplier']
},
dateFormat() {
return this.store.getters['getServerSetting']('dateFormat')
return this.store.state.serverSettings.dateFormat
},
_libraryItem() {
return this.libraryItem || {}

View file

@ -71,7 +71,7 @@ export default {
return this.height * this.sizeMultiplier
},
dateFormat() {
return this.store.getters['getServerSetting']('dateFormat')
return this.store.state.serverSettings.dateFormat
},
labelFontSize() {
if (this.width < 160) return 0.75

View file

@ -79,10 +79,10 @@ export default {
return !this.bookmarks.find((bm) => Math.abs(this.currentTime - bm.time) < 1)
},
dateFormat() {
return this.$store.getters['getServerSetting']('dateFormat')
return this.$store.state.serverSettings.dateFormat
},
timeFormat() {
return this.$store.getters['getServerSetting']('timeFormat')
return this.$store.state.serverSettings.timeFormat
}
},
methods: {

View file

@ -159,10 +159,10 @@ export default {
return 'Unknown'
},
dateFormat() {
return this.$store.getters['getServerSetting']('dateFormat')
return this.$store.state.serverSettings.dateFormat
},
timeFormat() {
return this.$store.getters['getServerSetting']('timeFormat')
return this.$store.state.serverSettings.timeFormat
},
isOpenSession() {
return !!this._session.open

View file

@ -144,7 +144,7 @@ export default {
expirationDateString() {
if (!this.expireDurationSeconds) return this.$strings.LabelPermanent
const dateMs = Date.now() + this.expireDurationSeconds * 1000
return this.$formatDatetime(dateMs, this.$store.getters['getServerSetting']('dateFormat'), this.$store.getters['getServerSetting']('timeFormat'))
return this.$formatDatetime(dateMs, this.$store.state.serverSettings.dateFormat, this.$store.state.serverSettings.timeFormat)
}
},
methods: {

View file

@ -40,7 +40,7 @@ export default {
}
},
dateFormat() {
return this.$store.getters['getServerSetting']('dateFormat')
return this.$store.state.serverSettings.dateFormat
},
releasesToShow() {
return this.versionData?.releasesToShow || []

View file

@ -78,10 +78,10 @@ export default {
return this.$store.getters['user/getToken']
},
dateFormat() {
return this.$store.getters['getServerSetting']('dateFormat')
return this.$store.state.serverSettings.dateFormat
},
timeFormat() {
return this.$store.getters['getServerSetting']('timeFormat')
return this.$store.state.serverSettings.timeFormat
}
},
methods: {

View file

@ -76,10 +76,10 @@ export default {
return usermap
},
dateFormat() {
return this.$store.getters['getServerSetting']('dateFormat')
return this.$store.state.serverSettings.dateFormat
},
timeFormat() {
return this.$store.getters['getServerSetting']('timeFormat')
return this.$store.state.serverSettings.timeFormat
}
},
methods: {

View file

@ -112,7 +112,7 @@ export default {
return this.episode?.publishedAt
},
dateFormat() {
return this.store.getters['getServerSetting']('dateFormat')
return this.store.state.serverSettings.dateFormat
},
itemProgress() {
return this.store.getters['user/getUserMediaProgress'](this.libraryItemId, this.episodeId)

View file

@ -239,10 +239,10 @@ export default {
})
},
dateFormat() {
return this.$store.getters['getServerSetting']('dateFormat')
return this.$store.state.serverSettings.dateFormat
},
timeFormat() {
return this.$store.getters['getServerSetting']('timeFormat')
return this.$store.state.serverSettings.timeFormat
}
},
methods: {

View file

@ -85,7 +85,7 @@ export default {
nextRun() {
if (!this.cronExpression) return ''
const parsed = this.$getNextScheduledDate(this.cronExpression)
return this.$formatJsDatetime(parsed, this.$store.getters['getServerSetting']('dateFormat'), this.$store.getters['getServerSetting']('timeFormat')) || ''
return this.$formatJsDatetime(parsed, this.$store.state.serverSettings.dateFormat, this.$store.state.serverSettings.timeFormat) || ''
},
description() {
if ((this.selectedInterval !== 'custom' || !this.selectedWeekdays.length) && this.selectedInterval !== 'daily') return ''

View file

@ -40,7 +40,6 @@ describe('LazySeriesCard', () => {
},
$store: {
getters: {
getServerSetting: () => 'MM/dd/yyyy',
'user/getUserCanUpdate': true,
'user/getUserMediaProgress': (id) => null,
'user/getSizeMultiplier': 1,

View file

@ -78,10 +78,10 @@ export default {
},
computed: {
dateFormat() {
return this.$store.getters['getServerSetting']('dateFormat')
return this.$store.state.serverSettings.dateFormat
},
timeFormat() {
return this.$store.getters['getServerSetting']('timeFormat')
return this.$store.state.serverSettings.timeFormat
}
},
methods: {

View file

@ -250,10 +250,10 @@ export default {
return user?.username || null
},
dateFormat() {
return this.$store.getters['getServerSetting']('dateFormat')
return this.$store.state.serverSettings.dateFormat
},
timeFormat() {
return this.$store.getters['getServerSetting']('timeFormat')
return this.$store.state.serverSettings.timeFormat
},
numSelected() {
return this.listeningSessions.filter((s) => s.selected).length

View file

@ -132,10 +132,10 @@ export default {
return this.listeningSessions.sessions[0]
},
dateFormat() {
return this.$store.getters['getServerSetting']('dateFormat')
return this.$store.state.serverSettings.dateFormat
},
timeFormat() {
return this.$store.getters['getServerSetting']('timeFormat')
return this.$store.state.serverSettings.timeFormat
}
},
methods: {

View file

@ -98,10 +98,10 @@ export default {
return this.$store.getters['users/getIsUserOnline'](this.user.id)
},
dateFormat() {
return this.$store.getters['getServerSetting']('dateFormat')
return this.$store.state.serverSettings.dateFormat
},
timeFormat() {
return this.$store.getters['getServerSetting']('timeFormat')
return this.$store.state.serverSettings.timeFormat
}
},
methods: {

View file

@ -193,7 +193,7 @@ export default {
return `${process.env.serverUrl}/api/items/${this.libraryItemId}/download?token=${this.userToken}`
},
dateFormat() {
return this.$store.getters['getServerSetting']('dateFormat')
return this.$store.state.serverSettings.dateFormat
},
userIsAdminOrUp() {
return this.$store.getters['user/getIsAdminOrUp']

View file

@ -141,7 +141,7 @@ export default {
return episodeIds
},
dateFormat() {
return this.$store.getters['getServerSetting']('dateFormat')
return this.$store.state.serverSettings.dateFormat
}
},
methods: {

View file

@ -305,8 +305,8 @@ export default {
},
async mounted() {
// Token passed as query parameter after successful oidc login
if (this.$route.query?.accessToken) {
localStorage.setItem('token', this.$route.query.accessToken)
if (this.$route.query?.setToken) {
localStorage.setItem('token', this.$route.query.setToken)
}
if (localStorage.getItem('token')) {
if (await this.checkAuth()) return // if valid user no need to check status

View file

@ -266,8 +266,7 @@ class Auth {
if (req.cookies.auth_cb) {
let stateQuery = req.cookies.auth_state ? `&state=${req.cookies.auth_state}` : ''
// UI request -> redirect to auth_cb url and send the jwt token as parameter
// TODO: Temporarily continue sending the old token as setToken
res.redirect(302, `${req.cookies.auth_cb}?setToken=${userResponse.user.token}&accessToken=${userResponse.user.accessToken}${stateQuery}`)
res.redirect(302, `${req.cookies.auth_cb}?setToken=${userResponse.user.accessToken}${stateQuery}`)
} else {
res.status(400).send('No callback or already expired')
}