Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/common/src/hooks/useCollectionMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export const useCollectionMetadata = ({
const {
is_private: isPrivate,
updated_at: updatedAt,
release_date: releaseDate
release_date: releaseDate,
created_at: createdAt
} = collection
const numTracks = collection.playlist_contents?.track_ids?.length ?? 0

Expand All @@ -60,13 +61,13 @@ export const useCollectionMetadata = ({
},
{
id: CollectionMetadataType.RELEASE_DATE,
value: formatDate(releaseDate ?? ''),
value: formatDate(releaseDate ?? createdAt),
label: 'Released',
isHidden: isPrivate
},
{
id: CollectionMetadataType.UPDATED_AT,
value: formatDate(updatedAt ?? ''),
value: formatDate(updatedAt ?? createdAt),
label: 'Updated',
isHidden: isPrivate
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ function* getCollectionTracks() {

const trackIds = tracks.map((t) => t.track)
// TODO: Conform all timestamps to be of the same format so we don't have to do any special work here.
const now = Math.floor(Date.now() / 1000)
const times = tracks.map((t) => t.metadata_time || now)
// Some playlists & albums may not have a metadata time, so use the time if not.
const times = tracks.map((t) => t.metadata_time || t.time)

// Reconcile fetching this playlist with the queue.
// Search the queue for its currently playing uids. If any are sourced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export const CollectionHeader = (props: CollectionHeaderProps) => {
/>
<Flex
direction='column'
gap='xl'
justifyContent='space-between'
css={{ minWidth: 400 }}
>
Expand Down