30 lines
760 B
TypeScript
30 lines
760 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);
|
|
}
|
|
|
|
queue(uri: string) {
|
|
return this.http.post(environment.apiUrl + "/jukebox/queue?uri=" + uri, "");
|
|
}
|
|
|
|
} |