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
+39 -25
View File
@@ -4333,9 +4333,16 @@ speechSynthesis.getVoices();
) { ) {
return; return;
} }
if (noty.type === 'VideoPlay' && !noty.videoName) { if (noty.type === 'VideoPlay') {
// skip videos without names if (!noty.videoName) {
return; // 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 ( if (
noty.type !== 'VideoPlay' && noty.type !== 'VideoPlay' &&
@@ -4869,7 +4876,7 @@ speechSynthesis.getVoices();
this.speak(noty.data); this.speak(noty.data);
break; break;
case 'VideoPlay': case 'VideoPlay':
this.speak(`Now playing: ${noty.videoName}`); this.speak(`Now playing: ${noty.notyName}`);
break; break;
case 'BlockedOnPlayerJoined': case 'BlockedOnPlayerJoined':
this.speak(`Blocked user ${noty.displayName} has joined`); this.speak(`Blocked user ${noty.displayName} has joined`);
@@ -5054,7 +5061,7 @@ speechSynthesis.getVoices();
case 'VideoPlay': case 'VideoPlay':
AppApi.XSNotification( AppApi.XSNotification(
'VRCX', 'VRCX',
`Now playing: ${noty.videoName}`, `Now playing: ${noty.notyName}`,
timeout, timeout,
image image
); );
@@ -5237,7 +5244,7 @@ speechSynthesis.getVoices();
case 'VideoPlay': case 'VideoPlay':
AppApi.DesktopNotification( AppApi.DesktopNotification(
'Now playing', 'Now playing',
noty.videoName, noty.notyName,
image image
); );
break; break;
@@ -7248,7 +7255,7 @@ speechSynthesis.getVoices();
} }
}; };
$app.methods.addGameLogEvent = async function (json) { $app.methods.addGameLogEvent = function (json) {
var rawLogs = JSON.parse(json); var rawLogs = JSON.parse(json);
var gameLog = gameLogService.parseRawGameLog( var gameLog = gameLogService.parseRawGameLog(
rawLogs[1], rawLogs[1],
@@ -7256,14 +7263,11 @@ speechSynthesis.getVoices();
rawLogs.slice(3) rawLogs.slice(3)
); );
var pushToTable = true; var pushToTable = true;
await this.addGameLogEntry( this.addGameLogEntry(
gameLog, gameLog,
this.lastLocation.location, this.lastLocation.location,
pushToTable pushToTable
); );
this.updateSharedFeed(false);
this.notifyMenu('gameLog');
this.sweepGameLog();
}; };
$app.lastLocationDestinationTime = 0; $app.lastLocationDestinationTime = 0;
@@ -7410,6 +7414,9 @@ speechSynthesis.getVoices();
if (pushToTable && entry) { if (pushToTable && entry) {
this.queueGameLogNoty(entry); this.queueGameLogNoty(entry);
this.gameLogTable.data.push(entry); this.gameLogTable.data.push(entry);
this.updateSharedFeed(false);
this.notifyMenu('gameLog');
this.sweepGameLog();
} }
}; };
@@ -7468,6 +7475,9 @@ speechSynthesis.getVoices();
if (pushToTable) { if (pushToTable) {
this.queueGameLogNoty(entry); this.queueGameLogNoty(entry);
this.gameLogTable.data.push(entry); this.gameLogTable.data.push(entry);
this.updateSharedFeed(false);
this.notifyMenu('gameLog');
this.sweepGameLog();
} }
if (this.youTubeApi && youtubeVideoId) { if (this.youTubeApi && youtubeVideoId) {
var data = await this.lookupYouTubeVideo(youtubeVideoId); var data = await this.lookupYouTubeVideo(youtubeVideoId);
@@ -7507,6 +7517,9 @@ speechSynthesis.getVoices();
if (pushToTable) { if (pushToTable) {
this.queueGameLogNoty(entry); this.queueGameLogNoty(entry);
this.gameLogTable.data.push(entry); this.gameLogTable.data.push(entry);
this.updateSharedFeed(false);
this.notifyMenu('gameLog');
this.sweepGameLog();
} }
database.addGamelogVideoPlayToDatabase(entry); database.addGamelogVideoPlayToDatabase(entry);
} }
@@ -14190,21 +14203,22 @@ speechSynthesis.getVoices();
return; return;
} }
if ( if (
this.downloadCurrent.type === 'Auto' && this.downloadCurrent.type !== 'Auto' ||
this.cacheAutoDownloadHistory.has(assetUrl) !this.cacheAutoDownloadHistory.has(assetUrl)
) { ) {
this.downloadCurrent = {}; this.cacheAutoDownloadHistory.add(assetUrl);
this.downloadInProgress = false; try {
this.downloadVRChatCache(); var args = await API.getBundles(fileId);
return; } catch (err) {
} this.downloadCurrent.status = 'API request failed';
this.cacheAutoDownloadHistory.add(assetUrl); this.downloadCurrent.date = Date.now();
try { this.downloadHistoryTable.data.unshift(this.downloadCurrent);
var args = await API.getBundles(fileId); this.downloadCurrent = {};
} catch (err) { this.downloadInProgress = false;
this.downloadCurrent.status = 'API request failed'; this.downloadVRChatCache();
this.downloadCurrent.date = Date.now(); return;
this.downloadHistoryTable.data.unshift(this.downloadCurrent); }
} else {
this.downloadCurrent = {}; this.downloadCurrent = {};
this.downloadInProgress = false; this.downloadInProgress = false;
this.downloadVRChatCache(); this.downloadVRChatCache();
+1 -1
View File
@@ -400,7 +400,7 @@ speechSynthesis.getVoices();
text = noty.data; text = noty.data;
break; break;
case 'VideoPlay': case 'VideoPlay':
text = `<strong>Now playing:</strong> ${noty.videoName}`; text = `<strong>Now playing:</strong> ${noty.notyName}`;
break; break;
case 'BlockedOnPlayerJoined': case 'BlockedOnPlayerJoined':
text = `Blocked user <strong>${noty.displayName}</strong> has joined`; text = `Blocked user <strong>${noty.displayName}</strong> has joined`;
+4 -4
View File
@@ -69,8 +69,8 @@ html
span.extra span.extra
span.time {{ feed.created_at | formatDate('HH:MI') }} span.time {{ feed.created_at | formatDate('HH:MI') }}
| 🎵 #[span.name(v-text="feed.displayName")] | 🎵 #[span.name(v-text="feed.displayName")]
template(v-if="feed.videoName") template(v-if="feed.notyName")
| #[span(v-text="feed.videoName")] | #[span(v-text="feed.notyName")]
template(v-else) template(v-else)
| #[span(v-text="feed.videoUrl")] | #[span(v-text="feed.videoUrl")]
div(v-else-if="feed.type === 'invite'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }") 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.extra
span.time {{ feed.created_at | formatDate('HH:MI') }} span.time {{ feed.created_at | formatDate('HH:MI') }}
| #[span.name(v-text="feed.displayName")] changed video to | #[span.name(v-text="feed.displayName")] changed video to
template(v-if="feed.videoName") template(v-if="feed.notyName")
| #[span(v-text="feed.videoName")] | #[span(v-text="feed.notyName")]
template(v-else) template(v-else)
| #[span(v-text="feed.videoUrl")] | #[span(v-text="feed.videoUrl")]
div(v-else-if="feed.type === 'invite'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }") div(v-else-if="feed.type === 'invite'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")