mirror of https://github.com/Ombi-app/Ombi
commit
296e739b0e
@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ombi.Core.Models.Search.V2.Music
|
||||
{
|
||||
public class AlbumInformation
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string Id { get; set; }
|
||||
public string StartYear { get; set; }
|
||||
public string EndYear { get; set; }
|
||||
public bool IsEnded => string.IsNullOrEmpty(EndYear);
|
||||
public bool Monitored { get; set; }
|
||||
public string Type { get; set; }
|
||||
public string Country { get; set; }
|
||||
public string Region { get; set; }
|
||||
public string Disambiguation { get; set; }
|
||||
public string Cover { get; set; }
|
||||
public string Overview { get; set; }
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,205 @@
|
||||
<div *ngIf="!album" class="justify-content-md-center top-spacing loading-spinner">
|
||||
<mat-spinner [color]="'accent'"></mat-spinner>
|
||||
</div>
|
||||
|
||||
<div *ngIf="album" class="dark-theme">
|
||||
|
||||
<top-banner [title]="album.title" [background]="getBackground()" [tagline]="album.disambiguation"></top-banner>
|
||||
|
||||
<section id="info-wrapper">
|
||||
<div class="small-middle-container">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<media-poster [posterPath]="album.cover"></media-poster>
|
||||
|
||||
<!--Next to poster-->
|
||||
<!-- <div class="col-12 col-lg-3 col-xl-3 media-row">
|
||||
|
||||
<social-icons [homepage]="artist.links?.homePage" [doNotAppend]="true" [imdbId]="artist.links?.imdb" [twitter]="artist.links?.twitter" [facebook]="artist.links?.facebook" [instagram]="artist.links?.instagram"></social-icons>
|
||||
|
||||
</div> -->
|
||||
|
||||
<div class="col-12 col-lg-6 col-xl-6 media-row">
|
||||
|
||||
<button *ngIf="!album.monitored" mat-raised-button class="btn-spacing" color="primary" (click)="requestAlbum()">
|
||||
<i class="fas fa-plus"></i> {{ 'MediaDetails.RequestAlbum' | translate }}</button>
|
||||
|
||||
|
||||
|
||||
<button mat-raised-button class="btn-green btn-spacing" *ngIf="album.monitored"> {{
|
||||
'Common.Requested' | translate }}</button>
|
||||
<span *ngIf="!album.monitored">
|
||||
<span *ngIf="album.monitored; then requestedBtn else notRequestedBtn"></span>
|
||||
|
||||
<!-- <ng-template #requestedBtn>
|
||||
<button mat-raised-button *ngIf="!hasRequest || hasRequest && movieRequest && !movieRequest.denied"
|
||||
class="btn-spacing" color="warn" [disabled]><i class="fas fa-check"></i>
|
||||
{{ 'Common.Requested' | translate }}</button>
|
||||
</ng-template>
|
||||
<ng-template #notRequestedBtn>
|
||||
<button mat-raised-button class="btn-spacing" color="primary" (click)="request()">
|
||||
<i *ngIf="movie.requestProcessing" class="fas fa-circle-notch fa-spin fa-fw"></i> <i
|
||||
*ngIf="!movie.requestProcessing && !movie.processed" class="fas fa-plus"></i>
|
||||
<i *ngIf="movie.processed && !movie.requestProcessing" class="fas fa-check"></i> {{
|
||||
'Common.Request' | translate }}</button>
|
||||
<!-- </ng-template> -->
|
||||
</span>
|
||||
<!-- <span *ngIf="isAdmin && hasRequest">
|
||||
<button (click)="approve()" mat-raised-button class="btn-spacing" color="accent">
|
||||
<i class="fas fa-plus"></i> {{ 'Common.Approve' | translate }}
|
||||
</button>
|
||||
<button *ngIf="!movie.available" (click)="markAvailable()" mat-raised-button class="btn-spacing"
|
||||
color="accent">
|
||||
<i class="fas fa-plus"></i> {{ 'Requests.MarkAvailable' | translate }}
|
||||
</button>
|
||||
|
||||
<button *ngIf="movieRequest && !movieRequest.denied" mat-raised-button class="btn-spacing" color="warn"
|
||||
(click)="deny()">
|
||||
<i class="fas fa-times"></i> {{
|
||||
'Requests.Deny' | translate }}</button>
|
||||
<button *ngIf="movieRequest && movieRequest.denied" [matTooltip]="movieRequest.deniedReason"
|
||||
mat-raised-button class="btn-spacing" color="warn">
|
||||
<i class="fas fa-times"></i> {{
|
||||
'MediaDetails.Denied' | translate }}</button>
|
||||
</span> -->
|
||||
|
||||
<!-- <button *ngIf="(hasRequest && movieRequest) || movie.available" mat-raised-button class="btn-spacing"
|
||||
color="danger" (click)="issue()">
|
||||
<i class="fas fa-exclamation"></i> {{
|
||||
'Requests.ReportIssue' | translate }}</button> -->
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- <div class="col-12 col-md-2">
|
||||
|
||||
<mat-card class="mat-elevation-z8">
|
||||
<mat-card-content class="medium-font">
|
||||
<album-information-panel [album]="album"></album-information-panel>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
|
||||
</div> -->
|
||||
|
||||
<div class="col-12 col-md-10">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<mat-card class=" mat-elevation-z8 spacing-below">
|
||||
<mat-card-content>
|
||||
<h1>{{album.title}} - {{album.disambiguation}}</h1>
|
||||
<br />
|
||||
{{album.overview}}
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="row">
|
||||
<div class="col-12">
|
||||
<div class="issuesPanel" *ngIf="album.requestId">
|
||||
<issues-panel [requestId]="album.requestId" [isAdmin]="isAdmin"></issues-panel>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="row">
|
||||
<div class="col-12">
|
||||
<mat-accordion class="mat-elevation-z8 spacing-below">
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
{{'MediaDetails.RecommendationsTitle' | translate}}
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
|
||||
<div class="row card-spacer" *ngIf="movie.recommendations.results.length > 0">
|
||||
|
||||
<div class="col-md-2" *ngFor="let r of movie.recommendations.results">
|
||||
<div class="sidebar affixable affix-top preview-poster">
|
||||
<div class="poster">
|
||||
<a [routerLink]="'/details/movie/'+r.id">
|
||||
<img class="real grow" matTooltip="{{r.title}}"
|
||||
src="https://image.tmdb.org/t/p/w300/{{r.poster_path}}" alt="Poster"
|
||||
style="display: block;">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
{{'MediaDetails.SimilarTitle' | translate}}
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
|
||||
<div class="row card-spacer" *ngIf="movie.similar.results.length > 0">
|
||||
|
||||
<div class="col-md-2" *ngFor="let r of movie.similar.results">
|
||||
<div class="sidebar affixable affix-top preview-poster">
|
||||
<div class="poster ">
|
||||
<a [routerLink]="'/details/movie/'+r.id">
|
||||
<img class="real grow" matTooltip="{{r.title}}"
|
||||
src="https://image.tmdb.org/t/p/w300/{{r.poster_path}}" alt="Poster"
|
||||
style="display: block;">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
{{'MediaDetails.VideosTitle' | translate}}
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
|
||||
<div class="row card-spacer" *ngIf="movie.videos.results.length > 0">
|
||||
|
||||
<div class="col-md-6" *ngFor="let video of movie.videos.results">
|
||||
<iframe width="100%" height="315px" [src]="'https://www.youtube.com/embed/' + video.key | safe"
|
||||
frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="bottom-page-gap">
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
@ -0,0 +1,126 @@
|
||||
import { Component, ViewEncapsulation } from "@angular/core";
|
||||
import { ImageService, SearchV2Service, RequestService, MessageService } from "../../../services";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { DomSanitizer } from "@angular/platform-browser";
|
||||
import { MatDialog } from "@angular/material/dialog";
|
||||
import { YoutubeTrailerComponent } from "../shared/youtube-trailer.component";
|
||||
import { AuthService } from "../../../auth/auth.service";
|
||||
import { DenyDialogComponent } from "../shared/deny-dialog/deny-dialog.component";
|
||||
import { NewIssueComponent } from "../shared/new-issue/new-issue.component";
|
||||
import { IAlbumSearchResult, IReleaseGroups } from "../../../interfaces/IMusicSearchResultV2";
|
||||
|
||||
@Component({
|
||||
templateUrl: "./album-details.component.html",
|
||||
styleUrls: ["../../media-details.component.scss"],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class AlbumDetailsComponent {
|
||||
private albumId: string;
|
||||
|
||||
public album: IAlbumSearchResult = null;
|
||||
private selectedAlbums: IReleaseGroups[] = [];
|
||||
|
||||
public isAdmin: boolean;
|
||||
|
||||
constructor(private searchService: SearchV2Service, private route: ActivatedRoute,
|
||||
private sanitizer: DomSanitizer, private imageService: ImageService,
|
||||
public dialog: MatDialog, private requestService: RequestService,
|
||||
public messageService: MessageService, private auth: AuthService) {
|
||||
this.route.params.subscribe((params: any) => {
|
||||
this.albumId = params.albumId;
|
||||
this.load();
|
||||
});
|
||||
}
|
||||
|
||||
public load() {
|
||||
this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser");
|
||||
this.searchService.getAlbumInformation(this.albumId).subscribe(x => this.album = x);
|
||||
}
|
||||
|
||||
public getBackground(): string {
|
||||
if (this.album.cover) {
|
||||
this.album.background = this.sanitizer.bypassSecurityTrustStyle
|
||||
("url(" + this.album.cover + ")");
|
||||
return this.album.background
|
||||
}
|
||||
|
||||
return this.album.background
|
||||
}
|
||||
|
||||
public async requestAlbum() {
|
||||
if (this.album.monitored) {
|
||||
return;
|
||||
}
|
||||
this.requestService.requestAlbum({
|
||||
foreignAlbumId: this.album.id,
|
||||
monitored: true,
|
||||
monitor: "existing",
|
||||
searchForMissingAlbums: true
|
||||
}).toPromise()
|
||||
.then(r => {
|
||||
if (r.result) {
|
||||
this.album.monitored = true;
|
||||
this.messageService.send(r.message);
|
||||
} else {
|
||||
this.messageService.send(r.errorMessage);
|
||||
}
|
||||
})
|
||||
.catch(r => {
|
||||
console.log(r);
|
||||
this.messageService.send("Error when requesting album");
|
||||
});
|
||||
// const
|
||||
}
|
||||
|
||||
public openDialog() {
|
||||
this.dialog.open(YoutubeTrailerComponent, {
|
||||
width: '560px',
|
||||
// data: this.movie.videos.results[0].key
|
||||
});
|
||||
}
|
||||
|
||||
public async deny() {
|
||||
const dialogRef = this.dialog.open(DenyDialogComponent, {
|
||||
width: '250px',
|
||||
// data: {requestId: this.movieRequest.id, requestType: RequestType.movie}
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
// this.movieRequest.denied = result;
|
||||
// if(this.movieRequest.denied) {
|
||||
// this.movie.approved = false;
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
public async issue() {
|
||||
const dialogRef = this.dialog.open(NewIssueComponent, {
|
||||
width: '500px',
|
||||
// data: {requestId: this.movieRequest ? this.movieRequest.id : null, requestType: RequestType.movie, imdbid: this.movie.imdbId}
|
||||
});
|
||||
}
|
||||
|
||||
public async approve() {
|
||||
// const result = await this.requestService.approveMovie({ id: this.movieRequest.id }).toPromise();
|
||||
// if (result.result) {
|
||||
// this.movie.approved = false;
|
||||
// this.messageService.send("Successfully Approved", "Ok");
|
||||
// } else {
|
||||
// this.messageService.send(result.errorMessage, "Ok");
|
||||
// }
|
||||
}
|
||||
|
||||
public async markAvailable() {
|
||||
// const result = await this.requestService.markMovieAvailable({id: this.movieRequest.id}).toPromise();
|
||||
// if (result.result) {
|
||||
// // this.movie.available = true;
|
||||
// this.messageService.send(result.message, "Ok");
|
||||
// } else {
|
||||
// this.messageService.send(result.errorMessage, "Ok");
|
||||
// }
|
||||
}
|
||||
|
||||
public setAdvancedOptions(data: any) {
|
||||
// this.advancedOptions = data;
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<div *ngIf="album">
|
||||
<div>
|
||||
<strong>Type:</strong>
|
||||
<div>{{album.type}}</div>
|
||||
</div>
|
||||
<div>
|
||||
<strong>Country</strong>
|
||||
<div>{{album.country}}</div>
|
||||
</div>
|
||||
<div>
|
||||
<strong>Release Date</strong>
|
||||
<div>{{album.startYear}}</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,12 @@
|
||||
import { Component, Input, ViewEncapsulation } from "@angular/core";
|
||||
import { ISearchArtistResult } from "../../../../../interfaces";
|
||||
|
||||
@Component({
|
||||
templateUrl: "./album-information-panel.component.html",
|
||||
styleUrls: ["../../../../media-details.component.scss"],
|
||||
selector: "album-information-panel",
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class AlbumInformationPanel {
|
||||
@Input() public album: ISearchAlbumResult;
|
||||
}
|
Loading…
Reference in new issue