mirror of
https://codeberg.org/lucida/lucida.git
synced 2026-11-14 07:37:24 -05:00
add playlist
This commit is contained in:
@@ -4,9 +4,10 @@ import type {
|
||||
SpotifyThumbnail,
|
||||
SpotifyTrack,
|
||||
SpotifyEpisode,
|
||||
SpotifyPodcast
|
||||
SpotifyPodcast,
|
||||
SpotifyPlaylist
|
||||
} from 'librespot/types'
|
||||
import { Album, Artist, Episode, Podcast, Track } from '../../types.js'
|
||||
import { Album, Artist, Episode, Playlist, Podcast, Track } from '../../types.js'
|
||||
|
||||
function parseThumbnails(raw: SpotifyThumbnail[]) {
|
||||
return raw
|
||||
@@ -92,3 +93,14 @@ export function parsePodcast(raw: SpotifyPodcast) {
|
||||
|
||||
return podcast
|
||||
}
|
||||
|
||||
export function parsePlaylist(raw: SpotifyPlaylist) {
|
||||
const playlist: Playlist = {
|
||||
id: raw.id,
|
||||
title: raw.name,
|
||||
url: raw.externalUrl,
|
||||
trackCount: raw.totalTracks
|
||||
}
|
||||
|
||||
return playlist
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user