123
This commit is contained in:
@@ -239,7 +239,7 @@ const pollStatus = async (id) => {
|
||||
generationSuccess.value = true
|
||||
|
||||
// For global generation, we might need to fetch the assets by ID if returned
|
||||
if (response.assets_list && response.assets_list.length > 0) {
|
||||
if (response.result_list && response.result_list.length > 0) {
|
||||
// Since we don't have a direct "getAssetsByIds" batch endpoint easily available in dataService yet,
|
||||
// we might just fetch the first one or construct objects if URL is provided.
|
||||
// Assuming response includes asset details or just IDs.
|
||||
@@ -287,18 +287,18 @@ const restoreGeneration = async (gen) => {
|
||||
const foundAspect = aspectRatioOptions.value.find(opt => opt.key === gen.aspect_ratio)
|
||||
if (foundAspect) aspectRatio.value = foundAspect
|
||||
|
||||
if (gen.status === 'done' && gen.assets_list && gen.assets_list.length > 0) {
|
||||
if (gen.status === 'done' && gen.result_list && gen.result_list.length > 0) {
|
||||
// We need to fetch details or just display the image
|
||||
// history list usually has the main image preview
|
||||
generatedResult.value = {
|
||||
type: 'assets',
|
||||
// Mocking asset object structure from history usage in DetailView
|
||||
assets: gen.assets_list.map(id => ({
|
||||
assets: gen.result_list.map(id => ({
|
||||
id,
|
||||
url: `/assets/${id}`, // This might need adjustment based on how API serves files
|
||||
// Ideally history API should return full asset objects or URLs.
|
||||
// If not, we rely on the implementation in CharacterDetailView:
|
||||
// :src="API_URL + '/assets/' + gen.assets_list[0]"
|
||||
// :src="API_URL + '/assets/' + gen.result_list[0]"
|
||||
// So let's construct it similarly
|
||||
})),
|
||||
tech_prompt: gen.tech_prompt,
|
||||
@@ -363,9 +363,8 @@ const reusePrompt = (gen) => {
|
||||
}
|
||||
|
||||
const reuseAsset = (gen) => {
|
||||
// Try to find input assets field from history object
|
||||
// We check linked_assets or input_assets, and fallback to empty array if not found
|
||||
const assetIds = gen.assets_list || gen.input_assets || []
|
||||
// Assets used as INPUT are now explicitly in assets_list (per user request)
|
||||
const assetIds = gen.assets_list || []
|
||||
|
||||
if (assetIds && assetIds.length > 0) {
|
||||
selectedAssets.value = assetIds.map(id => {
|
||||
@@ -386,9 +385,10 @@ const reuseAsset = (gen) => {
|
||||
}
|
||||
|
||||
const useResultAsReference = (gen) => {
|
||||
if (gen.assets_list && gen.assets_list.length > 0) {
|
||||
// Result (output) is now in result_list
|
||||
if (gen.result_list && gen.result_list.length > 0) {
|
||||
// Appends the generated assets to the selection
|
||||
const newAssets = gen.assets_list.map(id => ({
|
||||
const newAssets = gen.result_list.map(id => ({
|
||||
id,
|
||||
url: `/assets/${id}`
|
||||
}))
|
||||
@@ -697,8 +697,8 @@ onMounted(() => {
|
||||
<div class="flex gap-3 items-start cursor-pointer" @click="restoreGeneration(gen)">
|
||||
<div
|
||||
class="w-12 h-12 rounded bg-black/40 border border-white/10 overflow-hidden flex-shrink-0 mt-0.5">
|
||||
<img v-if="gen.assets_list && gen.assets_list.length > 0"
|
||||
:src="API_URL + '/assets/' + gen.assets_list[0] + '?thumbnail=true'"
|
||||
<img v-if="gen.result_list && gen.result_list.length > 0"
|
||||
:src="API_URL + '/assets/' + gen.result_list[0] + '?thumbnail=true'"
|
||||
class="w-full h-full object-cover" />
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
|
||||
Reference in New Issue
Block a user