Skip to content

Commit

Permalink
check earlier for playlist too
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlan-00 committed May 14, 2024
1 parent 949d65a commit 9ccc325
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/Module/Api/Json4_Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,10 @@ public static function playlists($playlists, $user, $songs = false): string
$art_url = Art::url($playlist->id, $object_type, Core::get_request('auth'));
$playitem_total = $playlist->last_count;
} else {
$playlist = new Playlist($playlist_id);
$playlist = new Playlist($playlist_id);
if ($playlist->isNew()) {
continue;
}
$object_type = 'playlist';
$art_url = Art::url($playlist_id, $object_type, Core::get_request('auth'));
$playitem_total = $playlist->get_media_count('song');
Expand Down
5 changes: 4 additions & 1 deletion src/Module/Api/Json5_Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,10 @@ public static function playlists($playlists, $user, $songs = false, $object = tr
$art_url = Art::url($playlist->id, $object_type, Core::get_request('auth'));
$playitem_total = $playlist->last_count;
} else {
$playlist = new Playlist($playlist_id);
$playlist = new Playlist($playlist_id);
if ($playlist->isNew()) {
continue;
}
$object_type = 'playlist';
$art_url = Art::url($playlist_id, $object_type, Core::get_request('auth'));
$playitem_total = $playlist->get_media_count('song');
Expand Down
8 changes: 4 additions & 4 deletions src/Module/Api/Json_Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,10 @@ public static function playlists($objects, $user, $songs = false, $encode = true
$art_url = Art::url($playlist->id, $object_type, Core::get_request('auth'));
$playitem_total = $playlist->last_count;
} else {
$playlist = new Playlist($playlist_id);
$playlist = new Playlist($playlist_id);
if ($playlist->isNew()) {
continue;
}
$object_type = 'playlist';
$art_url = Art::url($playlist_id, $object_type, Core::get_request('auth'));
$playitem_total = $playlist->get_media_count('song');
Expand All @@ -900,9 +903,6 @@ public static function playlists($objects, $user, $songs = false, $encode = true
$playlist_names[] = $playlist->name;
}
}
if ($playlist->isNew()) {
continue;
}
$playlist_name = $playlist->get_fullname();
$playlist_user = $playlist->username;
$playlist_type = $playlist->type;
Expand Down
5 changes: 4 additions & 1 deletion src/Module/Api/Xml4_Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,10 @@ public static function playlists($playlists, $user): string
$art_url = Art::url($playlist->id, $object_type, Core::get_request('auth'));
$playitem_total = $playlist->last_count;
} else {
$playlist = new Playlist($playlist_id);
$playlist = new Playlist($playlist_id);
if ($playlist->isNew()) {
continue;
}
$object_type = 'playlist';
$art_url = Art::url($playlist_id, $object_type, Core::get_request('auth'));
$playitem_total = $playlist->get_media_count('song');
Expand Down
5 changes: 4 additions & 1 deletion src/Module/Api/Xml5_Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,10 @@ public static function playlists($playlists, $user): string
$art_url = Art::url($playlist->id, $object_type, Core::get_request('auth'));
$playitem_total = $playlist->last_count;
} else {
$playlist = new Playlist($playlist_id);
$playlist = new Playlist($playlist_id);
if ($playlist->isNew()) {
continue;
}
$object_type = 'playlist';
$art_url = Art::url($playlist_id, $object_type, Core::get_request('auth'));
$playitem_total = $playlist->get_media_count('song');
Expand Down
5 changes: 4 additions & 1 deletion src/Module/Api/Xml_Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,10 @@ public static function playlists($playlists, $user, $songs = false): string
$art_url = Art::url($playlist->id, $object_type, Core::get_request('auth'));
$playitem_total = (int)$playlist->last_count;
} else {
$playlist = new Playlist($playlist_id);
$playlist = new Playlist($playlist_id);
if ($playlist->isNew()) {
continue;
}
$object_type = 'playlist';
$art_url = Art::url($playlist_id, $object_type, Core::get_request('auth'));
$playitem_total = $playlist->get_media_count('song');
Expand Down

0 comments on commit 9ccc325

Please sign in to comment.