Skip to content

Commit

Permalink
feat(route/steam/search): add thumbnails to steam search items (DIYgo…
Browse files Browse the repository at this point in the history
…d#17638)

Co-authored-by: dandersch <[email protected]>
  • Loading branch information
2 people authored and artefaritaKuniklo committed Dec 13, 2024
1 parent 7d2959c commit b5e1fe2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/routes/steam/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ async function handler(ctx) {
const isBundle = !!$el.attr('data-ds-bundle-data');
const isDiscounted = $el.find('.discount_original_price').length > 0;
const hasReview = $el.find('.search_review_summary').length > 0;
const appID : string | undefined = $el.attr('data-ds-appid');

let desc = '';
if (isBundle) {
const bundle = JSON.parse($el.attr('data-ds-bundle-data'));
Expand All @@ -57,6 +59,11 @@ async function handler(ctx) {
title: $el.find('span.title').text(),
link: $el.attr('href'),
description: desc.replaceAll('\n', '<br>'),
media: {
thumbnail: {
url: `https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/${appID}/header.jpg`,
},
},
};
})
.filter((it) => it.title),
Expand Down

0 comments on commit b5e1fe2

Please sign in to comment.