we_bstly-web/src/app/services/jukebox.service.ts
2022-01-03 12:56:29 +01:00

34 lines
858 B
TypeScript

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { environment } from '../../environments/environment';
@Injectable({
providedIn: 'root',
})
export class JukeboxService {
constructor(private http: HttpClient) {
}
check() {
return this.http.get(environment.apiUrl + "/jukebox");
}
search(query: string) {
return this.http.get(environment.apiUrl + "/jukebox/search?q=" + query);
}
searchOffset(query: string, offset: number) {
return this.http.get(environment.apiUrl + "/jukebox/search?q=" + query + "&offset=" + offset);
}
current() {
return this.http.get(environment.apiUrl + "/jukebox/current");
}
queue(uri: string) {
return this.http.post(environment.apiUrl + "/jukebox/queue?uri=" + uri, "");
}
}