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.google.android.material:material:1.9.0"
|
||||||
implementation 'com.karumi:dexter:5.0.0'
|
implementation 'com.karumi:dexter:5.0.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||||
|
implementation 'androidx.test.uiautomator:uiautomator:2.2.0'
|
||||||
|
|
||||||
// Jetpack Compose
|
// Jetpack Compose
|
||||||
def composeBom = platform('androidx.compose:compose-bom:2024.08.00')
|
def composeBom = platform('androidx.compose:compose-bom:2024.08.00')
|
||||||
|
|
|
||||||
|
|
@ -556,20 +556,16 @@ class UploadWorker(
|
||||||
fileName
|
fileName
|
||||||
} else {
|
} else {
|
||||||
if (fileName.indexOf('.') == -1) {
|
if (fileName.indexOf('.') == -1) {
|
||||||
"$fileName $sequenceNumber"
|
"$fileName ($sequenceNumber)"
|
||||||
} else {
|
} else {
|
||||||
val regex =
|
val regex = Pattern.compile("^(.*)(\\..+?)$")
|
||||||
Pattern.compile("^(.*)(\\..+?)$")
|
|
||||||
val regexMatcher = regex.matcher(fileName)
|
val regexMatcher = regex.matcher(fileName)
|
||||||
regexMatcher.replaceAll("$1 $sequenceNumber$2")
|
regexMatcher.replaceAll("$1 ($sequenceNumber)$2")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!mediaClient
|
if (!mediaClient
|
||||||
.checkPageExistsUsingTitle(
|
.checkPageExistsUsingTitle(
|
||||||
String.format(
|
String.format("File:%s", sequenceFileName)
|
||||||
"File:%s",
|
|
||||||
sequenceFileName,
|
|
||||||
),
|
|
||||||
).blockingGet()
|
).blockingGet()
|
||||||
) {
|
) {
|
||||||
break
|
break
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ buildscript {
|
||||||
maven { url "https://plugins.gradle.org/m2/" }
|
maven { url "https://plugins.gradle.org/m2/" }
|
||||||
}
|
}
|
||||||
dependencies {
|
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 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
|
||||||
classpath 'org.codehaus.groovy:groovy-all:2.4.15'
|
classpath 'org.codehaus.groovy:groovy-all:2.4.15'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue