mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
commit
a46b08648d
@ -2,6 +2,7 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:installLocation="auto">
|
android:installLocation="auto">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
|
@ -1,5 +1,20 @@
|
|||||||
package com.github.libretube.api
|
package com.github.libretube.api
|
||||||
|
|
||||||
|
import com.github.libretube.api.obj.Channel
|
||||||
|
import com.github.libretube.api.obj.CommentsPage
|
||||||
|
import com.github.libretube.api.obj.DeleteUserRequest
|
||||||
|
import com.github.libretube.api.obj.Login
|
||||||
|
import com.github.libretube.api.obj.Message
|
||||||
|
import com.github.libretube.api.obj.Playlist
|
||||||
|
import com.github.libretube.api.obj.PlaylistId
|
||||||
|
import com.github.libretube.api.obj.Playlists
|
||||||
|
import com.github.libretube.api.obj.SearchResult
|
||||||
|
import com.github.libretube.api.obj.Segments
|
||||||
|
import com.github.libretube.api.obj.StreamItem
|
||||||
|
import com.github.libretube.api.obj.Streams
|
||||||
|
import com.github.libretube.api.obj.Subscribe
|
||||||
|
import com.github.libretube.api.obj.Subscription
|
||||||
|
import com.github.libretube.api.obj.Token
|
||||||
import retrofit2.http.Body
|
import retrofit2.http.Body
|
||||||
import retrofit2.http.GET
|
import retrofit2.http.GET
|
||||||
import retrofit2.http.Header
|
import retrofit2.http.Header
|
||||||
@ -9,25 +24,25 @@ import retrofit2.http.Query
|
|||||||
|
|
||||||
interface PipedApi {
|
interface PipedApi {
|
||||||
@GET("trending")
|
@GET("trending")
|
||||||
suspend fun getTrending(@Query("region") region: String): List<com.github.libretube.api.obj.StreamItem>
|
suspend fun getTrending(@Query("region") region: String): List<StreamItem>
|
||||||
|
|
||||||
@GET("streams/{videoId}")
|
@GET("streams/{videoId}")
|
||||||
suspend fun getStreams(@Path("videoId") videoId: String): com.github.libretube.api.obj.Streams
|
suspend fun getStreams(@Path("videoId") videoId: String): Streams
|
||||||
|
|
||||||
@GET("comments/{videoId}")
|
@GET("comments/{videoId}")
|
||||||
suspend fun getComments(@Path("videoId") videoId: String): com.github.libretube.api.obj.CommentsPage
|
suspend fun getComments(@Path("videoId") videoId: String): CommentsPage
|
||||||
|
|
||||||
@GET("sponsors/{videoId}")
|
@GET("sponsors/{videoId}")
|
||||||
suspend fun getSegments(
|
suspend fun getSegments(
|
||||||
@Path("videoId") videoId: String,
|
@Path("videoId") videoId: String,
|
||||||
@Query("category") category: String
|
@Query("category") category: String
|
||||||
): com.github.libretube.api.obj.Segments
|
): Segments
|
||||||
|
|
||||||
@GET("nextpage/comments/{videoId}")
|
@GET("nextpage/comments/{videoId}")
|
||||||
suspend fun getCommentsNextPage(
|
suspend fun getCommentsNextPage(
|
||||||
@Path("videoId") videoId: String,
|
@Path("videoId") videoId: String,
|
||||||
@Query("nextpage") nextPage: String
|
@Query("nextpage") nextPage: String
|
||||||
): com.github.libretube.api.obj.CommentsPage
|
): CommentsPage
|
||||||
|
|
||||||
@GET("search")
|
@GET("search")
|
||||||
suspend fun getSearchResults(
|
suspend fun getSearchResults(
|
||||||
@ -40,49 +55,49 @@ interface PipedApi {
|
|||||||
@Query("q") searchQuery: String,
|
@Query("q") searchQuery: String,
|
||||||
@Query("filter") filter: String,
|
@Query("filter") filter: String,
|
||||||
@Query("nextpage") nextPage: String
|
@Query("nextpage") nextPage: String
|
||||||
): com.github.libretube.api.obj.SearchResult
|
): SearchResult
|
||||||
|
|
||||||
@GET("suggestions")
|
@GET("suggestions")
|
||||||
suspend fun getSuggestions(@Query("query") query: String): List<String>
|
suspend fun getSuggestions(@Query("query") query: String): List<String>
|
||||||
|
|
||||||
@GET("channel/{channelId}")
|
@GET("channel/{channelId}")
|
||||||
suspend fun getChannel(@Path("channelId") channelId: String): com.github.libretube.api.obj.Channel
|
suspend fun getChannel(@Path("channelId") channelId: String): Channel
|
||||||
|
|
||||||
@GET("user/{name}")
|
@GET("user/{name}")
|
||||||
suspend fun getChannelByName(@Path("name") channelName: String): com.github.libretube.api.obj.Channel
|
suspend fun getChannelByName(@Path("name") channelName: String): Channel
|
||||||
|
|
||||||
@GET("nextpage/channel/{channelId}")
|
@GET("nextpage/channel/{channelId}")
|
||||||
suspend fun getChannelNextPage(
|
suspend fun getChannelNextPage(
|
||||||
@Path("channelId") channelId: String,
|
@Path("channelId") channelId: String,
|
||||||
@Query("nextpage") nextPage: String
|
@Query("nextpage") nextPage: String
|
||||||
): com.github.libretube.api.obj.Channel
|
): Channel
|
||||||
|
|
||||||
@GET("playlists/{playlistId}")
|
@GET("playlists/{playlistId}")
|
||||||
suspend fun getPlaylist(@Path("playlistId") playlistId: String): com.github.libretube.api.obj.Playlist
|
suspend fun getPlaylist(@Path("playlistId") playlistId: String): Playlist
|
||||||
|
|
||||||
@GET("nextpage/playlists/{playlistId}")
|
@GET("nextpage/playlists/{playlistId}")
|
||||||
suspend fun getPlaylistNextPage(
|
suspend fun getPlaylistNextPage(
|
||||||
@Path("playlistId") playlistId: String,
|
@Path("playlistId") playlistId: String,
|
||||||
@Query("nextpage") nextPage: String
|
@Query("nextpage") nextPage: String
|
||||||
): com.github.libretube.api.obj.Playlist
|
): Playlist
|
||||||
|
|
||||||
@POST("login")
|
@POST("login")
|
||||||
suspend fun login(@Body login: com.github.libretube.api.obj.Login): com.github.libretube.api.obj.Token
|
suspend fun login(@Body login: Login): Token
|
||||||
|
|
||||||
@POST("register")
|
@POST("register")
|
||||||
suspend fun register(@Body login: com.github.libretube.api.obj.Login): com.github.libretube.api.obj.Token
|
suspend fun register(@Body login: Login): Token
|
||||||
|
|
||||||
@POST("user/delete")
|
@POST("user/delete")
|
||||||
suspend fun deleteAccount(
|
suspend fun deleteAccount(
|
||||||
@Header("Authorization") token: String,
|
@Header("Authorization") token: String,
|
||||||
@Body password: com.github.libretube.api.obj.DeleteUserRequest
|
@Body password: DeleteUserRequest
|
||||||
)
|
)
|
||||||
|
|
||||||
@GET("feed")
|
@GET("feed")
|
||||||
suspend fun getFeed(@Query("authToken") token: String?): List<com.github.libretube.api.obj.StreamItem>
|
suspend fun getFeed(@Query("authToken") token: String?): List<StreamItem>
|
||||||
|
|
||||||
@GET("feed/unauthenticated")
|
@GET("feed/unauthenticated")
|
||||||
suspend fun getUnauthenticatedFeed(@Query("channels") channels: String): List<com.github.libretube.api.obj.StreamItem>
|
suspend fun getUnauthenticatedFeed(@Query("channels") channels: String): List<StreamItem>
|
||||||
|
|
||||||
@GET("subscribed")
|
@GET("subscribed")
|
||||||
suspend fun isSubscribed(
|
suspend fun isSubscribed(
|
||||||
@ -91,66 +106,66 @@ interface PipedApi {
|
|||||||
): com.github.libretube.api.obj.Subscribed
|
): com.github.libretube.api.obj.Subscribed
|
||||||
|
|
||||||
@GET("subscriptions")
|
@GET("subscriptions")
|
||||||
suspend fun subscriptions(@Header("Authorization") token: String): List<com.github.libretube.api.obj.Subscription>
|
suspend fun subscriptions(@Header("Authorization") token: String): List<Subscription>
|
||||||
|
|
||||||
@GET("subscriptions/unauthenticated")
|
@GET("subscriptions/unauthenticated")
|
||||||
suspend fun unauthenticatedSubscriptions(@Query("channels") channels: String): List<com.github.libretube.api.obj.Subscription>
|
suspend fun unauthenticatedSubscriptions(@Query("channels") channels: String): List<Subscription>
|
||||||
|
|
||||||
@POST("subscribe")
|
@POST("subscribe")
|
||||||
suspend fun subscribe(
|
suspend fun subscribe(
|
||||||
@Header("Authorization") token: String,
|
@Header("Authorization") token: String,
|
||||||
@Body subscribe: com.github.libretube.api.obj.Subscribe
|
@Body subscribe: Subscribe
|
||||||
): com.github.libretube.api.obj.Message
|
): Message
|
||||||
|
|
||||||
@POST("unsubscribe")
|
@POST("unsubscribe")
|
||||||
suspend fun unsubscribe(
|
suspend fun unsubscribe(
|
||||||
@Header("Authorization") token: String,
|
@Header("Authorization") token: String,
|
||||||
@Body subscribe: com.github.libretube.api.obj.Subscribe
|
@Body subscribe: Subscribe
|
||||||
): com.github.libretube.api.obj.Message
|
): Message
|
||||||
|
|
||||||
@POST("import")
|
@POST("import")
|
||||||
suspend fun importSubscriptions(
|
suspend fun importSubscriptions(
|
||||||
@Query("override") override: Boolean,
|
@Query("override") override: Boolean,
|
||||||
@Header("Authorization") token: String,
|
@Header("Authorization") token: String,
|
||||||
@Body channels: List<String>
|
@Body channels: List<String>
|
||||||
): com.github.libretube.api.obj.Message
|
): Message
|
||||||
|
|
||||||
@POST("import/playlist")
|
@POST("import/playlist")
|
||||||
suspend fun importPlaylist(
|
suspend fun importPlaylist(
|
||||||
@Header("Authorization") token: String,
|
@Header("Authorization") token: String,
|
||||||
@Body playlistId: com.github.libretube.api.obj.PlaylistId
|
@Body playlistId: PlaylistId
|
||||||
): com.github.libretube.api.obj.Message
|
): Message
|
||||||
|
|
||||||
@GET("user/playlists")
|
@GET("user/playlists")
|
||||||
suspend fun playlists(@Header("Authorization") token: String): List<com.github.libretube.api.obj.Playlists>
|
suspend fun playlists(@Header("Authorization") token: String): List<Playlists>
|
||||||
|
|
||||||
@POST("user/playlists/rename")
|
@POST("user/playlists/rename")
|
||||||
suspend fun renamePlaylist(
|
suspend fun renamePlaylist(
|
||||||
@Header("Authorization") token: String,
|
@Header("Authorization") token: String,
|
||||||
@Body playlistId: com.github.libretube.api.obj.PlaylistId
|
@Body playlistId: PlaylistId
|
||||||
)
|
)
|
||||||
|
|
||||||
@POST("user/playlists/delete")
|
@POST("user/playlists/delete")
|
||||||
suspend fun deletePlaylist(
|
suspend fun deletePlaylist(
|
||||||
@Header("Authorization") token: String,
|
@Header("Authorization") token: String,
|
||||||
@Body playlistId: com.github.libretube.api.obj.PlaylistId
|
@Body playlistId: PlaylistId
|
||||||
): com.github.libretube.api.obj.Message
|
): Message
|
||||||
|
|
||||||
@POST("user/playlists/create")
|
@POST("user/playlists/create")
|
||||||
suspend fun createPlaylist(
|
suspend fun createPlaylist(
|
||||||
@Header("Authorization") token: String,
|
@Header("Authorization") token: String,
|
||||||
@Body name: com.github.libretube.api.obj.Playlists
|
@Body name: Playlists
|
||||||
): com.github.libretube.api.obj.PlaylistId
|
): PlaylistId
|
||||||
|
|
||||||
@POST("user/playlists/add")
|
@POST("user/playlists/add")
|
||||||
suspend fun addToPlaylist(
|
suspend fun addToPlaylist(
|
||||||
@Header("Authorization") token: String,
|
@Header("Authorization") token: String,
|
||||||
@Body playlistId: com.github.libretube.api.obj.PlaylistId
|
@Body playlistId: PlaylistId
|
||||||
): com.github.libretube.api.obj.Message
|
): Message
|
||||||
|
|
||||||
@POST("user/playlists/remove")
|
@POST("user/playlists/remove")
|
||||||
suspend fun removeFromPlaylist(
|
suspend fun removeFromPlaylist(
|
||||||
@Header("Authorization") token: String,
|
@Header("Authorization") token: String,
|
||||||
@Body playlistId: com.github.libretube.api.obj.PlaylistId
|
@Body playlistId: PlaylistId
|
||||||
): com.github.libretube.api.obj.Message
|
): Message
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class MarkableTimeBar(
|
|||||||
attributeSet: AttributeSet? = null
|
attributeSet: AttributeSet? = null
|
||||||
) : DefaultTimeBar(context, attributeSet) {
|
) : DefaultTimeBar(context, attributeSet) {
|
||||||
|
|
||||||
private var segments: List<Segment> = listOf(Segment(segment = listOf(1f, 10f)), Segment(segment = listOf(20f, 30f)))
|
private var segments: List<Segment> = listOf()
|
||||||
private var player: Player? = null
|
private var player: Player? = null
|
||||||
private var length: Int = 0
|
private var length: Int = 0
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.github.libretube.util
|
package com.github.libretube.util
|
||||||
|
|
||||||
import android.R.attr.data
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.NotificationManager
|
import android.app.NotificationManager
|
||||||
import android.app.PendingIntent
|
import android.app.PendingIntent
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<item
|
<item
|
||||||
android:id="@+id/action_queue"
|
android:id="@+id/action_queue"
|
||||||
android:title="@string/queue"
|
android:title="@string/queue"
|
||||||
app:showAsAction="never"
|
android:visible="false"
|
||||||
android:visible="false" />
|
app:showAsAction="never" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
Loading…
x
Reference in New Issue
Block a user