Improved the backend in regards to searching

pull/3895/head
tidusjar 6 years ago
parent 4fb965e782
commit e5b74d32d0

@ -262,6 +262,7 @@ namespace Ombi.Core.Engine.V2
var mapped = Mapper.Map<MovieFullInfoViewModel>(movie);
mapped.Available = viewMovie.Available;
mapped.Approved = viewMovie.Approved;
mapped.RequestId = viewMovie.RequestId;
mapped.Requested = viewMovie.Requested;
mapped.PlexUrl = viewMovie.PlexUrl;
@ -286,6 +287,7 @@ namespace Ombi.Core.Engine.V2
var mapped = Mapper.Map<MovieCollection>(movie);
mapped.Available = movie.Available;
mapped.Approved = movie.Approved;
mapped.RequestId = movie.RequestId;
mapped.Requested = movie.Requested;
mapped.PlexUrl = movie.PlexUrl;

@ -53,6 +53,10 @@ namespace Ombi.Core.Engine.V2
{
var tvdbshow = await Cache.GetOrAdd(nameof(GetShowInformation) + tvdbid,
async () => await TvMazeApi.ShowLookupByTheTvDbId(tvdbid), DateTime.Now.AddHours(12));
if (tvdbshow == null)
{
return null;
}
var show = await Cache.GetOrAdd("GetTvFullInformation" + tvdbshow.id,
async () => await TvMazeApi.GetTvFullInformation(tvdbshow.id), DateTime.Now.AddHours(12));
if (show == null)
@ -148,9 +152,9 @@ namespace Ombi.Core.Engine.V2
return model;
}
model.Trailer = result.Trailer.AbsoluteUri;
model.Trailer = result.Trailer?.AbsoluteUri ?? string.Empty;
model.Certification = result.Certification;
model.Homepage = result.Homepage.AbsoluteUri;
model.Homepage = result.Homepage?.AbsoluteUri ?? string.Empty;
return model;
}

@ -54,7 +54,8 @@ export class DiscoverActorComponent implements AfterViewInit {
url: null,
rating: 0,
overview: m.overview,
approved: false
approved: false,
imdbid: "",
});
});
}

@ -4,8 +4,8 @@ import { RequestType, ISearchTvResult, ISearchMovieResult } from "../../../inter
import { SearchV2Service } from "../../../services";
import { MatDialog } from "@angular/material";
import { DiscoverCardDetailsComponent } from "./discover-card-details.component";
import { ISearchTvResultV2 } from "../../interfaces/ISearchTvResultV2";
import { ISearchMovieResultV2 } from "../../interfaces/ISearchMovieResultV2";
import { ISearchTvResultV2 } from "../../../interfaces/ISearchTvResultV2";
import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2";
@Component({
selector: "discover-card",
@ -43,12 +43,12 @@ export class DiscoverCardComponent implements OnInit {
}
private getExtraMovieInfo() {
// if(!this.result.imdbid) {
if(!this.result.imdbid) {
this.searchService.getFullMovieDetails(this.result.id)
.subscribe(m => {
this.updateMovieItem(m);
});
// }
}
}
private updateMovieItem(updated: ISearchMovieResultV2) {

@ -52,7 +52,8 @@ export class DiscoverCollectionsComponent implements OnInit {
url: `http://www.imdb.com/title/${m.imdbId}/`,
rating: 0,
overview: m.overview,
approved: m.approved
approved: m.approved,
imdbid: m.imdbId,
});
});
}

Loading…
Cancel
Save