Save Instance Prints To File

This commit is contained in:
Natsumi
2024-11-17 10:11:52 +13:00
parent 7956e19a10
commit 78a6dfbfe1
10 changed files with 223 additions and 82 deletions

View File

@@ -39,7 +39,7 @@ export default class extends baseClass {
if (this.gameLogDisabled) {
return;
}
var userId = gameLog.userId;
var userId = String(gameLog.userId || '');
if (!userId && gameLog.displayName) {
for (var ref of API.cachedUsers.values()) {
if (ref.displayName === gameLog.displayName) {
@@ -257,6 +257,25 @@ export default class extends baseClass {
// if (!userId) {
// break;
// }
if (!$app.saveInstancePrints) {
break;
}
try {
var printId = '';
var url = new URL(gameLog.url);
if (
url.pathname.substring(0, 14) === '/api/1/prints/'
) {
var pathArray = url.pathname.split('/');
printId = pathArray[4];
}
if (printId && printId.length === 41) {
$app.trySavePrintToFile(printId);
}
} catch (err) {
console.error(err);
}
break;
case 'avatar-change':
var ref = this.lastLocation.playerList.get(userId);

View File

@@ -598,6 +598,9 @@ export default class extends baseClass {
},
key() {
this.parse();
},
userid() {
this.parse();
}
},
mounted() {

View File

@@ -514,19 +514,34 @@ export default class extends baseClass {
var contentType = content.contentType;
console.log('content-refresh', content);
if (contentType === 'icon') {
if ($app.galleryDialogVisible) {
if (
$app.galleryDialogVisible &&
!$app.galleryDialogIconsLoading
) {
$app.refreshVRCPlusIconsTable();
}
} else if (contentType === 'gallery') {
if ($app.galleryDialogVisible) {
if (
$app.galleryDialogVisible &&
!$app.galleryDialogGalleryLoading
) {
$app.refreshGalleryTable();
}
} else if (contentType === 'emoji') {
if ($app.galleryDialogVisible) {
if (
$app.galleryDialogVisible &&
!$app.galleryDialogEmojisLoading
) {
$app.refreshEmojiTable();
}
} else if (contentType === 'print') {
if ($app.galleryDialogVisible) {
} else if (
contentType === 'print' ||
contentType === 'prints'
) {
if (
$app.galleryDialogVisible &&
!$app.galleryDialogPrintsLoading
) {
$app.refreshPrintTable();
}
} else if (contentType === 'avatar') {