File tree Expand file tree Collapse file tree 1 file changed +5
-17
lines changed
2025/src/components/Sessions Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -5,26 +5,14 @@ const images = import.meta.glob<{ default: ImageMetadata }>(
5
5
) ;
6
6
7
7
export async function getSessionImageUrl ( sessionId : string ) : Promise < string > {
8
- // ファイル名とsession_idのマッピング
9
- const imageFiles : Record < string , string > = {
10
- atusy : "atusy.jpg" ,
11
- hrsh7th : "hrsh7th.png" ,
12
- kawarimidoll : "kawarimidoll.png" ,
13
- kuuote : "kuuote.png" ,
14
- Λlisue : "lambdalisue.png" ,
15
- mikoto2000 : "mikoto2000.png" ,
16
- rbtnn : "rbtnn.png" ,
17
- satoru_kitaguchi_register : "satorunooshie.png" ,
18
- satoru_kitaguchi_dot : "satorunooshie.png" ,
19
- teppei22 : "teppei22.jpg" ,
8
+ const customExtensions : Record < string , string > = {
9
+ atusy : "jpg" ,
10
+ teppei22 : "jpg" ,
20
11
} ;
21
12
22
- const fileName = imageFiles [ sessionId ] ;
23
- if ( ! fileName ) {
24
- return "" ;
25
- }
13
+ const suffix = customExtensions [ sessionId ] ?? "png" ;
26
14
27
- const imagePath = `/src/assets/sessions/${ fileName } ` ;
15
+ const imagePath = `/src/assets/sessions/${ sessionId } . ${ suffix } ` ;
28
16
if ( images [ imagePath ] ) {
29
17
const imageModule = await images [ imagePath ] ( ) ;
30
18
return imageModule . default . src ;
You can’t perform that action at this time.
0 commit comments