ConnectionInfo and the db ConnectionRow types are now completely seperate things. Started on audio fetching yay!

This commit is contained in:
Eclypsed
2024-04-05 02:00:17 -04:00
parent 952c8383f9
commit c5408d76b6
20 changed files with 220 additions and 253 deletions

17
src/app.d.ts vendored
View File

@@ -24,11 +24,28 @@ declare global {
passwordHash: string
}
type ConnectionInfo = {
id: string
userId: string
} & ({
type: 'jellyfin'
serverUrl: string
serverName: string
jellyfinUserId: string
username: string
} | {
type: 'youtube-music'
youtubeUserId: string
username: string
profilePicture: string
})
interface Connection {
public id: string
getRecommendations: () => Promise<(Song | Album | Artist | Playlist)[]>
getConnectionInfo: () => Promise<ConnectionInfo>
search: (searchTerm: string, filter?: 'song' | 'album' | 'artist' | 'playlist') => Promise<(Song | Album | Artist | Playlist)[]>
getSongAudio: (id: string) => Promise<ReadableStream<Uint8Array>>
}
// These Schemas should only contain general info data that is necessary for data fetching purposes.
// They are NOT meant to be stores for large amounts of data, i.e. Don't include the data for every single song the Playlist type.