Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions websites/K/kitsu.live/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
"$schema": "https://schemas.premid.app/metadata/1.17",
"apiVersion": 1,
Comment thread
zzxncl marked this conversation as resolved.
"author": {
"name": "kitsu.live",
"id": "1515251988646989854"
},
"service": "kitsu.live",
"description": {
"en": "kitsu.live is a premium anime streaming and manga reading platform."
},
"url": "kitsu.live",
"regExp": "^https?[:][/][/]([a-z0-9-]+[.])*kitsu[.]live[/]",
"version": "1.0.0",
"logo": "https://kitsu.live/favicon.png",
"thumbnail": "https://kitsu.live/assets/hero_banner.png",
"color": "#8b5cf6",
"category": "anime",
"tags": [
"anime",
"manga",
"streaming"
]
}
40 changes: 40 additions & 0 deletions websites/K/kitsu.live/presence.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { ActivityType } from 'premid'

const presence = new Presence({ clientId: '1515251988646989854' })

presence.on('UpdateData', () => {
const el = document.getElementById('kitsu-presence-data')

if (!el || !el.getAttribute('data-active')) {
presence.clearActivity()
return
}

const details = el.getAttribute('data-details') || undefined
const state = el.getAttribute('data-state') || undefined
const largeImageKey = el.getAttribute('data-large-image') || undefined
const largeImageText = el.getAttribute('data-large-image-text') || undefined
const startTimestampStr = el.getAttribute('data-start-timestamp')
const endTimestampStr = el.getAttribute('data-end-timestamp')

const startTimestamp = startTimestampStr ? Number.parseInt(startTimestampStr, 10) * 1000 : undefined
const endTimestamp = endTimestampStr ? Number.parseInt(endTimestampStr, 10) * 1000 : undefined

presence.setActivity({
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
type: ActivityType.Watching,
details,
state,
largeImageKey,
largeImageText,
smallImageKey: 'https://kitsu.live/favicon.png',
smallImageText: 'kitsu.live',
startTimestamp,
endTimestamp,
buttons: [
{
label: 'Watch on kitsu.live',
url: document.location.href,
},
],
})
})
Loading