Add artists robot tests

This commit is contained in:
Zoe Roux
2022-10-25 11:57:50 +09:00
committed by Bluub
parent 89dbee0b17
commit 7bcdc4ff22
4 changed files with 127 additions and 9 deletions
+7 -2
View File
@@ -6,6 +6,7 @@ import {
DefaultValuePipe,
Delete,
Get,
InternalServerErrorException,
NotFoundException,
Param,
ParseIntPipe,
@@ -30,8 +31,12 @@ export class SongController {
const song = await this.songService.song({ id });
if (!song) throw new NotFoundException('Song not found');
const file = createReadStream(song.midiPath);
return new StreamableFile(file);
try {
const file = createReadStream(song.midiPath);
return new StreamableFile(file, { type: 'audio/midi' });
} catch {
throw new InternalServerErrorException();
}
}
@Get(':id/musicXml')