Add:Filter for RSS feeds open #893

This commit is contained in:
advplyr 2022-08-06 07:58:19 -05:00
parent 24a142e718
commit e02169907d
4 changed files with 10 additions and 2 deletions

View File

@ -88,6 +88,7 @@ export default {
if (this.page === 'collections') return "You haven't made any collections yet"
if (this.hasFilter) {
if (this.filterName === 'Issues') return 'No Issues'
else if (this.filterName === 'Feed-open') return 'No RSS feeds are open'
return `No Results for filter "${this.filterName}: ${this.filterValue}"`
}
return 'No results'

View File

@ -116,6 +116,11 @@ export default {
text: 'Issues',
value: 'issues',
sublist: false
},
{
text: 'RSS Feed Open',
value: 'feed-open',
sublist: false
}
],
podcastItems: [

View File

@ -163,7 +163,7 @@ class LibraryController {
// If filtering by series, will include seriesName and seriesSequence on media metadata
filterSeries = (payload.mediaType == 'book' && payload.filterBy.startsWith('series.')) ? libraryHelpers.decode(payload.filterBy.replace('series.', '')) : null
libraryItems = libraryHelpers.getFilteredLibraryItems(libraryItems, payload.filterBy, req.user)
libraryItems = libraryHelpers.getFilteredLibraryItems(libraryItems, payload.filterBy, req.user, this.rssFeedManager.feedsArray)
payload.total = libraryItems.length
}

View File

@ -10,7 +10,7 @@ module.exports = {
return Buffer.from(decodeURIComponent(text), 'base64').toString()
},
getFilteredLibraryItems(libraryItems, filterBy, user) {
getFilteredLibraryItems(libraryItems, filterBy, user, feedsArray) {
var filtered = libraryItems
var searchGroups = ['genres', 'tags', 'series', 'authors', 'progress', 'narrators', 'missing', 'languages']
@ -61,6 +61,8 @@ module.exports = {
}
} else if (filterBy === 'issues') {
filtered = filtered.filter(li => li.hasIssues)
} else if (filterBy === 'feed-open') {
filtered = filtered.filter(li => feedsArray.some(feed => feed.entityId === li.id))
}
return filtered