Add paste-your-songs manual import feature

Users can now paste a list of songs as text to create a playlist without
needing any service integration. Supports multiple formats: "Artist - Title",
"Title by Artist", "Artist: Title", and numbered lists. Includes a live
song count preview in the modal and free tier playlist limit enforcement.
This commit is contained in:
root
2026-03-30 22:48:35 -05:00
parent f799a12ed5
commit d0ab1755bb
5 changed files with 402 additions and 4 deletions

View File

@@ -171,6 +171,30 @@ export const importYouTubePlaylist = (url: string) =>
export const searchYouTubeMusic = (query: string) =>
api.post<YouTubeTrackResult[]>('/youtube-music/search', { query }).then((r) => r.data)
// Last.fm Import
export interface LastfmPreviewTrack {
title: string
artist: string
playcount: number
image_url: string | null
}
export interface LastfmPreviewResponse {
display_name: string
track_count: number
sample_tracks: LastfmPreviewTrack[]
}
export const previewLastfm = (username: string) =>
api.get<LastfmPreviewResponse>('/lastfm/preview', { params: { username } }).then((r) => r.data)
export const importLastfm = (username: string, period: string) =>
api.post<PlaylistDetailResponse>('/lastfm/import', { username, period }).then((r) => r.data)
// Manual Import (paste songs)
export const importPastedSongs = (name: string, text: string) =>
api.post<PlaylistDetailResponse>('/import/paste', { name, text }).then((r) => r.data)
// Billing
export interface BillingStatusResponse {
is_pro: boolean