Fix duplicate bookmarked items bug (#383)
* Fix duplicate bookmarked items bug * Add a check on task state
This commit is contained in:
1 parent
7ce5105434
commit
795435ff4b
2 files changed
+19
-4
No files matched your search
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- A bug where bookmarked channels can be duplicated
|
||||||
|
|
||||||
## [0.23.5] - 2024-05-19
|
## [0.23.5] - 2024-05-19
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -222,13 +222,13 @@ function InitContent() as void
|
|||||||
node: m.top
|
node: m.top
|
||||||
feeds: m.top.feeds
|
feeds: m.top.feeds
|
||||||
}, OnVideoRowListContentTaskResult)
|
}, OnVideoRowListContentTaskResult)
|
||||||
m.pendingLoadTasks[task.id] = task
|
m.pendingLoadTasks[task.id] = { task: task }
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function CancelCurrentTasks()
|
function CancelCurrentTasks()
|
||||||
pendingLoadTasks = m.pendingLoadTasks
|
pendingLoadTasks = m.pendingLoadTasks
|
||||||
for each id in pendingLoadTasks
|
for each id in pendingLoadTasks
|
||||||
task = pendingLoadTasks[id]
|
task = pendingLoadTasks[id].task
|
||||||
task.cancel = true
|
task.cancel = true
|
||||||
end for
|
end for
|
||||||
m.pendingLoadTasks = {}
|
m.pendingLoadTasks = {}
|
||||||
@@ -287,7 +287,16 @@ function GetRowsToLoad() as object
|
|||||||
return subContentNodes
|
return subContentNodes
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function LoadRowContent(contentNode as object)
|
function LoadRowContent(contentNode as object) as void
|
||||||
|
' Do not spin up multiple tasks for the same content node
|
||||||
|
for each id in m.pendingLoadTasks
|
||||||
|
pendingTask = m.pendingLoadTasks[id]
|
||||||
|
if contentNode.isSameNode(pendingTask.content) and pendingTask.task.state = "run"
|
||||||
|
LogInfo("Row content already loading:", contentNode.title)
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
|
||||||
LogInfo("Loading row content:", contentNode.title)
|
LogInfo("Loading row content:", contentNode.title)
|
||||||
|
|
||||||
contentNode.loadState = FeedLoadState.Loading
|
contentNode.loadState = FeedLoadState.Loading
|
||||||
@@ -296,7 +305,7 @@ function LoadRowContent(contentNode as object)
|
|||||||
feedContentNode: contentNode
|
feedContentNode: contentNode
|
||||||
invidious: m.invidious
|
invidious: m.invidious
|
||||||
}, OnVideoRowListRowContentTaskResult)
|
}, OnVideoRowListRowContentTaskResult)
|
||||||
m.pendingLoadTasks[task.id] = task
|
m.pendingLoadTasks[task.id] = { task: task, content: contentNode }
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function OnVideoRowListRowContentTaskResult(output as object) as void
|
function OnVideoRowListRowContentTaskResult(output as object) as void
|
||||||
|
|||||||
Reference in new issue
Block a user