mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: use production videos
This commit is contained in:
1 parent
b1917c73f2
commit
c30358248f
1 file changed
+23
-5
@@ -6,10 +6,7 @@ import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL';
|
|||||||
import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL';
|
import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL';
|
||||||
import { toUniqueId } from '../../src/core/blitz/toUniqueId';
|
import { toUniqueId } from '../../src/core/blitz/toUniqueId';
|
||||||
import { commitAssets } from '../../src/core/blitzkit/commitAssets';
|
import { commitAssets } from '../../src/core/blitzkit/commitAssets';
|
||||||
import {
|
import { VideoDefinitions } from '../../src/core/blitzkit/videos';
|
||||||
VideoDefinitions,
|
|
||||||
videoDefinitions,
|
|
||||||
} from '../../src/core/blitzkit/videos';
|
|
||||||
import { DATA, POI } from './constants';
|
import { DATA, POI } from './constants';
|
||||||
import { BlitzStrings, botPattern, VehicleDefinitionList } from './definitions';
|
import { BlitzStrings, botPattern, VehicleDefinitionList } from './definitions';
|
||||||
|
|
||||||
@@ -21,7 +18,27 @@ const youtubers = [
|
|||||||
export async function videos(production: boolean) {
|
export async function videos(production: boolean) {
|
||||||
console.log('Building videos...');
|
console.log('Building videos...');
|
||||||
|
|
||||||
const currentVideos = await videoDefinitions;
|
const currentVideos = await fetch(
|
||||||
|
'https://raw.githubusercontent.com/tresabhi/blitzkit-assets/main/definitions/videos.csv',
|
||||||
|
)
|
||||||
|
.then((response) => response.text())
|
||||||
|
.then((lines) => {
|
||||||
|
return lines
|
||||||
|
.split('\n')
|
||||||
|
.map((line) => {
|
||||||
|
const [idString, lastUpdatedString, ...videos] = line.split(',');
|
||||||
|
const id = Number(idString);
|
||||||
|
const lastUpdated = Number(lastUpdatedString);
|
||||||
|
return { id, lastUpdated, videos };
|
||||||
|
})
|
||||||
|
.reduce<VideoDefinitions>(
|
||||||
|
(accumulator, { id, lastUpdated, videos }) => {
|
||||||
|
accumulator[id] = { lastUpdated, videos };
|
||||||
|
return accumulator;
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
);
|
||||||
|
});
|
||||||
const auth = await google.auth.getClient({
|
const auth = await google.auth.getClient({
|
||||||
scopes: ['https://www.googleapis.com/auth/youtube.readonly'],
|
scopes: ['https://www.googleapis.com/auth/youtube.readonly'],
|
||||||
});
|
});
|
||||||
@@ -116,6 +133,7 @@ export async function videos(production: boolean) {
|
|||||||
)
|
)
|
||||||
.join('\n');
|
.join('\n');
|
||||||
|
|
||||||
|
return;
|
||||||
await commitAssets(
|
await commitAssets(
|
||||||
'videos',
|
'videos',
|
||||||
[{ content, encoding: 'utf-8', path: 'definitions/videos.csv' }],
|
[{ content, encoding: 'utf-8', path: 'definitions/videos.csv' }],
|
||||||
|
|||||||
Reference in new issue
Block a user