Skip to content

Commit 0a8f299

Browse files
author
Greg Trihus
committed
Updated burrito files to conform to schema
1 parent a352374 commit 0a8f299

File tree

3 files changed

+64
-50
lines changed

3 files changed

+64
-50
lines changed

src/renderer/src/burrito/data/burritoBuilder.ts

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,22 @@ interface BurritoLanguage {
3838
};
3939
}
4040

41-
interface BurritoFormat {
42-
compression: string;
43-
trackConfiguration?: string;
44-
bitRate?: number;
45-
bitDepth?: number;
46-
samplingRate?: number;
47-
}
48-
49-
export interface BurritoFormats {
50-
[key: string]: BurritoFormat;
51-
}
41+
// interface BurritoFormat {
42+
// compression: string;
43+
// trackConfiguration?: string;
44+
// bitRate?: number;
45+
// bitDepth?: number;
46+
// samplingRate?: number;
47+
// }
48+
49+
// export interface BurritoFormats {
50+
// [key: string]: BurritoFormat;
51+
// }
5252

5353
interface BurritoFlavor {
5454
name: string;
55-
performance: string[];
56-
formats: BurritoFormats;
55+
// performance: string[];
56+
// formats: BurritoFormats;
5757
}
5858

5959
export interface BurritoScopes {
@@ -112,7 +112,7 @@ interface BurritoIngredient {
112112
scope?: {
113113
[key: string]: string[];
114114
};
115-
role?: string[];
115+
role?: string;
116116
}
117117

118118
export interface BurritoIngredients {
@@ -177,8 +177,8 @@ export class BurritoBuilder {
177177
name: 'scripture',
178178
flavor: {
179179
name: 'audioTranslation',
180-
performance: [],
181-
formats: {},
180+
// performance: [],
181+
// formats: {},
182182
},
183183
currentScope: {},
184184
},
@@ -198,11 +198,11 @@ export class BurritoBuilder {
198198
return this;
199199
}
200200

201-
withIdAuthority(id: string, name: string): BurritoBuilder {
201+
withIdAuthority(key: string, id: string, name: string): BurritoBuilder {
202202
if (!this.burrito.idAuthorities) {
203203
this.burrito.idAuthorities = {};
204204
}
205-
this.burrito.idAuthorities[id] = {
205+
this.burrito.idAuthorities[key] = {
206206
id,
207207
name: { en: name },
208208
};
@@ -239,8 +239,8 @@ export class BurritoBuilder {
239239
name: '',
240240
flavor: {
241241
name: '',
242-
performance: [],
243-
formats: {},
242+
// performance: [],
243+
// formats: {},
244244
},
245245
currentScope: {},
246246
},
@@ -250,8 +250,8 @@ export class BurritoBuilder {
250250
name: '',
251251
flavor: {
252252
name: '',
253-
performance: [],
254-
formats: {},
253+
// performance: [],
254+
// formats: {},
255255
},
256256
currentScope: {},
257257
};
@@ -458,7 +458,11 @@ export const createAudioBurrito = () => {
458458
},
459459
comments: ['Updated with working audio files for GEN 1-3 and MAT 1-3'],
460460
})
461-
.withIdAuthority('dbl', 'The Digital Bible Library')
461+
.withIdAuthority(
462+
'dbl',
463+
'https://www.thedigitalbiblelibrary.org',
464+
'The Digital Bible Library'
465+
)
462466
.withIdentification({
463467
primary: {
464468
dbl: {
@@ -474,16 +478,16 @@ export const createAudioBurrito = () => {
474478
})
475479
.withLanguage('en', 'English')
476480
.withFlavor({
477-
performance: ['multipleVoice', 'drama', 'withMusic'],
478-
formats: {
479-
format1: {
480-
compression: 'mp3',
481-
trackConfiguration: '2/0 (Stereo)',
482-
bitRate: 128000,
483-
bitDepth: 16,
484-
samplingRate: 44100,
485-
},
486-
},
481+
// performance: ['multipleVoice', 'drama', 'withMusic'],
482+
// formats: {
483+
// format1: {
484+
// compression: 'mp3',
485+
// trackConfiguration: '2/0 (Stereo)',
486+
// bitRate: 128000,
487+
// bitDepth: 16,
488+
// samplingRate: 44100,
489+
// },
490+
// },
487491
})
488492
.withAgency({
489493
id: 'dbl::54650cfa5117ad690fb05fb6',

src/renderer/src/routes/useBurritoAudo.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
} from '../burrito/data/alignmentBuilder';
77
import {
88
Burrito,
9-
BurritoFormats,
109
BurritoIngredients,
1110
BurritoScopes,
1211
} from '../burrito/data/burritoBuilder';
@@ -192,7 +191,7 @@ export const useBurritoAudo = (teamId: string) => {
192191
mimeType: 'application/json',
193192
size: alignmentContent.length,
194193
scope: { [book]: Array.from(chapters).sort() },
195-
role: ['timing'],
194+
role: 'timing',
196195
};
197196
const curScopes = scopes.get(book) || [];
198197
scopes.set(book, [...curScopes, ...Array.from(chapters).sort()]);
@@ -206,17 +205,17 @@ export const useBurritoAudo = (teamId: string) => {
206205
metadata.ingredients = ingredients;
207206

208207
// add the formats to the metadata file
209-
const formats: BurritoFormats = {};
210-
let formatn = 0;
211-
Array.from(compressions).forEach((c) => {
212-
formats[`format${++formatn}`] = {
213-
compression: c,
214-
trackConfiguration: 'mono',
215-
};
216-
});
217-
if (metadata.type?.flavorType?.flavor) {
218-
metadata.type.flavorType.flavor.formats = formats;
219-
}
208+
// const formats: BurritoFormats = {};
209+
// let formatn = 0;
210+
// Array.from(compressions).forEach((c) => {
211+
// formats[`format${++formatn}`] = {
212+
// compression: c,
213+
// trackConfiguration: 'mono',
214+
// };
215+
// });
216+
// if (metadata.type?.flavorType?.flavor) {
217+
// metadata.type.flavorType.flavor.formats = formats;
218+
// }
220219
return metadata;
221220
};
222221
};

src/renderer/src/routes/useCreateBurrito.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ export const useCreateBurrito = (teamId: string) => {
8989
[teamId]
9090
);
9191

92+
const cleanName = (name: string) => {
93+
const m = name.match(/^[^A-Za-z]*([A-Za-z0-9 ]+)[^A-Za-z0-9]*$/);
94+
return m ? m[1] : name;
95+
};
96+
9297
const getMetadata = () => {
9398
const userRec = users.find((user) => user.id === userId);
9499
const teamRec = teams.find((team) => team.id === teamId);
@@ -118,7 +123,11 @@ export const useCreateBurrito = (teamId: string) => {
118123
}`,
119124
],
120125
})
121-
.withIdAuthority('apm', productName)
126+
.withIdAuthority(
127+
'apm',
128+
'https://www.audioprojectmanager.org',
129+
productName
130+
)
122131
.withIdentification({
123132
primary: {
124133
apm: {
@@ -130,8 +139,8 @@ export const useCreateBurrito = (teamId: string) => {
130139
},
131140
name: {
132141
en:
133-
bible?.attributes.bibleName ||
134-
teamRec?.attributes.name ||
142+
cleanName(bible?.attributes.bibleName || '') ||
143+
cleanName(teamRec?.attributes.name || '') ||
135144
'Unknown Bible',
136145
},
137146
description: { en: bible?.attributes.description || '' },
@@ -142,7 +151,9 @@ export const useCreateBurrito = (teamId: string) => {
142151
.withAgency({
143152
id: `apm::${teamRemId}`,
144153
roles: ['rightsHolder'],
145-
name: { en: teamRec?.attributes.name || 'Unknown Team' },
154+
name: {
155+
en: cleanName(teamRec?.attributes.name || '') || 'Unknown Team',
156+
},
146157
})
147158
.withTargetArea('US', 'United States')
148159
.withLocalizedNames(localizedNames)

0 commit comments

Comments
 (0)