Add time for Album + pipe to convert Ms
This commit is contained in:
@@ -23,7 +23,7 @@ export class ElsService {
|
||||
constructor(private http: Http) { }
|
||||
|
||||
getTime(): Promise<number> {
|
||||
return this.http.post(this.elsUrl + ElsService.ACTION_SEARCH, JSON.stringify({aggs:{sum_time:{sum:{field:"Total Time"}}},"size":0}), {headers: this.headers})
|
||||
return this.http.post(this.elsUrl + 'song/' + ElsService.ACTION_SEARCH, JSON.stringify({aggs:{sum_time:{sum:{field:"Total Time"}}},"size":0}), {headers: this.headers})
|
||||
.toPromise()
|
||||
.then(res => res.json().aggregations.sum_time.value as number)
|
||||
.catch(this.handleError);
|
||||
@@ -84,7 +84,7 @@ export class ElsService {
|
||||
"Play Count": {
|
||||
"order": "desc"
|
||||
} } ],
|
||||
"size": 10
|
||||
"size": 5
|
||||
}),
|
||||
{headers: this.headers})
|
||||
.map(res => {
|
||||
@@ -130,18 +130,18 @@ export class ElsService {
|
||||
return this.http
|
||||
.post(this.elsUrl + "song" + ElsService.ACTION_SEARCH,
|
||||
JSON.stringify(
|
||||
{
|
||||
"query": {
|
||||
"bool": {
|
||||
"should": [
|
||||
{"match_phrase" : { "Album Artist" : artistName }},
|
||||
{"match_phrase" : { "Artist" : artistName }}
|
||||
]
|
||||
}
|
||||
},
|
||||
"size": ElsService.DEFAULT_SIZE,
|
||||
"from": from
|
||||
}),
|
||||
{
|
||||
"query": {
|
||||
"bool": {
|
||||
"should": [
|
||||
{"match_phrase" : { "Album Artist" : artistName }},
|
||||
{"match_phrase" : { "Artist" : artistName }}
|
||||
]
|
||||
}
|
||||
},
|
||||
"size": ElsService.DEFAULT_SIZE,
|
||||
"from": from
|
||||
}),
|
||||
{headers: this.headers})
|
||||
.map(res => {
|
||||
return res.json().hits.hits;
|
||||
|
||||
Reference in New Issue
Block a user