Edit saved print names

This commit is contained in:
Natsumi
2024-11-18 10:39:22 +13:00
parent 9bcd58d776
commit 78dc8ea42d
5 changed files with 47 additions and 17 deletions

View File

@@ -4581,6 +4581,10 @@ speechSynthesis.getVoices();
);
}
}
if (!this.friends.has(id)) {
console.log('Friend not found', id);
return;
}
var isVIP = this.localFavoriteFriends.has(id);
var ref = ctx.ref;
if (ctx.state !== newState && typeof ctx.ref !== 'undefined') {
@@ -17615,7 +17619,12 @@ speechSynthesis.getVoices();
console.error('Print image URL is missing', print);
return;
}
var createdAt = new Date(print.json.createdAt);
var createdAt = new Date();
if (print.json.timestamp) {
createdAt = new Date(print.json.timestamp);
} else if (print.json.createdAt) {
createdAt = new Date(print.json.createdAt);
}
var authorName = print.json.authorName;
// fileDate format: 2024-11-03_16-14-25.757
var fileNameDate = createdAt
@@ -17623,10 +17632,11 @@ speechSynthesis.getVoices();
.replace(/:/g, '-')
.replace(/T/g, '_')
.replace(/Z/g, '');
var fileName = `Prints\\${createdAt.toISOString().slice(0, 7)}\\${authorName}_${fileNameDate}_${printId}.png`;
var status = await AppApi.SavePrintToFile(imageUrl, fileName);
var path = `${createdAt.toISOString().slice(0, 7)}`;
var fileName = `${authorName}_${fileNameDate}_${printId}.png`;
var status = await AppApi.SavePrintToFile(imageUrl, path, fileName);
if (status) {
console.log(`Print saved to file: ${fileName}`);
console.log(`Print saved to file: ${path}\\${fileName}`);
}
};

View File

@@ -161,12 +161,13 @@ mixin currentUser()
.x-friend-item(v-for="image in printTable" :key="image.id" style="display:inline-block;margin-top:10px;width:unset;cursor:default")
.vrcplus-icon(style="overflow:hidden" @click="showFullscreenImageDialog(image.files.image)")
img.avatar(v-lazy="image.files.image")
div(style="margin-top:5px")
span(v-text="image.note")
br
location(v-if="image.worldId" :location="image.worldId" :hint="image.worldName")
br
display-name(v-if="image.authorId" :userid="image.authorId" :hint="image.authorName" style="color:#909399;font-family:monospace")
div(style="float:right;margin-top:5px")
div(style="margin-top:5px;width:208px")
span.x-ellipsis(v-if="image.note" v-text="image.note" style="display:block")
span(v-else style="display:block")  
location.x-ellipsis(v-if="image.worldId" :location="image.worldId" :hint="image.worldName" style="display:block")
span(v-else style="display:block")  
display-name.x-ellipsis(v-if="image.authorId" :userid="image.authorId" :hint="image.authorName" style="color:#909399;font-family:monospace;display:block")
span(v-else style="font-family:monospace;display:block")  
div(style="float:right")
el-button(type="default" @click="showFullscreenImageDialog(image.files.image)" size="mini" icon="el-icon-picture-outline" circle)
el-button(type="default" @click="deletePrint(image.id)" size="mini" icon="el-icon-delete" circle style="margin-left:5px")