Fix #22, fix #23. Display posts as grid instead of flexbox, add song info

This commit is contained in:
2023-04-23 20:10:45 +02:00
parent 42d91a097f
commit 9bbcc843c2
5 changed files with 149 additions and 24 deletions

View File

@ -32,8 +32,15 @@ type PostTagRow = {
url: string;
};
type SongRow = SongInfo & {
type SongRow = {
post_url: string;
postedUrl: string;
overviewUrl?: string;
type: 'album' | 'song';
youtubeUrl?: string;
title?: string;
artistName?: string;
thumbnailUrl?: string;
};
type Migration = {
@ -468,7 +475,16 @@ function getSongData(postIdsParams: String, postIds: string[]): Promise<Map<stri
}
const songMap: Map<string, SongInfo[]> = tagRows.reduce(
(result: Map<string, SongInfo[]>, item) => {
result.set(item.post_url, [...(result.get(item.post_url) || []), item]);
const info = {
pageUrl: item.overviewUrl,
youtubeUrl: item.youtubeUrl,
type: item.type,
title: item.title,
artistName: item.artistName,
thumbnailUrl: item.thumbnailUrl,
postedUrl: item.postedUrl
} as SongInfo;
result.set(item.post_url, [...(result.get(item.post_url) || []), info]);
return result;
},
new Map()