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="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>
<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)">
<button mat-icon-button class="playBtn"><i class="material-icons playIcon">play_circle_outline</i></button>
</div>
@ -19,13 +19,13 @@
</a>
</div>
</div>
<mat-menu #more="matMenu">
<ng-template matMenuContent let-episode="episode">
<a [href]="'/video/' + episode.link" download><button mat-menu-item>Download episode</button></a>
</ng-template>
</mat-menu>
<button mat-raised-button color="accent" class="scrollBtn leftBtn d-none" #leftBtn (click)="scrollLeft()"><mat-icon>arrow_left</mat-icon></button>
<button mat-raised-button color="accent" class="scrollBtn rightBtn" #rightBtn (click)="scrollRight()"><mat-icon>arrow_right</mat-icon></button>
</div>

View File

@ -52,8 +52,8 @@ export class PlayerComponent implements OnInit
private thumb: HTMLElement;
private progress: HTMLElement;
private buffered: HTMLElement;
private oidcSecurity: OidcSecurityService;
constructor(private route: ActivatedRoute, private sanitizer: DomSanitizer, private snackBar: MatSnackBar, private title: Title, private router: Router, private location: Location, private injector: Injector) { }
@ -78,7 +78,7 @@ export class PlayerComponent implements OnInit
this.title.setTitle(this.item.showTitle + " - Kyoo");
else
this.title.setTitle(this.item.showTitle + " S" + this.item.seasonNumber + ":E" + this.item.episodeNumber + " - Kyoo");
if (navigator.userAgent.match(/Mobi/) && document.fullscreenElement == null)
{
this.fullscreen();
@ -414,11 +414,11 @@ export class PlayerComponent implements OnInit
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)
{
this.hlsPlayer.loadSource("/video/transmux/" + this.item.link + "/");
this.hlsPlayer.loadSource("/video/transmux/" + this.item.slug + "/");
this.hlsPlayer.attachMedia(this.player);
this.hlsPlayer.on(Hls.Events.MANIFEST_LOADED, () =>
{
@ -427,7 +427,7 @@ export class PlayerComponent implements OnInit
}
else
{
this.hlsPlayer.loadSource("/video/transcode/" + this.item.link + "/");
this.hlsPlayer.loadSource("/video/transcode/" + this.item.slug + "/");
this.hlsPlayer.attachMedia(this.player);
this.hlsPlayer.on(Hls.Events.MANIFEST_LOADED, () =>
{
@ -444,7 +444,7 @@ export class PlayerComponent implements OnInit
next()
{
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()
@ -620,7 +620,7 @@ export class PlayerComponent implements OnInit
track.src = subtitle.link.replace(".srt", ".vtt");
track.classList.add("subtitle_container");
track.default = true;
track.onload = () =>
track.onload = () =>
{
this.player.textTracks[0].mode = "showing";
};

View File

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

View File

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