Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/api-reference/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4217,8 +4217,8 @@
},
"source": {
"type": "string",
"example": "allthingsyoutube",
"description": "Extractor or upstream implementation that produced the normalized response."
"example": "video2ctx",
"description": "Service or upstream implementation that produced the normalized response."
},
"fetchedAt": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion platform/src/lib/youtube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function withYouTubeMetadata<T>(value: T): T {
if (!metadata || typeof metadata !== 'object' || Array.isArray(metadata)) return value;
return {
...record,
meta: { ...metadata, source: 'allthingsyoutube', provider: 'youtube' },
meta: { ...metadata, source: 'video2ctx', provider: 'youtube' },
} as T;
}

Expand Down
2 changes: 1 addition & 1 deletion platform/src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const sourceMetadata: Schema = {
required: ['provider', 'source', 'fetchedAt', 'partial', 'warnings'],
properties: {
provider: { type: 'string', enum: PROVIDER_IDS, description: 'Platform that owns the source resource.' },
source: { type: 'string', example: 'allthingsyoutube', description: 'Extractor or upstream implementation that produced the normalized response.' },
source: { type: 'string', example: 'video2ctx', description: 'Service or upstream implementation that produced the normalized response.' },
fetchedAt: { type: 'string', format: 'date-time' },
partial: { type: 'boolean' },
warnings: { type: 'array', items: { type: 'string' } },
Expand Down
4 changes: 2 additions & 2 deletions platform/test/contracts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('universal input routing', () => {
});

describe('public source metadata', () => {
test('brands cached provider metadata as allthingsyoutube', async () => {
test('brands cached provider metadata as video2ctx', async () => {
const snapshot = {
type: 'video', id: 'abcdefghijk', title: 'Cached video', channel: { id: '', name: '', url: '' },
thumbnails: [], isLive: false, url: 'https://youtube.com/watch?v=abcdefghijk', keywords: [],
Expand All @@ -36,7 +36,7 @@ describe('public source metadata', () => {

const video = await getVideo(env, 'abcdefghijk');

expect(video.meta.source).toBe('allthingsyoutube');
expect(video.meta.source).toBe('video2ctx');
expect((video.meta as typeof video.meta & { provider: string }).provider).toBe('youtube');
});
});
Expand Down
2 changes: 1 addition & 1 deletion platform/test/youtube-package-adapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ describe('platform YouTube container adapter', () => {
expect(stale.cacheStatus).toBe('stale');
expect(stale.value).toMatchObject({
id: 'abcdefghijk',
meta: { source: 'allthingsyoutube' },
meta: { source: 'video2ctx' },
freshness: { state: 'stale', reason: 'UPSTREAM_UNAVAILABLE' },
});
});
Expand Down
Loading