This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user