Revamp the pop-up player modal
This commit is contained in:
@@ -42,6 +42,7 @@ export function generateTrack(track: AlbumTrack, credentials: Credentials): Trac
|
||||
title: track.Name,
|
||||
artist: track.Artists.join(', '),
|
||||
album: track.Album,
|
||||
duration: track.RunTimeTicks,
|
||||
artwork: track.AlbumId
|
||||
? getImage(track.AlbumId, credentials)
|
||||
: getImage(track.Id, credentials),
|
||||
|
||||
9
src/utility/ticksToDuration.ts
Normal file
9
src/utility/ticksToDuration.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
function ticksToDuration(ticks: number) {
|
||||
const seconds = Math.round(ticks / 10000000);
|
||||
const minutes = Math.round(seconds / 60);
|
||||
const hours = Math.round(minutes / 60);
|
||||
|
||||
return `${hours > 0 ? hours + ':' : ''}${minutes}:${(seconds % 60).toString().padStart(2, '0')}`;
|
||||
}
|
||||
|
||||
export default ticksToDuration;
|
||||
@@ -57,7 +57,7 @@ export default function usePlayTracks() {
|
||||
// Check if a downloaded version exists, and if so rewrite the URL
|
||||
const download = downloads[trackId];
|
||||
if (download?.location) {
|
||||
generatedTrack.url = download.location;
|
||||
generatedTrack.url = 'file://' + download.location;
|
||||
}
|
||||
|
||||
return generatedTrack;
|
||||
|
||||
Reference in New Issue
Block a user