mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2026-05-23 00:05:20 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6166392515 | |||
| 49d0dead7d | |||
| 6f004830ff |
@@ -866,6 +866,9 @@ class Settings : FragmentedStorageFileJson() {
|
||||
|
||||
@FormField(R.string.enable_polycentric, FieldForm.TOGGLE, R.string.can_be_disabled_when_you_are_experiencing_issues, 3)
|
||||
var polycentricEnabled: Boolean = true;
|
||||
|
||||
@FormField(R.string.polycentric_local_cache, FieldForm.TOGGLE, R.string.polycentric_local_cache_description, 4)
|
||||
var polycentricLocalCache: Boolean = true;
|
||||
}
|
||||
|
||||
@FormField(R.string.gesture_controls, FieldForm.GROUP, -1, 19)
|
||||
|
||||
@@ -834,7 +834,7 @@ class MainActivity : AppCompatActivity, IWithResultLauncher {
|
||||
} else if (StatePlatform.instance.hasEnabledPlaylistClient(url)) {
|
||||
Logger.i(TAG, "handleUrl(url=$url) found playlist client");
|
||||
lifecycleScope.launch(Dispatchers.Main) {
|
||||
navigate(_fragMainPlaylist, url);
|
||||
navigate(_fragMainRemotePlaylist, url);
|
||||
delay(100);
|
||||
_fragVideoDetail.minimizeVideoDetail();
|
||||
};
|
||||
|
||||
+2
-1
@@ -10,6 +10,7 @@ import com.futo.platformplayer.api.media.structures.IPager
|
||||
import com.futo.platformplayer.api.media.structures.ReusablePager
|
||||
import com.futo.platformplayer.getOrThrow
|
||||
import com.futo.platformplayer.models.Playlist
|
||||
import java.util.UUID
|
||||
|
||||
class JSPlaylistDetails: JSPlaylist, IPlatformPlaylistDetails {
|
||||
override val contents: IPager<IPlatformVideo>;
|
||||
@@ -37,6 +38,6 @@ class JSPlaylistDetails: JSPlaylist, IPlatformPlaylistDetails {
|
||||
onProgress?.invoke(videos.size);
|
||||
}
|
||||
|
||||
return Playlist(id.toString(), name, videos.map { SerializedPlatformVideo.fromVideo(it)});
|
||||
return Playlist(UUID.randomUUID().toString(), name, videos.map { SerializedPlatformVideo.fromVideo(it)});
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -70,7 +70,7 @@ class PlaylistFragment : MainFragment() {
|
||||
private var _editPlaylistOverlay: SlideUpMenuOverlay? = null;
|
||||
private var _url: String? = null;
|
||||
|
||||
private val _taskLoadPlaylist: TaskHandler<String, IPlatformPlaylistDetails>;
|
||||
private val _taskLoadPlaylist: TaskHandler<String, Playlist>;
|
||||
|
||||
constructor(fragment: PlaylistFragment, inflater: LayoutInflater) : super(inflater) {
|
||||
_fragment = fragment;
|
||||
@@ -137,16 +137,16 @@ class PlaylistFragment : MainFragment() {
|
||||
);
|
||||
};
|
||||
|
||||
_taskLoadPlaylist = TaskHandler<String, IPlatformPlaylistDetails>(
|
||||
_taskLoadPlaylist = TaskHandler<String, Playlist>(
|
||||
StateApp.instance.scopeGetter,
|
||||
{
|
||||
return@TaskHandler StatePlatform.instance.getPlaylist(it);
|
||||
return@TaskHandler StatePlatform.instance.getPlaylist(it).toPlaylist();
|
||||
})
|
||||
.success {
|
||||
setName(it.name);
|
||||
//TODO: Implement support for pagination
|
||||
setVideos(it.toPlaylist().videos, false);
|
||||
setVideoCount(it.videoCount);
|
||||
setVideos(it.videos, false);
|
||||
setVideoCount(it.videos.size);
|
||||
setLoading(false);
|
||||
}
|
||||
.exception<Throwable> {
|
||||
|
||||
@@ -47,6 +47,7 @@ import com.futo.platformplayer.services.DownloadService
|
||||
import com.futo.platformplayer.stores.FragmentedStorage
|
||||
import com.futo.platformplayer.stores.v2.ManagedStore
|
||||
import com.futo.platformplayer.views.ToastView
|
||||
import com.futo.polycentric.core.ApiMethods
|
||||
import kotlinx.coroutines.*
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
@@ -156,6 +157,7 @@ class StateApp {
|
||||
|
||||
//Files
|
||||
private var _tempDirectory: File? = null;
|
||||
private var _cacheDirectory: File? = null;
|
||||
private var _persistentDirectory: File? = null;
|
||||
|
||||
|
||||
@@ -324,6 +326,9 @@ class StateApp {
|
||||
_tempDirectory?.deleteRecursively();
|
||||
}
|
||||
_tempDirectory?.mkdirs();
|
||||
_cacheDirectory = File(context.filesDir, "cache");
|
||||
if(_cacheDirectory?.exists() == false)
|
||||
_cacheDirectory?.mkdirs();
|
||||
_persistentDirectory = File(context.filesDir, "persist");
|
||||
if(_persistentDirectory?.exists() == false) {
|
||||
_persistentDirectory?.mkdirs();
|
||||
@@ -383,6 +388,11 @@ class StateApp {
|
||||
Logger.i(TAG, "MainApp Starting");
|
||||
initializeFiles(true);
|
||||
|
||||
if(Settings.instance.other.polycentricLocalCache) {
|
||||
Logger.i(TAG, "Initialize Polycentric Disk Cache")
|
||||
_cacheDirectory?.let { ApiMethods.initCache(it) };
|
||||
}
|
||||
|
||||
val logFile = File(context.filesDir, "log.txt");
|
||||
if (Settings.instance.logging.logLevel > LogLevel.NONE.value) {
|
||||
val fileLogConsumer = FileLogConsumer(logFile, LogLevel.fromInt(Settings.instance.logging.logLevel), false);
|
||||
|
||||
@@ -424,6 +424,8 @@
|
||||
<string name="playlist_delete_confirmation">Playlist Delete Confirmation</string>
|
||||
<string name="playlist_delete_confirmation_description">Show confirmation dialog when deleting media from a playlist</string>
|
||||
<string name="enable_polycentric">Enable Polycentric</string>
|
||||
<string name="polycentric_local_cache">Enable Polycentric Local Caching</string>
|
||||
<string name="polycentric_local_cache_description">Caches polycentric results on-device to reduce load times, changing requires app reboot</string>
|
||||
<string name="can_be_disabled_when_you_are_experiencing_issues">Can be disabled when you are experiencing issues</string>
|
||||
<string name="bypass_rotation_prevention_description">Allows for rotation on non-video views.\nWARNING: Not designed for it</string>
|
||||
<string name="bypass_rotation_prevention_warning">This may cause unexpected behavior, and is mostly untested.</string>
|
||||
|
||||
Submodule app/src/stable/assets/sources/bilibili updated: 9dedbca4f2...258c71e4f5
Submodule app/src/stable/assets/sources/patreon updated: 7b66aea99f...9c835e075c
Submodule app/src/stable/assets/sources/soundcloud updated: 3f7c9f8c94...9a10cb8e78
Submodule app/src/stable/assets/sources/twitch updated: 543a727d78...c3ee73a3e5
Submodule app/src/unstable/assets/sources/bilibili updated: 9dedbca4f2...258c71e4f5
Submodule app/src/unstable/assets/sources/patreon updated: 7b66aea99f...9c835e075c
Submodule app/src/unstable/assets/sources/soundcloud updated: 3f7c9f8c94...9a10cb8e78
Submodule app/src/unstable/assets/sources/twitch updated: 543a727d78...c3ee73a3e5
+1
-1
Submodule dep/polycentricandroid updated: f7d58c6ca6...44edd69ece
Reference in New Issue
Block a user