added dark mode and jacket art
This commit is contained in:
@ -13,7 +13,6 @@ type LinkSharingToken = {
|
||||
|
||||
export async function getSongsWithTitles(userId: number) {
|
||||
try {
|
||||
|
||||
const songs: ChuniScorePlaylog[] = await artemis.chuni_score_playlog.findMany({
|
||||
where: {
|
||||
user: userId,
|
||||
@ -63,7 +62,6 @@ export async function getSongsWithTitles(userId: number) {
|
||||
},
|
||||
});
|
||||
|
||||
// Extract unique musicIds from the fetched songs
|
||||
const chuniScorePlaylogMusicId = songs
|
||||
.map((song) => song.musicId)
|
||||
.filter((id): id is number => id !== null);
|
||||
@ -82,6 +80,7 @@ export async function getSongsWithTitles(userId: number) {
|
||||
level: true,
|
||||
genre: true,
|
||||
worldsEndTag: true,
|
||||
jacketPath: true, // Add jacketPath to the selection
|
||||
},
|
||||
});
|
||||
|
||||
@ -98,7 +97,6 @@ export async function getSongsWithTitles(userId: number) {
|
||||
},
|
||||
});
|
||||
|
||||
// Create a map of musicId to play count
|
||||
const playCountMap = playCounts.reduce((map, item) => {
|
||||
if (item.musicId !== null) {
|
||||
map[item.musicId] = item._count.musicId;
|
||||
@ -121,6 +119,7 @@ export async function getSongsWithTitles(userId: number) {
|
||||
level: staticInfo?.level || "Unknown Level",
|
||||
chartlevel: song.level || "Unknown Level",
|
||||
playCount: song.musicId !== null ? playCountMap[song.musicId] || 0 : 0,
|
||||
jacketPath: staticInfo?.jacketPath || "",
|
||||
};
|
||||
});
|
||||
|
||||
@ -131,6 +130,8 @@ export async function getSongsWithTitles(userId: number) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function generatePlaylogId(playlogid: number) {
|
||||
try {
|
||||
const tokens = (await daphnis.linkSharingToken.findMany({
|
||||
|
Reference in New Issue
Block a user