Browse Source

refactor: temporarily disabled genres validation

Kristian Vos 5 năm trước cách đây
mục cha
commit
ca4bc489aa
2 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 2 2
      backend/logic/db/index.js
  2. 2 2
      frontend/components/Modals/EditSong.vue

+ 2 - 2
backend/logic/db/index.js

@@ -153,13 +153,13 @@ module.exports = class extends coreClass {
 					this.schemas.song.path('artists').validate(songArtists, 'Invalid artists.');
 					this.schemas.queueSong.path('artists').validate(songArtists, 'Invalid artists.');
 		
-					let songGenres = (genres) => {
+					/*let songGenres = (genres) => {
 						return genres.filter((genre) => {
 								return (isLength(genre, 1, 16) && regex.azAZ09_.test(genre));
 							}).length === genres.length;
 					};
 					this.schemas.song.path('genres').validate(songGenres, 'Invalid genres.');
-					this.schemas.queueSong.path('genres').validate(songGenres, 'Invalid genres.');
+					this.schemas.queueSong.path('genres').validate(songGenres, 'Invalid genres.');*/
 		
 					this.schemas.song.path('thumbnail').validate((thumbnail) => {
 						return isLength(thumbnail, 8, 256);

+ 2 - 2
frontend/components/Modals/EditSong.vue

@@ -701,7 +701,7 @@ export default {
 			if (error) return Toast.methods.addToast(error, 8000);
 
 			// Genres
-			error = undefined;
+			/* error = undefined;
 			song.genres.forEach(genre => {
 				if (!validation.isLength(genre, 1, 16)) {
 					error = "Genre must have between 1 and 16 characters.";
@@ -715,7 +715,7 @@ export default {
 
 				return false;
 			});
-			if (error) return Toast.methods.addToast(error, 8000);
+			if (error) return Toast.methods.addToast(error, 8000); */
 
 			// Thumbnail
 			if (!validation.isLength(song.thumbnail, 8, 256))