movieDbId was switched to string fron number so accomodated for change

pull/2093/head
Anojh 7 years ago
parent 609f4ab064
commit 892ce167c9

@ -93,11 +93,11 @@ export class IssueDetailsComponent implements OnInit {
private setBackground(issue: any) {
if (issue.requestType === 1) {
this.imageService.getMovieBackground(Number(issue.providerId)).subscribe(x => {
this.imageService.getMovieBackground(issue.providerId).subscribe(x => {
this.backgroundPath = this.sanitizer.bypassSecurityTrustStyle
("url(" + x + ")");
});
this.imageService.getMoviePoster(Number(issue.providerId)).subscribe(x => {
this.imageService.getMoviePoster(issue.providerId).subscribe(x => {
this.posterPath = x.toString();
});

@ -21,7 +21,7 @@ export class ImageService extends ServiceHelpers {
return this.http.get<string>(`${this.url}tv/${tvdbid}`, {headers: this.headers});
}
public getMoviePoster(movieDbId: number): Observable<string> {
public getMoviePoster(movieDbId: string): Observable<string> {
return this.http.get<string>(`${this.url}poster/movie/${movieDbId}`, { headers: this.headers });
}
@ -29,7 +29,7 @@ export class ImageService extends ServiceHelpers {
return this.http.get<string>(`${this.url}poster/tv/${tvdbid}`, { headers: this.headers });
}
public getMovieBackground(movieDbId: number): Observable<string> {
public getMovieBackground(movieDbId: string): Observable<string> {
return this.http.get<string>(`${this.url}background/movie/${movieDbId}`, { headers: this.headers });
}

@ -58,7 +58,7 @@ namespace Ombi.Controllers
}
[HttpGet("poster/movie/{movieDbId}")]
public async Task<string> GetMoviePoster(int movieDbId)
public async Task<string> GetMoviePoster(string movieDbId)
{
var key = await _cache.GetOrAdd(CacheKeys.FanartTv, async () => await Config.Get(Store.Entities.ConfigurationTypes.FanartTv), DateTime.Now.AddDays(1));
@ -118,7 +118,7 @@ namespace Ombi.Controllers
}
[HttpGet("background/movie/{movieDbId}")]
public async Task<string> GetMovieBackground(int movieDbId)
public async Task<string> GetMovieBackground(string movieDbId)
{
var key = await _cache.GetOrAdd(CacheKeys.FanartTv, async () => await Config.Get(Store.Entities.ConfigurationTypes.FanartTv), DateTime.Now.AddDays(1));
@ -182,11 +182,11 @@ namespace Ombi.Controllers
if (moviesArray.Any())
{
var item = rand.Next(moviesArray.Length);
var result = await FanartTvApi.GetMovieImages(moviesArray[item], key.Value);
var result = await FanartTvApi.GetMovieImages(moviesArray[item].ToString(), key.Value);
while (!result.moviebackground.Any())
{
result = await FanartTvApi.GetMovieImages(moviesArray[item], key.Value);
result = await FanartTvApi.GetMovieImages(moviesArray[item].ToString(), key.Value);
}
movieUrl = result.moviebackground[0].url;

Loading…
Cancel
Save