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

View File

@@ -4332,8 +4332,9 @@ speechSynthesis.getVoices();
return;
}
if (noty.type === 'VideoPlay') {
if (!noty.videoName) {
// skip videos without names
if (!noty.videoName || noty.videoUrl === this.nowPlaying.url) {
// skip video without name
// skip video already playing
return;
}
noty.notyName = noty.videoName;
@@ -7112,7 +7113,7 @@ speechSynthesis.getVoices();
userId: ref.userId,
time
};
this.addGameLog(entry);
$app.addGameLog(entry);
database.addGamelogJoinLeaveToDatabase(entry);
}
if (this.lastLocation.date !== 0) {
@@ -7620,15 +7621,11 @@ speechSynthesis.getVoices();
};
$app.methods.setNowPlaying = function (ctx) {
var videoId = '';
var displayName = '';
if (ctx.videoId) {
videoId = `${ctx.videoId} : `;
}
if (ctx.displayName) {
displayName = ` (${ctx.displayName})`;
}
var name = `${videoId}${ctx.videoName}${displayName} `;
var name = `${ctx.videoName}${displayName}`;
this.nowPlaying = {
url: ctx.videoUrl,
name,
@@ -7786,10 +7783,20 @@ speechSynthesis.getVoices();
}
var appId = '883308884863901717';
var bigIcon = 'vrchat';
if (L.worldId === 'wrld_f20326da-f1ac-45fc-a062-609723b097b1') {
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') {
appId = '784094509008551956';
bigIcon = 'pypy';
} else if (
L.worldId === 'wrld_42377cf1-c54f-45ed-8996-5875b0573a83'
) {
appId = '846232616054030376';
bigIcon = 'vr_dancing';
}
L.worldName = this.nowPlaying.name;
appId = '784094509008551956';
bigIcon = 'pypy';
Discord.SetTimestamps(
Date.now(),
(this.nowPlaying.startTime + this.nowPlaying.length) * 1000
@@ -9440,6 +9447,7 @@ speechSynthesis.getVoices();
$app.methods.vrInit = function () {
this.updateVRConfigVars();
this.updateVRLastLocation();
this.updateVrNowPlaying();
this.updateSharedFeed(true);
};

View File

@@ -173,6 +173,7 @@ html
span(v-else-if="scope.row.status === 'busy'") Do Not Disturb
span(v-else) Offline
i.x-user-status(:class="statusClass(scope.row.status)")
span
span(v-text="scope.row.statusDescription")
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")

View File

@@ -349,9 +349,10 @@ html
br
span {{ device[2] }}%
.x-containerbottom
span(style="float:right;padding-left:10px") {{ nowPlaying.remainingText }}
marquee-text {{ nowPlaying.name }}
div.np-progress-bar(:style="{ width: nowPlaying.percentage + '%' }")
template(v-if="nowPlaying.playing")
span(style="float:right;padding-left:10px") {{ nowPlaying.remainingText }}
marquee-text {{ nowPlaying.name }}
div.np-progress-bar(:style="{ width: nowPlaying.percentage + '%' }")
template(v-if="config && config.minimalFeed")
template(v-if="config.downloadProgress === 100")
span(style="display:inline-block;margin-right:5px") #[i.el-icon-loading]