Skip to content

Commit

Permalink
chore: display the number of active crawlers
Browse files Browse the repository at this point in the history
+ update crawlers order
  • Loading branch information
AXeL-dev committed Sep 13, 2021
1 parent 39e07d0 commit 0b2730b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/modules/settings/main/main.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<a mdcTab (activate)="activeTabKey = 'general'" tabindex="0">General</a>
<a mdcTab (activate)="activeTabKey = 'display'" tabindex="0">Display</a>
<a *ngIf="browser.isWebExtension" mdcTab (activate)="activeTabKey = 'notifications'" tabindex="0">Notifications</a>
<a mdcTab (activate)="activeTabKey = 'crawlers'" tabindex="0">Crawlers</a>
<a mdcTab (activate)="activeTabKey = 'crawlers'" tabindex="0">Crawlers ({{ crawlers.getActiveCount() }}/{{ crawlers.getCount() }})</a>
</nav>
</div>
<div mdcTabBarScrollerForward>
Expand Down
2 changes: 2 additions & 0 deletions src/app/modules/settings/main/main.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { BrowserService } from 'src/app/services/browser.service';
import { Settings } from 'src/app/models/settings';
import { DebugService } from 'src/app/services/debug.service';
import { MdcSnackbarService } from '@blox/material';
import { CrawlersService } from 'src/app/services/crawlers.service';

@Component({
selector: 'app-main',
Expand All @@ -21,6 +22,7 @@ export class MainComponent implements OnInit {
private router: Router,
private debug: DebugService,
public browser: BrowserService,
public crawlers: CrawlersService,
private snackbar: MdcSnackbarService
) {
this.defaults = this.settings.getDefaults();
Expand Down
12 changes: 10 additions & 2 deletions src/app/services/crawlers.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ export class CrawlersService {
this.add(new VoirAnimeOrgCrawler(this.scraper));
this.add(new MavAnimesCrawler(this.scraper));
this.add(new AnimeResistanceCrawler(this.scraper));
this.add(new OtakuFrCrawler(this.scraper));
this.add(new VostFreeCrawler(this.scraper));
this.add(new MangasVostfrCrawler(this.scraper));
this.add(new WacVostfrCrawler(this.scraper));
this.add(new OtakuFrCrawler(this.scraper));
this.add(new JapMangaCrawler(this.scraper));
this.add(new ToonAnimeCrawler(this.scraper));
// Vosten crawlers
this.add(new AnimeKisaCrawler(this.scraper));
this.add(new YugenAnimeCrawler(this.scraper));
this.add(new AnimixPlayCrawler(this.scraper));
this.add(new GogoAnimeCrawler(this.scraper));
this.add(new AnimeKisaCrawler(this.scraper));
// Vostar crawlers
this.add(new WitAnimeCrawler(this.scraper));
this.add(new AnimeFourUpCrawler(this.scraper));
Expand Down Expand Up @@ -93,4 +93,12 @@ export class CrawlersService {
return this.crawlers.filter((c: BaseCrawler) => c.isActive);
}

getCount() {
return this.getAll().length;
}

getActiveCount() {
return this.getActive().length;
}

}

0 comments on commit 0b2730b

Please sign in to comment.