Skip to content

Commit 3f94430

Browse files
committed
sync ffprobe
1 parent 7ce8f79 commit 3f94430

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

Controllers/SyncController.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,22 @@ public ActionResult FdbTorrents(long time)
3333
var torrents = new Dictionary<string, (DateTime, IReadOnlyDictionary<string, TorrentDetails>)>();
3434
foreach (var item in FileDB.masterDb.OrderBy(i => i.Value).Where(i => i.Value > lastsync).ToArray())
3535
{
36-
var torrent = FileDB.OpenRead(item.Key);
37-
countread = countread + torrent.Count;
36+
var torrent = new Dictionary<string, TorrentDetails>();
37+
foreach (var t in FileDB.OpenRead(item.Key))
38+
{
39+
var _t = (TorrentDetails)t.Value.Clone();
40+
41+
var streams = TracksDB.Get(_t.magnet, _t.types);
42+
if (streams != null)
43+
{
44+
_t.ffprobe = streams;
45+
_t.languages = TracksDB.Languages(_t, streams);
46+
}
47+
48+
torrent.TryAdd(t.Key, _t);
49+
}
3850

51+
countread = countread + torrent.Count;
3952
torrents.TryAdd(item.Key, (item.Value, torrent));
4053

4154
if (countread > take)

0 commit comments

Comments
 (0)