diff --git a/frontend/src/components/Layout/SearchBar.tsx b/frontend/src/components/Layout/SearchBar.tsx index 66bf31f..6180f89 100644 --- a/frontend/src/components/Layout/SearchBar.tsx +++ b/frontend/src/components/Layout/SearchBar.tsx @@ -1,10 +1,11 @@ -import React, { useState, useEffect } from "react"; +import React, { useState } from "react"; import Input from "./Input"; import { Search as SearchIcon } from "lucide-react"; import { useNavigate } from "react-router-dom"; const SearchBar: React.FC = () => { const [searchQuery, setSearchQuery] = useState(""); +<<<<<<< HEAD //const [debouncedQuery, setDebouncedQuery] = useState(searchQuery); const navigate = useNavigate(); @@ -51,11 +52,39 @@ const SearchBar: React.FC = () => { } }; +======= + + const handleSearch = async () => { + if (searchQuery.trim()) { + try { + const response = await fetch("/api/search", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ query: searchQuery }), + }); + + const data = await response.json(); + console.log("Search results:", data); + // Handle the search results here + } catch (error) { + console.error("Error performing search:", error); + } + } + }; +>>>>>>> 571cb9c0f570358236daeed97c2e969a85cd8d1e const handleSearchChange = (e: React.ChangeEvent) => { setSearchQuery(e.target.value); }; + const handleKeyDown = (e: React.KeyboardEvent) => { + if (e.key === "Enter") { + handleSearch(); + } + }; + return ( ); diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 9baa77f..10a3b76 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -32,6 +32,7 @@ rtmp { hls_nested on; hls_fragment 5s; hls_playlist_length 60s; + hls_fragment_naming system; hls_cleanup off; } } diff --git a/web_server/celery_tasks/__init__.py b/web_server/celery_tasks/__init__.py index 5a85441..1e6ae2c 100644 --- a/web_server/celery_tasks/__init__.py +++ b/web_server/celery_tasks/__init__.py @@ -34,6 +34,7 @@ def combine_ts_stream(stream_path, vods_path): """ ts_files = [f for f in listdir(stream_path) if f.endswith(".ts")] ts_files.sort() + print(ts_files) # Create temp file listing all ts files with open(f"{stream_path}/list.txt", "w") as f: @@ -61,3 +62,5 @@ def combine_ts_stream(stream_path, vods_path): # Remove ts files for ts_file in ts_files: remove(f"{stream_path}/{ts_file}") + # Remove m3u8 file + remove(f"{stream_path}/index.m3u8") \ No newline at end of file