From 6abc0fbad0050aa7c88cf9299592c01794f4bd97 Mon Sep 17 00:00:00 2001 From: immisterio <96652250+immisterio@users.noreply.github.com> Date: Sun, 30 Jul 2023 18:03:31 +0300 Subject: [PATCH] fix sync v1 --- Controllers/SyncController.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Controllers/SyncController.cs b/Controllers/SyncController.cs index 4c9ccd1..785dd88 100644 --- a/Controllers/SyncController.cs +++ b/Controllers/SyncController.cs @@ -84,14 +84,23 @@ public JsonResult Torrents(long time) { foreach (var torrent in FileDB.OpenRead(item.Key)) { + var _t = (TorrentDetails)torrent.Value.Clone(); + + var streams = TracksDB.Get(_t.magnet, _t.types); + if (streams != null) + { + _t.ffprobe = streams; + _t.languages = TracksDB.Languages(_t, streams); + } + if (torrents.TryGetValue(torrent.Key, out TorrentDetails val)) { if (torrent.Value.updateTime > val.updateTime) - torrents[torrent.Key] = torrent.Value; + torrents[torrent.Key] = _t; } else { - torrents.TryAdd(torrent.Key, torrent.Value); + torrents.TryAdd(torrent.Key, _t); } }