Automatic media analysis for new items

This commit is contained in:
Ben Adrian Sarmiento
2024-06-19 00:02:04 +02:00
parent acc9b69b5a
commit 74052e2f67
3 changed files with 25 additions and 8 deletions

View File

@@ -55,12 +55,13 @@ type TorrentManager struct {
OnceDoneBin mapset.Set[string]
DeleteOnCompletionBin cmap.ConcurrentMap[string, string]
hasFFprobe bool
}
// NewTorrentManager creates a new torrent manager
// it will fetch all torrents and their info in the background
// and store them in-memory and cached in files
func NewTorrentManager(cfg config.ConfigInterface, api *realdebrid.RealDebrid, workerPool *ants.Pool, log, repairLog *logutil.Logger) *TorrentManager {
func NewTorrentManager(cfg config.ConfigInterface, api *realdebrid.RealDebrid, workerPool *ants.Pool, hasFFprobe bool, log, repairLog *logutil.Logger) *TorrentManager {
t := &TorrentManager{
requiredVersion: "0.10.0",
@@ -87,6 +88,7 @@ func NewTorrentManager(cfg config.ConfigInterface, api *realdebrid.RealDebrid, w
OnceDoneBin: mapset.NewSet[string](),
DeleteOnCompletionBin: cmap.New[string](),
hasFFprobe: hasFFprobe,
}
t.initializeBins()