mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 22:46:06 +02:00
Fix avatar errors
This commit is contained in:
+25
-39
@@ -2654,17 +2654,6 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
API.$on('FAVORITE:FRIEND:LIST', function (args) {
|
|
||||||
for (var json of args.json) {
|
|
||||||
this.$emit('USER', {
|
|
||||||
json,
|
|
||||||
params: {
|
|
||||||
userId: json.id
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
API.$on('FAVORITE:WORLD:LIST', function (args) {
|
API.$on('FAVORITE:WORLD:LIST', function (args) {
|
||||||
for (var json of args.json) {
|
for (var json of args.json) {
|
||||||
if (json.id === '???') {
|
if (json.id === '???') {
|
||||||
@@ -2755,7 +2744,6 @@ speechSynthesis.getVoices();
|
|||||||
|
|
||||||
API.refreshFavoriteItems = function () {
|
API.refreshFavoriteItems = function () {
|
||||||
var types = {
|
var types = {
|
||||||
// 'friend': [0, 'getFavoriteFriends'],
|
|
||||||
'world': [0, 'getFavoriteWorlds'],
|
'world': [0, 'getFavoriteWorlds'],
|
||||||
'avatar': [0, 'getFavoriteAvatars']
|
'avatar': [0, 'getFavoriteAvatars']
|
||||||
};
|
};
|
||||||
@@ -3150,26 +3138,6 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
params: {
|
|
||||||
n: number,
|
|
||||||
offset: number
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
API.getFavoriteFriends = function (params) {
|
|
||||||
return this.call('auth/user/friends/favorite', {
|
|
||||||
method: 'GET',
|
|
||||||
params
|
|
||||||
}).then((json) => {
|
|
||||||
var args = {
|
|
||||||
json,
|
|
||||||
params
|
|
||||||
};
|
|
||||||
this.$emit('FAVORITE:FRIEND:LIST', args);
|
|
||||||
return args;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
params: {
|
params: {
|
||||||
n: number,
|
n: number,
|
||||||
@@ -7497,6 +7465,7 @@ speechSynthesis.getVoices();
|
|||||||
$avatarInfo: {
|
$avatarInfo: {
|
||||||
ownerId: '',
|
ownerId: '',
|
||||||
avatarName: '',
|
avatarName: '',
|
||||||
|
fileCreatedAt: ''
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -8527,12 +8496,13 @@ speechSynthesis.getVoices();
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
D.ref = args.ref;
|
D.ref = args.ref;
|
||||||
if (D.fileSize === 'Loading') {
|
if (D.fileSize === 'Unknown') {
|
||||||
var id = extractFileId(args.ref.assetUrl);
|
var id = extractFileId(args.ref.assetUrl);
|
||||||
if (id) {
|
if (id) {
|
||||||
|
D.fileSize = 'Loading';
|
||||||
this.call(`file/${id}`).then((json) => {
|
this.call(`file/${id}`).then((json) => {
|
||||||
var ref = json.versions[json.versions.length - 1];
|
var ref = json.versions[json.versions.length - 1];
|
||||||
D.fileCreatedAt = ref.created_at;
|
D.ref.created_at = ref.created_at;
|
||||||
D.fileSize = `${(ref.file.sizeInBytes / 1048576).toFixed(2)} MiB`;
|
D.fileSize = `${(ref.file.sizeInBytes / 1048576).toFixed(2)} MiB`;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -8564,8 +8534,7 @@ speechSynthesis.getVoices();
|
|||||||
var D = this.avatarDialog;
|
var D = this.avatarDialog;
|
||||||
D.id = avatarId;
|
D.id = avatarId;
|
||||||
D.treeData = [];
|
D.treeData = [];
|
||||||
D.fileCreatedAt = '';
|
D.fileSize = 'Unknown';
|
||||||
D.fileSize = 'Loading';
|
|
||||||
D.visible = true;
|
D.visible = true;
|
||||||
D.loading = true;
|
D.loading = true;
|
||||||
API.getCachedAvatar({
|
API.getCachedAvatar({
|
||||||
@@ -8575,12 +8544,25 @@ speechSynthesis.getVoices();
|
|||||||
D.visible = false;
|
D.visible = false;
|
||||||
throw err;
|
throw err;
|
||||||
}).then((args) => {
|
}).then((args) => {
|
||||||
if (D.id === args.ref.id) {
|
if ((D.visible) && (D.id === args.ref.id)) {
|
||||||
D.loading = false;
|
D.loading = false;
|
||||||
D.ref = args.ref;
|
D.ref = args.ref;
|
||||||
D.isFavorite = API.cachedFavoritesByObjectId.has(D.ref.id);
|
D.isFavorite = API.cachedFavoritesByObjectId.has(D.ref.id);
|
||||||
if (args.cache) {
|
if ((args.cache) && (D.ref.authorId === API.currentUser.id)) {
|
||||||
API.getAvatar(args.params);
|
API.getAvatar(args.params);
|
||||||
|
} else {
|
||||||
|
var fileId = extractFileId(D.ref.imageUrl);
|
||||||
|
if ((fileId) && (!D.ref.created_at)) {
|
||||||
|
if (API.cachedAvatarNames.has(fileId)) {
|
||||||
|
var avatarInfo = API.cachedAvatarNames.get(fileId);
|
||||||
|
D.ref.created_at = avatarInfo.fileCreatedAt;
|
||||||
|
} else {
|
||||||
|
API.getAvatarImages({fileId}).then((args) => {
|
||||||
|
var avatarInfo = this.storeAvatarImage(args);
|
||||||
|
D.ref.created_at = avatarInfo.fileCreatedAt;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return args;
|
return args;
|
||||||
@@ -10696,6 +10678,9 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
|
|
||||||
$app.methods.storeAvatarImage = function (args) {
|
$app.methods.storeAvatarImage = function (args) {
|
||||||
|
var refCreatedAt = args.json.versions[0];
|
||||||
|
var fileCreatedAt = refCreatedAt.created_at;
|
||||||
|
var ref = args.json.versions[args.json.versions.length - 1];
|
||||||
var fileId = args.params.fileId;
|
var fileId = args.params.fileId;
|
||||||
var avatarName = '';
|
var avatarName = '';
|
||||||
var imageName = args.json.name;
|
var imageName = args.json.name;
|
||||||
@@ -10706,7 +10691,8 @@ speechSynthesis.getVoices();
|
|||||||
var ownerId = args.json.ownerId;
|
var ownerId = args.json.ownerId;
|
||||||
var avatarInfo = {
|
var avatarInfo = {
|
||||||
ownerId,
|
ownerId,
|
||||||
avatarName
|
avatarName,
|
||||||
|
fileCreatedAt
|
||||||
};
|
};
|
||||||
API.cachedAvatarNames.set(fileId, avatarInfo);
|
API.cachedAvatarNames.set(fileId, avatarInfo);
|
||||||
return avatarInfo;
|
return avatarInfo;
|
||||||
|
|||||||
+6
-4
@@ -1110,7 +1110,7 @@ html
|
|||||||
span(v-if="!scope.data.children" v-text="scope.data.value")
|
span(v-if="!scope.data.children" v-text="scope.data.value")
|
||||||
|
|
||||||
//- dialog: world
|
//- dialog: world
|
||||||
el-dialog.x-dialog.x-world-dialog(ref="worldDialog" :visible.sync="worldDialog.visible" :show-close="false" width="600px")
|
el-dialog.x-dialog.x-world-dialog(ref="worldDialog" :visible.sync="worldDialog.visible" :show-close="false" width="770px")
|
||||||
div(v-loading="worldDialog.loading")
|
div(v-loading="worldDialog.loading")
|
||||||
div(style="display:flex")
|
div(style="display:flex")
|
||||||
el-popover(placement="right" width="500px" trigger="click")
|
el-popover(placement="right" width="500px" trigger="click")
|
||||||
@@ -1274,15 +1274,17 @@ html
|
|||||||
.x-friend-item(style="cursor:default")
|
.x-friend-item(style="cursor:default")
|
||||||
.detail
|
.detail
|
||||||
span.name Last Updated
|
span.name Last Updated
|
||||||
span.extra {{ avatarDialog.fileCreatedAt | formatDate('YYYY-MM-DD HH24:MI:SS') || '-' }}
|
span.extra {{ avatarDialog.ref.updated_at | formatDate('YYYY-MM-DD HH24:MI:SS') || '-' }}
|
||||||
.x-friend-item(style="cursor:default")
|
.x-friend-item(style="cursor:default")
|
||||||
.detail
|
.detail
|
||||||
span.name Version
|
span.name Version
|
||||||
span.extra(v-text="avatarDialog.ref.version")
|
span.extra(v-if="avatarDialog.ref.version !== 0" v-text="avatarDialog.ref.version")
|
||||||
|
span.extra(v-else) -
|
||||||
.x-friend-item(style="width:100%;cursor:default")
|
.x-friend-item(style="width:100%;cursor:default")
|
||||||
.detail
|
.detail
|
||||||
span.name Platform
|
span.name Platform
|
||||||
span.extra(v-text="avatarDialogPlatform")
|
span.extra(v-if="avatarDialogPlatform" v-text="avatarDialogPlatform")
|
||||||
|
span.extra(v-else) -
|
||||||
el-tab-pane(label="JSON")
|
el-tab-pane(label="JSON")
|
||||||
el-button(type="default" @click="refreshAvatarDialogTreeData()" size="mini" icon="el-icon-refresh" circle)
|
el-button(type="default" @click="refreshAvatarDialogTreeData()" size="mini" icon="el-icon-refresh" circle)
|
||||||
el-tree(:data="avatarDialog.treeData" style="margin-top:5px;font-size:12px")
|
el-tree(:data="avatarDialog.treeData" style="margin-top:5px;font-size:12px")
|
||||||
|
|||||||
Reference in New Issue
Block a user