Skip to content

Commit

Permalink
Changed scraping to not require user interaction [#36]
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpierce committed Nov 15, 2021
1 parent 735aea6 commit e183027
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
Expand Up @@ -48,24 +48,11 @@
</mat-option>
</mat-select>
</mat-form-field>
<button
id="scrape-with-comicvine-id-button"
mat-icon-button
color="primary"
[disabled]="
(this.comicForm.controls.comicVineId.value || '').length === 0 ||
!this.comicForm.controls.comicVineId.valid
"
[matTooltip]="'scraping.tooltip.use-comicvine-id' | translate"
(click)="onScrapeUsingComicVineId()"
>
<mat-icon>download_for_offline</mat-icon>
</button>
<button
id="skip-cache-button"
class="cx-toolbar-button cx-margin-left-5"
mat-icon-button
color="accent"
color="warn"
[matTooltip]="
'scraping.tooltip.skip-cache' | translate: { enabled: skipCache }
"
Expand All @@ -78,12 +65,12 @@
id="scrape-comic"
class="cx-toolbar-button cx-margin-left-5"
mat-icon-button
color="accent"
color="primary"
[matTooltip]="'comic-book.tooltip.scrape-comic' | translate"
[disabled]="!comicForm.valid || !hasApiKey"
(click)="onFetchScrapingVolumes()"
>
<mat-icon>find_replace</mat-icon>
<mat-icon>cloud_download</mat-icon>
</button>
</mat-toolbar>
<form *ngIf="!!comic" [formGroup]="comicForm">
Expand Down Expand Up @@ -179,6 +166,20 @@
formControlName="comicVineId"
[placeholder]="'comic-book.placeholder.comicvine-id' | translate"
/>
<button
id="scrape-with-comicvine-id-button"
mat-icon-button
matSuffix
color="primary"
[disabled]="
(this.comicForm.controls.comicVineId.value || '').length === 0 ||
!this.comicForm.controls.comicVineId.valid
"
[matTooltip]="'scraping.tooltip.use-comicvine-id' | translate"
(click)="onScrapeUsingComicVineId()"
>
<mat-icon>cloud_download</mat-icon>
</button>
<mat-hint>
{{ "comic-book.hint.useful-for-scraping" | translate }}
</mat-hint>
Expand Down
Expand Up @@ -86,7 +86,7 @@ export class ComicEditComponent implements OnInit, OnDestroy {
apiKey: [''],
publisher: [''],
series: ['', [Validators.required]],
volume: [''],
volume: ['', [Validators.pattern('[0-9]{4}')]],
issueNumber: ['', [Validators.required]],
comicVineId: ['', [Validators.pattern('[0-9]{6}')]],
imprint: [''],
Expand Down
Expand Up @@ -5,7 +5,6 @@
[pageSizeOptions]="[5, 10, 20]"
showFirstLastButtons
></mat-paginator>

<div class="cx-spacer"></div>
<mat-form-field appearance="fill" class="cx-width-100">
<input
Expand Down
Expand Up @@ -128,6 +128,7 @@ <h2 *ngIf="!!comic">{{ comic | comicTitle }}</h2>
</div>
<div class="cx-padding-left-5" fxFlex.gt-sm="80%" fxFlex.sm="100%">
<mat-tab-group
animationDuration="0ms"
[selectedIndex]="currentTab"
(selectedTabChange)="onTabChange($event.index)"
>
Expand Down

0 comments on commit e183027

Please sign in to comment.