mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-18 01:39:38 +00:00
Merge branch 'master' into auth_passportjs
This commit is contained in:
commit
2662e8f715
55 changed files with 1246 additions and 175 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue