mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 18:31:40 +00:00
Merge branch 'eddyizm:development' into development
This commit is contained in:
commit
4464b5b34d
5 changed files with 50 additions and 9 deletions
1
.github/ISSUE_TEMPLATE/bug_report.md
vendored
1
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
|
@ -26,6 +26,7 @@ Outline the steps required to reproduce the bug, including any specific actions,
|
||||||
- Android device: [Device Model]
|
- Android device: [Device Model]
|
||||||
- Android OS version: [Android Version]
|
- Android OS version: [Android Version]
|
||||||
- App version: [App Version]
|
- App version: [App Version]
|
||||||
|
- App variant: [goole play services, degoogled]
|
||||||
- Other relevant details: [e.g., specific network conditions, external dependencies]
|
- Other relevant details: [e.g., specific network conditions, external dependencies]
|
||||||
|
|
||||||
## Logs or Screenshots
|
## Logs or Screenshots
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,11 @@ import com.cappielloantonio.tempo.subsonic.models.Child;
|
||||||
import com.cappielloantonio.tempo.subsonic.models.IndexID3;
|
import com.cappielloantonio.tempo.subsonic.models.IndexID3;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
|
|
@ -312,24 +314,42 @@ public class ArtistRepository {
|
||||||
|
|
||||||
App.getSubsonicClientInstance(false)
|
App.getSubsonicClientInstance(false)
|
||||||
.getBrowsingClient()
|
.getBrowsingClient()
|
||||||
.getTopSongs(artist.getName(), count)
|
.getArtist(artist.getId())
|
||||||
.enqueue(new Callback<ApiResponse>() {
|
.enqueue(new Callback<ApiResponse>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<ApiResponse> call, @NonNull Response<ApiResponse> response) {
|
public void onResponse(@NonNull Call<ApiResponse> call, @NonNull Response<ApiResponse> response) {
|
||||||
if (response.isSuccessful() && response.body() != null && response.body().getSubsonicResponse().getTopSongs() != null && response.body().getSubsonicResponse().getTopSongs().getSongs() != null) {
|
if (response.isSuccessful() && response.body() != null &&
|
||||||
List<Child> songs = response.body().getSubsonicResponse().getTopSongs().getSongs();
|
response.body().getSubsonicResponse().getArtist() != null &&
|
||||||
|
response.body().getSubsonicResponse().getArtist().getAlbums() != null) {
|
||||||
|
|
||||||
if (songs != null && !songs.isEmpty()) {
|
List<AlbumID3> albums = response.body().getSubsonicResponse().getArtist().getAlbums();
|
||||||
Collections.shuffle(songs);
|
Log.d("ArtistRepository", "Got albums directly: " + albums.size());
|
||||||
|
if (albums.isEmpty()) {
|
||||||
|
Log.d("ArtistRepository", "No albums found in artist response");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
randomSongs.setValue(songs);
|
Collections.shuffle(albums);
|
||||||
|
int[] counts = albums.stream().mapToInt(AlbumID3::getSongCount).toArray();
|
||||||
|
Arrays.parallelPrefix(counts, Integer::sum);
|
||||||
|
int albumLimit = 0;
|
||||||
|
int multiplier = 4; // get more than the limit so we can shuffle them
|
||||||
|
while (albumLimit < albums.size() && counts[albumLimit] < count * multiplier)
|
||||||
|
albumLimit++;
|
||||||
|
Log.d("ArtistRepository", String.format("Retaining %d/%d albums", albumLimit, albums.size()));
|
||||||
|
|
||||||
|
fetchAllAlbumSongsWithCallback(albums.stream().limit(albumLimit).collect(Collectors.toList()), songs -> {
|
||||||
|
Collections.shuffle(songs);
|
||||||
|
randomSongs.setValue(songs.stream().limit(count).collect(Collectors.toList()));
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Log.d("ArtistRepository", "Failed to get artist info");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<ApiResponse> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<ApiResponse> call, @NonNull Throwable t) {
|
||||||
|
Log.d("ArtistRepository", "Error getting artist info: " + t.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -188,8 +188,6 @@ public class ArtistPageFragment extends Fragment implements ClickCallback {
|
||||||
} else {
|
} else {
|
||||||
if (bind != null)
|
if (bind != null)
|
||||||
bind.artistPageTopSongsSector.setVisibility(!songs.isEmpty() ? View.VISIBLE : View.GONE);
|
bind.artistPageTopSongsSector.setVisibility(!songs.isEmpty() ? View.VISIBLE : View.GONE);
|
||||||
if (bind != null)
|
|
||||||
bind.artistPageShuffleButton.setEnabled(!songs.isEmpty());
|
|
||||||
songHorizontalAdapter.setItems(songs);
|
songHorizontalAdapter.setItems(songs);
|
||||||
reapplyPlayback();
|
reapplyPlayback();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,9 @@ public class ArtistBottomSheetDialog extends BottomSheetDialogFragment implement
|
||||||
ArtistRepository artistRepository = new ArtistRepository();
|
ArtistRepository artistRepository = new ArtistRepository();
|
||||||
|
|
||||||
artistRepository.getInstantMix(artist, 20).observe(getViewLifecycleOwner(), songs -> {
|
artistRepository.getInstantMix(artist, 20).observe(getViewLifecycleOwner(), songs -> {
|
||||||
|
// navidrome may return null for this
|
||||||
|
if (songs == null)
|
||||||
|
return;
|
||||||
MusicUtil.ratingFilter(songs);
|
MusicUtil.ratingFilter(songs);
|
||||||
|
|
||||||
if (!songs.isEmpty()) {
|
if (!songs.isEmpty()) {
|
||||||
|
|
|
||||||
|
|
@ -413,7 +413,9 @@
|
||||||
<string name="share_bottom_sheet_delete">Eliminar compartición</string>
|
<string name="share_bottom_sheet_delete">Eliminar compartición</string>
|
||||||
<string name="share_bottom_sheet_update">Actualizar compartición</string>
|
<string name="share_bottom_sheet_update">Actualizar compartición</string>
|
||||||
<string name="share_subtitle_item">Fecha de caducidad: %1$s</string>
|
<string name="share_subtitle_item">Fecha de caducidad: %1$s</string>
|
||||||
|
<string name="share_no_expiration">Nunca</string>
|
||||||
<string name="share_unsupported_error">El uso compartido no está soportado o no está habilitado</string>
|
<string name="share_unsupported_error">El uso compartido no está soportado o no está habilitado</string>
|
||||||
|
<string name="asset_link_debug_toast">Enlace de recurso: %1$s</string>
|
||||||
<string name="share_update_dialog_hint_description">Descripción</string>
|
<string name="share_update_dialog_hint_description">Descripción</string>
|
||||||
<string name="share_update_dialog_hint_expiration_date">Fecha de caducidad</string>
|
<string name="share_update_dialog_hint_expiration_date">Fecha de caducidad</string>
|
||||||
<string name="song_bottom_sheet_add_to_queue">Añadir a la cola</string>
|
<string name="song_bottom_sheet_add_to_queue">Añadir a la cola</string>
|
||||||
|
|
@ -486,4 +488,21 @@
|
||||||
<string name="settings_sync_starred_artists_for_offline_use_summary">Si está habilitada, los artistas destacados se descargarán para uso sin conexión.</string>
|
<string name="settings_sync_starred_artists_for_offline_use_summary">Si está habilitada, los artistas destacados se descargarán para uso sin conexión.</string>
|
||||||
<string name="widget_time_elapsed_placeholder">0:00</string>
|
<string name="widget_time_elapsed_placeholder">0:00</string>
|
||||||
<string name="exo_controls_heart_off_description">Eliminar de favoritos</string>
|
<string name="exo_controls_heart_off_description">Eliminar de favoritos</string>
|
||||||
|
<string name="asset_link_chip_text">%1$s • %2$s</string>
|
||||||
|
<string name="asset_link_copied_toast">Copiado %1$s al portapapeles</string>
|
||||||
|
<string name="settings_album_detail">Mostrar los detalles del álbum</string>
|
||||||
|
<string name="settings_album_detail_summary">Si está habilitada, muestra los detalles del álbum, como el género, el número de pistas, etc. en la página de álbum</string>
|
||||||
|
<string name="asset_link_clipboard_label">Enlace de recurso de Tempus</string>
|
||||||
|
<string name="asset_link_label_song">UID de la pista</string>
|
||||||
|
<string name="asset_link_label_album">UID del álbum</string>
|
||||||
|
<string name="asset_link_label_artist">UID del artista</string>
|
||||||
|
<string name="asset_link_label_playlist">UID de la lista de reproducción</string>
|
||||||
|
<string name="asset_link_label_genre">UID del género</string>
|
||||||
|
<string name="asset_link_label_year">UID del año</string>
|
||||||
|
<string name="asset_link_label_unknown">UID del recurso</string>
|
||||||
|
<string name="asset_link_error_unsupported">Enlace de recurso no válido</string>
|
||||||
|
<string name="asset_link_error_song">No se ha podido abrir la pista</string>
|
||||||
|
<string name="asset_link_error_album">No se ha podido abrir el álbum</string>
|
||||||
|
<string name="asset_link_error_artist">No se ha podido abrir el artista</string>
|
||||||
|
<string name="asset_link_error_playlist">No se ha podido abrir la lista de reproducción</string>
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue