Skip to content

Commit ef3a323

Browse files
committed
refactor: rename SDAI to PDAI in code and paths
- Rename log tag [SDAI] -> [PDAI] - Rename log file sdaiv1.log -> pdaiv1.log - Update custom model path SDAI -> PDAI - Rename SdaiWorkerFactory -> PdaiWorkerFactory - Update test stubs naming - Add CHANGES.md with 0.7.0 release notes
1 parent 08bca0e commit ef3a323

10 files changed

Lines changed: 17 additions & 17 deletions

File tree

app/src/main/java/dev/minios/pdaiv1/app/AiStableDiffusionClientApp.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import dev.minios.pdaiv1.domain.di.domainModule
2121
import dev.minios.pdaiv1.network.di.networkModule
2222
import dev.minios.pdaiv1.presentation.di.presentationModule
2323
import dev.minios.pdaiv1.storage.di.databaseModule
24-
import dev.minios.pdaiv1.work.di.SdaiWorkerFactory
24+
import dev.minios.pdaiv1.work.di.PdaiWorkerFactory
2525
import dev.minios.pdaiv1.work.di.backgroundWorkModule
2626
import org.koin.android.ext.android.inject
2727
import org.koin.android.ext.koin.androidContext
@@ -84,7 +84,7 @@ class AiStableDiffusionClientApp : Application() {
8484

8585
private fun initializeWorkManager() {
8686
try {
87-
val workerFactory: SdaiWorkerFactory by inject()
87+
val workerFactory: PdaiWorkerFactory by inject()
8888
val configuration = Configuration.Builder()
8989
.setWorkerFactory(workerFactory)
9090
.build()

core/common/src/main/java/dev/minios/pdaiv1/core/common/file/FileProviderDescriptor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package dev.minios.pdaiv1.core.common.file
22

3-
const val LOCAL_DIFFUSION_CUSTOM_PATH = "/storage/emulated/0/Download/SDAI/model"
3+
const val LOCAL_DIFFUSION_CUSTOM_PATH = "/storage/emulated/0/Download/PDAI/model"
44

55
interface FileProviderDescriptor {
66
val providerPath: String

core/common/src/main/java/dev/minios/pdaiv1/core/common/log/FileLoggingTree.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ class FileLoggingTree : Timber.Tree(), KoinComponent {
8080

8181
companion object {
8282
private const val LOGGER_TIMESTAMP_FORMAT = "dd.MM.yyyy HH:mm:SS"
83-
private const val LOGGER_DEFAULT_TAG = "[SDAI]"
83+
private const val LOGGER_DEFAULT_TAG = "[PDAI]"
8484

85-
const val LOGGER_FILENAME = "sdaiv1.log"
85+
const val LOGGER_FILENAME = "pdaiv1.log"
8686

8787
fun clearLog(fileProviderDescriptor: FileProviderDescriptor) {
8888
val cacheDirectory = File(fileProviderDescriptor.logsCacheDirPath)

core/notification/src/main/java/dev/minios/pdaiv1/core/notification/PushNotificationManagerImpl.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ internal class PushNotificationManagerImpl(
5555
body: UiText?,
5656
block: NotificationCompat.Builder.() -> Unit
5757
): Notification = with(
58-
NotificationCompat.Builder(context, SDAI_NOTIFICATION_CHANNEL_ID)
58+
NotificationCompat.Builder(context, PDAI_NOTIFICATION_CHANNEL_ID)
5959
) {
6060
setSmallIcon(R.drawable.ic_notification)
6161
setContentTitle(title.asString(context))
@@ -76,13 +76,13 @@ internal class PushNotificationManagerImpl(
7676

7777
override fun createNotificationChannel() {
7878
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
79-
if (manager.getNotificationChannel(SDAI_NOTIFICATION_CHANNEL_ID) == null) {
79+
if (manager.getNotificationChannel(PDAI_NOTIFICATION_CHANNEL_ID) == null) {
8080
debugLog("Creating notification channel")
8181

8282
manager.createNotificationChannel(
8383
NotificationChannel(
84-
SDAI_NOTIFICATION_CHANNEL_ID,
85-
"SDAI Notifications",
84+
PDAI_NOTIFICATION_CHANNEL_ID,
85+
"PDAI Notifications",
8686
NotificationManager.IMPORTANCE_HIGH,
8787
).also { channel ->
8888
channel.lockscreenVisibility = Notification.VISIBILITY_PUBLIC
@@ -101,6 +101,6 @@ internal class PushNotificationManagerImpl(
101101
}
102102

103103
companion object {
104-
private const val SDAI_NOTIFICATION_CHANNEL_ID = "SDAI_NOTIFICATION_CHANNEL"
104+
private const val PDAI_NOTIFICATION_CHANNEL_ID = "PDAI_NOTIFICATION_CHANNEL"
105105
}
106106
}

feature/auth/src/main/java/dev/minios/pdaiv1/feature/auth/crypto/CryptoProviderImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ class CryptoProviderImpl(private val context: Context) : CryptoProvider {
2020
private fun getMasterKeyAlias() = MasterKeys.getOrCreate(MasterKeys.AES256_GCM_SPEC)
2121

2222
companion object {
23-
private const val KEY_PREFERENCE_AUTHORIZATION = "sdai_authorization_preference"
23+
private const val KEY_PREFERENCE_AUTHORIZATION = "pdai_authorization_preference"
2424
}
2525
}

feature/work/src/main/java/dev/minios/pdaiv1/work/di/BackgroundWorkModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ val backgroundWorkModule = module {
1818
WorkManagerProvider { WorkManager.getInstance(androidApplication()) }
1919
}
2020

21-
factoryOf(::SdaiWorkerFactory) binds arrayOf(SdaiWorkerFactory::class, WorkerFactory::class)
21+
factoryOf(::PdaiWorkerFactory) binds arrayOf(PdaiWorkerFactory::class, WorkerFactory::class)
2222
singleOf(::BackgroundWorkObserverImpl) bind BackgroundWorkObserver::class
2323
factoryOf(::BackgroundTaskManagerImpl) bind BackgroundTaskManager::class
2424
}

feature/work/src/main/java/dev/minios/pdaiv1/work/di/SdaiWorkerFactory.kt renamed to feature/work/src/main/java/dev/minios/pdaiv1/work/di/PdaiWorkerFactory.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import dev.minios.pdaiv1.work.task.FalAiTask
1919
import dev.minios.pdaiv1.work.task.ImageToImageTask
2020
import dev.minios.pdaiv1.work.task.TextToImageTask
2121

22-
class SdaiWorkerFactory(
22+
class PdaiWorkerFactory(
2323
private val backgroundWorkObserver: BackgroundWorkObserver,
2424
private val pushNotificationManager: PushNotificationManager,
2525
private val preferenceManager: PreferenceManager,

presentation/src/test/java/dev/minios/pdaiv1/presentation/core/CoreGenerationMviViewModelTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ abstract class CoreGenerationMviViewModelTest<V : GenerationMviViewModel<*, *, *
4949
protected val stubMainRouter = mockk<MainRouter>()
5050
protected val stubDrawerRouter = mockk<DrawerRouter>()
5151
protected val stubDimensionValidator = mockk<DimensionValidator>()
52-
protected val stubSdaiPushNotificationManager = mockk<PushNotificationManager>()
52+
protected val stubPdaiPushNotificationManager = mockk<PushNotificationManager>()
5353

5454
protected val stubAcquireWakelockUseCase = mockk<AcquireWakelockUseCase>()
5555
protected val stubReleaseWakelockUseCase = mockk<ReleaseWakeLockUseCase>()

presentation/src/test/java/dev/minios/pdaiv1/presentation/screen/img2img/ImageToImageViewModelTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class ImageToImageViewModelTest : CoreGenerationMviViewModelTest<ImageToImageVie
7070
base64ToBitmapConverter = stubBase64ToBitmapConverter,
7171
preferenceManager = stubPreferenceManager,
7272
schedulersProvider = stubCustomSchedulers,
73-
notificationManager = stubSdaiPushNotificationManager,
73+
notificationManager = stubPdaiPushNotificationManager,
7474
wakeLockInterActor = stubWakeLockInterActor,
7575
inPaintStateProducer = stubInPaintStateProducer,
7676
mainRouter = stubMainRouter,

presentation/src/test/java/dev/minios/pdaiv1/presentation/screen/txt2img/TextToImageViewModelTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class TextToImageViewModelTest : CoreGenerationMviViewModelTest<TextToImageViewM
5454
textToImageUseCase = stubTextToImageUseCase,
5555
schedulersProvider = stubCustomSchedulers,
5656
preferenceManager = stubPreferenceManager,
57-
notificationManager = stubSdaiPushNotificationManager,
57+
notificationManager = stubPdaiPushNotificationManager,
5858
wakeLockInterActor = stubWakeLockInterActor,
5959
backgroundWorkObserver = stubBackgroundWorkObserver,
6060
backgroundTaskManager = stubBackgroundTaskManager,
@@ -436,7 +436,7 @@ class TextToImageViewModelTest : CoreGenerationMviViewModelTest<TextToImageViewM
436436
} returns true
437437

438438
every {
439-
stubSdaiPushNotificationManager.show(any(), any())
439+
stubPdaiPushNotificationManager.show(any(), any())
440440
} returns Unit
441441

442442
every {

0 commit comments

Comments
 (0)