mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-22 06:50:33 -04:00
Fixing show's details studio/genres dependency
This commit is contained in:
parent
1dbbc0a67a
commit
93afbd9e01
@ -73,7 +73,7 @@ const routes: Routes = [
|
||||
},
|
||||
|
||||
{path: "show/:slug", component: ShowDetailsComponent,
|
||||
resolve: {show: ItemResolver.forResource<Show>("shows/:slug")},
|
||||
resolve: {show: ItemResolver.forResource<Show>("shows/:slug?fields=studio,genres")},
|
||||
canLoad: [AuthGuard.forPermissions("read")],
|
||||
canActivate: [AuthGuard.forPermissions("read")]
|
||||
},
|
||||
|
@ -123,12 +123,18 @@ export class ShowDetailsComponent implements AfterViewInit, OnDestroy
|
||||
|
||||
openTrailer(): void
|
||||
{
|
||||
this.dialog.open(TrailerDialogComponent, {width: "80%", height: "45vw", data: this.show.trailerUrl, panelClass: "panel"});
|
||||
this.dialog.open(TrailerDialogComponent, {
|
||||
width: "80%",
|
||||
height: "45vw",
|
||||
data: this.show.trailerUrl,
|
||||
panelClass: "panel"
|
||||
});
|
||||
}
|
||||
|
||||
editMetadata(): void
|
||||
{
|
||||
this.dialog.open(MetadataEditComponent, {width: "80%", data: this.show}).afterClosed().subscribe((result: Show) =>
|
||||
this.dialog.open(MetadataEditComponent, {width: "80%", data: this.show})
|
||||
.afterClosed().subscribe((result: Show) =>
|
||||
{
|
||||
if (result) {
|
||||
this.show = result;
|
||||
@ -138,7 +144,8 @@ export class ShowDetailsComponent implements AfterViewInit, OnDestroy
|
||||
|
||||
redownloadImages(): void
|
||||
{
|
||||
this.http.put(`api/task/extract/show/${this.show.slug}/thumbnails`, undefined).subscribe(() => { }, error =>
|
||||
this.http.put(`api/task/extract/show/${this.show.slug}/thumbnails`, undefined)
|
||||
.subscribe(() => { }, error =>
|
||||
{
|
||||
console.log(error.status + " - " + error.message);
|
||||
this.snackBar.open("An unknown error occurred while re-downloading images.", null, {
|
||||
@ -151,7 +158,8 @@ export class ShowDetailsComponent implements AfterViewInit, OnDestroy
|
||||
|
||||
extractSubs(): void
|
||||
{
|
||||
this.http.put(`api/task/extract/show/${this.show.slug}/subs`, undefined).subscribe(() => { }, error =>
|
||||
this.http.put(`api/task/extract/show/${this.show.slug}/subs`, undefined)
|
||||
.subscribe(() => { }, error =>
|
||||
{
|
||||
console.log(error.status + " - " + error.message);
|
||||
this.snackBar.open("An unknown error occurred while re-downloading images.", null, {
|
||||
|
@ -21,7 +21,7 @@ export class ItemResolver
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot): T | Observable<T> | Promise<T>
|
||||
{
|
||||
const res: string = resource.replace(/:(.*?)(\/|$)/g, (x, y) => `${route.paramMap.get(y)}/`);
|
||||
const res: string = resource.replace(/:(.*?)(\/|\?|$)/g, (x, y, z) => `${route.paramMap.get(y)}${z}`);
|
||||
|
||||
return this.http.get<T>(`api/${res}`)
|
||||
.pipe(
|
||||
|
Loading…
x
Reference in New Issue
Block a user