mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-19 01:41:32 +00:00
Add favorite property for items and associated filters.
This commit is contained in:
parent
6d3773a0b8
commit
a5999fb9df
14 changed files with 308 additions and 11 deletions
|
|
@ -5,6 +5,7 @@ export const state = () => ({
|
|||
orderBy: 'media.metadata.title',
|
||||
orderDesc: false,
|
||||
filterBy: 'all',
|
||||
podcastLatestOnlyFavorites: false,
|
||||
playbackRate: 1,
|
||||
playbackRateIncrementDecrement: 0.1,
|
||||
bookshelfCoverSize: 120,
|
||||
|
|
@ -37,6 +38,9 @@ export const getters = {
|
|||
return li.libraryItemId == libraryItemId
|
||||
})
|
||||
},
|
||||
getIsLibraryItemFavorite: (state) => (libraryItemId) => {
|
||||
return state.user?.favorites?.includes(libraryItemId) || false
|
||||
},
|
||||
getUserBookmarksForItem: (state) => (libraryItemId) => {
|
||||
if (!state.user?.bookmarks) return []
|
||||
return state.user.bookmarks.filter((bm) => bm.libraryItemId === libraryItemId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue