Renaming links to slugs

This commit is contained in:
Zoe Roux 2020-06-08 19:29:17 +02:00
parent 82dfe99c68
commit 0c966ed49e
4 changed files with 13 additions and 13 deletions

View File

@ -2,7 +2,7 @@
<div class="episodes" #scrollView (scroll)="onScroll()"> <div class="episodes" #scrollView (scroll)="onScroll()">
<div class="episode" *ngFor="let episode of this.episodes" #episodeDom > <div class="episode" *ngFor="let episode of this.episodes" #episodeDom >
<button mat-icon-button class="moreBtn" [matMenuTriggerFor]="more" [matMenuTriggerData]="{episode: episode}"><i class="material-icons">more_vert</i></button> <button mat-icon-button class="moreBtn" [matMenuTriggerFor]="more" [matMenuTriggerData]="{episode: episode}"><i class="material-icons">more_vert</i></button>
<a routerLink="/watch/{{episode.link}}" href="/watch/{{episode.link}}"> <a routerLink="/watch/{{episode.slug}}" href="/watch/{{episode.slug}}">
<div matRipple class="img" [style.background-image]="sanitize(episode.thumb)"> <div matRipple class="img" [style.background-image]="sanitize(episode.thumb)">
<button mat-icon-button class="playBtn"><i class="material-icons playIcon">play_circle_outline</i></button> <button mat-icon-button class="playBtn"><i class="material-icons playIcon">play_circle_outline</i></button>
</div> </div>

View File

@ -414,11 +414,11 @@ export class PlayerComponent implements OnInit
if (this.playMethod == method.direct) if (this.playMethod == method.direct)
{ {
this.player.src = "/video/" + this.item.link; this.player.src = "/video/" + this.item.slug;
} }
else if (this.playMethod == method.transmux) else if (this.playMethod == method.transmux)
{ {
this.hlsPlayer.loadSource("/video/transmux/" + this.item.link + "/"); this.hlsPlayer.loadSource("/video/transmux/" + this.item.slug + "/");
this.hlsPlayer.attachMedia(this.player); this.hlsPlayer.attachMedia(this.player);
this.hlsPlayer.on(Hls.Events.MANIFEST_LOADED, () => this.hlsPlayer.on(Hls.Events.MANIFEST_LOADED, () =>
{ {
@ -427,7 +427,7 @@ export class PlayerComponent implements OnInit
} }
else else
{ {
this.hlsPlayer.loadSource("/video/transcode/" + this.item.link + "/"); this.hlsPlayer.loadSource("/video/transcode/" + this.item.slug + "/");
this.hlsPlayer.attachMedia(this.player); this.hlsPlayer.attachMedia(this.player);
this.hlsPlayer.on(Hls.Events.MANIFEST_LOADED, () => this.hlsPlayer.on(Hls.Events.MANIFEST_LOADED, () =>
{ {
@ -444,7 +444,7 @@ export class PlayerComponent implements OnInit
next() next()
{ {
if (this.item.nextEpisode != null) if (this.item.nextEpisode != null)
this.router.navigate(["/watch/" + this.item.nextEpisode.link], { queryParamsHandling: "merge", replaceUrl: true }); this.router.navigate(["/watch/" + this.item.nextEpisode.slug], { queryParamsHandling: "merge", replaceUrl: true });
} }
previous() previous()

View File

@ -6,7 +6,7 @@ export interface Episode
episodeNumber: number; episodeNumber: number;
title: string; title: string;
thumb: string; thumb: string;
link: string; slug: string;
overview: string; overview: string;
releaseDate; releaseDate;
runtime: number; runtime: number;

View File

@ -7,7 +7,7 @@ export interface WatchItem
seasonNumber: number; seasonNumber: number;
episodeNumber: number; episodeNumber: number;
title: string; title: string;
link: string; slug: string;
duration: number; duration: number;
releaseDate; releaseDate;
isMovie: boolean; isMovie: boolean;