Skip to content

Commit

Permalink
Fix saving videos (#1429)
Browse files Browse the repository at this point in the history
  • Loading branch information
MV-GH committed Mar 8, 2024
1 parent 9baa411 commit 5df3d7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/com/jerboa/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ enum class PostType {
return when (this) {
Image -> Environment.DIRECTORY_PICTURES
Video -> Environment.DIRECTORY_MOVIES
Link -> Environment.DIRECTORY_DOCUMENTS
Link -> Environment.DIRECTORY_DOWNLOADS
}
}
}
Expand Down Expand Up @@ -1453,7 +1453,7 @@ fun Context.getInputStream(url: String): InputStream {

val videoRgx =
Regex(
pattern = "(http)?s?:?(//[^\"']*\\.(?:mp4|mp3|ogg|flv|m4a|3gp|mkv|mpeg|mov))",
pattern = "(http)?s?:?(//[^\"']*\\.(?:mp4|mp3|ogg|flv|m4a|3gp|mkv|mpeg|mov|webm))",
)

fun isVideo(url: String): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ fun ViewerHeader(
IconButton(
// TODO disable once it is busy
onClick = {
storeMedia(appState.coroutineScope, ctx, url, PostType.Image)
storeMedia(appState.coroutineScope, ctx, url, PostType.fromURL(url))
},
) {
Icon(
Expand Down

0 comments on commit 5df3d7b

Please sign in to comment.