mirror of https://github.com/Ombi-app/Ombi
parent
3c78eda246
commit
cb84ff0e34
@ -1,103 +1,104 @@
|
||||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"ombi": {
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"projectType": "application",
|
||||
"prefix": "app",
|
||||
"schematics": {},
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"progress": true,
|
||||
"extractCss": true,
|
||||
"outputPath": "dist",
|
||||
"index": "src/index.html",
|
||||
"main": "src/main.ts",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "src/tsconfig.app.json",
|
||||
"assets": [
|
||||
"src/assets"
|
||||
],
|
||||
"styles": [
|
||||
"node_modules/pace/themes/orange/pace-theme-flash.css",
|
||||
"node_modules/primeng/resources/primeng.min.css",
|
||||
"node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
|
||||
"node_modules/font-awesome/scss/font-awesome.scss",
|
||||
"node_modules/bootswatch/superhero/bootstrap.min.css"
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"ombi": {
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"projectType": "application",
|
||||
"prefix": "app",
|
||||
"schematics": {},
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"progress": true,
|
||||
"extractCss": true,
|
||||
"outputPath": "dist",
|
||||
"index": "src/index.html",
|
||||
"main": "src/main.ts",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "src/tsconfig.app.json",
|
||||
"assets": [
|
||||
"src/assets"
|
||||
],
|
||||
"styles": [
|
||||
"src/styles/styles.scss",
|
||||
"node_modules/bootstrap/scss/bootstrap.scss",
|
||||
"node_modules/angular-bootstrap-md/scss/mdb-free.scss",
|
||||
"node_modules/pace/themes/orange/pace-theme-flash.css",
|
||||
"node_modules/font-awesome/scss/font-awesome.scss"
|
||||
],
|
||||
"scripts": [
|
||||
"node_modules/jquery/dist/jquery.min.js",
|
||||
"node_modules/chart.js/dist/Chart.js",
|
||||
"node_modules/hammerjs/hammer.min.js"
|
||||
]
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
],
|
||||
"scripts": [
|
||||
"node_modules/jquery/dist/jquery.min.js"
|
||||
]
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": false,
|
||||
"extractCss": true,
|
||||
"namedChunks": false,
|
||||
"aot": true,
|
||||
"extractLicenses": true,
|
||||
"vendorChunk": false,
|
||||
"buildOptimizer": true
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
],
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": false,
|
||||
"extractCss": true,
|
||||
"namedChunks": false,
|
||||
"aot": true,
|
||||
"extractLicenses": true,
|
||||
"vendorChunk": false,
|
||||
"buildOptimizer": true
|
||||
},
|
||||
"hmr": {
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.hmr.ts"
|
||||
}
|
||||
]
|
||||
}
|
||||
"hmr": {
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.hmr.ts"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "ombi:build"
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "ombi:build"
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "ombi:build:production"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "ombi:build:production"
|
||||
},
|
||||
"hmr": {
|
||||
"hmr": true,
|
||||
"browserTarget": "ombi:build:hmr",
|
||||
"hmrWarning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"browserTarget": "ombi:build"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"src/tsconfig.app.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
"hmr": {
|
||||
"hmr": true,
|
||||
"browserTarget": "ombi:build:hmr",
|
||||
"hmrWarning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"browserTarget": "ombi:build"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"src/tsconfig.app.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultProject": "ombi"
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
"defaultProject": "ombi"
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
<h3>Movies</h3>
|
||||
<popular-movies></popular-movies>
|
||||
<mat-divider></mat-divider>
|
||||
<h3>TV Shows</h3>
|
||||
|
||||
<popular-tv></popular-tv>
|
@ -0,0 +1,23 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { SearchService } from "../services";
|
||||
import { ISearchMovieResult, ISearchTvResult } from "../interfaces";
|
||||
|
||||
@Component({
|
||||
templateUrl: "./home.component.html",
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
|
||||
public movies: ISearchMovieResult[];
|
||||
public tvShows: ISearchTvResult[];
|
||||
|
||||
public defaultTvPoster: string;
|
||||
|
||||
constructor(private searchService: SearchService) {
|
||||
|
||||
}
|
||||
public ngOnInit() {
|
||||
this.defaultTvPoster = "../../../images/default_tv_poster.png";
|
||||
this.searchService.popularMovies().subscribe(x => this.movies = x);
|
||||
this.searchService.popularTv().subscribe(x => this.tvShows = x);
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
|
||||
<div *ngIf="movies" class="row">
|
||||
<div class="col-lg-2 col-md-4 col-6" *ngFor="let movie of movies">
|
||||
<mat-card>
|
||||
|
||||
<img mat-card-image src="https://image.tmdb.org/t/p/w300/{{movie.posterPath}}" alt="{{movie.title}}">
|
||||
<mat-card-content>
|
||||
|
||||
<h5>{{movie.title}}</h5>
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<button mat-raised-button color="primary">Request</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,19 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { SearchService } from "../../services";
|
||||
import { ISearchMovieResult, ISearchTvResult } from "../../interfaces";
|
||||
|
||||
@Component({
|
||||
selector:"popular-movies",
|
||||
templateUrl: "./popular-movies.component.html",
|
||||
})
|
||||
export class PopularMoviesComponent implements OnInit {
|
||||
|
||||
public movies: ISearchMovieResult[];
|
||||
|
||||
constructor(private searchService: SearchService) {
|
||||
|
||||
}
|
||||
public ngOnInit() {
|
||||
this.searchService.popularMovies().subscribe(x => this.movies = x);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<div *ngIf="tvShows" class="row">
|
||||
<div class="col-lg-2 col-md-4 col-6" *ngFor="let tv of tvShows">
|
||||
<mat-card>
|
||||
|
||||
<img mat-card-image src="{{tv.banner}}" alt="{{tv.title}}">
|
||||
<mat-card-content>
|
||||
|
||||
<h5>{{tv.title}}</h5>
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<button mat-raised-button color="primary">Request</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,66 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { SearchService } from "../../services";
|
||||
import { ISearchTvResult } from "../../interfaces";
|
||||
|
||||
@Component({
|
||||
selector: "popular-tv",
|
||||
templateUrl: "./popular-tv.component.html",
|
||||
})
|
||||
export class PopularTvComponent implements OnInit {
|
||||
|
||||
public tvShows: ISearchTvResult[];
|
||||
|
||||
public defaultPoster: string;
|
||||
|
||||
constructor(private searchService: SearchService) {
|
||||
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
this.defaultPoster = "../../../images/default_tv_poster.png";
|
||||
this.searchService.popularTv().subscribe(x => {this.tvShows = x; this.getExtraInfo();});
|
||||
}
|
||||
|
||||
public getExtraInfo() {
|
||||
this.tvShows.forEach((val, index) => {
|
||||
this.searchService.getShowInformation(val.id)
|
||||
.subscribe(x => {
|
||||
if (x) {
|
||||
this.setDefaults(x);
|
||||
this.updateItem(val, x);
|
||||
} else {
|
||||
const index = this.tvShows.indexOf(val, 0);
|
||||
if (index > -1) {
|
||||
this.tvShows.splice(index, 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private setDefaults(x: ISearchTvResult) {
|
||||
if (x.banner === null) {
|
||||
x.banner = this.defaultPoster;
|
||||
}
|
||||
|
||||
if (x.imdbId === null) {
|
||||
x.imdbId = "https://www.tvmaze.com/shows/" + x.seriesId;
|
||||
} else {
|
||||
x.imdbId = "http://www.imdb.com/title/" + x.imdbId + "/";
|
||||
}
|
||||
}
|
||||
|
||||
private updateItem(key: ISearchTvResult, updated: ISearchTvResult) {
|
||||
const index = this.tvShows.indexOf(key, 0);
|
||||
if (index > -1) {
|
||||
// Update certain properties, otherwise we will loose some data
|
||||
this.tvShows[index].title = updated.title;
|
||||
this.tvShows[index].banner = updated.banner;
|
||||
this.tvShows[index].imdbId = updated.imdbId;
|
||||
this.tvShows[index].seasonRequests = updated.seasonRequests;
|
||||
this.tvShows[index].seriesId = updated.seriesId;
|
||||
this.tvShows[index].fullyAvailable = updated.fullyAvailable;
|
||||
this.tvShows[index].background = updated.banner;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<mat-sidenav-container class="sidenav-container">
|
||||
<mat-sidenav #drawer class="sidenav" fixedInViewport="true" [attr.role]="isHandset ? 'dialog' : 'navigation'"
|
||||
[mode]="(isHandset | async)!.matches ? 'over' : 'side'" [opened]="!(isHandset | async)!.matches">
|
||||
<mat-toolbar color="primary">Ombi</mat-toolbar>
|
||||
<mat-nav-list>
|
||||
<a mat-list-item routerLink="/">Home</a>
|
||||
<a mat-list-item routerLink="/search">Search</a>
|
||||
<a mat-list-item routerLink="/settings">Settings</a>
|
||||
</mat-nav-list>
|
||||
</mat-sidenav>
|
||||
<mat-sidenav-content>
|
||||
<mat-toolbar color="primary">
|
||||
<button type="button" aria-label="Toggle sidenav" mat-icon-button (click)="drawer.toggle()" *ngIf="(isHandset | async)!.matches">
|
||||
<mat-icon aria-label="Side nav toggle icon"></mat-icon>
|
||||
</button>
|
||||
|
||||
|
||||
<span class="example-fill-remaining-space"></span>
|
||||
|
||||
</mat-toolbar>
|
||||
</mat-sidenav-content>
|
||||
</mat-sidenav-container>
|
@ -0,0 +1,17 @@
|
||||
.sidenav-container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.sidenav {
|
||||
width: 200px;
|
||||
box-shadow: 3px 0 6px rgba(0,0,0,.24);
|
||||
}
|
||||
.example-fill-remaining-space {
|
||||
/* This fills the remaining space, by using flexbox.
|
||||
Every toolbar row uses a flexbox row layout. */
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.right-spacing {
|
||||
margin-right:2%;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
import { BreakpointObserver, Breakpoints, BreakpointState } from "@angular/cdk/layout";
|
||||
import { Component } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
@Component({
|
||||
selector: "app-nav",
|
||||
templateUrl: "./nav.component.html",
|
||||
styleUrls: ["./nav.component.scss"],
|
||||
})
|
||||
export class NavComponent {
|
||||
public isHandset: Observable<BreakpointState> = this.breakpointObserver.observe(Breakpoints.HandsetPortrait);
|
||||
|
||||
constructor(private breakpointObserver: BreakpointObserver) {
|
||||
// this.checkLogin();
|
||||
// this.authService.userLoggedIn.subscribe(x => {
|
||||
// this.checkLogin();
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in new issue