Skip to content

Commit

Permalink
fixed Number Casting exception
Browse files Browse the repository at this point in the history
  • Loading branch information
iankang committed Jan 29, 2022
1 parent 336401a commit 99a3a10
Show file tree
Hide file tree
Showing 53 changed files with 4,045 additions and 10 deletions.
11 changes: 3 additions & 8 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ data class ShowResponse (
@SerializedName("audio_length") val audio_length : Int?,
@SerializedName("description") val description : String?,
@SerializedName("sections") val sections : List<String?>?,
@SerializedName("picture_primary_color") val picture_primary_color : Int?,
@SerializedName("picture_primary_color") val picture_primary_color : String?,
@SerializedName("type") val type : String?,
@SerializedName("metadata") val metadata : ShowResponseMetadata?
){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ data class UserResponse(
@SerializedName("city") val city: String?,
@SerializedName("country") val country: String?,
@SerializedName("cover_pictures") val cover_pictures: UserResponseCoverPictures?,
@SerializedName("picture_primary_color") val picture_primary_color: Int?,
@SerializedName("picture_primary_color") val picture_primary_color: String?,
@SerializedName("type") val type: String?,
@SerializedName("metadata") val metadata: UserResponseMetadata?
){
Expand Down
Binary file removed target/classes/META-INF/mixjar.kotlin_module
Binary file not shown.
157 changes: 157 additions & 0 deletions target/classes/com/mixsteroids/mixjar/HearThisAt.kt
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)
}
}
Loading

0 comments on commit 99a3a10

Please sign in to comment.