mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
PipedApi update
This commit is contained in:
parent
1900e7cd5f
commit
35e6641503
@ -1,9 +1,7 @@
|
||||
package com.github.libretube
|
||||
|
||||
import com.github.libretube.obj.*
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Path
|
||||
import retrofit2.http.Query
|
||||
import retrofit2.http.*
|
||||
|
||||
interface PipedApi {
|
||||
@GET("trending")
|
||||
@ -33,4 +31,20 @@ interface PipedApi {
|
||||
@GET("nextpage/playlists/{playlistId}")
|
||||
suspend fun getPlaylistNextPage(@Path("playlistId") playlistId: String, @Query("nextpage") nextPage: String): Playlist
|
||||
|
||||
@POST("login")
|
||||
suspend fun login(@Body login: Login): Token
|
||||
|
||||
@POST("register")
|
||||
suspend fun register(@Body login: Login): Token
|
||||
|
||||
@GET("feed")
|
||||
suspend fun getFeed(@Query("authToken") token: String?): List<StreamItem>
|
||||
|
||||
@GET("subscribed")
|
||||
suspend fun isSubscribed(@Query("channelId") channelId: String, @Header("Authorization") token: String): Subscribed
|
||||
|
||||
@GET("subscriptions")
|
||||
suspend fun subscriptions(@Header("Authorization") token: String): List<Subscription>
|
||||
|
||||
|
||||
}
|
6
app/src/main/java/com/github/libretube/obj/Login.kt
Normal file
6
app/src/main/java/com/github/libretube/obj/Login.kt
Normal file
@ -0,0 +1,6 @@
|
||||
package com.github.libretube.obj
|
||||
|
||||
data class Login(
|
||||
val username: String? = null,
|
||||
val password: String? = null
|
||||
)
|
@ -10,7 +10,8 @@ data class StreamItem(
|
||||
var uploadedDate: String?,
|
||||
var duration: Long?,
|
||||
var views: Long?,
|
||||
var uploaderVerified: Boolean?
|
||||
var uploaderVerified: Boolean?,
|
||||
var uploaded: Long?
|
||||
){
|
||||
constructor() : this("","","","","","","",0,0,null)
|
||||
constructor() : this("","","","","","","",0,0,null,0)
|
||||
}
|
||||
|
5
app/src/main/java/com/github/libretube/obj/Subscribed.kt
Normal file
5
app/src/main/java/com/github/libretube/obj/Subscribed.kt
Normal file
@ -0,0 +1,5 @@
|
||||
package com.github.libretube.obj
|
||||
|
||||
data class Subscribed(
|
||||
var subscribed: Boolean? = null
|
||||
)
|
@ -0,0 +1,8 @@
|
||||
package com.github.libretube.obj
|
||||
|
||||
data class Subscription(
|
||||
var url: String? = null,
|
||||
var name: String? = null,
|
||||
var avatar: String? = null,
|
||||
var verified: Boolean? = null
|
||||
)
|
6
app/src/main/java/com/github/libretube/obj/Token.kt
Normal file
6
app/src/main/java/com/github/libretube/obj/Token.kt
Normal file
@ -0,0 +1,6 @@
|
||||
package com.github.libretube.obj
|
||||
|
||||
data class Token(
|
||||
var token: String? = null,
|
||||
var error: String? = null
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user