Skip to content
Closed
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
27 changes: 27 additions & 0 deletions websites/O/OKISO/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://schemas.premid.app/metadata/1.16",
"apiVersion": 1,
"author": {
"name": "OKISO",
"id": "274178934143451137"
},
"service": "OKISO",
"description": {
"en": "Shows what you're watching on okiso.net"
},
"url": [
"okiso.net",
"localhost"
],
"regExp": ".*(okiso\\.net|localhost).*",
"version": "1.0.0",
"logo": "https://i.imgur.com/LLE4SVZ.png",

Check failure

Code scanning / PMD

Makes sure all images (logo and URLs) are exactly 512x512 pixels Error

Image URL dimensions must be exactly 512x512 pixels, got 496x503 for URL: https://i.imgur.com/LLE4SVZ.png
"thumbnail": "https://i.imgur.com/LLE4SVZ.png",
"color": "#FF7EB3",
"category": "music",
"tags": [
"music",
"vtuber",
"streaming"
]
}

Check failure

Code scanning / ESLint

Require or disallow newline at the end of files Error

Newline required at end of file but not found.
93 changes: 93 additions & 0 deletions websites/O/OKISO/presence.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import { Presence, PresenceData, ActivityType, Assets, getTimestampsFromMedia } from 'premid'

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Module '"premid"' has no exported member 'Presence'.

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Module '"premid"' has no exported member 'PresenceData'.

Check failure

Code scanning / ESLint

Disallow unused variables Error

'PresenceData' is defined but never used.

Check failure

Code scanning / ESLint

Enforce sorted named imports. Error

Expected "ActivityType" to come before "PresenceData".

Check failure

Code scanning / ESLint

Disallow unused variables Error

'ActivityType' is defined but never used.

// Initialize without a custom clientId to use official PreMiD Application
const presence = new Presence()
Comment on lines +3 to +4
const browsingTimestamp = Math.floor(Date.now() / 1000)

enum ActivityAssets {
Logo = 'logo',

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 1 tab.
}

presence.on('UpdateData', async () => {
const { pathname } = document.location

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 1 tab.

// Initialize basic presence

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 1 tab.
const presenceData = {

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 1 tab.
largeImageKey: ActivityAssets.Logo,

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 4 spaces but found 2 tabs.
largeImageText: 'okiso.net',

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 4 spaces but found 2 tabs.
startTimestamp: browsingTimestamp,

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 4 spaces but found 2 tabs.
buttons: [

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 4 spaces but found 2 tabs.
{ label: 'Visit okiso.net', url: `https://okiso.net${pathname === '/' ? '' : pathname}` }

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 6 spaces but found 3 tabs.
]

Check failure

Code scanning / ESLint

Require or disallow trailing commas Error

Missing trailing comma.

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 4 spaces but found 2 tabs.
Comment on lines +19 to +21
} as any

Check failure

Code scanning / ESLint

Require or disallow trailing commas Error

Missing trailing comma.

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 1 tab.

// ─── Home Page ───

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 1 tab.
if (pathname === '/') {

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 1 tab.
// Check for Terms Modal

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 4 spaces but found 2 tabs.
const termsModal = document.querySelector('[data-premid-modal="terms"]')

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 4 spaces but found 2 tabs.
if (termsModal) {

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 4 spaces but found 2 tabs.
presenceData.details = 'Reading Content Terms'

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 6 spaces but found 3 tabs.
presenceData.state = 'Legal & Guidelines'

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 6 spaces but found 3 tabs.
} else {

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 4 spaces but found 2 tabs.

Check failure

Code scanning / ESLint

Enforce consistent brace style for blocks Error

Closing curly brace appears on the same line as the subsequent block.
// Check for live broadcast

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 6 spaces but found 3 tabs.
const isLive = document.querySelector('[data-premid-live="true"]')

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 6 spaces but found 3 tabs.
if (isLive) {

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 6 spaces but found 3 tabs.
presenceData.details = 'Watching Live Broadcast'

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 4 tabs.
presenceData.state = '🔴 LIVE on Twitch'

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 4 tabs.
presenceData.smallImageKey = Assets.Live

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 4 tabs.
presenceData.smallImageText = 'Live'

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 4 tabs.
delete presenceData.startTimestamp

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 4 tabs.
} else {

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 6 spaces but found 3 tabs.

Check failure

Code scanning / ESLint

Enforce consistent brace style for blocks Error

Closing curly brace appears on the same line as the subsequent block.
// Check for video playback

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 4 tabs.
const videoPlayer = document.querySelector('[data-premid-title]')

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 4 tabs.
if (videoPlayer) {

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 4 tabs.
const videoTitle = videoPlayer.getAttribute('data-premid-title')

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 10 spaces but found 5 tabs.
const paused = videoPlayer.getAttribute('data-premid-paused') === 'true'

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 10 spaces but found 5 tabs.

presenceData.details = videoTitle || 'Watching a Video'

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 10 spaces but found 5 tabs.
presenceData.smallImageKey = paused ? Assets.Pause : Assets.Play

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 10 spaces but found 5 tabs.
presenceData.smallImageText = paused ? 'Paused' : 'Playing'

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 10 spaces but found 5 tabs.

if (!paused) {

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 10 spaces but found 5 tabs.
const video = document.querySelector<HTMLVideoElement>('[data-premid-title] video')

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 12 spaces but found 6 tabs.
if (video) {

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 12 spaces but found 6 tabs.
[presenceData.startTimestamp, presenceData.endTimestamp] = getTimestampsFromMedia(video)

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 14 spaces but found 7 tabs.
}

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 12 spaces but found 6 tabs.
}

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 10 spaces but found 5 tabs.

presenceData.state = paused ? '⏸ Paused' : '▶ Playing'

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 10 spaces but found 5 tabs.
} else {

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 8 spaces but found 4 tabs.

Check failure

Code scanning / ESLint

Enforce consistent brace style for blocks Error

Closing curly brace appears on the same line as the subsequent block.
presenceData.details = 'Browsing'

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 10 spaces but found 5 tabs.
presenceData.state = 'Home Page'

Check failure

Code scanning / ESLint

Disallow all tabs Error

Unexpected tab character.
}
}
}
}
// ─── Discography (3D Gallery) ───
else if (pathname === '/releases') {
presenceData.details = 'Exploring the 3D Audio Archive'
presenceData.state = 'Interactive Discography'
}
// ─── Individual Release Page ───
else if (pathname.startsWith('/releases/')) {
const releaseEl = document.querySelector('[data-premid-release-title]')
const releaseTitle = releaseEl?.getAttribute('data-premid-release-title')
presenceData.details = 'Viewing Release'
presenceData.state = releaseTitle ? `🎵 ${releaseTitle}` : 'Release Page'
}
// ─── Upcoming Page ───
else if (pathname === '/upcoming') {
presenceData.details = 'Browsing'
presenceData.state = 'Upcoming Releases'
}
// ─── Fallback ───
else {
presenceData.details = document.title || 'Browsing'
presenceData.state = 'okiso.net'
}

if (presenceData.details)
presence.setActivity(presenceData)
else
presence.setActivity()
})
6 changes: 6 additions & 0 deletions websites/O/OKISO/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist/"
}
}
Loading