mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-26 23:18:17 +03:00
fix: delete duplicate files
This commit is contained in:
parent
c2a89dfdd5
commit
e3301235bf
2 changed files with 0 additions and 44 deletions
|
@ -1,19 +0,0 @@
|
|||
package eu.kanade.tachiyomi.util.storage
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import com.arthenica.ffmpegkit.FFmpegKitConfig
|
||||
import java.io.File
|
||||
|
||||
fun String.toFFmpegString(context: Context): String {
|
||||
return File(this).getUriCompat(context).toFFmpegString(context)
|
||||
}
|
||||
|
||||
fun Uri.toFFmpegString(context: Context): String {
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && this.scheme == "content") {
|
||||
FFmpegKitConfig.getSafParameter(context, this, "rw")
|
||||
} else {
|
||||
this.path!!
|
||||
}.replace("\"", "\\\"")
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
package eu.kanade.tachiyomi.util.storage
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import androidx.core.content.FileProvider
|
||||
import androidx.core.net.toUri
|
||||
import eu.kanade.tachiyomi.BuildConfig
|
||||
import java.io.File
|
||||
|
||||
val Context.cacheImageDir: File
|
||||
get() = File(cacheDir, "shared_image")
|
||||
|
||||
/**
|
||||
* Returns the uri of a file
|
||||
*
|
||||
* @param context context of application
|
||||
*/
|
||||
fun File.getUriCompat(context: Context): Uri {
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".provider", this)
|
||||
} else {
|
||||
this.toUri()
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue