mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
!wip
This commit is contained in:
parent
9d02f5e551
commit
5bb4d133ae
10 changed files with 103 additions and 38 deletions
|
@ -38,8 +38,16 @@ namespace Ombi.Core.Models.Search.V2
|
||||||
public DateTime? DigitalReleaseDate { get; set; }
|
public DateTime? DigitalReleaseDate { get; set; }
|
||||||
public Similar Similar { get; set; }
|
public Similar Similar { get; set; }
|
||||||
public Recommendations Recommendations { get; set; }
|
public Recommendations Recommendations { get; set; }
|
||||||
|
public ExternalIds ExternalIds { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ExternalIds
|
||||||
|
{
|
||||||
|
public string ImdbId { get; set; }
|
||||||
|
public string FacebookId { get; set; }
|
||||||
|
public string InstagramId { get; set; }
|
||||||
|
public string TwitterId { get; set; }
|
||||||
|
}
|
||||||
public class GenreViewModel
|
public class GenreViewModel
|
||||||
{
|
{
|
||||||
public int id { get; set; }
|
public int id { get; set; }
|
||||||
|
|
|
@ -85,6 +85,7 @@ namespace Ombi.Mapping.Profiles
|
||||||
CreateMap<Ombi.Api.TheMovieDb.Models.Result, Ombi.Core.Models.Search.V2.VideoResultsDetails>().ReverseMap();
|
CreateMap<Ombi.Api.TheMovieDb.Models.Result, Ombi.Core.Models.Search.V2.VideoResultsDetails>().ReverseMap();
|
||||||
CreateMap<Ombi.Api.TheMovieDb.Models.FullMovieCast, Ombi.Core.Models.Search.V2.FullMovieCastViewModel>().ReverseMap();
|
CreateMap<Ombi.Api.TheMovieDb.Models.FullMovieCast, Ombi.Core.Models.Search.V2.FullMovieCastViewModel>().ReverseMap();
|
||||||
CreateMap<Ombi.Api.TheMovieDb.Models.FullMovieCrew, Ombi.Core.Models.Search.V2.FullMovieCrewViewModel>().ReverseMap();
|
CreateMap<Ombi.Api.TheMovieDb.Models.FullMovieCrew, Ombi.Core.Models.Search.V2.FullMovieCrewViewModel>().ReverseMap();
|
||||||
|
CreateMap<Ombi.Api.TheMovieDb.Models.ExternalIds, Ombi.Core.Models.Search.V2.ExternalIds>().ReverseMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -64,6 +64,8 @@ namespace Ombi.Api.TheMovieDb.Models
|
||||||
public Recommendations Recommendations { get; set; }
|
public Recommendations Recommendations { get; set; }
|
||||||
[JsonProperty("release_dates")]
|
[JsonProperty("release_dates")]
|
||||||
public ReleaseDates ReleaseDates { get; set; }
|
public ReleaseDates ReleaseDates { get; set; }
|
||||||
|
[JsonProperty("external_ids")]
|
||||||
|
public ExternalIds ExternalIds { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Videos
|
public class Videos
|
||||||
|
@ -83,6 +85,18 @@ namespace Ombi.Api.TheMovieDb.Models
|
||||||
public string type { get; set; }
|
public string type { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ExternalIds
|
||||||
|
{
|
||||||
|
[JsonProperty("imdb_id")]
|
||||||
|
public string ImdbId { get; set; }
|
||||||
|
[JsonProperty("facebook_id")]
|
||||||
|
public string FacebookId { get; set; }
|
||||||
|
[JsonProperty("instagram_id")]
|
||||||
|
public string InstagramId { get; set; }
|
||||||
|
[JsonProperty("twitter_id")]
|
||||||
|
public string TwitterId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class Credits
|
public class Credits
|
||||||
{
|
{
|
||||||
public FullMovieCast[] cast { get; set; }
|
public FullMovieCast[] cast { get; set; }
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace Ombi.Api.TheMovieDb
|
||||||
var request = new Request($"movie/{movieId}", BaseUri, HttpMethod.Get);
|
var request = new Request($"movie/{movieId}", BaseUri, HttpMethod.Get);
|
||||||
request.FullUri = request.FullUri.AddQueryParameter("api_key", ApiToken);
|
request.FullUri = request.FullUri.AddQueryParameter("api_key", ApiToken);
|
||||||
request.FullUri = request.FullUri.AddQueryParameter("language", langCode);
|
request.FullUri = request.FullUri.AddQueryParameter("language", langCode);
|
||||||
request.FullUri = request.FullUri.AddQueryParameter("append_to_response", "videos,credits,similar,recommendations,release_dates");
|
request.FullUri = request.FullUri.AddQueryParameter("append_to_response", "videos,credits,similar,recommendations,release_dates,external_ids");
|
||||||
AddRetry(request);
|
AddRetry(request);
|
||||||
|
|
||||||
return await Api.Request<FullMovieInfo>(request);
|
return await Api.Request<FullMovieInfo>(request);
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
digitalReleaseDate: Date;
|
digitalReleaseDate: Date;
|
||||||
subscribed: boolean;
|
subscribed: boolean;
|
||||||
showSubscribe: boolean;
|
showSubscribe: boolean;
|
||||||
|
externalIds: IExternalIds;
|
||||||
|
|
||||||
// for the UI
|
// for the UI
|
||||||
requestProcessing: boolean;
|
requestProcessing: boolean;
|
||||||
|
@ -49,6 +50,13 @@ export interface IVideos {
|
||||||
results: IVideoResult[];
|
results: IVideoResult[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IExternalIds {
|
||||||
|
facebookId: string;
|
||||||
|
imdbId: string;
|
||||||
|
instagramId: string;
|
||||||
|
twitterId: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface IGenresViewModel {
|
export interface IGenresViewModel {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
|
@ -125,16 +133,16 @@ export interface IOtherMovies {
|
||||||
results: IOtherMoviesViewModel[];
|
results: IOtherMoviesViewModel[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IOtherMoviesViewModel {
|
export interface IOtherMoviesViewModel {
|
||||||
adult: boolean;
|
adult: boolean;
|
||||||
backdrop_path: string;
|
backdrop_path: string;
|
||||||
id: number;
|
id: number;
|
||||||
original_language: string;
|
original_language: string;
|
||||||
original_title: string;
|
original_title: string;
|
||||||
overview : string;
|
overview: string;
|
||||||
poster_path: string;
|
poster_path: string;
|
||||||
release_date : string;
|
release_date: string;
|
||||||
title : string;
|
title: string;
|
||||||
video: boolean;
|
video: boolean;
|
||||||
vote_average: number;
|
vote_average: number;
|
||||||
vote_count: number;
|
vote_count: number;
|
||||||
|
|
|
@ -35,7 +35,22 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--Next to poster-->
|
<!--Next to poster-->
|
||||||
|
<div class="col-6 media-row">
|
||||||
|
<a *ngIf="movie.imdbId" class="media-icons" href="https://imdb.com/title/{{movie.imdbId}}" target="_blank">
|
||||||
|
<i class="fa fa-imdb fa-2x grow"></i>
|
||||||
|
</a>
|
||||||
|
<a *ngIf="movie.externalIds.twitterId" class="media-icons" href="https://twitter.com/{{movie.externalIds.twitterId}}"
|
||||||
|
target="_blank">
|
||||||
|
<i class="fa fa-twitter fa-2x grow"></i>
|
||||||
|
</a>
|
||||||
|
<a *ngIf="movie.externalIds.facebookId" class="media-icons" href="https://facebook.com/{{movie.externalIds.facebookId}}"
|
||||||
|
target="_blank">
|
||||||
|
<i class="fa fa-facebook fa-2x grow"></i>
|
||||||
|
</a> <a *ngIf="movie.externalIds.instagramId" class="media-icons" href="https://instagram.com/{{movie.externalIds.instagramId}}"
|
||||||
|
target="_blank">
|
||||||
|
<i class="fa fa-istagram fa-2x grow"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -85,26 +100,48 @@
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2 card-full">
|
<div class="col-md-2 card-full">
|
||||||
<div><button mat-raised-button class="btn-spacing" color="accent">Request</button></div>
|
<div><button mat-raised-button class="btn-green btn-spacing" *ngIf="movie.available"> {{ 'Common.Available' | translate }}</button></div>
|
||||||
<div><button mat-raised-button class="btn-green btn-spacing">Available</button></div>
|
<div *ngIf="!movie.available">
|
||||||
|
<div *ngIf="movie.requested || movie.approved; then requestedBtn else notRequestedBtn"></div>
|
||||||
|
<ng-template #requestedBtn>
|
||||||
|
<button mat-raised-button class="btn-spacing btn-orange" [disabled]><i
|
||||||
|
class="fa fa-check"></i> {{ 'Common.Requested' | translate }}</button>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template #notRequestedBtn>
|
||||||
|
<button mat-raised-button class="btn-spacing"
|
||||||
|
(click)="request()">
|
||||||
|
<i *ngIf="movie.requestProcessing" class="fa fa-circle-o-notch fa-spin fa-fw"></i> <i
|
||||||
|
*ngIf="!movie.requestProcessing && !movie.processed" class="fa fa-plus"></i>
|
||||||
|
<i *ngIf="movie.processed && !movie.requestProcessing" class="fa fa-check"></i> {{
|
||||||
|
'Common.Request' | translate }}</button>
|
||||||
|
</ng-template>
|
||||||
|
</div>
|
||||||
<div><button mat-raised-button class="btn-spacing" color="warn">Deny</button></div>
|
<div><button mat-raised-button class="btn-spacing" color="warn">Deny</button></div>
|
||||||
|
<div *ngIf="result.available">
|
||||||
|
<a *ngIf="result.plexUrl" mat-raised-button style="text-align: right" class="btn-spacing btn-greem" href="{{result.plexUrl}}"
|
||||||
|
target="_blank"><i class="fa fa-eye"></i> {{'Search.ViewOnPlex' | translate}}</a>
|
||||||
|
<a *ngIf="result.embyUrl" mat-raised-button class="btn-green btn-spacing"
|
||||||
|
href="{{result.embyUrl}}" target="_blank"><i class="fa fa-eye"></i> {{'Search.ViewOnEmby' |
|
||||||
|
translate}}</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row card-spacer">
|
<div class="row card-spacer">
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<div><div>
|
<div>
|
||||||
<a *ngIf="movie.homepage" class="btn-spacing" href="{{movie.homepage}}" target="_blank"
|
<div>
|
||||||
mat-raised-button color="accent">Home Page</a></div>
|
<a *ngIf="movie.homepage" class="btn-spacing" href="{{movie.homepage}}" target="_blank"
|
||||||
<div>
|
mat-raised-button color="accent">Home Page</a></div>
|
||||||
<a *ngIf="movie.id" href="https://www.themoviedb.org/movie/{{movie.id}}"
|
<div>
|
||||||
target="_blank" mat-raised-button class="btn-blue btn-spacing">The Movie DB</a></div>
|
<a *ngIf="movie.id" href="https://www.themoviedb.org/movie/{{movie.id}}" target="_blank"
|
||||||
<div>
|
mat-raised-button class="btn-blue btn-spacing">The Movie DB</a></div>
|
||||||
<a *ngIf="movie.imdbId" href="https://www.imdb.com/title/tt1727824/{{movie.imdbId}}" target="_blank"
|
<div>
|
||||||
mat-raised-button class="imdb-color btn-spacing">IMDb</a></div>
|
<a *ngIf="movie.imdbId" href="https://www.imdb.com/title/tt1727824/{{movie.imdbId}}" target="_blank"
|
||||||
<div>
|
mat-raised-button class="imdb-color btn-spacing">IMDb</a></div>
|
||||||
<a *ngIf="movie.videos.results.length > 0" mat-raised-button class="btn-blue btn-spacing"
|
<div>
|
||||||
(click)="openDialog()">Trailer</a></div>
|
<a *ngIf="movie.videos.results.length > 0" mat-raised-button class="btn-blue btn-spacing"
|
||||||
|
(click)="openDialog()">Trailer</a></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
$ombi-primary:#3f3f3f;
|
||||||
//MINE
|
//MINE
|
||||||
@media (max-width: 570px) {
|
@media (max-width: 570px) {
|
||||||
h1 {
|
h1 {
|
||||||
|
@ -163,4 +164,13 @@ section {
|
||||||
}
|
}
|
||||||
.grow:hover {
|
.grow:hover {
|
||||||
transform: scale(1.1);
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.media-icons {
|
||||||
|
color:$ombi-primary;
|
||||||
|
padding: 1%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.media-row {
|
||||||
|
padding-top: 2%;
|
||||||
}
|
}
|
|
@ -34,6 +34,10 @@ export class MovieDetailsComponent {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public request() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
public openDialog() {
|
public openDialog() {
|
||||||
this.dialog.open(MovieDetailsTrailerComponent, {
|
this.dialog.open(MovieDetailsTrailerComponent, {
|
||||||
width: '560px',
|
width: '560px',
|
||||||
|
|
|
@ -1,20 +1,3 @@
|
||||||
<input class="form-control quater-width" type="text" [(ngModel)]="selectedItem" placeholder="Search" aria-label="Search" [ngbTypeahead]="searchModel" [resultFormatter]="formatter"
|
<input class="form-control quater-width" type="text" [(ngModel)]="selectedItem" placeholder="Search" aria-label="Search" [ngbTypeahead]="searchModel" [resultFormatter]="formatter"
|
||||||
[inputFormatter]="formatter" (selectItem)="selected($event)">
|
[inputFormatter]="formatter" (selectItem)="selected($event)">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <mat-form-field class="quater-width"> -->
|
|
||||||
|
|
||||||
<!-- <input [(ngModel)]="searchText" placeholder="Search" (keyup)="search($event)" matInput [matAutocomplete]="auto"> -->
|
|
||||||
<!-- <mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event)">
|
|
||||||
<mat-option *ngFor="let result of searchResult" [value]="result">
|
|
||||||
<img src="https://image.tmdb.org/t/p/w92/{{result.poster_path}}" class="autocomplete-img" aria-hidden/>
|
|
||||||
<span *ngIf="result.media_type == 'tv'">
|
|
||||||
{{result.name}}
|
|
||||||
</span>
|
|
||||||
<span *ngIf="result.media_type == 'movie'">
|
|
||||||
{{result.title}}
|
|
||||||
</span>
|
|
||||||
</mat-option>
|
|
||||||
</mat-autocomplete> -->
|
|
||||||
<!-- </mat-form-field> -->
|
|
|
@ -21,7 +21,7 @@ export class NavSearchComponent {
|
||||||
public searchFailed = false;
|
public searchFailed = false;
|
||||||
|
|
||||||
|
|
||||||
public formatter = (result: IMultiSearchResult) => result.media_type == "movie" ? result.title : result.name;
|
public formatter = (result: IMultiSearchResult) => result.media_type == "movie" ? result.title + ` (${result.release_date.slice(0,4)})` : result.name + ` (${result.release_date.slice(0,4)})`;
|
||||||
|
|
||||||
public searchModel = (text$: Observable<string>) =>
|
public searchModel = (text$: Observable<string>) =>
|
||||||
text$.pipe(
|
text$.pipe(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue