File tree Expand file tree Collapse file tree 4 files changed +8
-12
lines changed
android/src/main/kotlin/com/fluttercandies/photo_manager/core/utils Expand file tree Collapse file tree 4 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -653,7 +653,7 @@ object Android30DbUtils : IDBUtils {
653
653
}
654
654
}
655
655
656
- override fun getSomeInfo (context : Context , assetId : String ): Pair <String , String >? {
656
+ override fun getSomeInfo (context : Context , assetId : String ): Pair <String , String ? >? {
657
657
val cr = context.contentResolver
658
658
val cursor = cr.query(
659
659
allUri,
@@ -668,7 +668,7 @@ object Android30DbUtils : IDBUtils {
668
668
}
669
669
val galleryID = cursor.getString(0 )
670
670
val path = cursor.getString(1 )
671
- return Pair (galleryID, File (path).parent!! )
671
+ return Pair (galleryID, File (path).parent)
672
672
}
673
673
}
674
674
Original file line number Diff line number Diff line change @@ -673,7 +673,7 @@ object AndroidQDBUtils : IDBUtils {
673
673
}
674
674
}
675
675
676
- override fun getSomeInfo (context : Context , assetId : String ): Pair <String , String >? {
676
+ override fun getSomeInfo (context : Context , assetId : String ): Pair <String , String ? >? {
677
677
val cursor = context.contentResolver.query(
678
678
allUri,
679
679
arrayOf(BUCKET_ID , RELATIVE_PATH ),
@@ -687,7 +687,7 @@ object AndroidQDBUtils : IDBUtils {
687
687
}
688
688
val galleryID = cursor.getString(0 )
689
689
val path = cursor.getString(1 )
690
- return Pair (galleryID, File (path).parent!! )
690
+ return Pair (galleryID, File (path).parent)
691
691
}
692
692
}
693
693
Original file line number Diff line number Diff line change @@ -664,25 +664,21 @@ object DBUtils : IDBUtils {
664
664
* 0 : gallery id
665
665
* 1 : current asset parent path
666
666
*/
667
- override fun getSomeInfo (context : Context , assetId : String ): Pair <String , String >? {
667
+ override fun getSomeInfo (context : Context , assetId : String ): Pair <String , String ? >? {
668
668
val cursor = context.contentResolver.query(
669
669
allUri,
670
670
arrayOf(MediaStore .Files .FileColumns .BUCKET_ID , MediaStore .Files .FileColumns .DATA ),
671
671
" ${MediaStore .Files .FileColumns ._ID } = ?" ,
672
672
arrayOf(assetId),
673
673
null
674
- )
675
- ? : return null
676
-
674
+ ) ? : return null
677
675
cursor.use {
678
676
if (! cursor.moveToNext()) {
679
677
return null
680
678
}
681
-
682
679
val galleryID = cursor.getString(0 )
683
680
val path = cursor.getString(1 )
684
-
685
- return Pair (galleryID, File (path).parent!! )
681
+ return Pair (galleryID, File (path).parent)
686
682
}
687
683
}
688
684
Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ interface IDBUtils {
358
358
359
359
fun moveToGallery (context : Context , assetId : String , galleryId : String ): AssetEntity ?
360
360
361
- fun getSomeInfo (context : Context , assetId : String ): Pair <String , String >?
361
+ fun getSomeInfo (context : Context , assetId : String ): Pair <String , String ? >?
362
362
363
363
fun getUri (id : String , type : Int , isOrigin : Boolean = false): Uri {
364
364
var uri = when (type) {
You can’t perform that action at this time.
0 commit comments