Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Updated User.ts query to include deprecated stat fields
Browse files Browse the repository at this point in the history
  • Loading branch information
RLAlpha49 committed Apr 26, 2024
1 parent 9feaf87 commit a3b2593
Show file tree
Hide file tree
Showing 17 changed files with 266 additions and 33 deletions.
5 changes: 5 additions & 0 deletions src/apis/anilist/interfaces/ActivityHistory.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface ActivityHistory {
date: number;
amount: number;
level: number;
}
4 changes: 4 additions & 0 deletions src/apis/anilist/interfaces/Distribution.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface Distribution {
status: string;
amount: number;
}
15 changes: 15 additions & 0 deletions src/apis/anilist/interfaces/Favoured.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {Tag} from "./Tag";
import {Staff} from "./Staff";
import {Studio} from "./Studio";

export interface Favoured {
genre?: string;
amount: number;
meanScore: number;
timeWatched: number;
tag?: Tag;
staff?: Staff;
studio?: Studio;
year?: number;
format?: string;
}
4 changes: 4 additions & 0 deletions src/apis/anilist/interfaces/ListScores.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface ListScores {
meanScore: number;
standardDeviation: number;
}
4 changes: 2 additions & 2 deletions src/apis/anilist/interfaces/Media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { NextAiringEpisode } from './NextAiringEpisode'
import { ExternalLink } from './ExternalLink'
import { StreamingEpisode } from './StreamingEpisode'
import { Ranking } from './Ranking'
import { Stats } from './Stats'
import { MediaStats } from './MediaStats'
import { MediaListEntry } from './MediaListEntry'

export interface Media {
Expand Down Expand Up @@ -51,7 +51,7 @@ export interface Media {
streamingEpisodes: StreamingEpisode[]
rankings: Ranking[]
mediaListEntry: MediaListEntry
stats: Stats
stats: MediaStats
siteUrl: string
autoCreateForumThread: boolean
isRecommendationBlocked: boolean
Expand Down
23 changes: 23 additions & 0 deletions src/apis/anilist/interfaces/MediaStatistics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {Stat} from "./Stat";

export interface MediaStatistics {
count: number;
meanScore: number;
standardDeviation: number;
minutesWatched?: number;
episodesWatched?: number;
chaptersRead?: number;
volumesRead?: number;
formats: Stat[];
statuses: Stat[];
scores: Stat[];
lengths: Stat[];
releaseYears: Stat[];
startYears: Stat[];
genres: Stat[];
tags: Stat[];
countries: Stat[];
voiceActors?: Stat[];
staff: Stat[];
studios: Stat[];
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ScoreDistribution } from './ScoreDistribution'
import { StatusDistribution } from './StatusDistribution'

export interface Stats {
export interface MediaStats {
scoreDistribution: ScoreDistribution[]
statusDistribution: StatusDistribution[]
}
2 changes: 2 additions & 0 deletions src/apis/anilist/interfaces/Name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ export interface Name {
last: string
full: string
native: string
alternative: string
userPreferred: string
}
6 changes: 6 additions & 0 deletions src/apis/anilist/interfaces/Staff.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {Name} from "./Name";

export interface Staff {
id: number;
name: Name;
}
24 changes: 24 additions & 0 deletions src/apis/anilist/interfaces/Stat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {Tag} from "./Tag";
import {Staff} from "./Staff";
import {Studio} from "./Studio";

export interface Stat {
count: number;
meanScore: number;
minutesWatched?: number;
chaptersRead?: number;
mediaIds: number[];
format?: string;
status?: string;
score?: number;
length?: number;
releaseYear?: number;
startYear?: number;
genre?: string;
tag?: Tag;
country?: string;
voiceActor?: Staff;
characterIds?: number[];
staff?: Staff;
studio?: Studio;
}
6 changes: 6 additions & 0 deletions src/apis/anilist/interfaces/Statistics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {MediaStatistics} from "./MediaStatistics";

export interface Statistics {
anime: MediaStatistics;
manga: MediaStatistics;
}
4 changes: 4 additions & 0 deletions src/apis/anilist/interfaces/Studio.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface Studio {
id: number;
name: string;
}
1 change: 1 addition & 0 deletions src/apis/anilist/interfaces/Tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface Tag {
id: number
name: string
description: string
category: string
rank: number
isGeneralSpoiler: boolean
isMediaSpoiler: boolean
Expand Down
25 changes: 25 additions & 0 deletions src/apis/anilist/interfaces/UserStats.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {ActivityHistory} from "./ActivityHistory";
import {Distribution} from "./Distribution";
import {ScoreDistribution} from "./ScoreDistribution";
import {ListScores} from "./ListScores";
import {Favoured} from "./Favoured";

export interface UserStats {
watchedTime: number;
chaptersRead: number;
activityHistory: ActivityHistory[];
animeStatusDistribution: Distribution[];
mangaStatusDistribution: Distribution[];
animeScoreDistribution: ScoreDistribution[];
mangaScoreDistribution: ScoreDistribution[];
animeListScores: ListScores;
mangaListScores: ListScores;
favouredGenresOverview: Favoured[];
favouredGenres: Favoured[];
favouredTags: Favoured[];
favouredActors: Favoured[];
favouredStaff: Favoured[];
favouredStudios: Favoured[];
favouredYears: Favoured[];
favouredFormats: Favoured[];
}
4 changes: 2 additions & 2 deletions src/apis/anilist/interfaces/responses/Media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { NextAiringEpisode } from '../NextAiringEpisode'
import { ExternalLink } from '../ExternalLink'
import { StreamingEpisode } from '../StreamingEpisode'
import { Ranking } from '../Ranking'
import { Stats } from '../Stats'
import { MediaStats } from '../MediaStats'
import { MediaListEntry } from '../MediaListEntry'
import { Name } from '../Name'
import { Image } from '../Image'
Expand Down Expand Up @@ -110,7 +110,7 @@ export interface MediaResponse {
streamingEpisodes: StreamingEpisode[]
rankings: Ranking[]
mediaListEntry: MediaListEntry
stats: Stats
stats: MediaStats
siteUrl: string
autoCreateForumThread: boolean
isRecommendationBlocked: boolean
Expand Down
8 changes: 4 additions & 4 deletions src/apis/anilist/interfaces/responses/User.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Image } from '../Image'
import {Statistics} from "../Statistics";
import {UserStats} from "../UserStats";

export interface UserResponse {
id: number
Expand Down Expand Up @@ -53,10 +55,8 @@ export interface UserResponse {
staff: any[]
studios: any[]
}
statistics: {
anime: any
manga: any
}
statistics: Statistics
stats: UserStats
unreadNotificationCount: number
siteUrl: string
donatorTier: number
Expand Down
Loading

0 comments on commit a3b2593

Please sign in to comment.