🔨 Remove Playlist search on web

This commit is contained in:
SebClem 2020-10-31 16:33:48 +01:00
parent 6cffd0ff73
commit eafc4b6170
3 changed files with 15 additions and 22 deletions

View File

@ -189,14 +189,12 @@ public class MusicWebAPIController {
}
@RequestMapping(value = "/search", method = RequestMethod.GET)
public ResponseEntity<List<SearchResult>> search(@CookieValue(name = "token", defaultValue = "") String token, @RequestParam(value = "query") String query, @RequestParam(value = "playlist") boolean playlist) {
public ResponseEntity<List<SearchResult>> search(@CookieValue(name = "token", defaultValue = "") String token, @RequestParam(value = "query") String query) {
if (token != null && !token.isEmpty()) {
try {
UserEntity user = userUtils.getUserWithApiToken(userRepository, token);
// YoutubeTools youtubeTools = YoutubeTools.getInstance();
// ArrayList<SearchResult> result = youtubeTools.search(query, 25, playlist);
YoutubeSearchRework youtubeSearch = YoutubeSearchRework.getInstance();
List<SearchResult> result = youtubeSearch.searchVideo(query, 25, playlist);
List<SearchResult> result = youtubeSearch.searchVideo(query, 25, false);
return new ResponseEntity<>(result, HttpStatus.OK);
} catch (UnknownTokenException e) {

View File

@ -431,14 +431,9 @@ function search() {
load.removeClass("hide");
load.addClass("scale-in");
$.get("/api/music/search?query=" + input_search.val() + "&playlist=" + $("#playlistSearch").is(':checked'), (data) => {
$.get("/api/music/search?query=" + input_search.val(), (data) => {
list.empty();
let url;
if($("#playlistSearch").is(':checked')){
url = "https://www.youtube.com/playlist?list="
}
else
url = "https://youtube.com/watch?v=";
let url = "https://youtube.com/watch?v=";
data.forEach((item) => {

View File

@ -253,17 +253,17 @@
<button class="btn waves-effect waves-light green darken-4 white-text" id="btn_search"
type="button"><i class="material-icons">search</i></button>
</div>
<div class="col l1 m1 s2 center" style="padding: 0; margin-top: 15px;">
<div class="row switch blue-grey-text text-darken-3" style="margin-bottom: 0px">
Playlist
</div>
<div class="row switch">
<label>
<input type="checkbox" id="playlistSearch"/>
<span class="lever"></span>
</label>
</div>
</div>
<!-- <div class="col l1 m1 s2 center" style="padding: 0; margin-top: 15px;">-->
<!-- <div class="row switch blue-grey-text text-darken-3" style="margin-bottom: 0px">-->
<!-- Playlist-->
<!-- </div>-->
<!-- <div class="row switch">-->
<!-- <label>-->
<!-- <input type="checkbox" id="playlistSearch"/>-->
<!-- <span class="lever"></span>-->
<!-- </label>-->
<!-- </div>-->
<!-- </div>-->
</div>
<div class="row">