fix #937, set Image as the default file type

This commit is contained in:
tibbi 2018-09-05 12:22:58 +02:00
parent 7c299edcd2
commit ee46cde8f3
4 changed files with 10 additions and 10 deletions

View File

@ -88,11 +88,11 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList
val file = File(mUri.toString())
val filename = getFilenameFromUri(mUri!!)
val type = when {
filename.isImageFast() -> TYPE_IMAGES
filename.isVideoFast() -> TYPE_VIDEOS
filename.isGif() -> TYPE_GIFS
filename.isRawFast() -> TYPE_RAWS
else -> TYPE_SVGS
filename.isSvg() -> TYPE_SVGS
else -> TYPE_IMAGES
}
mMedium = Medium(null, filename, mUri.toString(), mUri!!.path.getParentPath(), 0, 0, file.length(), type, false, 0L)

View File

@ -521,11 +521,11 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
dir_path?.text = "${directory.path.substringBeforeLast("/")}/"
photo_cnt.text = directory.mediaCnt.toString()
val thumbnailType = when {
directory.tmb.isImageFast() -> TYPE_IMAGES
directory.tmb.isVideoFast() -> TYPE_VIDEOS
directory.tmb.isGif() -> TYPE_GIFS
directory.tmb.isRawFast() -> TYPE_RAWS
else -> TYPE_SVGS
directory.tmb.isSvg() -> TYPE_SVGS
else -> TYPE_IMAGES
}
activity.loadImage(thumbnailType, directory.tmb, dir_thumbnail, scrollHorizontally, animateGifs, cropThumbnails)

View File

@ -237,11 +237,11 @@ class MediaFetcher(val context: Context) {
}
val type = when {
isImage -> TYPE_IMAGES
isVideo -> TYPE_VIDEOS
isGif -> TYPE_GIFS
isRaw -> TYPE_RAWS
else -> TYPE_SVGS
isSvg -> TYPE_SVGS
else -> TYPE_IMAGES
}
val isFavorite = favoritePaths.contains(path)
@ -299,11 +299,11 @@ class MediaFetcher(val context: Context) {
val dateModified = file.lastModified()
val type = when {
isImage -> TYPE_IMAGES
isVideo -> TYPE_VIDEOS
isGif -> TYPE_GIFS
isRaw -> TYPE_RAWS
else -> TYPE_SVGS
isSvg -> TYPE_SVGS
else -> TYPE_IMAGES
}
val path = Uri.decode(file.uri.toString().replaceFirst("${context.config.OTGTreeUri}/document/${context.config.OTGPartition}%3A", OTG_PATH))

View File

@ -22,10 +22,10 @@ class RefreshMediaReceiver : BroadcastReceiver() {
}
private fun getFileType(path: String) = when {
path.isImageFast() -> TYPE_IMAGES
path.isVideoFast() -> TYPE_VIDEOS
path.isGif() -> TYPE_GIFS
path.isRawFast() -> TYPE_RAWS
else -> TYPE_SVGS
path.isSvg() -> TYPE_SVGS
else -> TYPE_IMAGES
}
}