Skip to content

Conversation

@davidnewhall
Copy link
Contributor

@davidnewhall davidnewhall commented Jul 5, 2024

This code will only be merged if someone finds it useful. Please leave a comment telling us how you used this code, and if it worked for you.

Example Usage:

import (
	"golift.io/starr"
	"golift.io/starr/orbit"
	"golift.io/starr/prowlarr"
	"golift.io/starr/sonarr"
)

func Main() {
	p := prowlarr.New(&starr.Config{
		URL:    "http://192.168.3.2:9696/prowlarr/",
		APIKey: "abc",
	})

	s := sonarr.New(&starr.Config{
		URL:    "http://192.168.3.2:8989/sonarr/",
		APIKey: "xyz",
	})

	indexers, err := p.GetIndexers()
	if err != nil {
		panic(err)
	}

	for _, indexer := range indexers {
		input := &sonarr.IndexerInput{
			EnableAutomaticSearch:   true,
			EnableInteractiveSearch: true,
			EnableRss:               true,
			DownloadClientID:        15, // probably need to do more hits to find this ID in Sonarr.
		}

		_, err = s.AddIndexer(starr.Must(orbit.CopyIndexer(indexer, input, false)))
		if err != nil {
			panic(err)
		}
	}
}

@davidnewhall davidnewhall force-pushed the dn2_copy branch 2 times, most recently from 7f4d348 to ba46bd6 Compare July 8, 2024 18:50
@davidnewhall davidnewhall changed the title copier Copy Indexer structs example Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants