소스 검색

Fixed book images with hyphen in title

sirekanian 2 년 전
부모
커밋
da994ef5c9
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      app/src/main/java/org/sirekanyan/knigopis/common/functions/StringFactory.kt

+ 1 - 1
app/src/main/java/org/sirekanyan/knigopis/common/functions/StringFactory.kt

@@ -12,7 +12,7 @@ fun createUserImageUrl(userId: String) = "$STATIC_API/user/$userId"
 
 fun createBookImageUrl(bookTitle: String): String {
     val normalizedTitle = bookTitle.lowercase()
-        .replace(Regex("\\W+"), "_")
+        .replace(Regex("[^\\w-]+"), "_")
         .replace(Regex("(^_|_$)"), "")
         .replace("ё", "е")
     return "$STATIC_API/book/$normalizedTitle"