import axios from 'axios'

export interface EpisodeData {
    id: string
    title: string
    coverUrl: string
    releasedAt: number
    timeLength: number
    videoUrl: string
}

export interface QishierAllResponse {
    updatedAt: string | null
    name: string
    coverUrl: string
    displayType: number
    total: number
    years: number[]
    list: EpisodeData[]
}

export function getAllQishierList() {
    return axios.get<QishierAllResponse>('/api/qishier/all', {
        timeout: 15000
    })
}

export function refreshQishierCache() {
    return axios.post('/api/qishier/refresh', {}, {
        timeout: 15000
    })
}
