style: reformat code

This commit is contained in:
junkfood 2024-03-08 16:26:30 +08:00
parent d40743d5ff
commit 6b29a810ba
No known key found for this signature in database
GPG Key ID: 2EA5B648DB112A34

View File

@ -133,7 +133,8 @@ class FeverRssService @Inject constructor(
* 3. Fetch the Fever articles
* 4. Synchronize read/unread and starred/un-starred items
*/
override suspend fun sync(coroutineWorker: CoroutineWorker): ListenableWorker.Result = supervisorScope {
override suspend fun sync(coroutineWorker: CoroutineWorker): ListenableWorker.Result =
supervisorScope {
coroutineWorker.setProgress(SyncWorker.setIsSyncing(true))
try {
@ -165,7 +166,8 @@ class FeverRssService @Inject constructor(
}
// Fetch the Fever favicons
val faviconsById = feverAPI.getFavicons().favicons?.associateBy { it.id } ?: emptyMap()
val faviconsById =
feverAPI.getFavicons().favicons?.associateBy { it.id } ?: emptyMap()
feedDao.insertOrUpdate(
feedsBody.feeds?.map {
Feed(
@ -201,7 +203,8 @@ class FeverRssService @Inject constructor(
title = it.title.decodeHTML() ?: context.getString(R.string.empty),
author = it.author,
rawDescription = it.html ?: "",
shortDescription = Readability.parseToText(it.html, it.url).take(110),
shortDescription = Readability.parseToText(it.html, it.url)
.take(110),
fullContent = it.html,
img = rssHelper.findImg(it.html ?: ""),
link = it.url ?: "",
@ -234,7 +237,11 @@ class FeverRssService @Inject constructor(
articleDao.markAsReadByArticleId(accountId, meta.id, shouldBeUnread ?: true)
}
if (meta.isStarred != shouldBeStarred) {
articleDao.markAsStarredByArticleId(accountId, meta.id, shouldBeStarred ?: false)
articleDao.markAsStarredByArticleId(
accountId,
meta.id,
shouldBeStarred ?: false
)
}
}