# Auto Downloader

The `ctx.autoDownloader` API lets plugins inspect or trigger Seanime's auto-downloader.

## Core Methods

### run

`run(isSimulation?)`

Schedules a non-blocking auto-downloader run.

**Parameters:**

* `isSimulation`: Boolean - Optional. When `true`, Seanime runs the auto-downloader in simulation mode.

Example:

```typescript
ctx.autoDownloader.run(true)
```

### runNow

`runNow()`

Runs the auto-downloader immediately with real downloads enabled.

This call is non-blocking.

Example:

```typescript
ctx.autoDownloader.runNow()
```

### runCheck

`runCheck(options?)`

Runs a focused auto-downloader check and returns simulation results.

Seanime clears any previous simulation results before this runs.

**Parameters:**

* `options`: `AutoDownloaderRunCheckOptions`
* `options.isSimulation`: Boolean - Optional
* `options.ruleIds`: Number\[] - Optional list of rule IDs to check

Example:

```typescript
const results = await ctx.autoDownloader.runCheck({
	isSimulation: true,
	ruleIds: [12, 18],
})

console.log(results)
```

### getSimulationResults

`getSimulationResults()`

Returns the stored results from the last `runCheck()` call.

Example:

```typescript
const results = ctx.autoDownloader.getSimulationResults()
console.log(results.length)
```

### clearSimulationResults

`clearSimulationResults()`

Clears the stored auto-downloader simulation results.

Example:

```typescript
ctx.autoDownloader.clearSimulationResults()
```

### getSettings

`getSettings()`

Returns the current auto-downloader settings, or `undefined` if the feature is not configured.

**Returns:** `$app.Models_AutoDownloaderSettings | undefined`

Example:

```typescript
const settings = ctx.autoDownloader.getSettings()
console.log(settings)
```

### isEnabled

`isEnabled()`

Returns whether Seanime's auto-downloader is currently enabled.

Example:

```typescript
if (ctx.autoDownloader.isEnabled()) {
	ctx.autoDownloader.runNow()
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://seanime.gitbook.io/seanime-extensions/plugins/ui/anime-library/auto-downloader.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
