@euterpe.js/music-library
Advanced tools
Comparing version 1.0.7 to 1.0.8
{ | ||
"name": "@euterpe.js/music-library", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "A simple music library, acting as a Local DB as JS Object. Contains everything a person would need to store their music data for website playback.", |
@@ -44,3 +44,3 @@ export { RefTo, Ref, Song, Collection, DB, Artist, Platforms, CollectionType, from_json }; | ||
case RefTo.Collections: { | ||
return from.collections.find((col) => col.id = this.id); | ||
return from.collections.find((col) => col.id == this.id); | ||
} | ||
@@ -117,3 +117,2 @@ } | ||
artist.id = this.artists.length; | ||
this.artists.push(artist); | ||
for (const song_ref of artist.songs) { | ||
@@ -127,2 +126,3 @@ const curr_song = song_ref.get(this); | ||
} | ||
this.artists.push(artist); | ||
} | ||
@@ -133,3 +133,2 @@ else if (input instanceof Collection) { | ||
col.id = this.collections.length; | ||
this.collections.push(col); | ||
for (const song_ref of col.songs) { | ||
@@ -143,2 +142,3 @@ const curr_song = song_ref.get(this); | ||
} | ||
this.collections.push(col); | ||
} | ||
@@ -149,6 +149,7 @@ else if (input instanceof Song) { | ||
song.id = this.songs.length; | ||
this.songs.push(song); | ||
if (song.in_collection) { | ||
const curr_col = song.in_collection.get(this); | ||
curr_col === null || curr_col === void 0 ? void 0 : curr_col.songs.push(new Ref(RefTo.Songs, song.id)); | ||
curr_col.songs.push(new Ref(RefTo.Songs, song.id)); | ||
song.artists.forEach((artist) => curr_col.artists.push(new Ref(RefTo.Artists, artist.get(this).id))); | ||
song.remix_artists.forEach((artist) => curr_col.artists.push(new Ref(RefTo.Artists, artist.get(this).id))); | ||
} | ||
@@ -159,2 +160,7 @@ for (const artist_ref of song.artists) { | ||
} | ||
for (const artist_ref of song.remix_artists) { | ||
const curr_artist = artist_ref.get(this); | ||
curr_artist.songs.push(new Ref(RefTo.Songs, song.id)); | ||
} | ||
this.songs.push(song); | ||
} | ||
@@ -161,0 +167,0 @@ } |
Sorry, the diff of this file is not supported yet
29096
400