PyPyDance Discord RPC 1

This commit is contained in:
Natsumi
2021-09-13 12:38:02 +12:00
parent 9e1d6abc49
commit 62c846bb4d
3 changed files with 24 additions and 14 deletions
+17 -9
View File
@@ -4332,8 +4332,9 @@ speechSynthesis.getVoices();
return; return;
} }
if (noty.type === 'VideoPlay') { if (noty.type === 'VideoPlay') {
if (!noty.videoName) { if (!noty.videoName || noty.videoUrl === this.nowPlaying.url) {
// skip videos without names // skip video without name
// skip video already playing
return; return;
} }
noty.notyName = noty.videoName; noty.notyName = noty.videoName;
@@ -7112,7 +7113,7 @@ speechSynthesis.getVoices();
userId: ref.userId, userId: ref.userId,
time time
}; };
this.addGameLog(entry); $app.addGameLog(entry);
database.addGamelogJoinLeaveToDatabase(entry); database.addGamelogJoinLeaveToDatabase(entry);
} }
if (this.lastLocation.date !== 0) { if (this.lastLocation.date !== 0) {
@@ -7620,15 +7621,11 @@ speechSynthesis.getVoices();
}; };
$app.methods.setNowPlaying = function (ctx) { $app.methods.setNowPlaying = function (ctx) {
var videoId = '';
var displayName = ''; var displayName = '';
if (ctx.videoId) {
videoId = `${ctx.videoId} : `;
}
if (ctx.displayName) { if (ctx.displayName) {
displayName = ` (${ctx.displayName})`; displayName = ` (${ctx.displayName})`;
} }
var name = `${videoId}${ctx.videoName}${displayName} `; var name = `${ctx.videoName}${displayName}`;
this.nowPlaying = { this.nowPlaying = {
url: ctx.videoUrl, url: ctx.videoUrl,
name, name,
@@ -7786,10 +7783,20 @@ speechSynthesis.getVoices();
} }
var appId = '883308884863901717'; var appId = '883308884863901717';
var bigIcon = 'vrchat'; var bigIcon = 'vrchat';
if (
L.worldId === 'wrld_f20326da-f1ac-45fc-a062-609723b097b1' ||
L.worldId === 'wrld_42377cf1-c54f-45ed-8996-5875b0573a83'
) {
if (L.worldId === 'wrld_f20326da-f1ac-45fc-a062-609723b097b1') { if (L.worldId === 'wrld_f20326da-f1ac-45fc-a062-609723b097b1') {
L.worldName = this.nowPlaying.name;
appId = '784094509008551956'; appId = '784094509008551956';
bigIcon = 'pypy'; bigIcon = 'pypy';
} else if (
L.worldId === 'wrld_42377cf1-c54f-45ed-8996-5875b0573a83'
) {
appId = '846232616054030376';
bigIcon = 'vr_dancing';
}
L.worldName = this.nowPlaying.name;
Discord.SetTimestamps( Discord.SetTimestamps(
Date.now(), Date.now(),
(this.nowPlaying.startTime + this.nowPlaying.length) * 1000 (this.nowPlaying.startTime + this.nowPlaying.length) * 1000
@@ -9440,6 +9447,7 @@ speechSynthesis.getVoices();
$app.methods.vrInit = function () { $app.methods.vrInit = function () {
this.updateVRConfigVars(); this.updateVRConfigVars();
this.updateVRLastLocation(); this.updateVRLastLocation();
this.updateVrNowPlaying();
this.updateSharedFeed(true); this.updateSharedFeed(true);
}; };
+1
View File
@@ -173,6 +173,7 @@ html
span(v-else-if="scope.row.status === 'busy'") Do Not Disturb span(v-else-if="scope.row.status === 'busy'") Do Not Disturb
span(v-else) Offline span(v-else) Offline
i.x-user-status(:class="statusClass(scope.row.status)") i.x-user-status(:class="statusClass(scope.row.status)")
span
span(v-text="scope.row.statusDescription") span(v-text="scope.row.statusDescription")
template(v-else-if="scope.row.type === 'Avatar'") template(v-else-if="scope.row.type === 'Avatar'")
avatar-info(:imageurl="scope.row.currentAvatarImageUrl" :userid="scope.row.userId" :hintownerid="scope.row.ownerId" :hintavatarname="scope.row.avatarName") avatar-info(:imageurl="scope.row.currentAvatarImageUrl" :userid="scope.row.userId" :hintownerid="scope.row.ownerId" :hintavatarname="scope.row.avatarName")
+2 -1
View File
@@ -349,8 +349,9 @@ html
br br
span {{ device[2] }}% span {{ device[2] }}%
.x-containerbottom .x-containerbottom
template(v-if="nowPlaying.playing")
span(style="float:right;padding-left:10px") {{ nowPlaying.remainingText }} span(style="float:right;padding-left:10px") {{ nowPlaying.remainingText }}
marquee-text {{ nowPlaying.name }} marquee-text {{ nowPlaying.name }}
div.np-progress-bar(:style="{ width: nowPlaying.percentage + '%' }") div.np-progress-bar(:style="{ width: nowPlaying.percentage + '%' }")
template(v-if="config && config.minimalFeed") template(v-if="config && config.minimalFeed")
template(v-if="config.downloadProgress === 100") template(v-if="config.downloadProgress === 100")