mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
Implemented the API call for song lyrics
This commit is contained in:
parent
33a86a6d7a
commit
12ce97836d
3 changed files with 15 additions and 36 deletions
|
|
@ -44,6 +44,11 @@ public class MediaRetrievalClient {
|
||||||
return mediaRetrievalService.download(subsonic.getParams(), id);
|
return mediaRetrievalService.download(subsonic.getParams(), id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Call<SubsonicResponse> getLyrics(String artist, String title) {
|
||||||
|
Log.d(TAG, "getLyrics()");
|
||||||
|
return mediaRetrievalService.getLyrics(subsonic.getParams(), artist, title);
|
||||||
|
}
|
||||||
|
|
||||||
private OkHttpClient getOkHttpClient() {
|
private OkHttpClient getOkHttpClient() {
|
||||||
CacheUtil cacheUtil = new CacheUtil(context, 60, 60 * 60 * 24 * 30);
|
CacheUtil cacheUtil = new CacheUtil(context, 60, 60 * 60 * 24 * 30);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,4 +15,7 @@ public interface MediaRetrievalService {
|
||||||
|
|
||||||
@GET("download")
|
@GET("download")
|
||||||
Call<SubsonicResponse> download(@QueryMap Map<String, String> params, @Query("id") String id);
|
Call<SubsonicResponse> download(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||||
|
|
||||||
|
@GET("getLyrics")
|
||||||
|
Call<SubsonicResponse> getLyrics(@QueryMap Map<String, String> params, @Query("artist") String artist, @Query("title") String title);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,66 +1,37 @@
|
||||||
package com.cappielloantonio.play.subsonic.models;
|
package com.cappielloantonio.play.subsonic.models;
|
||||||
|
|
||||||
|
import com.tickaroo.tikxml.annotation.Attribute;
|
||||||
|
import com.tickaroo.tikxml.annotation.Xml;
|
||||||
|
|
||||||
|
@Xml
|
||||||
public class Lyrics {
|
public class Lyrics {
|
||||||
|
@Attribute(name = "value")
|
||||||
protected String content;
|
protected String content;
|
||||||
|
@Attribute
|
||||||
protected String artist;
|
protected String artist;
|
||||||
|
@Attribute
|
||||||
protected String title;
|
protected String title;
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the content property.
|
|
||||||
*
|
|
||||||
* @return possible object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public String getContent() {
|
public String getContent() {
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the content property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setContent(String value) {
|
public void setContent(String value) {
|
||||||
this.content = value;
|
this.content = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the artist property.
|
|
||||||
*
|
|
||||||
* @return possible object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public String getArtist() {
|
public String getArtist() {
|
||||||
return artist;
|
return artist;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the artist property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setArtist(String value) {
|
public void setArtist(String value) {
|
||||||
this.artist = value;
|
this.artist = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the title property.
|
|
||||||
*
|
|
||||||
* @return possible object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the title property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setTitle(String value) {
|
public void setTitle(String value) {
|
||||||
this.title = value;
|
this.title = value;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue