浏览代码

fix(Activities): content changes of private playlists doesn't create activities (until we add individual settings for activity privacy)

Signed-off-by: Jonathan Graham <theflametrooper@gmail.com>
Jonathan Graham 3 年之前
父节点
当前提交
f7fe6080cb
共有 1 个文件被更改,包括 25 次插入19 次删除
  1. 25 19
      backend/logic/actions/playlists.js

+ 25 - 19
backend/logic/actions/playlists.js

@@ -948,16 +948,17 @@ export default {
 						? `${newSong.title} by ${newSong.artists.join(", ")}`
 						: newSong.title;
 
-					ActivitiesModule.runJob("ADD_ACTIVITY", {
-						userId: session.userId,
-						type: "playlist__add_song",
-						payload: {
-							message: `Added <youtubeId>${songName}</youtubeId> to playlist <playlistId>${playlist.displayName}</playlistId>`,
-							thumbnail: newSong.thumbnail,
-							playlistId,
-							youtubeId
-						}
-					});
+					if (playlist.privacy === "public")
+						ActivitiesModule.runJob("ADD_ACTIVITY", {
+							userId: session.userId,
+							type: "playlist__add_song",
+							payload: {
+								message: `Added <youtubeId>${songName}</youtubeId> to playlist <playlistId>${playlist.displayName}</playlistId>`,
+								thumbnail: newSong.thumbnail,
+								playlistId,
+								youtubeId
+							}
+						});
 				}
 
 				StationsModule.runJob("GET_STATIONS_THAT_INCLUDE_OR_EXCLUDE_PLAYLIST", { playlistId })
@@ -1084,14 +1085,15 @@ export default {
 					return cb({ status: "error", message: err });
 				}
 
-				ActivitiesModule.runJob("ADD_ACTIVITY", {
-					userId: session.userId,
-					type: "playlist__import_playlist",
-					payload: {
-						message: `Imported ${addSongsStats.successful} songs to playlist <playlistId>${playlist.displayName}</playlistId>`,
-						playlistId
-					}
-				});
+				if (playlist.privacy === "public")
+					ActivitiesModule.runJob("ADD_ACTIVITY", {
+						userId: session.userId,
+						type: "playlist__import_playlist",
+						payload: {
+							message: `Imported ${addSongsStats.successful} songs to playlist <playlistId>${playlist.displayName}</playlistId>`,
+							playlistId
+						}
+					});
 
 				this.log(
 					"SUCCESS",
@@ -1172,7 +1174,11 @@ export default {
 						? `${youtubeSong.title} by ${youtubeSong.artists.join(", ")}`
 						: youtubeSong.title;
 
-					if (playlist.displayName !== "Liked Songs" && playlist.displayName !== "Disliked Songs") {
+					if (
+						playlist.displayName !== "Liked Songs" &&
+						playlist.displayName !== "Disliked Songs" &&
+						playlist.privacy === "public"
+					) {
 						ActivitiesModule.runJob("ADD_ACTIVITY", {
 							userId: session.userId,
 							type: "playlist__remove_song",