浏览代码

Added button to save, verify and close song with one press

Kristian Vos 3 年之前
父节点
当前提交
223c344d5e
共有 2 个文件被更改,包括 14 次插入39 次删除
  1. 14 4
      frontend/src/components/modals/EditSong.vue
  2. 0 35
      frontend/src/components/modals/ImportAlbum.vue

+ 14 - 4
frontend/src/components/modals/EditSong.vue

@@ -474,12 +474,21 @@
 				</div>
 			</div>
 			<div slot="footer">
-				<save-button ref="saveButton" @clicked="save(song, false)" />
+				<save-button
+					ref="saveButton"
+					@clicked="save(song, false, false)"
+				/>
 				<save-button
 					ref="saveAndCloseButton"
 					type="save-and-close"
-					@clicked="save(song, true)"
+					@clicked="save(song, false, true)"
 				/>
+				<button
+					class="button is-primary"
+					@click="save(song, true, true)"
+				>
+					Save, verify and close
+				</button>
 				<div class="right">
 					<button
 						v-if="song.status !== 'verified'"
@@ -988,7 +997,7 @@ export default {
 			ctrl: true,
 			preventDefault: true,
 			handler: () => {
-				this.save(this.song, false);
+				this.save(this.song, false, false);
 			}
 		});
 
@@ -1099,7 +1108,7 @@ export default {
 		});
 	},
 	methods: {
-		save(songToCopy, close) {
+		save(songToCopy, verify, close) {
 			const song = JSON.parse(JSON.stringify(songToCopy));
 
 			let saveButtonRef = this.$refs.saveButton;
@@ -1243,6 +1252,7 @@ export default {
 					saveButtonRef.handleSuccessfulSave();
 				else saveButtonRef.handleFailedSave();
 
+				if (verify) this.verify(this.song._id);
 				if (close) this.closeModal("editSong");
 			});
 		},

+ 0 - 35
frontend/src/components/modals/ImportAlbum.vue

@@ -3,9 +3,6 @@
 		<modal title="Import Album" class="import-album-modal">
 			<div slot="body" class="import-album-modal-body">
 				<div class="search-discogs-album">
-					<button class="button is-primary" @click="cheatSelect()">
-						Cheat import
-					</button>
 					<div
 						class="selected-discogs-info"
 						v-if="!discogsAlbum || !discogsAlbum.album"
@@ -501,38 +498,6 @@ export default {
 
 			this.updatePlaylistSongs(playlistSongs);
 		},
-		cheatSelect() {
-			this.selectAlbum({
-				expanded: true,
-				gotMoreInfo: true,
-				album: {
-					id: 1198933,
-					title: "Imagine Dragons - Evolve",
-					type: "Master",
-					year: "2017",
-					genres: ["Rock", "Pop"],
-					albumArt:
-						"https://img.discogs.com/NGObjk0gIIbrE6Ot3LbEET7H390=/fit-in/600x600/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-10469087-1501265566-7000.jpeg.jpg",
-					resourceUrl: "https://api.discogs.com/masters/1198933",
-					artists: ["Imagine Dragons"],
-					artistIds: [2727700]
-				},
-				dataQuality: "Correct",
-				tracks: [
-					{ position: "1", title: "I Don't Know Why" },
-					{ position: "2", title: "Whatever It Takes" },
-					{ position: "3", title: "Believer" },
-					{ position: "4", title: "Walking The Wire" },
-					{ position: "5", title: "Rise Up" },
-					{ position: "6", title: "I'll Make It Up To You" },
-					{ position: "7", title: "Yesterday" },
-					{ position: "8", title: "Mouth Of The River" },
-					{ position: "9", title: "Thunder" },
-					{ position: "10", title: "Start Over" },
-					{ position: "11", title: "Dancing In The Dark" }
-				]
-			});
-		},
 		selectAlbum(result) {
 			this.selectDiscogsAlbum(result);
 			this.clearDiscogsResults();