Random changes

This commit is contained in:
Natsumi
2021-09-08 07:15:11 +12:00
parent 6587f66a11
commit e227e94c14
3 changed files with 44 additions and 30 deletions

View File

@@ -4333,9 +4333,16 @@ speechSynthesis.getVoices();
) {
return;
}
if (noty.type === 'VideoPlay' && !noty.videoName) {
// skip videos without names
return;
if (noty.type === 'VideoPlay') {
if (!noty.videoName) {
// skip videos without names
return;
}
noty.notyName = noty.videoName;
if (noty.displayName) {
// add requester's name to noty
noty.notyName = `${noty.videoName} (${noty.displayName})`;
}
}
if (
noty.type !== 'VideoPlay' &&
@@ -4869,7 +4876,7 @@ speechSynthesis.getVoices();
this.speak(noty.data);
break;
case 'VideoPlay':
this.speak(`Now playing: ${noty.videoName}`);
this.speak(`Now playing: ${noty.notyName}`);
break;
case 'BlockedOnPlayerJoined':
this.speak(`Blocked user ${noty.displayName} has joined`);
@@ -5054,7 +5061,7 @@ speechSynthesis.getVoices();
case 'VideoPlay':
AppApi.XSNotification(
'VRCX',
`Now playing: ${noty.videoName}`,
`Now playing: ${noty.notyName}`,
timeout,
image
);
@@ -5237,7 +5244,7 @@ speechSynthesis.getVoices();
case 'VideoPlay':
AppApi.DesktopNotification(
'Now playing',
noty.videoName,
noty.notyName,
image
);
break;
@@ -7248,7 +7255,7 @@ speechSynthesis.getVoices();
}
};
$app.methods.addGameLogEvent = async function (json) {
$app.methods.addGameLogEvent = function (json) {
var rawLogs = JSON.parse(json);
var gameLog = gameLogService.parseRawGameLog(
rawLogs[1],
@@ -7256,14 +7263,11 @@ speechSynthesis.getVoices();
rawLogs.slice(3)
);
var pushToTable = true;
await this.addGameLogEntry(
this.addGameLogEntry(
gameLog,
this.lastLocation.location,
pushToTable
);
this.updateSharedFeed(false);
this.notifyMenu('gameLog');
this.sweepGameLog();
};
$app.lastLocationDestinationTime = 0;
@@ -7410,6 +7414,9 @@ speechSynthesis.getVoices();
if (pushToTable && entry) {
this.queueGameLogNoty(entry);
this.gameLogTable.data.push(entry);
this.updateSharedFeed(false);
this.notifyMenu('gameLog');
this.sweepGameLog();
}
};
@@ -7468,6 +7475,9 @@ speechSynthesis.getVoices();
if (pushToTable) {
this.queueGameLogNoty(entry);
this.gameLogTable.data.push(entry);
this.updateSharedFeed(false);
this.notifyMenu('gameLog');
this.sweepGameLog();
}
if (this.youTubeApi && youtubeVideoId) {
var data = await this.lookupYouTubeVideo(youtubeVideoId);
@@ -7507,6 +7517,9 @@ speechSynthesis.getVoices();
if (pushToTable) {
this.queueGameLogNoty(entry);
this.gameLogTable.data.push(entry);
this.updateSharedFeed(false);
this.notifyMenu('gameLog');
this.sweepGameLog();
}
database.addGamelogVideoPlayToDatabase(entry);
}
@@ -14190,21 +14203,22 @@ speechSynthesis.getVoices();
return;
}
if (
this.downloadCurrent.type === 'Auto' &&
this.cacheAutoDownloadHistory.has(assetUrl)
this.downloadCurrent.type !== 'Auto' ||
!this.cacheAutoDownloadHistory.has(assetUrl)
) {
this.downloadCurrent = {};
this.downloadInProgress = false;
this.downloadVRChatCache();
return;
}
this.cacheAutoDownloadHistory.add(assetUrl);
try {
var args = await API.getBundles(fileId);
} catch (err) {
this.downloadCurrent.status = 'API request failed';
this.downloadCurrent.date = Date.now();
this.downloadHistoryTable.data.unshift(this.downloadCurrent);
this.cacheAutoDownloadHistory.add(assetUrl);
try {
var args = await API.getBundles(fileId);
} catch (err) {
this.downloadCurrent.status = 'API request failed';
this.downloadCurrent.date = Date.now();
this.downloadHistoryTable.data.unshift(this.downloadCurrent);
this.downloadCurrent = {};
this.downloadInProgress = false;
this.downloadVRChatCache();
return;
}
} else {
this.downloadCurrent = {};
this.downloadInProgress = false;
this.downloadVRChatCache();

View File

@@ -400,7 +400,7 @@ speechSynthesis.getVoices();
text = noty.data;
break;
case 'VideoPlay':
text = `<strong>Now playing:</strong> ${noty.videoName}`;
text = `<strong>Now playing:</strong> ${noty.notyName}`;
break;
case 'BlockedOnPlayerJoined':
text = `Blocked user <strong>${noty.displayName}</strong> has joined`;

View File

@@ -69,8 +69,8 @@ html
span.extra
span.time {{ feed.created_at | formatDate('HH:MI') }}
| 🎵 #[span.name(v-text="feed.displayName")]
template(v-if="feed.videoName")
| #[span(v-text="feed.videoName")]
template(v-if="feed.notyName")
| #[span(v-text="feed.notyName")]
template(v-else)
| #[span(v-text="feed.videoUrl")]
div(v-else-if="feed.type === 'invite'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
@@ -215,8 +215,8 @@ html
span.extra
span.time {{ feed.created_at | formatDate('HH:MI') }}
| #[span.name(v-text="feed.displayName")] changed video to
template(v-if="feed.videoName")
| #[span(v-text="feed.videoName")]
template(v-if="feed.notyName")
| #[span(v-text="feed.notyName")]
template(v-else)
| #[span(v-text="feed.videoUrl")]
div(v-else-if="feed.type === 'invite'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")