new: feat: add magnet-metadata-api post processor (#39)
* new: feat: add magnet-metadata-api post processor * chg: fix: lint issue * chg: chore: comment optional containers * chg: fix: remove redundant check
This commit is contained in:
@@ -94,7 +94,7 @@ func (i *Indexer) HandlerComandoIndexer(w http.ResponseWriter, r *http.Request)
|
||||
})
|
||||
|
||||
// extract each torrent link
|
||||
indexedTorrents := utils.ParallelMap(links, func(link string) ([]schema.IndexedTorrent, error) {
|
||||
indexedTorrents := utils.ParallelFlatMap(links, func(link string) ([]schema.IndexedTorrent, error) {
|
||||
return getTorrents(ctx, i, link)
|
||||
})
|
||||
|
||||
@@ -208,6 +208,11 @@ func getTorrents(ctx context.Context, i *Indexer, link string) ([]schema.Indexed
|
||||
if len(size) == len(magnetLinks) {
|
||||
mySize = size[it]
|
||||
}
|
||||
if mySize == "" {
|
||||
go func() {
|
||||
_, _ = i.magnetMetadataAPI.FetchMetadata(ctx, magnetLink)
|
||||
}()
|
||||
}
|
||||
|
||||
ixt := schema.IndexedTorrent{
|
||||
Title: releaseTitle,
|
||||
|
||||
Reference in New Issue
Block a user