Skip to content

Commit 77b1886

Browse files
committed
fix:localImage
1 parent efa24dc commit 77b1886

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plugins {
1313
}
1414

1515
group = "com.hcyacg"
16-
version = "1.7.4"
16+
version = "1.7.4-fix"
1717

1818
repositories {
1919
// mavenLocal()

src/main/kotlin/com/hcyacg/Pixiv.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object Pixiv : KotlinPlugin(
3232
JvmPluginDescription(
3333
id = "com.hcyacg.pixiv",
3434
name = "pixiv插画",
35-
version = "1.7.4-future-2",
35+
version = "1.7.4",
3636
) {
3737
author("Nekoer")
3838
info("""pixiv插画""")

src/main/kotlin/com/hcyacg/sexy/SexyCenter.kt

+6-3
Original file line numberDiff line numberDiff line change
@@ -525,10 +525,13 @@ object SexyCenter {
525525
}
526526
try {
527527
val file = File(Config.localImagePath)
528-
val list = getAllImage(file)
529528

529+
val list = getAllImage(file)
530+
if(list.size == 0){
531+
return
532+
}
530533
val num = 0 until list.size
531-
534+
println(num)
532535
val imageFile = File(list[num.random()])
533536
val input = withContext(Dispatchers.IO) {
534537
FileInputStream(imageFile)
@@ -593,7 +596,7 @@ object SexyCenter {
593596
imageList.addAll(getAllImage(tempFile))
594597
} else {
595598
val type = CheckFileTypeUtil.getFileType(tempFile.path)
596-
if (tempFile.endsWith(".jpg") || tempFile.endsWith(".png") || tempFile.endsWith(".gif")){
599+
if (tempFile.path.endsWith(".jpg") || tempFile.path.endsWith(".png") || tempFile.path.endsWith(".gif")){
597600
if (arrayOf("jpg","png","gif").contains(type)){
598601
imageList.add(tempFile.path)
599602
}else{

0 commit comments

Comments
 (0)