working!
This commit is contained in:
@@ -25,6 +25,7 @@ interface VideoResult {
|
||||
channel: string;
|
||||
thumbnail: string;
|
||||
duration: number;
|
||||
url: string;
|
||||
}
|
||||
|
||||
interface SearchResponse {
|
||||
@@ -124,7 +125,7 @@ class QuixoticApp {
|
||||
}
|
||||
|
||||
this.results.innerHTML = videos.map(video => `
|
||||
<div class="video-item" onclick="app.convertVideo('${video.id}', '${this.escapeHtml(video.title)}')">
|
||||
<div class="video-item" onclick="app.convertVideo('${video.id}', '${this.escapeHtml(video.title)}', '${this.escapeHtml(video.url)}')">
|
||||
<img class="video-thumbnail" src="${video.thumbnail}" alt="${this.escapeHtml(video.title)}" loading="lazy">
|
||||
<div class="video-info">
|
||||
<div class="video-title">${this.escapeHtml(video.title)}</div>
|
||||
@@ -144,8 +145,8 @@ class QuixoticApp {
|
||||
this.noResults.classList.remove('hidden');
|
||||
}
|
||||
|
||||
public async convertVideo(videoId: string, title: string): Promise<void> {
|
||||
console.log('Convert video called:', { videoId, title });
|
||||
public async convertVideo(videoId: string, title: string, url: string): Promise<void> {
|
||||
console.log('Convert video called:', { videoId, title, url });
|
||||
const videoElement = (event as any)?.currentTarget as HTMLElement;
|
||||
if (videoElement) {
|
||||
videoElement.classList.add('converting');
|
||||
@@ -161,6 +162,7 @@ class QuixoticApp {
|
||||
body: JSON.stringify({
|
||||
videoId,
|
||||
title,
|
||||
url,
|
||||
userId: this.tg?.initDataUnsafe?.user?.id || 'demo'
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user