From afc1e39930298c064a6223572268badade3a5652 Mon Sep 17 00:00:00 2001 From: Mike Gibson Date: Thu, 5 Oct 2023 16:44:57 +0100 Subject: [PATCH] Fix importer (#12) --- internal/importer/importer.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/internal/importer/importer.go b/internal/importer/importer.go index fc815f13..b27ae116 100644 --- a/internal/importer/importer.go +++ b/internal/importer/importer.go @@ -78,11 +78,12 @@ var ( func (i importer) New(ctx context.Context, info Info) ActiveImport { ai := &activeImport{ - importer: i, - wg: &sync.WaitGroup{}, - mutex: &sync.RWMutex{}, - info: info, - itemChan: make(chan Item), + importer: i, + wg: &sync.WaitGroup{}, + mutex: &sync.RWMutex{}, + info: info, + itemChan: make(chan Item), + importedSources: make(map[string]struct{}), } ai.run(ctx) return ai @@ -245,10 +246,11 @@ func createTorrentModel(info Info, item Item) model.Torrent { title = item.Title.String } return model.Torrent{ - InfoHash: item.InfoHash, - Name: item.Name, - Size: item.Size, - Private: item.Private, + InfoHash: item.InfoHash, + Name: item.Name, + Size: item.Size, + Private: item.Private, + FilesStatus: model.FilesStatusNoInfo, Sources: []model.TorrentsTorrentSource{ { Source: item.Source,