From 3df41fbe87e538963e949adb838328470cdb0e6e Mon Sep 17 00:00:00 2001 From: shabinder Date: Thu, 30 Jul 2020 15:32:48 +0530 Subject: [PATCH] Updated Removal of Illegal char fun.(Bug-Fixed) --- .../spotiflyer/downloadHelper/DownloadHelper.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt b/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt index 2ae06cf8..022cf581 100644 --- a/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt @@ -166,13 +166,20 @@ object DownloadHelper { '\"', '.', ':', - '-' + '-', + '\'' ) + var name = fileName for (c in illegalCharArray) { name = fileName.replace(c, '_') } name = name.replace("\\s".toRegex(), "_") + name = name.replace("\\)".toRegex(), "") + name = name.replace("\\(".toRegex(), "") + name = name.replace("\\[".toRegex(), "") + name = name.replace("]".toRegex(), "") + name = name.replace("\\.".toRegex(), "") return name } } \ No newline at end of file