mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-11-02 15:53:55 +01:00
Fix filename conflict issue by appending numbers in parentheses
This commit is contained in:
parent
1e7aabad16
commit
7ba51665b9
3 changed files with 6 additions and 9 deletions
|
|
@ -50,6 +50,7 @@ dependencies {
|
|||
implementation "com.google.android.material:material:1.9.0"
|
||||
implementation 'com.karumi:dexter:5.0.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'androidx.test.uiautomator:uiautomator:2.2.0'
|
||||
|
||||
// Jetpack Compose
|
||||
def composeBom = platform('androidx.compose:compose-bom:2024.08.00')
|
||||
|
|
|
|||
|
|
@ -556,20 +556,16 @@ class UploadWorker(
|
|||
fileName
|
||||
} else {
|
||||
if (fileName.indexOf('.') == -1) {
|
||||
"$fileName $sequenceNumber"
|
||||
"$fileName ($sequenceNumber)"
|
||||
} else {
|
||||
val regex =
|
||||
Pattern.compile("^(.*)(\\..+?)$")
|
||||
val regex = Pattern.compile("^(.*)(\\..+?)$")
|
||||
val regexMatcher = regex.matcher(fileName)
|
||||
regexMatcher.replaceAll("$1 $sequenceNumber$2")
|
||||
regexMatcher.replaceAll("$1 ($sequenceNumber)$2")
|
||||
}
|
||||
}
|
||||
if (!mediaClient
|
||||
.checkPageExistsUsingTitle(
|
||||
String.format(
|
||||
"File:%s",
|
||||
sequenceFileName,
|
||||
),
|
||||
String.format("File:%s", sequenceFileName)
|
||||
).blockingGet()
|
||||
) {
|
||||
break
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ buildscript {
|
|||
maven { url "https://plugins.gradle.org/m2/" }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.5.0'
|
||||
classpath 'com.android.tools.build:gradle:8.6.0'
|
||||
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
|
||||
classpath 'org.codehaus.groovy:groovy-all:2.4.15'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue