mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 09:53:33 +00:00
feat: show sampling rate and bit depth if available
This commit is contained in:
parent
bfd6f28d7a
commit
181af686c2
11 changed files with 93 additions and 3 deletions
|
|
@ -54,6 +54,8 @@ public class MappingUtil {
|
|||
bundle.putString("transcodedSuffix", media.getTranscodedSuffix());
|
||||
bundle.putInt("duration", media.getDuration() != null ? media.getDuration() : 0);
|
||||
bundle.putInt("bitrate", media.getBitrate() != null ? media.getBitrate() : 0);
|
||||
bundle.putInt("samplingRate", media.getSamplingRate() != null ? media.getSamplingRate() : 0);
|
||||
bundle.putInt("bitDepth", media.getBitDepth() != null ? media.getBitDepth() : 0);
|
||||
bundle.putString("path", media.getPath());
|
||||
bundle.putBoolean("isVideo", media.isVideo());
|
||||
bundle.putInt("userRating", media.getUserRating() != null ? media.getUserRating() : 0);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import com.cappielloantonio.tempo.repository.DownloadRepository;
|
|||
import com.cappielloantonio.tempo.subsonic.models.Child;
|
||||
|
||||
import java.text.CharacterIterator;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.StringCharacterIterator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -163,6 +164,12 @@ public class MusicUtil {
|
|||
" " +
|
||||
child.getBitrate() +
|
||||
"kbps" +
|
||||
" • " +
|
||||
(child.getBitDepth() != null && child.getBitDepth() != 0
|
||||
? child.getBitDepth() + "/" + (child.getSamplingRate() != null ? child.getSamplingRate() / 1000 : "")
|
||||
: (child.getSamplingRate() != null
|
||||
? new DecimalFormat("0.#").format(child.getSamplingRate() / 1000.0) + "kHz"
|
||||
: "")) +
|
||||
" " +
|
||||
child.getSuffix();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue