Skip to content

Commit e627301

Browse files
committed
Fix imports
1 parent 775f0b3 commit e627301

File tree

13 files changed

+34
-34
lines changed

13 files changed

+34
-34
lines changed

app/src/main/java/com/melonhead/mangadexfollower/App.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class App: Application() {
5656
override fun onStop(owner: LifecycleOwner) {
5757
super.onStop(owner)
5858
inForeground = false
59-
com.melonhead.lib_logging.Clog.i("onStop: Creating background task")
59+
Clog.i("onStop: Creating background task")
6060
val refreshWorkRequest = PeriodicWorkRequestBuilder<RefreshWorker>(15.minutes.toJavaDuration()).build()
6161
WorkManager.getInstance(this@App).enqueueUniquePeriodicWork("refresh-task", ExistingPeriodicWorkPolicy.KEEP, refreshWorkRequest)
6262
}

app/src/main/java/com/melonhead/mangadexfollower/extensions/HttpClientExtensions.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import io.ktor.client.statement.*
88
import kotlin.random.Random
99

1010
suspend inline fun <reified T> HttpClient.catching(logMessage: String, function: HttpClient.() -> HttpResponse): T? {
11-
com.melonhead.lib_logging.Clog.i(logMessage)
11+
Clog.i(logMessage)
1212
var response: HttpResponse? = null
1313
return try {
1414
response = function()
@@ -21,14 +21,14 @@ suspend inline fun <reified T> HttpClient.catching(logMessage: String, function:
2121
App.authFailed()
2222
}
2323
} else {
24-
com.melonhead.lib_logging.Clog.e("$logMessage: ${response?.bodyAsText() ?: ""}", e)
24+
Clog.e("$logMessage: ${response?.bodyAsText() ?: ""}", e)
2525
}
2626
null
2727
}
2828
}
2929

3030
suspend inline fun HttpClient.catchingSuccess(logMessage: String, function: HttpClient.() -> HttpResponse): Boolean {
31-
com.melonhead.lib_logging.Clog.i(logMessage)
31+
Clog.i(logMessage)
3232
var response: HttpResponse? = null
3333
return try {
3434
response = function()
@@ -41,7 +41,7 @@ suspend inline fun HttpClient.catchingSuccess(logMessage: String, function: Http
4141
App.authFailed()
4242
}
4343
} else {
44-
com.melonhead.lib_logging.Clog.e("$logMessage: ${response?.bodyAsText() ?: ""}", e)
44+
Clog.e("$logMessage: ${response?.bodyAsText() ?: ""}", e)
4545
}
4646
false
4747
}

app/src/main/java/com/melonhead/mangadexfollower/models/shared/PaginatedResponse.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ suspend inline fun <reified T> handlePagination(
2121
if (fetchAll) total = response.total
2222
response.data
2323
} catch (e: Exception) {
24-
com.melonhead.lib_logging.Clog.e("handlePagination: ${result.bodyAsText()}", e)
24+
Clog.e("handlePagination: ${result.bodyAsText()}", e)
2525
break
2626
}
2727
allItems.addAll(items)

app/src/main/java/com/melonhead/mangadexfollower/notifications/AuthFailedNotification.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ object AuthFailedNotification {
4848

4949
val notificationManager = NotificationManagerCompat.from(context)
5050

51-
com.melonhead.lib_logging.Clog.i("postAuthFailed: Auth failed")
51+
Clog.i("postAuthFailed: Auth failed")
5252
val notification = buildNotification(context)
5353
notificationManager.notify(Random.nextInt(), notification)
5454
}

app/src/main/java/com/melonhead/mangadexfollower/notifications/NewChapterNotification.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ object NewChapterNotification {
6464

6565
val notificationManager = NotificationManagerCompat.from(context)
6666

67-
com.melonhead.lib_logging.Clog.i("post: New chapters for ${series.count()} manga")
67+
Clog.i("post: New chapters for ${series.count()} manga")
6868
series.forEach { manga ->
6969
manga.chapters.filter { it.createdDate >= installDateSeconds }.forEach chapters@{ uiChapter ->
7070
val pendingIntent = pendingIntent(context, manga, uiChapter) ?: return@chapters

app/src/main/java/com/melonhead/mangadexfollower/repositories/AuthRepository.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class AuthRepository(
3434

3535
suspend fun refreshToken(logoutOnFail: Boolean = false): AuthToken? {
3636
suspend fun signOut() {
37-
com.melonhead.lib_logging.Clog.e("Signing out, refresh failed", Exception())
37+
Clog.e("Signing out, refresh failed", Exception())
3838
mutableIsLoggedIn.value = LoginStatus.LoggedOut
3939
if ((appContext as App).inForeground) return
4040
val notificationManager = NotificationManagerCompat.from(appContext)
@@ -56,14 +56,14 @@ class AuthRepository(
5656
val userResponse = userService.getInfo(newToken)
5757
val userId = userResponse?.data?.id
5858
if (userId == null) {
59-
com.melonhead.lib_logging.Clog.e("User info returned null", RuntimeException())
59+
Clog.e("User info returned null", RuntimeException())
6060
}
6161
appDataService.updateUserId(userId ?: "")
6262
}
6363
return newToken
6464
}
6565
suspend fun authenticate(email: String, password: String) {
66-
com.melonhead.lib_logging.Clog.i("authenticate")
66+
Clog.i("authenticate")
6767
mutableIsLoggedIn.value = LoginStatus.LoggingIn
6868
val token = loginService.authenticate(email, password)
6969
appDataService.updateToken(token)

app/src/main/java/com/melonhead/mangadexfollower/repositories/MangaRepository.kt

+6-6
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,19 @@ class MangaRepository(
8787
// refresh auth
8888
val token = authRepository.refreshToken()
8989
if (token == null) {
90-
com.melonhead.lib_logging.Clog.i("Failed to refresh token")
90+
Clog.i("Failed to refresh token")
9191
return@launch
9292
}
9393

94-
com.melonhead.lib_logging.Clog.i("refreshManga")
94+
Clog.i("refreshManga")
9595

9696
mutableRefreshStatus.value = Following
9797
// fetch chapters from server
9898
val chaptersResponse = userService.getFollowedChapters(token)
9999
val chapterEntities = chaptersResponse.map { ChapterEntity.from(it) }
100100
val newChapters = chapterEntities.filter { !chapterDb.containsChapter(it.id) }
101101

102-
com.melonhead.lib_logging.Clog.i("New chapters: ${newChapters.count()}")
102+
Clog.i("New chapters: ${newChapters.count()}")
103103

104104
if (newChapters.isNotEmpty()) {
105105
mutableRefreshStatus.value = MangaSeries
@@ -111,7 +111,7 @@ class MangaRepository(
111111

112112
// fetch manga series
113113
val newMangaIds = mangaIds.filter { !mangaDb.containsManga(it) }
114-
com.melonhead.lib_logging.Clog.i("New manga: ${newMangaIds.count()}")
114+
Clog.i("New manga: ${newMangaIds.count()}")
115115

116116
if (newMangaIds.isNotEmpty()) {
117117
val newMangaSeries = mangaService.getManga(token, newMangaIds.toList())
@@ -135,7 +135,7 @@ class MangaRepository(
135135
val notificationManager = NotificationManagerCompat.from(appContext)
136136
if (!notificationManager.areNotificationsEnabled()) return
137137
val installDateSeconds = appDataService.installDateSeconds.firstOrNull() ?: 0L
138-
com.melonhead.lib_logging.Clog.i("notifyOfNewChapters")
138+
Clog.i("notifyOfNewChapters")
139139

140140
val newChapters = chapterDb.getAllSync().filter { readMarkerDb.isRead(it.mangaId, it.chapter) != true }
141141
val manga = mangaDb.getAllSync()
@@ -146,7 +146,7 @@ class MangaRepository(
146146
private suspend fun refreshReadStatus() {
147147
// make sure we have a token
148148
val token = appDataService.token.firstOrNull() ?: return
149-
com.melonhead.lib_logging.Clog.i("refreshReadStatus")
149+
Clog.i("refreshReadStatus")
150150
val manga = mangaDb.getAllSync()
151151
val chapters = chapterDb.getAllSync()
152152

app/src/main/java/com/melonhead/mangadexfollower/services/AtHomeService.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class AtHomeServiceImpl(
2323
authToken: AuthToken,
2424
chapterId: String
2525
): AtHomeChapterResponse? {
26-
com.melonhead.lib_logging.Clog.i("getChapterData: $chapterId")
26+
Clog.i("getChapterData: $chapterId")
2727
return client.catching("getChapterData") {
2828
client.get(CHAPTER_DATA_URL + chapterId) {
2929
headers {

app/src/main/java/com/melonhead/mangadexfollower/services/LoginService.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class LoginServiceImpl(
4545
val response: AuthResponse? = result.body()
4646
if (response?.result == "ok") response.token else null
4747
} catch (e: Exception) {
48-
com.melonhead.lib_logging.Clog.w(e.localizedMessage ?: "Unknown error")
48+
Clog.w(e.localizedMessage ?: "Unknown error")
4949
if (logoutOnFail) null else token
5050
}
5151
}

app/src/main/java/com/melonhead/mangadexfollower/services/MangaService.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class MangaServiceImpl(
2929
private val client: HttpClient,
3030
): MangaService {
3131
override suspend fun getManga(token: AuthToken, mangaIds: List<String>): List<Manga> {
32-
com.melonhead.lib_logging.Clog.i("getManga: ${mangaIds.count()}")
32+
Clog.i("getManga: ${mangaIds.count()}")
3333
val result: List<Manga?> = handlePagination(mangaIds.count()) { offset ->
3434
client.catching("getManga") {
3535
client.get(MANGA_URL) {
@@ -50,10 +50,10 @@ class MangaServiceImpl(
5050
}
5151

5252
override suspend fun getReadChapters(token: AuthToken, mangaIds: List<String>): List<String> {
53-
com.melonhead.lib_logging.Clog.i("getReadChapters: total ${mangaIds.count()}")
53+
Clog.i("getReadChapters: total ${mangaIds.count()}")
5454
val allChapters = mutableListOf<String>()
5555
mangaIds.chunked(100).map { list ->
56-
com.melonhead.lib_logging.Clog.i("getReadChapters: chunked ${list.count()}")
56+
Clog.i("getReadChapters: chunked ${list.count()}")
5757
val result: MangaReadMarkersResponse? = client.catching("getReadChapters") {
5858
client.get(MANGA_READ_MARKERS_URL) {
5959
headers {
@@ -74,7 +74,7 @@ class MangaServiceImpl(
7474
}
7575

7676
override suspend fun changeReadStatus(token: AuthToken, uiManga: UIManga, uiChapter: UIChapter, readStatus: Boolean) {
77-
com.melonhead.lib_logging.Clog.i("changeReadStatus: chapter ${uiChapter.title} readStatus $readStatus")
77+
Clog.i("changeReadStatus: chapter ${uiChapter.title} readStatus $readStatus")
7878
client.catchingSuccess("changeReadStatus") {
7979
client.post(MANGA_READ_CHAPTER_MARKERS_URL.replace(ID_PLACEHOLDER, uiManga.id)) {
8080
headers {

app/src/main/java/com/melonhead/mangadexfollower/services/UserService.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class UserServiceImpl(
2121
private val client: HttpClient
2222
): UserService {
2323
override suspend fun getFollowedChapters(token: AuthToken): List<Chapter> {
24-
com.melonhead.lib_logging.Clog.i("getFollowedChapters")
24+
Clog.i("getFollowedChapters")
2525
return handlePagination(50, fetchAll = false) { offset ->
2626
client.catching("getFollowedChapters") {
2727
client.get(HttpRoutes.USER_FOLLOW_CHAPTERS_URL) {
@@ -41,7 +41,7 @@ class UserServiceImpl(
4141
}
4242

4343
override suspend fun getInfo(token: AuthToken): UserResponse? {
44-
com.melonhead.lib_logging.Clog.i("Get user")
44+
Clog.i("Get user")
4545
return client.catching("getInfo") {
4646
client.get(HttpRoutes.USER_ME_URL) {
4747
headers {

app/src/main/java/com/melonhead/mangadexfollower/ui/scenes/chapter_reader/native_chapter_reader/ChapterScreen.kt

+8-8
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ internal fun ChapterScreen(
5050

5151
LaunchedEffect(key1 = allPages) {
5252
val preloadPages = 2
53-
com.melonhead.lib_logging.Clog.i("First page - Preloading pages 1 - ${1 + preloadPages}")
53+
Clog.i("First page - Preloading pages 1 - ${1 + preloadPages}")
5454
allPages.slice(min(1, allPages.count() - 1)..min((1 + preloadPages), allPages.count() - 1)).forEach { page ->
5555
preloadImage(page, allPages.indexOf(page))
5656
}
@@ -67,7 +67,7 @@ internal fun ChapterScreen(
6767
val nextPreloadIndex = currentPageIndex + 2
6868
val start = min(nextPreloadIndex, totalPages - 1)
6969
val end = min(totalPages - 1, nextPreloadIndex + 1)
70-
com.melonhead.lib_logging.Clog.i("Next page - Current Page $currentPageIndex, moving to ${currentPageIndex + 1} Preloading pages $start - $end")
70+
Clog.i("Next page - Current Page $currentPageIndex, moving to ${currentPageIndex + 1} Preloading pages $start - $end")
7171
allPages.slice(start..end).forEach {
7272
preloadImage(it, allPages.indexOf(it))
7373
}
@@ -157,7 +157,7 @@ private fun ChapterView(
157157
val (width, height) = getWidthHeight()
158158
SubcomposeAsyncImage(
159159
model = currentPageUrl.preloadImageRequest(pageIndex = currentPageIndex, LocalContext.current, width, height, retryHash) {
160-
com.melonhead.lib_logging.Clog.i("Retrying due to load failure")
160+
Clog.i("Retrying due to load failure")
161161
retryHash = !retryHash
162162
},
163163
loading = {
@@ -193,17 +193,17 @@ private fun String.preloadImageRequest(pageIndex: Int, context: Context, width:
193193
.crossfade(true)
194194
.listener(
195195
onStart = {
196-
com.melonhead.lib_logging.Clog.i("Image Load start: page $pageIndex")
196+
Clog.i("Image Load start: page $pageIndex")
197197
},
198198
onCancel = {
199-
com.melonhead.lib_logging.Clog.i("Image Load cancel: page $pageIndex")
199+
Clog.i("Image Load cancel: page $pageIndex")
200200
},
201201
onSuccess = { _, result ->
202-
com.melonhead.lib_logging.Clog.i("Image Load success: Source ${result.dataSource.name}, page $pageIndex")
202+
Clog.i("Image Load success: Source ${result.dataSource.name}, page $pageIndex")
203203
},
204204
onError = { _, result ->
205-
com.melonhead.lib_logging.Clog.i("Image Load failed: page $pageIndex")
206-
com.melonhead.lib_logging.Clog.e("Image Load failed", result.throwable)
205+
Clog.i("Image Load failed: page $pageIndex")
206+
Clog.e("Image Load failed", result.throwable)
207207
onError()
208208
}
209209
)

app/src/main/java/com/melonhead/mangadexfollower/ui/viewmodels/ChapterViewModel.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ChapterViewModel(
4444
if (!manga.useWebview) {
4545
mangaRepository.setUseWebview(manga, true)
4646
}
47-
com.melonhead.lib_logging.Clog.i("Falling back to webview")
47+
Clog.i("Falling back to webview")
4848
// fallback to secondary render style
4949
val intent = WebViewActivity.newIntent(activity, chapter, manga)
5050
activity.finish()

0 commit comments

Comments
 (0)