Skip to content
Open
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: 13 additions & 11 deletions websites/T/Twitch/presence.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { ActivityType, Assets, getTimestamps, getTimestampsFromMedia, StatusDisplayType, timestampFromFormat } from 'premid'
import {
ActivityType,

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 4.
Assets,

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 4.
getTimestamps,

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 4.
getTimestampsFromMedia,

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 4.
StatusDisplayType,

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 4.
timestampFromFormat

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 4.
} from 'premid'

Check failure

Code scanning / ESLint

Require or disallow trailing commas Error

Missing trailing comma.
Comment on lines +7 to +8

let elapsed = Math.floor(Date.now() / 1000)
let prevUrl = document.location.href
Expand Down Expand Up @@ -528,20 +535,15 @@

if (showVideo && !live) {
//* Video or Clips
const title = getElement('[data-a-target="stream-title"]')
?.split('•')
.shift()
const title = getElement('title')?.replace(' - Twitch', '')

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 10 spaces but found 12.
const uploader = document.querySelector('.channel-info-content h1')?.textContent
?? document
.querySelector('[class*="metadata-layout__support"]')
?.querySelector('a')
?.textContent
const game = getElement('a[data-a-target=\'stream-game-link\']')
|| 'Just Chatting'
const profilePic = document
.querySelector<HTMLImageElement>(
'.channel-info-content .tw-avatar > .tw-image',
)
const profilePic = document.querySelector<HTMLImageElement>('.channel-info-content .tw-avatar > img')
?.src
?.replace(/-\d{1,2}x\d{1,2}/, '-600x600')
?? (logoArr[logo] || ActivityAssets.Logo)
Expand Down Expand Up @@ -978,7 +980,7 @@
if (privacy || !buttons)
delete presenceData.buttons

if (presenceData.details)
presence.setActivity(presenceData)
else presence.clearActivity()
if (presenceData.details)

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 4.
presence.setActivity(presenceData)

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 4 spaces but found 8.
else presence.clearActivity()

Check failure

Code scanning / ESLint

Enforce consistent indentation Error

Expected indentation of 2 spaces but found 4.
})
Loading