> For the complete documentation index, see [llms.txt](https://seanime.gitbook.io/seanime-extensions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://seanime.gitbook.io/seanime-extensions/plugins/ui/anime-library/auto-downloader.md).

# 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()
}
```
