diff --git a/komga-webui/src/locales/en.json b/komga-webui/src/locales/en.json index 160c225ac..a4fbb9e6e 100644 --- a/komga-webui/src/locales/en.json +++ b/komga-webui/src/locales/en.json @@ -213,6 +213,7 @@ "on_deck": "On Deck", "recently_added_books": "Recently Added Books", "recently_added_series": "Recently Added Series", + "recently_read_books": "Recently Read Books", "recently_released_books": "Recently Released Books", "recently_updated_series": "Recently Updated Series" }, diff --git a/komga-webui/src/views/Dashboard.vue b/komga-webui/src/views/Dashboard.vue index 583db0f8c..16dc69754 100644 --- a/komga-webui/src/views/Dashboard.vue +++ b/komga-webui/src/views/Dashboard.vue @@ -137,6 +137,21 @@ /> + + + + + @@ -189,6 +204,7 @@ export default Vue.extend({ inProgressBooks: [] as BookDto[], onDeckBooks: [] as BookDto[], recentlyReleasedBooks: [] as BookDto[], + recentlyReadBooks: [] as BookDto[], selectedSeries: [] as SeriesDto[], selectedBooks: [] as BookDto[], } @@ -250,7 +266,8 @@ export default Vue.extend({ this.latestBooks.length === 0 && this.inProgressBooks.length === 0 && this.onDeckBooks.length === 0 && - this.recentlyReleasedBooks.length === 0 + this.recentlyReleasedBooks.length === 0 && + this.recentlyReadBooks.length === 0 }, individualLibrary(): boolean { return this.libraryId !== LIBRARIES_ALL @@ -275,6 +292,7 @@ export default Vue.extend({ else if (this.latestBooks.some(b => b.id === event.bookId)) this.reload() else if (this.onDeckBooks.some(b => b.id === event.bookId)) this.reload() else if (this.recentlyReleasedBooks.some(b => b.id === event.bookId)) this.reload() + else if (this.recentlyReadBooks.some(b => b.id === event.bookId)) this.reload() }, reload: throttle(function(this: any) { this.loadAll(this.libraryId) @@ -289,6 +307,7 @@ export default Vue.extend({ this.loadLatestBooks(libraryId) this.loadNewSeries(libraryId) this.loadUpdatedSeries(libraryId) + this.loadRecentlyReadBooks(libraryId) }, async loadNewSeries(libraryId: string) { this.newSeries = (await this.$komgaSeries.getNewSeries(this.getRequestLibraryId(libraryId))).content @@ -311,6 +330,13 @@ export default Vue.extend({ const releasedAfter = subMonths(new Date(), 1) this.recentlyReleasedBooks = (await this.$komgaBooks.getBooks(this.getRequestLibraryId(libraryId), pageRequest, undefined, undefined, undefined, releasedAfter)).content }, + async loadRecentlyReadBooks(libraryId: string) { + const pageRequest = { + sort: ['readProgress.lastModified,desc'], + } as PageRequest + + this.recentlyReadBooks = (await this.$komgaBooks.getBooks(this.getRequestLibraryId(libraryId), pageRequest, undefined, undefined, [ReadStatus.READ])).content + }, async loadInProgressBooks(libraryId: string) { const pageRequest = { sort: ['readProgress.lastModified,desc'],