Skip to content

Commit

Permalink
Fix importer (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdigital committed Oct 5, 2023
1 parent 84adcf9 commit afc1e39
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions internal/importer/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit afc1e39

Please sign in to comment.