summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
Diffstat (limited to 'src/web')
-rw-r--r--src/web/src/app/film/film.component.html11
-rw-r--r--src/web/src/app/film/film.component.ts38
-rw-r--r--src/web/src/app/home/home.component.html5
-rw-r--r--src/web/src/app/scrape.service.ts2
-rw-r--r--src/web/src/assets/movies pic.svg (renamed from src/web/src/assets/movies.svg)0
-rw-r--r--src/web/src/styles.css8
6 files changed, 30 insertions, 34 deletions
diff --git a/src/web/src/app/film/film.component.html b/src/web/src/app/film/film.component.html
index 7e18536..273dab1 100644
--- a/src/web/src/app/film/film.component.html
+++ b/src/web/src/app/film/film.component.html
@@ -36,14 +36,19 @@
Watch It Here
</h1>
<div class="cards-list pt-4">
- <div class="card">
+ <div
+ class="card"
+ *ngFor="let item of providers; let i = index"
+ >
<div class="card-img">
<img
class="p-3"
- src="https://iconape.com/wp-content/png_logo_vector/google-play-movies-tv.png"
+ src=" '../../assets/'+'movies pic' "
/>
</div>
- <div class="card_title"></div>
+ <div class="card_title title-white">
+ {{ getPrice(i) }}
+ </div>
</div>
</div>
</div>
diff --git a/src/web/src/app/film/film.component.ts b/src/web/src/app/film/film.component.ts
index 7d2f6cc..6dac982 100644
--- a/src/web/src/app/film/film.component.ts
+++ b/src/web/src/app/film/film.component.ts
@@ -11,12 +11,13 @@ import { ScrapeService } from '../scrape.service';
styleUrls: ['./film.component.css'],
})
export class FilmComponent implements OnInit {
- providers = ['Netflix'];
+ providers;
model: any;
loading: boolean = true;
img: string;
type: string;
id: string;
+ prices;
constructor(
private route: ActivatedRoute,
private service: MovieTVService,
@@ -26,33 +27,21 @@ export class FilmComponent implements OnInit {
this.route.paramMap.subscribe((x) => {
this.type = x.get('type');
this.id = x.get('id');
- //Start Scraping and loading the spinner
-
- //this.data.getUsers().subscribe((data) => {
- // this.users = data;
- //});
- ///
});
this.service.searchById(this.type, +this.id).subscribe((x: any) => {
+ let a;
this.model = x;
- console.log(this.model);
- });
- this.scraper
- .performCheck(this.id, this.model, this.type)
- .subscribe((x) => {
+ if (this.type === 'tv') {
+ a = this.model.name;
+ } else {
+ a = this.model.original_title;
+ }
+ this.scraper.performCheck(this.id, a, this.type).subscribe((x) => {
+ this.providers = x[0];
+ this.prices = x[1];
this.loading = false;
});
- //
- //Get Providers List
- /*this.service
- .getProviderList(this.model.media_type, this.model.id)
- .pipe(
- map((x: any) => {
- x.results.US.flatrate;
- })
- )
- .subscribe((x) => (this.model.watch_providers = x));
- console.log(this.model.watch_providers);*/
+ });
}
getImage() {
@@ -60,4 +49,7 @@ export class FilmComponent implements OnInit {
? 'https://image.tmdb.org/t/p/original' + this.model.poster_path
: '';
}
+ getPrice(i: number) {
+ return this.prices[i];
+ }
}
diff --git a/src/web/src/app/home/home.component.html b/src/web/src/app/home/home.component.html
index 7e59fe0..88dd292 100644
--- a/src/web/src/app/home/home.component.html
+++ b/src/web/src/app/home/home.component.html
@@ -2,7 +2,10 @@
<div class="row h-100">
<div class="offset-lg-1 offset-xs-2 mt-5 col-lg-10 col-xs-8">
<app-search-bar></app-search-bar>
- <img src="../../assets/movies.svg" class="cover-img img-fluid" />
+ <img
+ src="../../assets/movies pic.svg"
+ class="cover-img img-fluid"
+ />
</div>
</div>
</div>
diff --git a/src/web/src/app/scrape.service.ts b/src/web/src/app/scrape.service.ts
index 85eed58..fa25601 100644
--- a/src/web/src/app/scrape.service.ts
+++ b/src/web/src/app/scrape.service.ts
@@ -10,7 +10,7 @@ export class ScrapeService {
constructor(private service: HttpClient) {}
performCheck(id, query, type) {
- return this.service.get(this.apiURL, {
+ return this.service.get(this.apiURL + 'performCheck', {
params: { id: id, query: query, type: type },
});
}
diff --git a/src/web/src/assets/movies.svg b/src/web/src/assets/movies pic.svg
index 0f5cc91..0f5cc91 100644
--- a/src/web/src/assets/movies.svg
+++ b/src/web/src/assets/movies pic.svg
diff --git a/src/web/src/styles.css b/src/web/src/styles.css
index 8c0c651..b1664ee 100644
--- a/src/web/src/styles.css
+++ b/src/web/src/styles.css
@@ -97,6 +97,7 @@ body {
height: 120px;
box-shadow: 3px 3px 15px 5px rgba(0, 0, 0, 0.3);
transition: 0.3s;
+ margin: 20px auto;
}
.card .card-img {
@@ -117,8 +118,7 @@ body {
border-radius: 0px 0px 40px 40px;
font-family: sans-serif;
font-weight: bold;
- font-size: 30px;
- margin-top: -80px;
+ font-size: 20px;
height: 40px;
}
@@ -131,10 +131,6 @@ body {
color: white;
}
-.title-black {
- color: black;
-}
-
@media all and (max-width: 500px) {
.card-list {
/* On small screens, we are no longer using row direction but column */