Fix updated at dates

This commit is contained in:
Natsumi
2026-02-06 08:31:45 +13:00
committed by pa
parent d3e44523bd
commit 752c75b37c
3 changed files with 58 additions and 7 deletions

View File

@@ -455,10 +455,12 @@
side="top" side="top"
style="margin-left: 5px"> style="margin-left: 5px">
<template #content> <template #content>
<template v-for="(data, platform) in avatarDialog.fileAnalysis" :key="platform"> <template
v-for="(created_at, platform) in avatarDialogPlatformCreatedAt"
:key="platform">
<div class="flex justify-between w-full"> <div class="flex justify-between w-full">
<span class="mr-1">{{ platform }}:</span> <span class="mr-1">{{ platform }}:</span>
<span>{{ formatDateFilter(data.created_at, 'long') }}</span> <span>{{ formatDateFilter(created_at, 'long') }}</span>
</div> </div>
</template> </template>
</template> </template>
@@ -570,6 +572,7 @@
import { import {
commaNumber, commaNumber,
compareUnityVersion,
copyToClipboard, copyToClipboard,
downloadAndSaveJson, downloadAndSaveJson,
formatDateFilter, formatDateFilter,
@@ -667,6 +670,10 @@
unityPackage.variant !== 'standard' && unityPackage.variant !== 'standard' &&
unityPackage.variant !== 'security' unityPackage.variant !== 'security'
) { ) {
// skip imposters
continue;
}
if (!compareUnityVersion(unityPackage.unitySortNumber)) {
continue; continue;
} }
let platform = 'PC'; let platform = 'PC';
@@ -675,7 +682,7 @@
} else if (unityPackage.platform === 'android') { } else if (unityPackage.platform === 'android') {
platform = 'Android'; platform = 'Android';
} else if (unityPackage.platform) { } else if (unityPackage.platform) {
({ platform } = unityPackage); platform = unityPackage.platform;
} }
platforms.push(`${platform}/${unityPackage.unityVersion}`); platforms.push(`${platform}/${unityPackage.unityVersion}`);
} }
@@ -683,6 +690,25 @@
return platforms.join(', '); return platforms.join(', ');
}); });
const avatarDialogPlatformCreatedAt = computed(() => {
const { ref } = avatarDialog.value;
if (!ref.unityPackages) {
return null;
}
let newest = {};
for (const unityPackage of ref.unityPackages) {
if (unityPackage.variant && unityPackage.variant !== 'standard' && unityPackage.variant !== 'security') {
continue;
}
const platform = unityPackage.platform;
const createdAt = unityPackage.created_at;
if (!newest[platform] || new Date(createdAt) > new Date(newest[platform])) {
newest[platform] = createdAt;
}
}
return newest;
});
watch( watch(
() => avatarDialog.value.loading, () => avatarDialog.value.loading,
() => { () => {

View File

@@ -574,10 +574,12 @@
side="top" side="top"
style="margin-left: 5px"> style="margin-left: 5px">
<template #content> <template #content>
<template v-for="(data, platform) in worldDialog.fileAnalysis" :key="platform"> <template
v-for="(created_at, platform) in worldDialogPlatformCreatedAt"
:key="platform">
<div class="flex justify-between w-full"> <div class="flex justify-between w-full">
<span class="mr-1">{{ platform }}:</span> <span class="mr-1">{{ platform }}:</span>
<span>{{ formatDateFilter(data.created_at, 'long') }}</span> <span>{{ formatDateFilter(created_at, 'long') }}</span>
</div> </div>
</template> </template>
</template> </template>
@@ -790,6 +792,7 @@
import { import {
commaNumber, commaNumber,
compareUnityVersion,
deleteVRChatCache, deleteVRChatCache,
downloadAndSaveJson, downloadAndSaveJson,
formatDateFilter, formatDateFilter,
@@ -933,13 +936,16 @@
const platforms = []; const platforms = [];
if (ref.unityPackages) { if (ref.unityPackages) {
for (const unityPackage of ref.unityPackages) { for (const unityPackage of ref.unityPackages) {
if (!compareUnityVersion(unityPackage.unitySortNumber)) {
continue;
}
let platform = 'PC'; let platform = 'PC';
if (unityPackage.platform === 'standalonewindows') { if (unityPackage.platform === 'standalonewindows') {
platform = 'PC'; platform = 'PC';
} else if (unityPackage.platform === 'android') { } else if (unityPackage.platform === 'android') {
platform = 'Android'; platform = 'Android';
} else if (unityPackage.platform) { } else if (unityPackage.platform) {
({ platform } = unityPackage); platform = unityPackage.platform;
} }
platforms.unshift(`${platform}/${unityPackage.unityVersion}`); platforms.unshift(`${platform}/${unityPackage.unityVersion}`);
} }
@@ -947,6 +953,25 @@
return platforms.join(', '); return platforms.join(', ');
}); });
const worldDialogPlatformCreatedAt = computed(() => {
const { ref } = worldDialog.value;
if (!ref.unityPackages) {
return null;
}
let newest = {};
for (const unityPackage of ref.unityPackages) {
if (unityPackage.variant && unityPackage.variant !== 'standard' && unityPackage.variant !== 'security') {
continue;
}
const platform = unityPackage.platform;
const createdAt = unityPackage.created_at;
if (!newest[platform] || new Date(createdAt) > new Date(newest[platform])) {
newest[platform] = createdAt;
}
}
return newest;
});
watch( watch(
() => worldDialog.value.loading, () => worldDialog.value.loading,
() => { () => {

View File

@@ -571,8 +571,8 @@ export const useAvatarStore = defineStore('Avatar', () => {
if (!providerUrl || !authorId) { if (!providerUrl || !authorId) {
return avatars; return avatars;
} }
const url = `${providerUrl}?authorId=${encodeURIComponent(authorId)}`;
try { try {
const url = `${providerUrl}?authorId=${encodeURIComponent(authorId)}`;
const response = await webApiService.execute({ const response = await webApiService.execute({
url, url,
method: 'GET', method: 'GET',