summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/web/src/app/film/film.component.ts10
-rw-r--r--src/web/src/app/scrape.service.spec.ts16
-rw-r--r--src/web/src/app/scrape.service.ts17
3 files changed, 41 insertions, 2 deletions
diff --git a/src/web/src/app/film/film.component.ts b/src/web/src/app/film/film.component.ts
index d4e90f5..7d2f6cc 100644
--- a/src/web/src/app/film/film.component.ts
+++ b/src/web/src/app/film/film.component.ts
@@ -3,6 +3,7 @@ import { ActivatedRoute } from '@angular/router';
import { filter, map } from 'rxjs/operators';
import { MovieTVService } from '../movie-tv.service';
import { AppService } from '../app.service';
+import { ScrapeService } from '../scrape.service';
@Component({
selector: 'app-film',
@@ -18,7 +19,8 @@ export class FilmComponent implements OnInit {
id: string;
constructor(
private route: ActivatedRoute,
- private service: MovieTVService
+ private service: MovieTVService,
+ private scraper: ScrapeService
) {}
ngOnInit(): void {
this.route.paramMap.subscribe((x) => {
@@ -33,9 +35,13 @@ export class FilmComponent implements OnInit {
});
this.service.searchById(this.type, +this.id).subscribe((x: any) => {
this.model = x;
- this.loading = false;
console.log(this.model);
});
+ this.scraper
+ .performCheck(this.id, this.model, this.type)
+ .subscribe((x) => {
+ this.loading = false;
+ });
//
//Get Providers List
/*this.service
diff --git a/src/web/src/app/scrape.service.spec.ts b/src/web/src/app/scrape.service.spec.ts
new file mode 100644
index 0000000..45c2849
--- /dev/null
+++ b/src/web/src/app/scrape.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { ScrapeService } from './scrape.service';
+
+describe('ScrapeService', () => {
+ let service: ScrapeService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(ScrapeService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/web/src/app/scrape.service.ts b/src/web/src/app/scrape.service.ts
new file mode 100644
index 0000000..85eed58
--- /dev/null
+++ b/src/web/src/app/scrape.service.ts
@@ -0,0 +1,17 @@
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+
+@Injectable({
+ providedIn: 'root',
+})
+export class ScrapeService {
+ apiURL = 'http://localhost:5000/api/';
+
+ constructor(private service: HttpClient) {}
+
+ performCheck(id, query, type) {
+ return this.service.get(this.apiURL, {
+ params: { id: id, query: query, type: type },
+ });
+ }
+}