Skip to content

Commit

Permalink
fix sync v1
Browse files Browse the repository at this point in the history
  • Loading branch information
immisterio committed Jul 30, 2023
1 parent cbf0142 commit 6abc0fb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Controllers/SyncController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 6abc0fb

Please sign in to comment.