ソースを参照

feat: Add/remove media to/from admin playlist from admin/songs/import

Owen Diffey 2 年 前
コミット
d7d40e2a7a

+ 29 - 2
frontend/src/pages/Admin/Songs/Import.vue

@@ -46,8 +46,8 @@ const columns = ref<TableColumn[]>([
 		sortable: false,
 		hidable: false,
 		resizable: false,
-		minWidth: 160,
-		defaultWidth: 160
+		minWidth: 200,
+		defaultWidth: 200
 	},
 	{
 		name: "type",
@@ -358,6 +358,15 @@ const importAlbum = youtubeIds => {
 	});
 };
 
+const bulkEditPlaylist = youtubeIds => {
+	openModal({
+		modal: "bulkEditPlaylist",
+		props: {
+			youtubeIds
+		}
+	});
+};
+
 const removeImportJob = jobId => {
 	socket.dispatch("media.removeImportJobs", jobId, res => {
 		new Toast(res.message);
@@ -540,6 +549,24 @@ const removeImportJob = jobId => {
 								>
 									album
 								</button>
+								<button
+									v-if="hasPermission('playlists.songs.add')"
+									class="button is-primary icon-with-button material-icons"
+									@click="
+										bulkEditPlaylist(
+											slotProps.item.response
+												.successfulVideoIds
+										)
+									"
+									:disabled="
+										slotProps.item.removed ||
+										slotProps.item.status !== 'success'
+									"
+									content="Add/remove media to/from playlist"
+									v-tippy
+								>
+									playlist_add
+								</button>
 								<button
 									v-if="
 										hasPermission('media.removeImportJobs')

+ 1 - 1
frontend/src/pages/Admin/Songs/index.vue

@@ -778,7 +778,7 @@ onMounted(() => {
 						v-if="hasPermission('playlists.songs.add')"
 						class="material-icons playlist-bulk-edit-icon"
 						@click.prevent="bulkEditPlaylist(slotProps.item)"
-						content="Add To Playlist"
+						content="Add/remove to/from playlist"
 						v-tippy
 						tabindex="0"
 					>