Merge branch 'master' into auth_passportjs

This commit is contained in:
advplyr 2023-10-02 16:21:47 -05:00
commit 2662e8f715
55 changed files with 1246 additions and 175 deletions

View file

@ -168,7 +168,13 @@ class PlaybackSession {
this.currentTime = session.currentTime || 0
this.startedAt = session.startedAt
this.updatedAt = session.updatedAt || null
this.updatedAt = session.updatedAt || session.startedAt
// Local playback sessions dont set this date field so set using updatedAt
if (!this.date && session.updatedAt) {
this.date = date.format(new Date(session.updatedAt), 'YYYY-MM-DD')
this.dayOfWeek = date.format(new Date(session.updatedAt), 'dddd')
}
}
get mediaItemId() {

View file

@ -208,6 +208,7 @@ class ServerSettings {
loggerScannerLogsToKeep: this.loggerScannerLogsToKeep,
homeBookshelfView: this.homeBookshelfView,
bookshelfView: this.bookshelfView,
podcastEpisodeSchedule: this.podcastEpisodeSchedule,
sortingIgnorePrefix: this.sortingIgnorePrefix,
sortingPrefixes: [...this.sortingPrefixes],
chromecastEnabled: this.chromecastEnabled,

View file

@ -326,6 +326,18 @@ class User {
return this.checkCanAccessLibraryItemWithTags(libraryItem.media.tags)
}
/**
* Checks if a user can access a library item
* @param {string} libraryId
* @param {boolean} explicit
* @param {string[]} tags
*/
checkCanAccessLibraryItemWithData(libraryId, explicit, tags) {
if (!this.checkCanAccessLibrary(libraryId)) return false
if (explicit && !this.canAccessExplicitContent) return false
return this.checkCanAccessLibraryItemWithTags(tags)
}
findBookmark(libraryItemId, time) {
return this.bookmarks.find(bm => bm.libraryItemId === libraryItemId && bm.time == time)
}