mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Improved the backend in regards to searching
This commit is contained in:
parent
4fb965e782
commit
e5b74d32d0
5 changed files with 16 additions and 8 deletions
|
@ -262,6 +262,7 @@ namespace Ombi.Core.Engine.V2
|
||||||
var mapped = Mapper.Map<MovieFullInfoViewModel>(movie);
|
var mapped = Mapper.Map<MovieFullInfoViewModel>(movie);
|
||||||
|
|
||||||
mapped.Available = viewMovie.Available;
|
mapped.Available = viewMovie.Available;
|
||||||
|
mapped.Approved = viewMovie.Approved;
|
||||||
mapped.RequestId = viewMovie.RequestId;
|
mapped.RequestId = viewMovie.RequestId;
|
||||||
mapped.Requested = viewMovie.Requested;
|
mapped.Requested = viewMovie.Requested;
|
||||||
mapped.PlexUrl = viewMovie.PlexUrl;
|
mapped.PlexUrl = viewMovie.PlexUrl;
|
||||||
|
@ -286,6 +287,7 @@ namespace Ombi.Core.Engine.V2
|
||||||
var mapped = Mapper.Map<MovieCollection>(movie);
|
var mapped = Mapper.Map<MovieCollection>(movie);
|
||||||
|
|
||||||
mapped.Available = movie.Available;
|
mapped.Available = movie.Available;
|
||||||
|
mapped.Approved = movie.Approved;
|
||||||
mapped.RequestId = movie.RequestId;
|
mapped.RequestId = movie.RequestId;
|
||||||
mapped.Requested = movie.Requested;
|
mapped.Requested = movie.Requested;
|
||||||
mapped.PlexUrl = movie.PlexUrl;
|
mapped.PlexUrl = movie.PlexUrl;
|
||||||
|
|
|
@ -53,6 +53,10 @@ namespace Ombi.Core.Engine.V2
|
||||||
{
|
{
|
||||||
var tvdbshow = await Cache.GetOrAdd(nameof(GetShowInformation) + tvdbid,
|
var tvdbshow = await Cache.GetOrAdd(nameof(GetShowInformation) + tvdbid,
|
||||||
async () => await TvMazeApi.ShowLookupByTheTvDbId(tvdbid), DateTime.Now.AddHours(12));
|
async () => await TvMazeApi.ShowLookupByTheTvDbId(tvdbid), DateTime.Now.AddHours(12));
|
||||||
|
if (tvdbshow == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
var show = await Cache.GetOrAdd("GetTvFullInformation" + tvdbshow.id,
|
var show = await Cache.GetOrAdd("GetTvFullInformation" + tvdbshow.id,
|
||||||
async () => await TvMazeApi.GetTvFullInformation(tvdbshow.id), DateTime.Now.AddHours(12));
|
async () => await TvMazeApi.GetTvFullInformation(tvdbshow.id), DateTime.Now.AddHours(12));
|
||||||
if (show == null)
|
if (show == null)
|
||||||
|
@ -148,9 +152,9 @@ namespace Ombi.Core.Engine.V2
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
model.Trailer = result.Trailer.AbsoluteUri;
|
model.Trailer = result.Trailer?.AbsoluteUri ?? string.Empty;
|
||||||
model.Certification = result.Certification;
|
model.Certification = result.Certification;
|
||||||
model.Homepage = result.Homepage.AbsoluteUri;
|
model.Homepage = result.Homepage?.AbsoluteUri ?? string.Empty;
|
||||||
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,8 @@ export class DiscoverActorComponent implements AfterViewInit {
|
||||||
url: null,
|
url: null,
|
||||||
rating: 0,
|
rating: 0,
|
||||||
overview: m.overview,
|
overview: m.overview,
|
||||||
approved: false
|
approved: false,
|
||||||
|
imdbid: "",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,8 @@ import { RequestType, ISearchTvResult, ISearchMovieResult } from "../../../inter
|
||||||
import { SearchV2Service } from "../../../services";
|
import { SearchV2Service } from "../../../services";
|
||||||
import { MatDialog } from "@angular/material";
|
import { MatDialog } from "@angular/material";
|
||||||
import { DiscoverCardDetailsComponent } from "./discover-card-details.component";
|
import { DiscoverCardDetailsComponent } from "./discover-card-details.component";
|
||||||
import { ISearchTvResultV2 } from "../../interfaces/ISearchTvResultV2";
|
import { ISearchTvResultV2 } from "../../../interfaces/ISearchTvResultV2";
|
||||||
import { ISearchMovieResultV2 } from "../../interfaces/ISearchMovieResultV2";
|
import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "discover-card",
|
selector: "discover-card",
|
||||||
|
@ -43,12 +43,12 @@ export class DiscoverCardComponent implements OnInit {
|
||||||
|
|
||||||
}
|
}
|
||||||
private getExtraMovieInfo() {
|
private getExtraMovieInfo() {
|
||||||
// if(!this.result.imdbid) {
|
if(!this.result.imdbid) {
|
||||||
this.searchService.getFullMovieDetails(this.result.id)
|
this.searchService.getFullMovieDetails(this.result.id)
|
||||||
.subscribe(m => {
|
.subscribe(m => {
|
||||||
this.updateMovieItem(m);
|
this.updateMovieItem(m);
|
||||||
});
|
});
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateMovieItem(updated: ISearchMovieResultV2) {
|
private updateMovieItem(updated: ISearchMovieResultV2) {
|
||||||
|
|
|
@ -52,7 +52,8 @@ export class DiscoverCollectionsComponent implements OnInit {
|
||||||
url: `http://www.imdb.com/title/${m.imdbId}/`,
|
url: `http://www.imdb.com/title/${m.imdbId}/`,
|
||||||
rating: 0,
|
rating: 0,
|
||||||
overview: m.overview,
|
overview: m.overview,
|
||||||
approved: m.approved
|
approved: m.approved,
|
||||||
|
imdbid: m.imdbId,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue