Skip to content

Commit 055e396

Browse files
committed
Fix osse-broadcast url in script, add logging on album art fail
1 parent 11125c1 commit 055e396

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

osse-core/app/Services/MusicProcessor/ArtFile.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Services\MusicProcessor;
44

5+
use Illuminate\Support\Facades\Log;
56
use Illuminate\Support\Facades\Storage;
67
use Kiwilan\Audio\Models\AudioCover;
78
use SplFileInfo;
@@ -29,10 +30,14 @@ private function generateHash(): string
2930
public function storeFile(): void
3031
{
3132
if ($this->file instanceof SplFileInfo) {
32-
Storage::disk(config('scan.cover_art_disk'))->put('cover-art/'.$this->hash, file_get_contents($this->file->getRealPath()));
33+
if (!Storage::disk(config('scan.cover_art_disk'))->put('cover-art/'.$this->hash, file_get_contents($this->file->getRealPath()))) {
34+
Log::warning('Failed to store album art for ' . $this->trackFilePath);
35+
}
3336
$this->mimeType = Storage::disk(config('scan.cover_art_disk'))->mimeType('cover-art/'.$this->hash) ?? null;
3437
} else {
35-
Storage::disk(config('scan.cover_art_disk'))->put('cover-art/'.$this->hash, $this->file->getContents());
38+
if (!Storage::disk(config('scan.cover_art_disk'))->put('cover-art/'.$this->hash, $this->file->getContents())) {
39+
Log::warning('Failed to store album art for ' . $this->trackFilePath);
40+
}
3641
$this->mimeType = $this->file->getMimeType();
3742
}
3843
}

osse.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ generate_caddy() {
7272
sed -i "s+WEB_FRONTEND_TEMPLATE+$REPLACE+" Caddyfile
7373

7474
# Use localhost in prod, broadcast container in docker.
75-
if [[ -v $OSSE_DOCKER_PORT ]]; then
75+
if [ -z $OSSE_DOCKER_PORT ]; then
7676
REPLACE="reverse_proxy 127.0.0.1:${OSSE_BROADCAST_PORT}"
7777
else
7878
REPLACE="reverse_proxy broadcast:${OSSE_BROADCAST_PORT}"

0 commit comments

Comments
 (0)