@@ -278,7 +278,16 @@ export default {
"GET_SONGS",
{
youtubeIds,
- properties: ["youtubeId", "title", "artists", "thumbnail", "duration", "verified", "_id"]
+ properties: [
+ "youtubeId",
+ "title",
+ "artists",
+ "thumbnail",
+ "duration",
+ "verified",
+ "_id",
+ "youtubeVideoId"
+ ]
},
this
)
@@ -203,7 +203,8 @@ class _SongsModule extends CoreClass {
thumbnail || `https://img.youtube.com/vi/${youtubeId}/mqdefault.jpg`,
requestedBy: null,
requestedAt: Date.now(),
- verified: false
+ verified: false,
+ youtubeVideoId: video._id
};
});
next(null, [...songs, ...youtubeVideos]);
@@ -147,6 +147,11 @@ class _YouTubeModule extends CoreClass {
room: "admin.youtubeVideos",
args: ["event:admin.youtubeVideo.removed", { data: { videoId } }]
+
+ WSModule.runJob("EMIT_TO_ROOMS", {
+ rooms: ["import-album", "edit-songs"],
+ args: ["event:admin.youtubeVideo.removed", { videoId }]
+ });
}
@@ -305,6 +305,17 @@ export default {
{ modalUuid: this.modalUuid }
);
+ this.socket.on(
+ `event:admin.youtubeVideo.removed`,
+ res => {
+ const index = this.items
+ .map(item => item.song.youtubeVideoId)
+ .indexOf(res.videoId);
+ if (index !== -1) this.items[index].song.removed = true;
+ },
+ { modalUuid: this.modalUuid }
+ );
beforeUnmount() {
this.socket.dispatch("apis.leaveRoom", "edit-songs");