Explorar o código

Fixed issue where putting in a YouTube url with playlist id and index would not give any results.

KrisVos130 %!s(int64=8) %!d(string=hai) anos
pai
achega
9e755657f8
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      frontend/components/Modals/AddSongToQueue.vue

+ 7 - 1
frontend/components/Modals/AddSongToQueue.vue

@@ -71,7 +71,13 @@
 			},
 			submitQuery: function () {
 				let _this = this;
-				_this.socket.emit('apis.searchYoutube', _this.querySearch, results => {
+				let query = _this.querySearch;
+				if (query.indexOf('&index=') !== -1) {
+					query = query.split('&index=');
+					query.pop();
+					query = query.join('');
+				}
+				_this.socket.emit('apis.searchYoutube', query, results => {
 					results = results.data;
 					_this.queryResults = [];
 					for (let i = 0; i < results.items.length; i++) {