mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
feat: Show sampling rate and bit depth in downloads
This commit is contained in:
parent
e87b658447
commit
ca5a0698bb
3 changed files with 10 additions and 1 deletions
|
|
@ -40,6 +40,8 @@ class Download(@PrimaryKey override val id: String) : Child(id) {
|
||||||
transcodedSuffix = child.transcodedSuffix
|
transcodedSuffix = child.transcodedSuffix
|
||||||
duration = child.duration
|
duration = child.duration
|
||||||
bitrate = child.bitrate
|
bitrate = child.bitrate
|
||||||
|
samplingRate = child.samplingRate
|
||||||
|
bitDepth = child.bitDepth
|
||||||
path = child.path
|
path = child.path
|
||||||
isVideo = child.isVideo
|
isVideo = child.isVideo
|
||||||
userRating = child.userRating
|
userRating = child.userRating
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ public class DownloadHorizontalAdapter extends RecyclerView.Adapter<DownloadHori
|
||||||
R.string.song_subtitle_formatter,
|
R.string.song_subtitle_formatter,
|
||||||
song.getArtist(),
|
song.getArtist(),
|
||||||
MusicUtil.getReadableDurationString(song.getDuration(), false),
|
MusicUtil.getReadableDurationString(song.getDuration(), false),
|
||||||
""
|
MusicUtil.getReadableAudioQualityString(song)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,11 @@ public class MappingUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MediaItem mapDownload(Child media) {
|
public static MediaItem mapDownload(Child media) {
|
||||||
|
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putInt("samplingRate", media.getSamplingRate() != null ? media.getSamplingRate() : 0);
|
||||||
|
bundle.putInt("bitDepth", media.getBitDepth() != null ? media.getBitDepth() : 0);
|
||||||
|
|
||||||
return new MediaItem.Builder()
|
return new MediaItem.Builder()
|
||||||
.setMediaId(media.getId())
|
.setMediaId(media.getId())
|
||||||
.setMediaMetadata(
|
.setMediaMetadata(
|
||||||
|
|
@ -130,12 +135,14 @@ public class MappingUtil {
|
||||||
.setReleaseYear(media.getYear() != null ? media.getYear() : 0)
|
.setReleaseYear(media.getYear() != null ? media.getYear() : 0)
|
||||||
.setAlbumTitle(media.getAlbum())
|
.setAlbumTitle(media.getAlbum())
|
||||||
.setArtist(media.getArtist())
|
.setArtist(media.getArtist())
|
||||||
|
.setExtras(bundle)
|
||||||
.setIsBrowsable(false)
|
.setIsBrowsable(false)
|
||||||
.setIsPlayable(true)
|
.setIsPlayable(true)
|
||||||
.build()
|
.build()
|
||||||
)
|
)
|
||||||
.setRequestMetadata(
|
.setRequestMetadata(
|
||||||
new MediaItem.RequestMetadata.Builder()
|
new MediaItem.RequestMetadata.Builder()
|
||||||
|
.setExtras(bundle)
|
||||||
.setMediaUri(Preferences.preferTranscodedDownload() ? MusicUtil.getTranscodedDownloadUri(media.getId()) : MusicUtil.getDownloadUri(media.getId()))
|
.setMediaUri(Preferences.preferTranscodedDownload() ? MusicUtil.getTranscodedDownloadUri(media.getId()) : MusicUtil.getDownloadUri(media.getId()))
|
||||||
.build()
|
.build()
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue