[GH-ISSUE #1463] sync --force error #834

Closed
opened 2026-02-26 02:34:23 +03:00 by kerem · 1 comment
Owner

Originally created by @JBlond on GitHub (Jul 14, 2022).
Original GitHub issue: https://github.com/koel/koel/issues/1463

Describe the bug
I tried the sync force example from the source code and it ended in a crash

To reproduce
Steps to reproduce the behavior:

  1. Open terminal
  2. run php artisan koel:sync --force --tags=artist,album,lyric

Expected behavior
it should sync

Screenshots
sync

Environment

  • Koel version 5.1.14
  • OS: Debian 11
  • Browser: console fish shell
  • PHP version 8.0.21
  • Node version -

Additional context

 TypeError

  App\Models\Album::getOrCreate(): Argument #3 ($isCompilation) must be of type bool, null given, called in /home/mario/koel/app/Services/FileSynchronizer.php on line 181

  at app/Models/Album.php:55
     51▕     /**
     52▕      * Get an album using some provided information.
     53▕      * If such is not found, a new album will be created using the information.
     54▕      */
  ➜  55▕     public static function getOrCreate(Artist $artist, ?string $name = null, bool $isCompilation = false): self
     56▕     {
     57▕         // If this is a compilation album, its artist must be "Various Artists"
     58▕         if ($isCompilation) {
     59▕             $artist = Artist::getVariousArtist();

  1   app/Services/FileSynchronizer.php:181
      App\Models\Album::getOrCreate()

  2   app/Services/MediaSyncService.php:95
      App\Services\FileSynchronizer::sync()
Originally created by @JBlond on GitHub (Jul 14, 2022). Original GitHub issue: https://github.com/koel/koel/issues/1463 **Describe the bug** I tried the sync force example from the source code and it ended in a crash **To reproduce** Steps to reproduce the behavior: 1. Open terminal 2. run `php artisan koel:sync --force --tags=artist,album,lyric` **Expected behavior** it should sync **Screenshots** ![sync](https://user-images.githubusercontent.com/2391810/178932998-8aea14b2-1fc6-4aa1-b3b4-40f576df64b5.PNG) **Environment** - Koel version 5.1.14 - OS: Debian 11 - Browser: console fish shell - PHP version 8.0.21 - Node version - - **Additional context** ``` TypeError App\Models\Album::getOrCreate(): Argument #3 ($isCompilation) must be of type bool, null given, called in /home/mario/koel/app/Services/FileSynchronizer.php on line 181 at app/Models/Album.php:55 51▕ /** 52▕ * Get an album using some provided information. 53▕ * If such is not found, a new album will be created using the information. 54▕ */ ➜ 55▕ public static function getOrCreate(Artist $artist, ?string $name = null, bool $isCompilation = false): self 56▕ { 57▕ // If this is a compilation album, its artist must be "Various Artists" 58▕ if ($isCompilation) { 59▕ $artist = Artist::getVariousArtist(); 1 app/Services/FileSynchronizer.php:181 App\Models\Album::getOrCreate() 2 app/Services/MediaSyncService.php:95 App\Services\FileSynchronizer::sync() ```
kerem 2026-02-26 02:34:23 +03:00
Author
Owner

@phanan commented on GitHub (Jul 28, 2022):

Fixed in 7de788cb66.

<!-- gh-comment-id:1197866066 --> @phanan commented on GitHub (Jul 28, 2022): Fixed in 7de788cb6658225d8d84a22883bed24fad4ef72e.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#834
No description provided.