File size: 3,470 Bytes
64f8d95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b859647
 
64f8d95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fe0ce09
 
 
 
 
 
 
64f8d95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31e643e
 
 
 
 
 
 
 
 
 
64f8d95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b246ace
 
 
 
 
 
 
31e643e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// ─── Shared Types ──────────────────────────────────────────────────────────

export interface FileEntry {
  id: string;
  name: string;
  relativePath?: string;
  folder: string;
  sizeBytes: number;
  createdAt: number;
  source: string;
  mimeType?: string;
}

export interface Job {
  id: string;
  status: "running" | "done" | "failed" | "stopped";
  settings: Record<string, unknown>;
  progress: {
    percent: number;
    fps: number;
    bitrateKbps: number;
    sizeOutBytes: number;
    etaSeconds: number;
    speed?: number;
    log: string[];
  } | null;
  outputFolder: string;
  createdAt: number;
  batchIndex?: number;
  batchTotal?: number;
}

export interface DownloadJob {
  id: string;
  status: "running" | "done" | "failed" | "stopped";
  filename: string;
  url: string;
  bytesDownloaded: number;
  totalBytes: number;
  speedBytesPerSec?: number;
  useAria2?: boolean;
  error: string | null;
}

export interface VideoInfo {
  fileSize: string;
  duration: string;
  durationSeconds?: number;
  video: {
    codec: string;
    profile?: string;
    resolution: string;
    frameRate: string;
    bitrate: string;
    pixFmt: string;
    streamSize: string;
  } | null;
  audio: {
    codec: string;
    sampleRate: string;
    channels: string;
    channelLayout: string;
    bitrate: string;
    streamSize: string;
  } | null;
  audioStreams?: Array<{
    index: number;
    codec: string;
    language: string;
    title: string;
    channels: string;
    channelLayout: string;
    sampleRate: string;
    bitrate: string;
    streamSize: string;
  }>;
  subtitleStreams?: Array<{
    index: number;
    codec: string;
    language: string;
    title: string;
    default: boolean;
    forced: boolean;
  }>;
  encodeSettings?: {
    inputFilename: string;
    outputFilename: string;
    resolution?: string;
    settings: Record<string, unknown>;
  };
  savedCropSettings?: {
    cropEnabled: boolean;
    cropLeft: number;
    cropRight: number;
    cropTop: number;
    cropBottom: number;
  };
}

export interface RemoteEntry {
  name: string;
  isDir: boolean;
  size?: number;
  sizeStr?: string;
  type?: string;
  downloadUrl?: string;
  hfPath?: string;
  hfOrg?: string;
  hfBucket?: string;
}

export interface TeleboxEntry {
  id: string;
  itemId?: string;
  name: string;
  isDir: boolean;
  size?: number;
  sizeStr?: string;
  type?: string;
  subType?: string;
  pid?: number;
}

export interface BackblazeEntry {
  key: string;
  name: string;
  isDir: boolean;
  size?: number;
  sizeStr?: string;
  type?: string;
  lastModified?: string;
}

export interface PixeldrainJob {
  id: string;
  status: "running" | "done" | "failed";
  filename: string;
  bytesUploaded: number;
  totalBytes: number;
  pixeldrainUrl: string | null;
  error: string | null;
}

export interface QueueItem {
  uid: string;
  file: FileEntry;
  status: "waiting" | "encoding" | "done" | "failed";
  jobId: string | null;
  settings: Record<string, unknown>;
  presetLabel?: string;
}

export interface EncodePreset {
  id: number;
  label: string;
  settings: Record<string, unknown>;
}

// Per-remote URL credentials
export interface RemoteCredentials {
  hfToken: string;
  hfS3AccessKeyId: string;
  hfS3SecretAccessKey: string;
}

export type Tab = "files" | "encode" | "jobs" | "remote" | "telebox" | "backblaze";