Skip to content

Commit

Permalink
normName to handle collapsed folders
Browse files Browse the repository at this point in the history
  • Loading branch information
izderadicka committed Mar 7, 2021
1 parent f4c30bb commit 0c3380e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/main/java/eu/zderadicka/audioserve/data/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,12 @@ fun splitPositionFolder(f: String): Pair<String,Int> {

private val CHAPTER_RE = Regex("""\$\$[\d\-]+\$\$""")
fun normTitle(t:String): String {
return CHAPTER_RE.replace(t, "")
var res = t
val idx = res.indexOf(">>")
if (idx >= 0) {
res = res.substring(idx+2)
}
return CHAPTER_RE.replace(res, "")
}

fun MediaBrowserCompat.MediaItem.isNotablyDifferentFrom(other: MediaBrowserCompat.MediaItem): Boolean =
Expand Down

0 comments on commit 0c3380e

Please sign in to comment.