mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-12 23:33:43 +08:00
fix: Accumulate video counts per source across search result pages in search action.
This commit is contained in:
@@ -87,8 +87,11 @@ export function useSearchAction({ state, onCacheUpdate, onUrlUpdate }: UseSearch
|
||||
// Optimized: Insert new videos in sorted position
|
||||
setResults((prev) => binaryInsertVideos(prev, newVideos));
|
||||
|
||||
// Update source stats
|
||||
if (!sourcesMap.has(sourceId)) {
|
||||
// Update source stats (accumulate across pages)
|
||||
const existing = sourcesMap.get(sourceId);
|
||||
if (existing) {
|
||||
existing.count += newVideos.length;
|
||||
} else {
|
||||
sourcesMap.set(sourceId, {
|
||||
count: newVideos.length,
|
||||
name: newVideos[0]?.sourceName || sourceId,
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "kvideo",
|
||||
"version": "4.1.3",
|
||||
"version": "4.1.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "kvideo",
|
||||
"version": "4.1.3",
|
||||
"version": "4.1.4",
|
||||
"dependencies": {
|
||||
"@dnd-kit/core": "^6.3.1",
|
||||
"@dnd-kit/sortable": "^10.0.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "kvideo",
|
||||
"version": "4.1.3",
|
||||
"version": "4.1.4",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
Reference in New Issue
Block a user