@@ -19,7 +19,7 @@ type BatchConfig struct {
19
19
type BatchJob struct {
20
20
Output string `yaml:"output"`
21
21
Path string `yaml:"path"`
22
- Name string `yaml:"name "`
22
+ Name string `yaml:"- "`
23
23
Trackers []string `yaml:"trackers"`
24
24
WebSeeds []string `yaml:"webseeds"`
25
25
Private bool `yaml:"private"`
@@ -95,7 +95,7 @@ func ProcessBatch(configPath string, verbose bool, version string) ([]BatchResul
95
95
return nil , fmt .Errorf ("no jobs defined in batch config" )
96
96
}
97
97
98
- // Validate all jobs before processing
98
+ // validate all jobs before processing
99
99
for _ , job := range config .Jobs {
100
100
if err := validateJob (job ); err != nil {
101
101
return nil , fmt .Errorf ("invalid job configuration: %w" , err )
@@ -105,11 +105,11 @@ func ProcessBatch(configPath string, verbose bool, version string) ([]BatchResul
105
105
results := make ([]BatchResult , len (config .Jobs ))
106
106
var wg sync.WaitGroup
107
107
108
- // Process jobs in parallel with a worker pool
109
- workers := minInt (len (config .Jobs ), 4 ) // Limit concurrent jobs
108
+ // process jobs in parallel with a worker pool
109
+ workers := minInt (len (config .Jobs ), 4 ) // limit concurrent jobs
110
110
jobs := make (chan int , len (config .Jobs ))
111
111
112
- // Start workers
112
+ // start workers
113
113
for i := 0 ; i < workers ; i ++ {
114
114
wg .Add (1 )
115
115
go func () {
@@ -120,7 +120,7 @@ func ProcessBatch(configPath string, verbose bool, version string) ([]BatchResul
120
120
}()
121
121
}
122
122
123
- // Send jobs to workers
123
+ // send jobs to workers
124
124
for i := range config .Jobs {
125
125
jobs <- i
126
126
}
@@ -156,23 +156,23 @@ func processJob(job BatchJob, verbose bool, version string) BatchResult {
156
156
Trackers : job .Trackers ,
157
157
}
158
158
159
- // Ensure output has .torrent extension
159
+ // ensure output has .torrent extension
160
160
output := job .Output
161
161
if filepath .Ext (output ) != ".torrent" {
162
162
output += ".torrent"
163
163
}
164
164
165
- // Convert job to CreateTorrentOptions
165
+ // convert job to CreateTorrentOptions
166
166
opts := job .ToCreateOptions (verbose , version )
167
167
168
- // Create the torrent
168
+ // create the torrent
169
169
mi , err := CreateTorrent (opts )
170
170
if err != nil {
171
171
result .Error = fmt .Errorf ("failed to create torrent: %w" , err )
172
172
return result
173
173
}
174
174
175
- // Write the torrent file
175
+ // write the torrent file
176
176
f , err := os .Create (output )
177
177
if err != nil {
178
178
result .Error = fmt .Errorf ("failed to create output file: %w" , err )
@@ -185,7 +185,7 @@ func processJob(job BatchJob, verbose bool, version string) BatchResult {
185
185
return result
186
186
}
187
187
188
- // Collect torrent info
188
+ // collect torrent info
189
189
info := mi .GetInfo ()
190
190
result .Success = true
191
191
result .Info = & TorrentInfo {
0 commit comments