fix other places of duration display (and other minor fixes) (#249)

* fix other places of duration display

* add back comma

* add max-width for image
This commit is contained in:
Kendall Garner 2023-09-20 23:07:40 +00:00 committed by GitHub
parent ec457d5125
commit 6e62448b88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 4 deletions

View file

@ -145,7 +145,7 @@ ipcMain.on('update-song', (_event, args: SongUpdate) => {
mprisPlayer.metadata = {
'mpris:artUrl': upsizedImageUrl,
'mpris:length': song.duration ? Math.round((song.duration || 0) * 1e6) : null,
'mpris:length': song.duration ? Math.round((song.duration || 0) * 1e3) : null,
'mpris:trackid': song.id
? mprisPlayer.objectPath(`track/${song.id?.replace('-', '')}`)
: '',

View file

@ -45,7 +45,7 @@ export const RemoteContainer = () => {
<Title order={2}>Artist: {song.artistName}</Title>
</Group>
<Group position="apart">
<Title order={3}>Duration: {formatDuration(song.duration * 1000)}</Title>
<Title order={3}>Duration: {formatDuration(song.duration)}</Title>
{song.releaseDate && (
<Title order={3}>
Released: {new Date(song.releaseDate).toLocaleDateString()}

View file

@ -24,6 +24,7 @@ const Image = styled(motion.img)<{ $useAspectRatio: boolean }>`
object-position: 50% 100%;
filter: drop-shadow(0 0 5px rgb(0 0 0 / 40%)) drop-shadow(0 0 5px rgb(0 0 0 / 40%));
border-radius: 5px;
max-width: 100%;
`;
const ImageContainer = styled(motion.div)`
@ -42,7 +43,7 @@ interface TransparentMetadataContainer {
const MetadataContainer = styled(Stack)<TransparentMetadataContainer>`
padding: 1rem;
background: rgb(var(--main-bg-transparent) ${({ opacity }) => opacity}%);
background: rgb(var(--main-bg-transparent), ${({ opacity }) => opacity}%);
border-radius: 5px;
h1 {

View file

@ -50,7 +50,7 @@ const GridContainer = styled.div<TransparendGridContainerProps>`
grid-template-rows: auto minmax(0, 1fr);
grid-template-columns: 1fr;
padding: 1rem;
background: rgb(var(--main-bg-transparent) ${({ opacity }) => opacity}%);
background: rgb(var(--main-bg-transparent), ${({ opacity }) => opacity}%);
border-radius: 5px;
`;