update euterpe-web-test imports

This commit is contained in:
Djkáťo 2023-08-06 23:05:38 +02:00
parent d45173872b
commit 9bf138561e
3 changed files with 35 additions and 29 deletions

View file

@ -1,60 +1,59 @@
import { EuterpeBuilder, Library, Player } from "@euterpe.js/euterpe"; import { DB, Song, Artist, Ref, RefTo, Platforms } from "@euterpe.js/music-library"
//export const euterpe = new export const db = new DB
export const db = new Library.DB
db.add([ db.add([
//The IDs are added incrementally & are 0 based., so first artists ID added is 0, next 1 etc... //The IDs are added incrementally & are 0 based., so first artists ID added is 0, next 1 etc...
//You can specify the ID manually if you want //You can specify the ID manually if you want
new Library.Artist({ new Artist({
name: "Jamie xx", name: "Jamie xx",
}), }),
new Library.Artist({ new Artist({
name: "janz", name: "janz",
}), }),
new Library.Artist({ new Artist({
name: "Machinedrum", name: "Machinedrum",
}), }),
new Library.Artist({ new Artist({
name: "Tanerélle", name: "Tanerélle",
}), }),
new Library.Artist({ new Artist({
name: "Mono/Poly", name: "Mono/Poly",
}), }),
new Library.Artist({ new Artist({
name: "IMANU", name: "IMANU",
links: [ links: [
[Library.Platforms.Spotify, new URL("https://open.spotify.com/artist/5Y7rFm0tiJTVDzGLMzz0W1?si=DRaZyugTTIqlBHDkMGKVqA&nd=1")] [Platforms.Spotify, new URL("https://open.spotify.com/artist/5Y7rFm0tiJTVDzGLMzz0W1?si=DRaZyugTTIqlBHDkMGKVqA&nd=1")]
] ]
}), }),
new Library.Artist({ new Artist({
name: "toe", name: "toe",
id: 10 id: 10
}), }),
]) ])
db.add([ db.add([
new Library.Song({ new Song({
//Refrences are constructed as such. This allows to get to the artist from either collection or song //Refrences are constructed as such. This allows to get to the artist from either collection or song
artists: [new Library.Ref(Library.RefTo.Artists, 2), new Library.Ref(Library.RefTo.Artists, 3), new Library.Ref(Library.RefTo.Artists, 4)], artists: [new Ref(RefTo.Artists, 2), new Ref(RefTo.Artists, 3), new Ref(RefTo.Artists, 4)],
duration: 252, duration: 252,
name: "Star", name: "Star",
remix_artists: [new Library.Ref(Library.RefTo.Artists, 5)], remix_artists: [new Ref(RefTo.Artists, 5)],
url: new URL("http://127.0.0.1:4200/Machinedrum, Tanerelle & Mono Poly - Star (IMANU Remix) final.mp3") url: new URL("http://127.0.0.1:4200/Machinedrum, Tanerelle & Mono Poly - Star (IMANU Remix) final.mp3")
}), }),
new Library.Song({ new Song({
//If you don't like guessing the IDs, then this is also a way to do it //If you don't like guessing the IDs, then this is also a way to do it
artists: [new Library.Ref(Library.RefTo.Artists, db.artists.find((a) => a.name == "Jamie xx")!.id!)], artists: [new Ref(RefTo.Artists, db.artists.find((a) => a.name == "Jamie xx")!.id!)],
duration: 331, duration: 331,
name: "Sleep Sound", name: "Sleep Sound",
url: new URL("http://127.0.0.1:4200/Jamie xx - Sleep Sound.mp3") url: new URL("http://127.0.0.1:4200/Jamie xx - Sleep Sound.mp3")
}), }),
new Library.Song({ new Song({
artists: [new Library.Ref(Library.RefTo.Artists, 1)], artists: [new Ref(RefTo.Artists, 1)],
duration: 75, duration: 75,
name: "wish", name: "wish",
url: new URL("http://127.0.0.1:4200/janz - wish.mp3") url: new URL("http://127.0.0.1:4200/janz - wish.mp3")
}), }),
new Library.Song({ new Song({
artists: [new Library.Ref(Library.RefTo.Artists, 10)], artists: [new Ref(RefTo.Artists, 10)],
duration: 4 * 60 + 5, duration: 4 * 60 + 5,
name: "サニーボーイ・ラプソディ", name: "サニーボーイ・ラプソディ",
url: new URL("http://127.0.0.1:4200/16.サニーボーイ・ラプソディ.ogg") url: new URL("http://127.0.0.1:4200/16.サニーボーイ・ラプソディ.ogg")

View file

@ -5,7 +5,10 @@
"target": "ESNext", "target": "ESNext",
"useDefineForClassFields": true, "useDefineForClassFields": true,
"module": "ESNext", "module": "ESNext",
"lib": ["ESNext", "DOM"], "lib": [
"ESNext",
"DOM"
],
"moduleResolution": "Node", "moduleResolution": "Node",
"strict": true, "strict": true,
"resolveJsonModule": true, "resolveJsonModule": true,
@ -16,12 +19,16 @@
"noUnusedParameters": true, "noUnusedParameters": true,
"noImplicitReturns": true, "noImplicitReturns": true,
"skipLibCheck": true, "skipLibCheck": true,
"types": ["vite/client"] "types": [
"vite/client"
]
}, },
"include": ["src"], "include": [
"references": [ "src"
{ ],
"path": "./tsconfig.app.json" // "references": [
} // {
] // "path": "./tsconfig.app.json"
} // }
// ]
}