mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-11 02:29:31 +00:00
Fix racecondition watchlater adds
This commit is contained in:
parent
d686fa327b
commit
3cf8abd409
1 changed files with 2 additions and 2 deletions
|
@ -772,8 +772,8 @@ class StateSync {
|
|||
for(video in pack.videos) {
|
||||
val existing = allExisting.firstOrNull { it.url == video.url };
|
||||
val time = if(pack.videoAdds != null && pack.videoAdds.containsKey(video.url)) OffsetDateTime.ofInstant(Instant.ofEpochSecond(pack.videoAdds[video.url] ?: 0), ZoneOffset.UTC) else OffsetDateTime.MIN;
|
||||
|
||||
if(existing == null) {
|
||||
val removalTime = StatePlaylists.instance.getWatchLaterRemovalTime(video.url) ?: OffsetDateTime.MIN;
|
||||
if(existing == null && time > removalTime) {
|
||||
StatePlaylists.instance.addToWatchLater(video, false);
|
||||
if(time > OffsetDateTime.MIN)
|
||||
StatePlaylists.instance.setWatchLaterAddTime(video.url, time);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue