Skip to content

Commit

Permalink
fix: fix fallback icon behavior in get_icon_stream
Browse files Browse the repository at this point in the history
  • Loading branch information
KernelDeimos committed Dec 20, 2024
1 parent b1833ce commit 4f3a161
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/backend/src/services/AppIconService.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ class AppIconService extends BaseService {
app_uid = `app-${app_uid}`;
}

const stream = await this.get_icon_stream({ app_uid, size, })
const {
stream,
mime,
} = await this.get_icon_stream({ app_uid, size, })

res.set('Content-Type', 'image/png');
res.set('Content-Type', mime);
stream.pipe(res);
},
}).attach(app);
Expand All @@ -73,17 +76,20 @@ class AppIconService extends BaseService {
console.log('METADATA', metadata);
const mime = metadata.split(';')[0].split(':')[1];
const img = Buffer.from(app_icon, 'base64');
res.set('Content-Type', mime);
res.send(img);
return;
return {
mime,
stream: buffer_to_stream(img),
};
}

const svc_su = this.services.get('su');
const ll_read = new LLRead();
return await ll_read.run({
fsNode: node,
actor: await svc_su.get_system_actor(),
});
return {
stream: await ll_read.run({
fsNode: node,
actor: await svc_su.get_system_actor(),
})
};
}

/**
Expand Down

0 comments on commit 4f3a161

Please sign in to comment.