Parcourir la source

Fixed book images with hyphen in title

sirekanian il y a 2 ans
Parent
commit
da994ef5c9

+ 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"