Skip to content

Commit 7726932

Browse files
committed
chore: fix get default tilawa in get audio
1 parent 2586cc2 commit 7726932

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/build
55
data.json
66
seed.ts
7+
data_eng.json
78

89
# Logs
910
logs

src/audio/audio.service.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { CreateAudioDto } from './dto/create-audio.dto';
1010
import { FilterAudioDto } from './dto/filter-audio.dto';
1111
import { ReciterService } from 'src/reciter/reciter.service';
1212

13-
const DEFAULT_TILAWA = 'حفص عن عاصم - مرتل';
1413
@Injectable()
1514
export class AudioService {
1615
constructor(
@@ -36,8 +35,7 @@ export class AudioService {
3635

3736
if (!tilawa_id) {
3837
const tilawa = await this.reciterService.getReciterTilawa(reciter_id);
39-
const defaultTilawa = tilawa.find((t) => t.name == DEFAULT_TILAWA);
40-
tilawa_id = defaultTilawa.id;
38+
tilawa_id = tilawa[0].id;
4139
}
4240

4341
const audio = await this.tilawaSurahRepo.findOne({
@@ -49,21 +47,4 @@ export class AudioService {
4947
}
5048
return { ...audio, reciter_id };
5149
}
52-
53-
// async createAudioSeeder() {
54-
// const audio = await this.tilawaSurahRepo.find();
55-
56-
// if (audio.length) return;
57-
58-
// const audioData = await require('../../data/tilawa-surah.json');
59-
60-
// for (const audio of audioData) {
61-
// const newAudio = this.tilawaSurahRepo.create({
62-
// surah_id: audio.surah_id,
63-
// tilawa_id: audio.tilawa_id,
64-
// audio_url: audio.audio_url,
65-
// });
66-
// await this.tilawaSurahRepo.save(newAudio);
67-
// }
68-
// }
6950
}

src/reciter/dto/create-reciter.dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from 'class-validator';
88

99
export class CreateReciterDto {
10-
id: number;
10+
id?: number;
1111

1212
@IsString()
1313
@Length(3, 50)

0 commit comments

Comments
 (0)