Skip to content

Commit

Permalink
funnel down protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
Meezaan-ud-Din Abdu Dhil-Jalali Wal-Ikram committed Jul 15, 2019
1 parent 3814757 commit 4c71e77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Quran/Api/AyatResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ private function prepare($ayat)
$ax['number'] = $ayah->getNumber();
if (isset($this->audioEdition)) {
$ax['audio'] = $this->protocol . '://cdn.alquran.cloud/media/audio/ayah/' . $this->audioEdition->getIdentifier() . '/' . $ayah->getNumber();
$ax['audioSecondary'] = $this->protocol . '://' . $this->meta->getAudioBySize($this->audioEdition->getIdentifier(), $ayah->getNumber());
$ax['audioSecondary'] = $this->meta->getAudioBySize($this->audioEdition->getIdentifier(), $ayah->getNumber(), $this->protocol);

}
$ax['text'] = $ayah->getText();
Expand Down Expand Up @@ -484,7 +484,7 @@ private function prepare($ayat)
$a['number'] = $ayat->getNumber();
if (isset($this->audioEdition)) {
$a['audio'] = $this->protocol . '://cdn.alquran.cloud/media/audio/ayah/' . $this->audioEdition->getIdentifier() . '/' . $ayat->getNumber();
$a['audioSecondary'] = $this->protocol . '://' . $this->meta->getAudioBySize($this->audioEdition->getIdentifier(), $ayah->getNumber());
$a['audioSecondary'] = $this->meta->getAudioBySize($this->audioEdition->getIdentifier(), $ayah->getNumber(), $this->protocol);
}
$a['text'] = $ayat->getText();
$a['edition'] = (new EditionResponse($ayat->getEdition()->getIdentifier()))->getResponse();
Expand Down
4 changes: 2 additions & 2 deletions src/Quran/Helper/Meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ public function getAudioBySize()
];
}

public function getAudioUrlsByReciter($name = 'ar.alafasy', int $number): array
public function getAudioUrlsByReciter($name = 'ar.alafasy', int $number, $protocol = 'http'): array
{
$urls = [];
foreach ($this->getAudioBySize() as $size => $reciters) {
if (in_array($name, $reciters)) {
$urls[] = self::DO_CDN_BASE_URL . 'audio/' . $size . '/' . $name . '/' . $number . '.mp3';
$urls[] = $protocol . '://' . self::DO_CDN_BASE_URL . 'audio/' . $size . '/' . $name . '/' . $number . '.mp3';
}
}

Expand Down

0 comments on commit 4c71e77

Please sign in to comment.