Parcourir la source

通过数据库判断压缩文件是否在书架上

Xwite il y a 3 ans
Parent
commit
eeca8b22f2
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      app/src/main/java/io/legado/app/data/dao/BookDao.kt

+ 1 - 1
app/src/main/java/io/legado/app/data/dao/BookDao.kt

@@ -101,7 +101,7 @@ interface BookDao {
     @Query("select 1 from books where bookUrl = :bookUrl")
     @Query("select 1 from books where bookUrl = :bookUrl")
     fun has(bookUrl: String): Boolean?
     fun has(bookUrl: String): Boolean?
 
 
-    @Query("select 1 from books where originName = :fileName or origin = ${BookType.localTag} || '::' || :fileName")
+    @Query("select 1 from books where originName = :fileName or origin like '%' || :fileName")
     fun hasFile(fileName: String): Boolean?
     fun hasFile(fileName: String): Boolean?
 
 
     @Insert(onConflict = OnConflictStrategy.REPLACE)
     @Insert(onConflict = OnConflictStrategy.REPLACE)