# Continuity

## Core Methods

### getWatchHistoryItem

Gets the last recorded progress for an anime.

```typescript
const item = ctx.continuity.getWatchHistoryItem(21)
```

### updateWatchHistoryItem

Add or update the last recorded progress for an anime.

**Parameters:**

* `opts`: Object containing:
  * `currentTime`: Number - Last recorded progress in seconds
  * `duration` : Number - Total duration in seconds
  * `mediaId` : Number
  * `episodeNumber` : Number
  * `filepath?` : String
  * `kind` : "onlinestream" | "mediastream" | "external\_player"

### getWatchHistory

Gets all last recorded progress items.

```typescript
const items = ctx.continuity.getWatchHistory()
```

### deleteWatchHistoryItem

**Parameters**:

* `mediaId` : Number

```typescript
ctx.continuity.deleteWatchHistoryItem(21)
```


---

# 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/continuity.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.
