Downloading Enhancements (#2599)
This commit is contained in:
parent
e6f6090fcf
commit
70cb687ef6
15 changed files with 139 additions and 45 deletions
|
|
@ -277,11 +277,23 @@ export class CardItemComponent implements OnInit {
|
|||
});
|
||||
|
||||
this.download$ = this.downloadService.activeDownloads$.pipe(takeUntilDestroyed(this.destroyRef), map((events) => {
|
||||
if(this.utilityService.isSeries(this.entity)) return events.find(e => e.entityType === 'series' && e.subTitle === this.downloadService.downloadSubtitle('series', (this.entity as Series))) || null;
|
||||
if(this.utilityService.isVolume(this.entity)) return events.find(e => e.entityType === 'volume' && e.subTitle === this.downloadService.downloadSubtitle('volume', (this.entity as Volume))) || null;
|
||||
if(this.utilityService.isChapter(this.entity)) return events.find(e => e.entityType === 'chapter' && e.subTitle === this.downloadService.downloadSubtitle('chapter', (this.entity as Chapter))) || null;
|
||||
if(this.utilityService.isSeries(this.entity)) {
|
||||
return events.find(e => e.entityType === 'series' && e.id == this.entity.id
|
||||
&& e.subTitle === this.downloadService.downloadSubtitle('series', (this.entity as Series))) || null;
|
||||
}
|
||||
if(this.utilityService.isVolume(this.entity)) {
|
||||
return events.find(e => e.entityType === 'volume' && e.id == this.entity.id
|
||||
&& e.subTitle === this.downloadService.downloadSubtitle('volume', (this.entity as Volume))) || null;
|
||||
}
|
||||
if(this.utilityService.isChapter(this.entity)) {
|
||||
return events.find(e => e.entityType === 'chapter' && e.id == this.entity.id
|
||||
&& e.subTitle === this.downloadService.downloadSubtitle('chapter', (this.entity as Chapter))) || null;
|
||||
}
|
||||
// Is PageBookmark[]
|
||||
if(this.entity.hasOwnProperty('length')) return events.find(e => e.entityType === 'bookmark' && e.subTitle === this.downloadService.downloadSubtitle('bookmark', [(this.entity as PageBookmark)])) || null;
|
||||
if(this.entity.hasOwnProperty('length')) {
|
||||
return events.find(e => e.entityType === 'bookmark'
|
||||
&& e.subTitle === this.downloadService.downloadSubtitle('bookmark', [(this.entity as PageBookmark)])) || null;
|
||||
}
|
||||
return null;
|
||||
}));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue