Skip to content

Commit

Permalink
fix: 修复书籍路径bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorqin committed Jul 14, 2022
1 parent 59ec8e3 commit 2f73bfa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ apply(plugin = "kotlin")
apply(plugin = "io.github.fvarrui.javapackager.plugin")

group = "com.htmake"
version = "2.5.5"
version = "2.5.6"

java {
sourceCompatibility = JavaVersion.VERSION_1_8
Expand Down
2 changes: 1 addition & 1 deletion cli.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ apply plugin: 'io.spring.dependency-management'
apply plugin: 'kotlin'

group = 'com.htmake'
version = '2.5.5'
version = '2.5.6'
sourceCompatibility = '1.8'

repositories {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/legado/app/data/entities/Book.kt
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ data class Book(

fun getLocalFile(): File {
if (originName.startsWith(rootDir)) {
originName = originName.replace(rootDir, "")
originName = originName.replace(Regex("^${rootDir}"), "")
}
if (isEpub() && originName.indexOf("localStore") < 0 && originName.indexOf("webdav") < 0) {
// 非本地/webdav书仓的 epub文件
Expand Down Expand Up @@ -280,8 +280,8 @@ data class Book(
if (!rootPath.endsWith(File.separator)) {
rootPath = rootPath + File.separator
}
book.bookUrl = book.bookUrl.replace(rootPath, "")
book.originName = book.originName.replace(rootPath, "")
book.bookUrl = book.bookUrl.replace(Regex("^${rootPath}"), "")
book.originName = book.originName.replace(Regex("^${rootPath}"), "")
book.setRootDir(rootDir)
book.updateFromLocal()
return book
Expand Down
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reader",
"version": "2.5.5",
"version": "2.5.6",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down

0 comments on commit 2f73bfa

Please sign in to comment.