Added anime type and fixed image in player
This commit is contained in:
parent
3799bc5330
commit
2e2609b3a6
@ -1,4 +1,5 @@
|
|||||||
import { AnimeNotifier } from "./AnimeNotifier"
|
import { AnimeNotifier } from "./AnimeNotifier"
|
||||||
|
import { Anime } from "./Types/Anime"
|
||||||
|
|
||||||
export class AudioPlayer {
|
export class AudioPlayer {
|
||||||
arn: AnimeNotifier
|
arn: AnimeNotifier
|
||||||
@ -269,10 +270,10 @@ export class AudioPlayer {
|
|||||||
if(animeId !== "") {
|
if(animeId !== "") {
|
||||||
this.animeInfo.classList.remove("hidden")
|
this.animeInfo.classList.remove("hidden")
|
||||||
let animeResponse = await fetch("/api/anime/" + animeId)
|
let animeResponse = await fetch("/api/anime/" + animeId)
|
||||||
let anime = await animeResponse.json()
|
let anime = await animeResponse.json() as Anime
|
||||||
this.animeLink.title = anime.title.canonical
|
this.animeLink.title = anime.title.canonical
|
||||||
this.animeLink.href = "/anime/" + anime.id
|
this.animeLink.href = "/anime/" + anime.id
|
||||||
this.animeImage.dataset.src = "//media.notify.moe/images/anime/medium/" + anime.id + ".jpg"
|
this.animeImage.dataset.src = "//media.notify.moe/images/anime/medium/" + anime.id + ".jpg?" + anime.image.lastModified.toString()
|
||||||
this.animeImage.classList.remove("hidden")
|
this.animeImage.classList.remove("hidden")
|
||||||
this.animeImage["became visible"]()
|
this.animeImage["became visible"]()
|
||||||
}
|
}
|
||||||
|
85
scripts/Types/Anime.d.ts
vendored
Normal file
85
scripts/Types/Anime.d.ts
vendored
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
declare module anime {
|
||||||
|
export interface Title {
|
||||||
|
canonical: string;
|
||||||
|
romaji: string;
|
||||||
|
english: string;
|
||||||
|
japanese: string;
|
||||||
|
hiragana: string;
|
||||||
|
synonyms: any[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AverageColor {
|
||||||
|
hue: number;
|
||||||
|
saturation: number;
|
||||||
|
lightness: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Image {
|
||||||
|
extension: string;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
averageColor: AverageColor;
|
||||||
|
lastModified: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Count {
|
||||||
|
overall: number;
|
||||||
|
story: number;
|
||||||
|
visuals: number;
|
||||||
|
soundtrack: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Rating {
|
||||||
|
overall: number;
|
||||||
|
story: number;
|
||||||
|
visuals: number;
|
||||||
|
soundtrack: number;
|
||||||
|
count: Count;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Popularity {
|
||||||
|
watching: number;
|
||||||
|
completed: number;
|
||||||
|
planned: number;
|
||||||
|
hold: number;
|
||||||
|
dropped: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Trailer {
|
||||||
|
service: string;
|
||||||
|
serviceId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Mapping {
|
||||||
|
service: string;
|
||||||
|
serviceId: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Anime {
|
||||||
|
id: string;
|
||||||
|
type: string;
|
||||||
|
title: anime.Title;
|
||||||
|
summary: string;
|
||||||
|
status: string;
|
||||||
|
genres: string[];
|
||||||
|
startDate: string;
|
||||||
|
endDate: string;
|
||||||
|
episodeCount: number;
|
||||||
|
episodeLength: number;
|
||||||
|
source: string;
|
||||||
|
image: anime.Image;
|
||||||
|
firstChannel: string;
|
||||||
|
rating: anime.Rating;
|
||||||
|
popularity: anime.Popularity;
|
||||||
|
trailers: anime.Trailer[];
|
||||||
|
mappings: anime.Mapping[];
|
||||||
|
studios: string[];
|
||||||
|
producers: string[];
|
||||||
|
licensors: string[];
|
||||||
|
links?: any;
|
||||||
|
created: string;
|
||||||
|
createdBy: string;
|
||||||
|
edited: string;
|
||||||
|
editedBy: string;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user