mirror of https://github.com/Ombi-app/Ombi
parent
83537e2a36
commit
33fdffdd0f
@ -0,0 +1,77 @@
|
|||||||
|
<div class="row" >
|
||||||
|
|
||||||
|
<div class="myBg backdrop" [style.background-image]="result.background"></div>
|
||||||
|
<div class="tint" style="background-image: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%,rgba(0,0,0,0.6) 100%);"></div>
|
||||||
|
<div class="col-sm-3 small-padding">
|
||||||
|
<img *ngIf="result.cover" class="img-responsive poster" src="{{result.cover}}" alt="poster">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-7 small-padding">
|
||||||
|
<div>
|
||||||
|
<a href="" target="_blank">
|
||||||
|
<h4>{{result.title}}</h4>
|
||||||
|
</a>
|
||||||
|
<a href="" target="_blank">
|
||||||
|
<h4>{{result.artistName}}</h4>
|
||||||
|
</a>
|
||||||
|
<span class="tags">
|
||||||
|
<!-- <span *ngIf="result.releaseDate" class="label label-info" id="releaseDateLabel" target="_blank">{{ 'Search.TheatricalRelease' | translate: {date: result.releaseDate | date: 'mediumDate'} }}</span>
|
||||||
|
<span *ngIf="result.digitalReleaseDate" class="label label-info" id="releaseDateLabel" target="_blank">{{ 'Search.DigitalDate' | translate: {date: result.digitalReleaseDate | date: 'mediumDate'} }}</span>
|
||||||
|
|
||||||
|
<a *ngIf="result.homepage" href="{{result.homepage}}" id="homePageLabel" target="_blank"><span class="label label-info" [translate]="'Search.Movies.HomePage'"></span></a>
|
||||||
|
|
||||||
|
<a *ngIf="result.trailer" href="{{result.trailer}}" id="trailerLabel" target="_blank"><span class="label label-info" [translate]="'Search.Movies.Trailer'"></span></a> -->
|
||||||
|
|
||||||
|
<ng-template [ngIf]="result.available"><span class="label label-success" id="availableLabel" [translate]="'Common.Available'"></span></ng-template>
|
||||||
|
<ng-template [ngIf]="result.approved && !result.available"><span class="label label-info" id="processingRequestLabel" [translate]="'Common.ProcessingRequest'"></span></ng-template>
|
||||||
|
<ng-template [ngIf]="result.requested && !result.approved && !result.available"><span class="label label-warning" id="pendingApprovalLabel" [translate]="'Common.PendingApproval'"></span></ng-template>
|
||||||
|
<ng-template [ngIf]="!result.requested && !result.available && !result.approved"><span class="label label-danger" id="notRequestedLabel" [translate]="'Common.NotRequested'"></span></ng-template>
|
||||||
|
|
||||||
|
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
</div>
|
||||||
|
<p style="font-size: 0.9rem !important">{{result.overview | truncate: 350 }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-2 small-padding">
|
||||||
|
<div class="row" *ngIf="result.requested">
|
||||||
|
<div class="col-md-2 col-md-push-10">
|
||||||
|
|
||||||
|
<!-- <a *ngIf="result.showSubscribe && !result.subscribed" style="color:white" (click)="subscribe(result)" pTooltip="Subscribe for notifications"> <i class="fa fa-rss"></i></a>
|
||||||
|
<a *ngIf="result.showSubscribe && result.subscribed" style="color:red" (click)="unSubscribe(result)" pTooltip="Unsubscribe notification"> <i class="fa fa-rss"></i></a> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="result.available">
|
||||||
|
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> {{ 'Common.Available' | translate }}</button>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="!result.available">
|
||||||
|
<div *ngIf="result.requested || result.approved; then requestedBtn else notRequestedBtn"></div>
|
||||||
|
<ng-template #requestedBtn>
|
||||||
|
<button style="text-align: right" class="btn btn-primary-outline disabled" [disabled]><i class="fa fa-check"></i> {{ 'Common.Requested' | translate }}</button>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template #notRequestedBtn>
|
||||||
|
<button style="text-align: right" class="btn btn-primary-outline" (click)="request(result)">
|
||||||
|
<i *ngIf="result.requestProcessing" class="fa fa-circle-o-notch fa-spin fa-fw"></i> <i *ngIf="!result.requestProcessing && !result.processed" class="fa fa-plus"></i>
|
||||||
|
<i *ngIf="result.processed && !result.requestProcessing" class="fa fa-check"></i> {{ 'Common.Request' | translate }}</button>
|
||||||
|
</ng-template>
|
||||||
|
</div>
|
||||||
|
<!-- <button style="text-align: right" class="btn btn-sm btn-info-outline" (click)="similarMovies(result.id)"> <i class="fa fa-eye"></i> {{ 'Search.Similar' | translate }}</button> -->
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<div class="dropdown" *ngIf="result.available && issueCategories && issuesEnabled">
|
||||||
|
<button class="btn btn-sm btn-primary-outline dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||||
|
<i class="fa fa-plus"></i> Report Issue
|
||||||
|
<span class="caret"></span>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
|
||||||
|
<!-- <li *ngFor="let cat of issueCategories"><a [routerLink]="" (click)="reportIssue(cat, result)">{{cat.value}}</a></li> -->
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
@ -0,0 +1,63 @@
|
|||||||
|
import { Component, Input } from "@angular/core";
|
||||||
|
import { TranslateService } from "@ngx-translate/core";
|
||||||
|
|
||||||
|
import { AuthService } from "../../auth/auth.service";
|
||||||
|
import { IRequestEngineResult, ISearchMovieResult } from "../../interfaces";
|
||||||
|
import { ISearchAlbumResult } from "../../interfaces/ISearchMusicResult";
|
||||||
|
import { NotificationService, RequestService } from "../../services";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: "album-search",
|
||||||
|
templateUrl: "./albumsearch.component.html",
|
||||||
|
})
|
||||||
|
export class AlbumSearchComponent {
|
||||||
|
|
||||||
|
@Input() public result: ISearchAlbumResult;
|
||||||
|
public engineResult: IRequestEngineResult;
|
||||||
|
@Input() public defaultPoster: string;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private requestService: RequestService,
|
||||||
|
private notificationService: NotificationService, private authService: AuthService,
|
||||||
|
private readonly translate: TranslateService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public request(searchResult: ISearchMovieResult) {
|
||||||
|
searchResult.requested = true;
|
||||||
|
searchResult.requestProcessing = true;
|
||||||
|
searchResult.showSubscribe = false;
|
||||||
|
if (this.authService.hasRole("admin") || this.authService.hasRole("AutoApproveMovie")) {
|
||||||
|
searchResult.approved = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
this.requestService.requestMovie({ theMovieDbId: searchResult.id })
|
||||||
|
.subscribe(x => {
|
||||||
|
this.engineResult = x;
|
||||||
|
|
||||||
|
if (this.engineResult.result) {
|
||||||
|
this.translate.get("Search.RequestAdded", { title: searchResult.title }).subscribe(x => {
|
||||||
|
this.notificationService.success(x);
|
||||||
|
searchResult.processed = true;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (this.engineResult.errorMessage && this.engineResult.message) {
|
||||||
|
this.notificationService.warning("Request Added", `${this.engineResult.message} - ${this.engineResult.errorMessage}`);
|
||||||
|
} else {
|
||||||
|
this.notificationService.warning("Request Added", this.engineResult.message ? this.engineResult.message : this.engineResult.errorMessage);
|
||||||
|
}
|
||||||
|
searchResult.requested = false;
|
||||||
|
searchResult.approved = false;
|
||||||
|
searchResult.processed = false;
|
||||||
|
searchResult.requestProcessing = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
|
searchResult.processed = false;
|
||||||
|
searchResult.requestProcessing = false;
|
||||||
|
this.notificationService.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="myBg backdrop" [style.background-image]="result.background"></div>
|
||||||
|
<div class="tint" style="background-image: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%,rgba(0,0,0,0.6) 100%);"></div>
|
||||||
|
<div class="col-sm-3 small-padding">
|
||||||
|
<img *ngIf="result.poster" class="img-responsive poster" src="{{result.poster}}" alt="poster">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-7 small-padding">
|
||||||
|
<div>
|
||||||
|
<a href="" target="_blank">
|
||||||
|
<h4>{{result.artistName}}</h4>
|
||||||
|
</a>
|
||||||
|
<span class="tags">
|
||||||
|
<!-- <span *ngIf="result.releaseDate" class="label label-info" id="releaseDateLabel" target="_blank">{{ 'Search.TheatricalRelease' | translate: {date: result.releaseDate | date: 'mediumDate'} }}</span>
|
||||||
|
<span *ngIf="result.digitalReleaseDate" class="label label-info" id="releaseDateLabel" target="_blank">{{ 'Search.DigitalDate' | translate: {date: result.digitalReleaseDate | date: 'mediumDate'} }}</span>
|
||||||
|
|
||||||
|
<a *ngIf="result.homepage" href="{{result.homepage}}" id="homePageLabel" target="_blank"><span class="label label-info" [translate]="'Search.Movies.HomePage'"></span></a>
|
||||||
|
|
||||||
|
<a *ngIf="result.trailer" href="{{result.trailer}}" id="trailerLabel" target="_blank"><span class="label label-info" [translate]="'Search.Movies.Trailer'"></span></a> -->
|
||||||
|
|
||||||
|
<ng-template [ngIf]="result.artistType">
|
||||||
|
<span class="label label-info" id="artistType">{{result.artistType}}</span>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template [ngIf]="result.disambiguation">
|
||||||
|
<span class="label label-info" id="disambiguation">{{result.disambiguation}}</span>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template [ngIf]="result.monitored">
|
||||||
|
<span class="label label-info" id="disambiguation">Monitored</span>
|
||||||
|
</ng-template>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
</div>
|
||||||
|
<p style="font-size: 0.9rem !important">{{result.overview | truncate: 350 }}</p>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<a id="infoTags" *ngFor="let link of result.links" href="{{link.url}}" target="_blank" class="label label-primary">
|
||||||
|
|
||||||
|
{{link.name}}
|
||||||
|
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-2 small-padding">
|
||||||
|
<div class="row" *ngIf="result.requested">
|
||||||
|
<div class="col-md-2 col-md-push-10">
|
||||||
|
|
||||||
|
<!-- <a *ngIf="result.showSubscribe && !result.subscribed" style="color:white" (click)="subscribe(result)" pTooltip="Subscribe for notifications"> <i class="fa fa-rss"></i></a>
|
||||||
|
<a *ngIf="result.showSubscribe && result.subscribed" style="color:red" (click)="unSubscribe(result)" pTooltip="Unsubscribe notification"> <i class="fa fa-rss"></i></a> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button style="text-align: right" class="btn btn-info-outline">
|
||||||
|
<i class="fa fa-eye"></i> View Albums</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- <button style="text-align: right" class="btn btn-sm btn-info-outline" (click)="similarMovies(result.id)"> <i class="fa fa-eye"></i> {{ 'Search.Similar' | translate }}</button> -->
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
@ -0,0 +1,63 @@
|
|||||||
|
import { Component, Input } from "@angular/core";
|
||||||
|
import { TranslateService } from "@ngx-translate/core";
|
||||||
|
|
||||||
|
import { AuthService } from "../../auth/auth.service";
|
||||||
|
import { IRequestEngineResult, ISearchMovieResult } from "../../interfaces";
|
||||||
|
import { ISearchArtistResult } from "../../interfaces/ISearchMusicResult";
|
||||||
|
import { NotificationService, RequestService } from "../../services";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: "artist-search",
|
||||||
|
templateUrl: "./artistsearch.component.html",
|
||||||
|
})
|
||||||
|
export class ArtistSearchComponent {
|
||||||
|
|
||||||
|
@Input() public result: ISearchArtistResult;
|
||||||
|
public engineResult: IRequestEngineResult;
|
||||||
|
@Input() public defaultPoster: string;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private requestService: RequestService,
|
||||||
|
private notificationService: NotificationService, private authService: AuthService,
|
||||||
|
private readonly translate: TranslateService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public request(searchResult: ISearchMovieResult) {
|
||||||
|
searchResult.requested = true;
|
||||||
|
searchResult.requestProcessing = true;
|
||||||
|
searchResult.showSubscribe = false;
|
||||||
|
if (this.authService.hasRole("admin") || this.authService.hasRole("AutoApproveMovie")) {
|
||||||
|
searchResult.approved = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
this.requestService.requestMovie({ theMovieDbId: searchResult.id })
|
||||||
|
.subscribe(x => {
|
||||||
|
this.engineResult = x;
|
||||||
|
|
||||||
|
if (this.engineResult.result) {
|
||||||
|
this.translate.get("Search.RequestAdded", { title: searchResult.title }).subscribe(x => {
|
||||||
|
this.notificationService.success(x);
|
||||||
|
searchResult.processed = true;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (this.engineResult.errorMessage && this.engineResult.message) {
|
||||||
|
this.notificationService.warning("Request Added", `${this.engineResult.message} - ${this.engineResult.errorMessage}`);
|
||||||
|
} else {
|
||||||
|
this.notificationService.warning("Request Added", this.engineResult.message ? this.engineResult.message : this.engineResult.errorMessage);
|
||||||
|
}
|
||||||
|
searchResult.requested = false;
|
||||||
|
searchResult.approved = false;
|
||||||
|
searchResult.processed = false;
|
||||||
|
searchResult.requestProcessing = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
|
searchResult.processed = false;
|
||||||
|
searchResult.requestProcessing = false;
|
||||||
|
this.notificationService.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue