-
Notifications
You must be signed in to change notification settings - Fork 876
Fix bugs related VLC external app not found and Downloads crash the a… #2783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,41 @@ | |
| android:name="android.permission.QUERY_ALL_PACKAGES" | ||
| tools:ignore="QueryAllPackagesPermission" /> | ||
|
|
||
| <queries> | ||
| <!-- For external video players --> | ||
| <intent> | ||
| <action android:name="android.intent.action.VIEW" /> | ||
| <data android:mimeType="video/*" /> | ||
| </intent> | ||
| <intent> | ||
| <action android:name="android.intent.action.VIEW" /> | ||
| <data android:mimeType="application/x-mpegURL" /> | ||
| </intent> | ||
| <intent> | ||
| <action android:name="android.intent.action.VIEW" /> | ||
| <data android:mimeType="application/vnd.apple.mpegurl" /> | ||
| </intent> | ||
| <intent> | ||
| <action android:name="android.intent.action.VIEW" /> | ||
| <data android:scheme="magnet" /> | ||
| </intent> | ||
|
|
||
| <!-- Common players --> | ||
| <package android:name="org.videolan.vlc" /> | ||
| <package android:name="org.videolan.vlc.debug" /> | ||
| <package android:name="is.xyz.mpv" /> | ||
| <package android:name="is.xyz.mpv.ext" /> | ||
| <package android:name="is.xyz.mpv.kt" /> | ||
| <package android:name="is.xyz.mpv.kt.preview" /> | ||
| <package android:name="com.brouken.player" /> | ||
| <package android:name="com.nextplayer.pro" /> | ||
| <package android:name="com.instantbits.cast.webvideo" /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only use players we have included in the app. See https://github.com/recloudstream/cloudstream/tree/master/app/src/main/java/com/lagradost/cloudstream3/actions/temp |
||
|
|
||
| <!-- Torrent clients --> | ||
| <package android:name="org.proninyaroslav.libretorrent" /> | ||
| <package android:name="com.biglybt.android.client" /> | ||
| </queries> | ||
|
|
||
| <!-- Fixes android tv fuckery --> | ||
| <uses-feature | ||
| android:name="android.hardware.touchscreen" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1074,7 +1074,7 @@ object VideoDownloadManager { | |
| ) | ||
|
|
||
| val currentMutex = Mutex() | ||
| val current = (0 until items.size).iterator() | ||
| var currentIndex = 0 | ||
|
|
||
| val fileMutex = Mutex() | ||
| // start to data | ||
|
|
@@ -1169,8 +1169,20 @@ object VideoDownloadManager { | |
|
|
||
| // mutex just in case, we never want this to fail due to multithreading | ||
| val index = currentMutex.withLock { | ||
| if (!current.hasNext()) return@launch | ||
| current.nextInt() | ||
| if (currentIndex >= items.size) return@withLock -1 | ||
| val writtenIndex = | ||
| (metadata.bytesWritten - stream.startAt) / items.chuckSize | ||
| if (currentIndex > writtenIndex + (parallelConnections * 2).coerceAtLeast(5)) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use This check should be placed in |
||
| -2 | ||
| } else { | ||
| currentIndex++ | ||
| } | ||
| } | ||
|
|
||
| if (index == -1) return@launch | ||
| if (index == -2) { | ||
| delay(500) | ||
| continue | ||
| } | ||
|
|
||
| // in case something has gone wrong set to failed if the fail is not caused by | ||
|
|
@@ -1307,7 +1319,7 @@ object VideoDownloadManager { | |
| metadata.type = DownloadType.IsDownloading | ||
|
|
||
| val currentMutex = Mutex() | ||
| val current = (startAt until items.size).iterator() | ||
| var currentIndex = startAt | ||
|
|
||
| val fileMutex = Mutex() | ||
| val pendingData: HashMap<Int, ByteArray> = hashMapOf() | ||
|
|
@@ -1341,8 +1353,18 @@ object VideoDownloadManager { | |
|
|
||
| // mutex just in case, we never want this to fail due to multithreading | ||
| val index = currentMutex.withLock { | ||
| if (!current.hasNext()) return@launch | ||
| current.nextInt() | ||
| if (currentIndex >= items.size) return@withLock -1 | ||
| if (currentIndex > metadata.hlsWrittenProgress + (parallelConnections * 2).coerceAtLeast(5)) { | ||
| -2 | ||
| } else { | ||
| currentIndex++ | ||
| } | ||
| } | ||
|
|
||
| if (index == -1) return@launch | ||
| if (index == -2) { | ||
| delay(500) | ||
| continue | ||
| } | ||
|
|
||
| // in case something has gone wrong set to failed if the fail is not caused by | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| # https://docs.gradle.org/current/userguide/dependency_versions.html#sec:strict-version | ||
| [versions] | ||
| activityKtx = "1.13.0" | ||
| androidGradlePlugin = "9.1.1" | ||
| androidGradlePlugin = "9.0.0" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this, there is no reason to downgrade to 9.0.0. |
||
| animeDb = "1.0.2" | ||
| annotation = "1.10.0" | ||
| appcompat = "1.7.1" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a short comment here explaining why we need queries when we already have QUERY_ALL_PACKAGES.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be something as simple as "QUERY_ALL_PACKAGES does not work on X device running Android Y so we also have to specify the packages we query."