4, partial 5

This commit is contained in:
2026-02-04 01:00:57 -05:00
parent 7b5c256e07
commit d5ce8452e4
20 changed files with 2215 additions and 69 deletions

86
src/types/episode.ts Normal file
View File

@@ -0,0 +1,86 @@
/**
* Episode type definitions for PodTUI
*/
/** Episode playback status */
export enum EpisodeStatus {
NOT_STARTED = "not_started",
PLAYING = "playing",
PAUSED = "paused",
COMPLETED = "completed",
}
/** Core episode information */
export interface Episode {
/** Unique identifier */
id: string
/** Parent podcast ID */
podcastId: string
/** Episode title */
title: string
/** Episode description/show notes */
description: string
/** Audio file URL */
audioUrl: string
/** Duration in seconds */
duration: number
/** Publication date */
pubDate: Date
/** Episode number (if available) */
episodeNumber?: number
/** Season number (if available) */
seasonNumber?: number
/** Episode type (full, trailer, bonus) */
episodeType?: EpisodeType
/** Whether episode is explicit */
explicit?: boolean
/** Episode image URL (if different from podcast) */
imageUrl?: string
/** File size in bytes */
fileSize?: number
/** MIME type */
mimeType?: string
}
/** Episode type enumeration */
export enum EpisodeType {
FULL = "full",
TRAILER = "trailer",
BONUS = "bonus",
}
/** Episode playback progress */
export interface Progress {
/** Episode ID */
episodeId: string
/** Current position in seconds */
position: number
/** Total duration in seconds */
duration: number
/** Last played timestamp */
timestamp: Date
/** Playback speed (1.0 = normal) */
playbackSpeed?: number
}
/** Episode with playback state */
export interface EpisodeWithProgress extends Episode {
/** Current playback status */
status: EpisodeStatus
/** Playback progress */
progress?: Progress
}
/** Episode list item for display */
export interface EpisodeListItem {
/** Episode data */
episode: Episode
/** Podcast title (for display in feeds) */
podcastTitle: string
/** Podcast cover URL */
podcastCoverUrl?: string
/** Current status */
status: EpisodeStatus
/** Progress percentage (0-100) */
progressPercent: number
}