mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-22 00:07:52 +01:00
Fix:Local sessions set date and dayOfWeek using the updatedAt timestamp passed in from the client #2795
This commit is contained in:
parent
1396a432a4
commit
aefda8bd51
@ -144,8 +144,13 @@ class PlaybackSessionManager {
|
|||||||
session.currentTime = sessionJson.currentTime
|
session.currentTime = sessionJson.currentTime
|
||||||
session.timeListening = sessionJson.timeListening
|
session.timeListening = sessionJson.timeListening
|
||||||
session.updatedAt = sessionJson.updatedAt
|
session.updatedAt = sessionJson.updatedAt
|
||||||
session.date = date.format(new Date(), 'YYYY-MM-DD')
|
|
||||||
session.dayOfWeek = date.format(new Date(), 'dddd')
|
let jsDate = new Date(sessionJson.updatedAt)
|
||||||
|
if (isNaN(jsDate)) {
|
||||||
|
jsDate = new Date()
|
||||||
|
}
|
||||||
|
session.date = date.format(jsDate, 'YYYY-MM-DD')
|
||||||
|
session.dayOfWeek = date.format(jsDate, 'dddd')
|
||||||
|
|
||||||
Logger.debug(`[PlaybackSessionManager] Updated session for "${session.displayTitle}" (${session.id})`)
|
Logger.debug(`[PlaybackSessionManager] Updated session for "${session.displayTitle}" (${session.id})`)
|
||||||
await Database.updatePlaybackSession(session)
|
await Database.updatePlaybackSession(session)
|
||||||
|
Loading…
Reference in New Issue
Block a user