chore: update Angular TypeScript build info cache
This commit is contained in:
parent
3d78d0aef9
commit
c0249768dd
2
.angular/cache/20.2.2/app/.tsbuildinfo
vendored
2
.angular/cache/20.2.2/app/.tsbuildinfo
vendored
File diff suppressed because one or more lines are too long
BIN
db/newtube.db
BIN
db/newtube.db
Binary file not shown.
@ -36,6 +36,36 @@ export class YoutubeApiService {
|
||||
this.ytKeys = this.loadYouTubeKeys();
|
||||
}
|
||||
|
||||
// Some Odysee API responses return thumbnail URLs on hosts like "thumbs.odycdn.com"
|
||||
// that can be flaky or blocked by the browser. Prefer the canonical
|
||||
// "thumbnails.odycdn.com" host and ensure https scheme.
|
||||
private normalizeOdyseeThumb(url?: string): string {
|
||||
if (!url) return '';
|
||||
try {
|
||||
let u = String(url).trim();
|
||||
if (!u) return '';
|
||||
// Ensure protocol
|
||||
if (u.startsWith('//')) u = 'https:' + u;
|
||||
if (!/^https?:\/\//i.test(u)) u = 'https://' + u.replace(/^\/*/, '');
|
||||
// Replace non-canonical host variants
|
||||
try {
|
||||
const parsed = new URL(u);
|
||||
const host = parsed.hostname.toLowerCase();
|
||||
if (host === 'thumbs.odycdn.com' || host === 'thumb.odycdn.com') {
|
||||
parsed.hostname = 'thumbnails.odycdn.com';
|
||||
return parsed.toString();
|
||||
}
|
||||
// Already canonical
|
||||
return parsed.toString();
|
||||
} catch {
|
||||
// Fallback simple replace
|
||||
return u.replace('thumbs.odycdn.com', 'thumbnails.odycdn.com');
|
||||
}
|
||||
} catch {
|
||||
return url || '';
|
||||
}
|
||||
}
|
||||
|
||||
// ... (rest of the code remains the same)
|
||||
|
||||
// ===================== Twitch Search Helpers =====================
|
||||
@ -603,7 +633,8 @@ export class YoutubeApiService {
|
||||
const channelVal = channel?.value || {};
|
||||
const lbryUrl = i?.permanent_url || i?.canonical_url || '';
|
||||
const webUrl = this.lbryToOdyseeUrl(lbryUrl) || (i?.name ? `https://odysee.com/${i.name}` : '');
|
||||
const thumb = val?.thumbnail?.url || '';
|
||||
const thumbRaw = val?.thumbnail?.url || '';
|
||||
const thumb = this.normalizeOdyseeThumb(thumbRaw);
|
||||
const publishedAt = val?.release_time ? new Date(val.release_time * 1000).toISOString() : '';
|
||||
const duration = val?.video?.duration || 0;
|
||||
const views = (i?.meta?.view_count != null) ? Number(i.meta.view_count) : 0;
|
||||
@ -617,7 +648,7 @@ export class YoutubeApiService {
|
||||
thumbnail: thumb,
|
||||
uploaderName,
|
||||
uploaderUrl: channel?.permanent_url ? this.lbryToOdyseeUrl(channel.permanent_url) : '',
|
||||
uploaderAvatar: channelVal?.thumbnail?.url || thumb,
|
||||
uploaderAvatar: this.normalizeOdyseeThumb(channelVal?.thumbnail?.url) || thumb,
|
||||
uploadedDate: publishedAt,
|
||||
duration: Number(duration || 0),
|
||||
views: views,
|
||||
|
Loading…
x
Reference in New Issue
Block a user