From 61ce7df5b6e228743c05555b4e4c9cff8a11c916 Mon Sep 17 00:00:00 2001 From: wont-stream Date: Tue, 9 Jul 2024 22:39:33 +0000 Subject: [PATCH] deploy: 138aed0a1ab377fe0972c3a3a7ed86ec5925d354 --- DiscordRPC/index.js | 2 +- DiscordRPC/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DiscordRPC/index.js b/DiscordRPC/index.js index 2f915e5..d5441f6 100644 --- a/DiscordRPC/index.js +++ b/DiscordRPC/index.js @@ -1 +1 @@ -import{store as g,intercept as y,currentMediaItem as u}from"@neptune";import{getMediaURLFromID as T}from"@neptune/utils";var s=[],o=t=>t.length>=128?t.slice(0,125)+"...":t,a=new WebSocket("ws://127.0.0.1:6463/?v=1&client_id=1130698654987067493");a.op;a.onopen=()=>{s.push(y("playbackControls/TIME_UPDATE",([t])=>{let c=g.getState(),{item:e,type:i}=u;if(i!="track")return;let r=T(e.album.cover),n=new Date,m=n.getTime()/1e3|0,l=n.setSeconds(n.getSeconds()+(e.duration-t)),p=c.playbackControls.playbackState=="NOT_PLAYING";a.send(JSON.stringify({cmd:"SET_ACTIVITY",args:{pid:2094112,activity:{...p?{smallImageKey:"paused-icon",smallImageText:"Paused"}:{startTimestamp:m,endTimestamp:l},type:2,name:o(e.title),details:o("by "+e.artists.map(d=>d.name).join(", ")),largeImageKey:r,largeImageText:`on ${o(e.album.title)}`}}}))}))};async function S(){s.forEach(t=>t());try{a.close()}catch{}}export{S as onUnload}; +import{store as g,intercept as u,currentMediaItem as y}from"@neptune";import{getMediaURLFromID as T}from"@neptune/utils";var i=[],o=t=>t.length>=128?t.slice(0,125)+"...":t,a=new WebSocket("ws://127.0.0.1:6463/?v=1&client_id=1130698654987067493");a.op;a.onopen=()=>{i.push(u("playbackControls/TIME_UPDATE",([t])=>{let c=g.getState(),{item:e,type:r}=y;if(r!="track")return;let l=T(e.album.cover),n=new Date,m=n.getTime()/1e3|0,p=n.setSeconds(n.getSeconds()+(e.duration-t)),s=c.playbackControls.playbackState=="NOT_PLAYING";a.send(JSON.stringify({cmd:"SET_ACTIVITY",args:{pid:2094112,activity:{...s?{}:{startTimestamp:m,endTimestamp:p},type:2,name:o(e.title),details:o("by "+e.artists.map(d=>d.name).join(", ")),assets:{large_image:l,large_text:`on ${o(e.album.title)}`,...s?{small_image:"paused-icon",small_text:"Paused"}:{}}}}}))}))};async function _(){i.forEach(t=>t());try{a.close()}catch{}}export{_ as onUnload}; diff --git a/DiscordRPC/manifest.json b/DiscordRPC/manifest.json index 7a06bbf..7fb55d6 100644 --- a/DiscordRPC/manifest.json +++ b/DiscordRPC/manifest.json @@ -1 +1 @@ -{"name":"Discord RPC","description":"An opinionated arRPC only Discord RPC. (forked from toonlink's plugin)","author":"wont-stream","hash":"c75c9130e885c428140fdcc13d2f601b"} \ No newline at end of file +{"name":"Discord RPC","description":"An opinionated arRPC only Discord RPC. (forked from toonlink's plugin)","author":"wont-stream","hash":"6b64b528c1d330c7bd06332e5625ece2"} \ No newline at end of file