itube-specs 0.0.756 → 0.0.758

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.756",
4
+ "version": "0.0.758",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {
@@ -13,5 +13,5 @@ export const cleanModelInfo = (card: IRawModelInfo): ICardInfo => ({
13
13
  relatedNames: card.relatedNames || [],
14
14
  akaNames: card.aka_names?.join(', ') || '',
15
15
  birthSummary: card.birth_summary || '',
16
- nationalityIsoCode: card.nationality_iso_code || '',
16
+ nationalityIsoCodes: card.nationality_iso_codes || [],
17
17
  })
@@ -18,15 +18,23 @@ export class VttHelper {
18
18
 
19
19
  /** Загружает и парсит VTT-файл по url из конструктора. Устанавливает hasInited = true после успешной загрузки. */
20
20
  async init(): Promise<void> {
21
- const vttContent: Response = await fetch(this.vttUrl);
21
+ if (!this.vttUrl) {
22
+ return;
23
+ }
24
+
25
+ try {
26
+ const vttContent: Response = await fetch(this.vttUrl);
22
27
 
23
- if (vttContent.body) {
24
- const reader: ReadableStreamDefaultReader<string> = vttContent.body
25
- .pipeThrough(new TextDecoderStream())
26
- .getReader();
27
- const vtt: ReadableStreamReadResult<string> = await reader.read();
28
- this.vttData = this.parseVTT(vtt);
29
- this.hasInited = true;
28
+ if (vttContent.body) {
29
+ const reader: ReadableStreamDefaultReader<string> = vttContent.body
30
+ .pipeThrough(new TextDecoderStream())
31
+ .getReader();
32
+ const vtt: ReadableStreamReadResult<string> = await reader.read();
33
+ this.vttData = this.parseVTT(vtt);
34
+ this.hasInited = true;
35
+ }
36
+ } catch {
37
+ this.hasInited = false;
30
38
  }
31
39
  }
32
40
 
@@ -24,7 +24,7 @@ export interface ICardInfo {
24
24
  relatedNames?: string[]
25
25
  akaNames: string;
26
26
  birthSummary: string;
27
- nationalityIsoCode: string;
27
+ nationalityIsoCodes: string[];
28
28
 
29
29
  // Fields specific to Category
30
30
  related?: IChipsItem[]
@@ -40,5 +40,5 @@ export interface IRawModelInfo {
40
40
  title: string
41
41
  }[];
42
42
  birth_summary: string;
43
- nationality_iso_code: string;
43
+ nationality_iso_codes: string[];
44
44
  }