Skip to content

feat(Seanime): add activity#10574

Closed
dynnx wants to merge 26 commits intoPreMiD:mainfrom
dynnx:main
Closed

feat(Seanime): add activity#10574
dynnx wants to merge 26 commits intoPreMiD:mainfrom
dynnx:main

Conversation

@dynnx
Copy link
Copy Markdown

@dynnx dynnx commented Mar 17, 2026

Description

Adds Rich Presence support for Seanime — an anime and manga streaming platform.

This activity displays the user's current watching or reading status in Discord Rich Presence.

Features

  • Displays the anime title
  • Shows the current episode number and progress
  • Shows playback progress
  • Shows the site logo as the large image
  • Shows manga title and current page number

The activity detects the video player and manga reader on the Seanime website and updates the Rich Presence dynamically.

No existing activities were modified.


Acknowledgements


Screenshots

Proof showing the creation/modification is working as expected

Anime Watching

Activity Settings

Manga Reading

Signed-off-by: Dynnx <realdynnxx@gmail.com>
Comment thread websites/S/Seanime/metadata.json Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
Copy link
Copy Markdown

@github-advanced-security github-advanced-security AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

dynnx added 3 commits March 17, 2026 17:58
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Comment thread websites/S/Seanime/dist/presence.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file

Comment thread websites/S/Seanime/metadata.json Outdated
"apiVersion": 1,
"author": {
"name": "Dynnx",
"id": "0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enter your Discord ID

Comment thread websites/S/Seanime/metadata.json Outdated
},
"service": "Seanime",
"description": {
"en": "Discord Rich Presence for Seanime, a self-hosted anime streaming app."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use official description from service

Comment thread websites/S/Seanime/metadata.json Outdated
"en": "Discord Rich Presence for Seanime, a self-hosted anime streaming app."
},
"url": "localhost",
"regExp": "^https?:\\/\\/.*:43211\\/",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"regExp": "^https?:\\/\\/.*:43211\\/",
"regExp": "^https?[:][/][/](localhost|(?:\d{1,3}[.]){3}\d{1,3})[:]43211[/]",

Comment thread websites/S/Seanime/metadata.json Outdated
"regExp": "^https?:\\/\\/.*:43211\\/",
"version": "1.0.0",
"logo": "https://i.imgur.com/e3lBwoS.png",
"thumbnail": "https://i.imgur.com/e3lBwoS.png",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thumbnail should be a landscape promotional image or screenshot, not the logo

Comment thread websites/S/Seanime/presence.ts Outdated
Comment on lines +40 to +43
if (!url.includes(':43211')) {
return
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!url.includes(':43211')) {
return
}

Unnecessary, since the regex only keeps links ending in :43211

Comment thread websites/S/Seanime/presence.ts Outdated
return
}

const video = document.querySelector('video') as HTMLVideoElement | null
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use generics when using document.querySelector rather than type casting

Signed-off-by: Dynnx <realdynnxx@gmail.com>
Comment thread websites/S/Seanime/metadata.json Fixed
Comment thread websites/S/Seanime/metadata.json Fixed
dynnx added 4 commits March 18, 2026 18:04
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Signed-off-by: Dynnx <realdynnxx@gmail.com>
fixed the episodes now show and corrected for any errors
hope you'll like it ;)

Signed-off-by: Dynnx <realdynnxx@gmail.com>
Comment thread websites/S/Seanime/metadata.json Fixed
Comment thread websites/S/Seanime/metadata.json Fixed
Comment thread websites/S/Seanime/metadata.json Fixed
Comment thread websites/S/Seanime/metadata.json Fixed
dynnx added 3 commits March 18, 2026 18:32
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Comment thread websites/S/Seanime/metadata.json Fixed
dynnx added 3 commits March 18, 2026 18:40
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Comment thread websites/S/Seanime/presence.ts Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Comment thread websites/S/Seanime/presence.ts Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
dynnx added 4 commits March 19, 2026 16:58
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Signed-off-by: Dynnx <realdynnxx@gmail.com>
dynnx added 2 commits March 19, 2026 17:11
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Comment thread websites/S/Seanime/metadata.json Outdated
"en": "Seanime is a media server with a web interface and desktop app for managing your local library, streaming anime and reading manga."
},
"url": "localhost",
"regExp": "^https?:\\/\\/(localhost|(?:\\d{1,3}\\.){3}\\d{1,3}):43211(\\/|$)",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"regExp": "^https?:\\/\\/(localhost|(?:\\d{1,3}\\.){3}\\d{1,3}):43211(\\/|$)",
"regExp": "^https?[:][/][/](localhost|(?:\\d{1,3}[.]){3}\\d{1,3})[:]43211([/]|$)",

Comment thread websites/S/Seanime/presence.js Outdated
Comment on lines +6 to +7
const PLAY_ICON = 'https://i.imgur.com/Fi1hHy2.png'
const PAUSE_ICON = 'https://i.imgur.com/OnySmVp.png'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the Assets enum from the premid package instead
https://docs.premid.app/v1/api/utility-functions.html#assets-enum

Comment thread websites/S/Seanime/presence.js Outdated
}

presence.on('UpdateData', async () => {
console.log('Presence running')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log('Presence running')

Comment thread websites/S/Seanime/presence.js Outdated

if (!path || path === '/' || path.length <= 1) {
presence.setActivity({
type: 0,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the ActivityType enum from the premid package instead

Comment thread websites/S/Seanime/presence.js Outdated
const page = findPageCounter()

presence.setActivity({
type: 0,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dito

Comment thread websites/S/Seanime/presence.js Outdated
const paused = video.paused

presence.setActivity({
type: 3,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dito

Comment thread websites/S/Seanime/presence.js Outdated
}

presence.setActivity({
type: 0,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dito

dynnx added 2 commits March 20, 2026 11:47
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Comment thread websites/S/Seanime/presence.ts Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
@theusaf theusaf changed the title feat(Seanime): add Seanime activity feat(Seanime): add activity Mar 20, 2026
Signed-off-by: Dynnx <realdynnxx@gmail.com>
Comment thread websites/S/Seanime/presence.ts Fixed
Comment thread websites/S/Seanime/presence.ts Fixed
Signed-off-by: Dynnx <realdynnxx@gmail.com>
@@ -0,0 +1,96 @@
presence.on('UpdateData', async () => {

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Cannot find name 'presence'. Did you mean 'Presence'?
const rawTitle = document.title.replace(' | Seanime', '')

if (!path || path === '/' || path.length <= 1) {
presence.setActivity({

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Cannot find name 'presence'. Did you mean 'Presence'?
type: 0,
details: 'Browsing Library',
state: 'Looking for something to watch',
largeImageKey: LOGO,

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Cannot find name 'LOGO'.
}

if (path.includes('/manga/entry')) {
const chapter = findChapter()

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Cannot find name 'findChapter'.

if (path.includes('/manga/entry')) {
const chapter = findChapter()
const page = findPageCounter()

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Cannot find name 'findPageCounter'.
name: 'Anime',
details: cleanTitle,
state: stateText,
largeImageKey: LOGO,

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Cannot find name 'LOGO'.
? undefined
: endTimestamp,
smallImageKey: paused
? PAUSE_ICON

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Cannot find name 'PAUSE_ICON'.
: endTimestamp,
smallImageKey: paused
? PAUSE_ICON
: PLAY_ICON,

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Cannot find name 'PLAY_ICON'.
return
}

presence.setActivity({

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Cannot find name 'presence'. Did you mean 'Presence'?
type: 0,
details: rawTitle,
state: 'Browsing',
largeImageKey: LOGO,

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Cannot find name 'LOGO'.
const episodeTitle = findEpisodeTitle()

const cleanTitle
= document

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 6 spaces but found 8.

const cleanTitle
= document
.querySelector('[data-vc-element="top-playback-info-title"]')

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 12.
const cleanTitle
= document
.querySelector('[data-vc-element="top-playback-info-title"]')
?.textContent

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 12.
= document
.querySelector('[data-vc-element="top-playback-info-title"]')
?.textContent
?.trim()

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 12.
.querySelector('[data-vc-element="top-playback-info-title"]')
?.textContent
?.trim()
|| rawTitle

Check failure

Code scanning / ESLint

Indentation for binary operators Error

Expected indentation of 12 spaces

const epShort
= epNumber
? `Ep ${epNumber[0]}`

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 12.
const epShort
= epNumber
? `Ep ${epNumber[0]}`
: null

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 12.
const paused = video.paused

const stateText
= paused

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 6 spaces but found 8.

const stateText
= paused
? `Paused • ${epShort || ''}\n${episodeTitle || ''}`.trim()

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 12.
const stateText
= paused
? `Paused • ${epShort || ''}\n${episodeTitle || ''}`.trim()
: `${epShort || ''}\n${episodeTitle || ''}`.trim()

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 12.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

This PR has been marked as stale because it has been inactive for over 14 days.
If you believe this PR is still relevant, please leave a comment to let us know.
Otherwise, this PR may be closed automatically in 7 days.

@github-actions github-actions bot added the inactive PR/Issue has been inactive for a while and will be closed soon label Apr 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR has been automatically closed due to inactivity for over 14 days.
If you believe this PR is still relevant, feel free to reopen it or create a new one with updated information.

@github-actions github-actions bot closed this Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

activity creation inactive PR/Issue has been inactive for a while and will be closed soon

Development

Successfully merging this pull request may close these issues.

4 participants