Recently Added Chapter Feedback (#1020)
* Added an alt implementation which shows Recently Added chapters. No extra grouping is performed if multiple chapters per volume. * Started working on a grouping implementation for series. * Disabled the code for bookmarks cleanup as there is some critical issue in there. * Implemented a Series Group activity stream which shows recently updated series and providers a count badge showing how many new chapters/volumes were added in that series. * Removed the bookmark disabling code * Cleaned up code * One more code cleanup
This commit is contained in:
parent
0ce0ee39e0
commit
730624d364
14 changed files with 261 additions and 153 deletions
|
@ -8,6 +8,7 @@ import { SeriesRemovedEvent } from '../_models/events/series-removed-event';
|
|||
import { Library } from '../_models/library';
|
||||
import { RecentlyAddedItem } from '../_models/recently-added-item';
|
||||
import { Series } from '../_models/series';
|
||||
import { SeriesGroup } from '../_models/series-group';
|
||||
import { User } from '../_models/user';
|
||||
import { AccountService } from '../_services/account.service';
|
||||
import { ImageService } from '../_services/image.service';
|
||||
|
@ -28,6 +29,7 @@ export class LibraryComponent implements OnInit, OnDestroy {
|
|||
isAdmin = false;
|
||||
|
||||
recentlyAdded: Series[] = [];
|
||||
recentlyUpdatedSeries: SeriesGroup[] = [];
|
||||
recentlyAddedChapters: RecentlyAddedItem[] = [];
|
||||
inProgress: Series[] = [];
|
||||
|
||||
|
@ -45,10 +47,14 @@ export class LibraryComponent implements OnInit, OnDestroy {
|
|||
this.seriesService.getSeries(seriesAddedEvent.seriesId).subscribe(series => {
|
||||
this.recentlyAdded.unshift(series);
|
||||
});
|
||||
this.loadRecentlyAddedChapters();
|
||||
} else if (res.event === EVENTS.SeriesRemoved) {
|
||||
const seriesRemovedEvent = res.payload as SeriesRemovedEvent;
|
||||
this.recentlyAdded = this.recentlyAdded.filter(item => item.id != seriesRemovedEvent.seriesId);
|
||||
this.inProgress = this.inProgress.filter(item => item.id != seriesRemovedEvent.seriesId);
|
||||
|
||||
this.recentlyUpdatedSeries = this.recentlyUpdatedSeries.filter(item => item.seriesId != seriesRemovedEvent.seriesId);
|
||||
this.recentlyAddedChapters = this.recentlyAddedChapters.filter(item => item.seriesId != seriesRemovedEvent.seriesId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -105,6 +111,10 @@ export class LibraryComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
loadRecentlyAddedChapters() {
|
||||
this.seriesService.getRecentlyUpdatedSeries().pipe(takeUntil(this.onDestroy)).subscribe(updatedSeries => {
|
||||
this.recentlyUpdatedSeries = updatedSeries;
|
||||
});
|
||||
|
||||
this.seriesService.getRecentlyAddedChapters().pipe(takeUntil(this.onDestroy)).subscribe(updatedSeries => {
|
||||
this.recentlyAddedChapters = updatedSeries;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue