-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
4,045 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
package com.mixsteroids.mixjar | ||
|
||
import com.mixsteroids.mixjar.models.* | ||
import com.mixsteroids.mixjar.services.HearThisAtServiceImpl | ||
import com.mixsteroids.mixjar.services.contracts.HearThisAtInterface | ||
|
||
class HearThisAt { | ||
|
||
val hearThisAtInterface: HearThisAtInterface | ||
|
||
init { | ||
hearThisAtInterface = HearThisAtServiceImpl() | ||
} | ||
|
||
/** | ||
* get the hearthisat feed | ||
* @param page page to show | ||
* @param count entries per page (max: 20) | ||
* @param duration duration (+/- 5 minutes) | ||
* @param type empty / popular / new | ||
* @param category empty / house / drumandbass / etc. - see genre API | ||
* @param showFeedStart 2021-12-05 Start Date | ||
* @param showFeedEnd 2021-12-12 End Date | ||
* @return HearThisAtFeedResponse | ||
* @see HearthisAtFeedResponse | ||
*/ | ||
fun getFeed( | ||
page:Int, | ||
count:Int, | ||
duration:Int, | ||
type:String?, | ||
category: String?, | ||
showFeedStart:String, | ||
showFeedEnd:String | ||
): HearthisAtFeedResponse? { | ||
return hearThisAtInterface.getFeed(page, count, duration, type, category, showFeedStart, showFeedEnd) | ||
} | ||
|
||
/** | ||
* gets all available genres | ||
* @return HearThisAtGenresResponse | ||
* @see HearThisAtGenresResponse | ||
*/ | ||
fun getAllGenres(): HearThisAtGenresResponse? { | ||
return hearThisAtInterface.getAllGenres() | ||
} | ||
|
||
/** | ||
* gets tracks based on genres | ||
* @param categoryName name of genre | ||
* @param count entries per page. | ||
* @param page page to show | ||
*/ | ||
fun getGenreList( | ||
categoryName:String, | ||
page: Int, | ||
count:Int, | ||
duration: Int? | ||
):GenreList?{ | ||
return hearThisAtInterface.getGenreList(categoryName, page, count,duration) | ||
} | ||
|
||
/** | ||
* gets a single artist | ||
* @param artistName name of the artist | ||
* @return SingleArtistResponse | ||
* @see SingleArtistResponse | ||
*/ | ||
fun getSingleArtist(artistName:String):SingleArtistResponse?{ | ||
return hearThisAtInterface.getSingleArtist(artistName) | ||
} | ||
|
||
/** | ||
* gets all artists lists | ||
* @param artistName name of the artist | ||
* @param type choose list type: likes / playlists / tracks | ||
* @param page page to show | ||
* @param count entries per page (max: 20) | ||
* @return ArtistListResponse | ||
* @see ArtistListResponse | ||
*/ | ||
fun getArtistsLists( | ||
artistName: String, | ||
type: String?, | ||
page: Int?, | ||
count: Int? | ||
):ArtistListResponse?{ | ||
return hearThisAtInterface.getArtistsList(artistName, type, page, count) | ||
} | ||
|
||
|
||
/** | ||
* get single track information | ||
* @param artistName name of artist | ||
* @param trackName name of track | ||
* @return SingleTrackResponse | ||
* @see SingleTrackResponse | ||
*/ | ||
fun getSingleTrack( | ||
artistName:String, | ||
trackName:String | ||
):SingleTrackResponse?{ | ||
return hearThisAtInterface.getSingleTrack(artistName, trackName) | ||
} | ||
|
||
/** | ||
* get single playlist | ||
* @param artistName name of artist | ||
* @param types playlists | ||
* @param page page to show | ||
* @param count entries per page (max: 20) | ||
* @return SinglePlaylist | ||
* @see SinglePlaylist | ||
*/ | ||
fun getSinglePlaylist( | ||
artistName: String, | ||
types: String, | ||
page: Int?, | ||
count: Int? | ||
):SinglePlaylist?{ | ||
return hearThisAtInterface.getSinglePlaylist(artistName, types, page, count) | ||
} | ||
|
||
/** | ||
* search hearthisat repo | ||
* @param type tracks (or empty) / user / playlists | ||
* @param t search query | ||
* @param page page to show | ||
* @param count entries per page (max: 20) | ||
* @param duration duration (+/- 5 minutes) | ||
* @return HearthisatSearchResponse | ||
* @see HearthisAtSearchResponse | ||
*/ | ||
fun search( | ||
type:String, | ||
t:String, | ||
page:Int?, | ||
count:Int?, | ||
duration:Int? | ||
):HearthisAtSearchResponse?{ | ||
return hearThisAtInterface.search(type, t, page, count, duration) | ||
} | ||
|
||
/** | ||
* login into hearthisat. | ||
* @param email email address to login | ||
* @param password password address to login | ||
* @return HearthisatLoginResponse | ||
* @see HearthisatLoginResponse | ||
*/ | ||
fun login( | ||
email:String, | ||
password:String | ||
): HearthisatLoginResponse?{ | ||
return hearThisAtInterface.login(email, password) | ||
} | ||
} |
Oops, something went wrong.