mirror of
https://github.com/mihonapp/mihon.git
synced 2025-07-27 09:55:53 +02:00
Compare commits
4 Commits
eb6092bd0c
...
788235feec
Author | SHA1 | Date | |
---|---|---|---|
788235feec | |||
afa5002988 | |||
9503082d44 | |||
de36357da8 |
1
.github/workflows/build_pull_request.yml
vendored
1
.github/workflows/build_pull_request.yml
vendored
@ -2,6 +2,7 @@ name: PR build check
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!i18n/src/commonMain/moko-resources/**/strings.xml'
|
||||
- '!i18n/src/commonMain/moko-resources/**/plurals.xml'
|
||||
|
22
.gitignore
vendored
22
.gitignore
vendored
@ -1,18 +1,16 @@
|
||||
# Build files
|
||||
.gradle
|
||||
.kotlin
|
||||
/local.properties
|
||||
/.idea/workspace.xml
|
||||
.DS_Store
|
||||
build
|
||||
|
||||
# IDE files
|
||||
*.iml
|
||||
.idea/*
|
||||
!.idea/icon.png
|
||||
*iml
|
||||
*.iml
|
||||
/captures
|
||||
|
||||
# Built files
|
||||
*/build
|
||||
/build
|
||||
*.apk
|
||||
app/**/output.json
|
||||
# Configuration files
|
||||
local.properties
|
||||
|
||||
# Unnecessary file
|
||||
*.swp
|
||||
# macOS specific files
|
||||
.DS_Store
|
||||
|
3
app/.gitignore
vendored
3
app/.gitignore
vendored
@ -1,3 +0,0 @@
|
||||
/build
|
||||
*iml
|
||||
*.iml
|
@ -45,8 +45,8 @@ fun ReaderAppBars(
|
||||
onClickTopAppBar: () -> Unit,
|
||||
bookmarked: Boolean,
|
||||
onToggleBookmarked: () -> Unit,
|
||||
onOpenInBrowser: (() -> Unit)?,
|
||||
onOpenInWebView: (() -> Unit)?,
|
||||
onOpenInBrowser: (() -> Unit)?,
|
||||
onShare: (() -> Unit)?,
|
||||
|
||||
viewer: Viewer?,
|
||||
@ -120,14 +120,6 @@ fun ReaderAppBars(
|
||||
onClick = onToggleBookmarked,
|
||||
),
|
||||
)
|
||||
onOpenInBrowser?.let {
|
||||
add(
|
||||
AppBar.OverflowAction(
|
||||
title = stringResource(MR.strings.action_open_in_browser),
|
||||
onClick = it,
|
||||
),
|
||||
)
|
||||
}
|
||||
onOpenInWebView?.let {
|
||||
add(
|
||||
AppBar.OverflowAction(
|
||||
@ -136,6 +128,14 @@ fun ReaderAppBars(
|
||||
),
|
||||
)
|
||||
}
|
||||
onOpenInBrowser?.let {
|
||||
add(
|
||||
AppBar.OverflowAction(
|
||||
title = stringResource(MR.strings.action_open_in_browser),
|
||||
onClick = it,
|
||||
),
|
||||
)
|
||||
}
|
||||
onShare?.let {
|
||||
add(
|
||||
AppBar.OverflowAction(
|
||||
|
@ -27,6 +27,7 @@ import tachiyomi.core.common.util.system.logcat
|
||||
import tachiyomi.domain.backup.service.BackupPreferences
|
||||
import tachiyomi.domain.manga.interactor.GetFavorites
|
||||
import tachiyomi.domain.manga.model.Manga
|
||||
import tachiyomi.domain.manga.repository.MangaRepository
|
||||
import tachiyomi.i18n.MR
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
@ -43,6 +44,7 @@ class BackupCreator(
|
||||
private val parser: ProtoBuf = Injekt.get(),
|
||||
private val getFavorites: GetFavorites = Injekt.get(),
|
||||
private val backupPreferences: BackupPreferences = Injekt.get(),
|
||||
private val mangaRepository: MangaRepository = Injekt.get(),
|
||||
|
||||
private val categoriesBackupCreator: CategoriesBackupCreator = CategoriesBackupCreator(),
|
||||
private val mangaBackupCreator: MangaBackupCreator = MangaBackupCreator(),
|
||||
@ -75,7 +77,9 @@ class BackupCreator(
|
||||
throw IllegalStateException(context.stringResource(MR.strings.create_backup_file_error))
|
||||
}
|
||||
|
||||
val backupManga = backupMangas(getFavorites.await(), options)
|
||||
val nonFavoriteManga = if (options.readEntries) mangaRepository.getReadMangaNotInLibrary() else emptyList()
|
||||
val backupManga = backupMangas(getFavorites.await() + nonFavoriteManga, options)
|
||||
|
||||
val backup = Backup(
|
||||
backupManga = backupManga,
|
||||
backupCategories = backupCategories(options),
|
||||
|
@ -10,6 +10,7 @@ data class BackupOptions(
|
||||
val chapters: Boolean = true,
|
||||
val tracking: Boolean = true,
|
||||
val history: Boolean = true,
|
||||
val readEntries: Boolean = true,
|
||||
val appSettings: Boolean = true,
|
||||
val extensionRepoSettings: Boolean = true,
|
||||
val sourceSettings: Boolean = true,
|
||||
@ -22,6 +23,7 @@ data class BackupOptions(
|
||||
chapters,
|
||||
tracking,
|
||||
history,
|
||||
readEntries,
|
||||
appSettings,
|
||||
extensionRepoSettings,
|
||||
sourceSettings,
|
||||
@ -60,6 +62,12 @@ data class BackupOptions(
|
||||
getter = BackupOptions::categories,
|
||||
setter = { options, enabled -> options.copy(categories = enabled) },
|
||||
),
|
||||
Entry(
|
||||
label = MR.strings.non_library_settings,
|
||||
getter = BackupOptions::readEntries,
|
||||
setter = { options, enabled -> options.copy(readEntries = enabled) },
|
||||
enabled = { it.libraryEntries },
|
||||
),
|
||||
)
|
||||
|
||||
val settingsOptions = persistentListOf(
|
||||
@ -92,10 +100,11 @@ data class BackupOptions(
|
||||
chapters = array[2],
|
||||
tracking = array[3],
|
||||
history = array[4],
|
||||
appSettings = array[5],
|
||||
extensionRepoSettings = array[6],
|
||||
sourceSettings = array[7],
|
||||
privateSettings = array[8],
|
||||
readEntries = array[5],
|
||||
appSettings = array[6],
|
||||
extensionRepoSettings = array[7],
|
||||
sourceSettings = array[8],
|
||||
privateSettings = array[9],
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -390,8 +390,8 @@ class ReaderActivity : BaseActivity() {
|
||||
onClickTopAppBar = ::openMangaScreen,
|
||||
bookmarked = state.bookmarked,
|
||||
onToggleBookmarked = viewModel::toggleChapterBookmark,
|
||||
onOpenInBrowser = ::openChapterInBrowser.takeIf { isHttpSource },
|
||||
onOpenInWebView = ::openChapterInWebView.takeIf { isHttpSource },
|
||||
onOpenInBrowser = ::openChapterInBrowser.takeIf { isHttpSource },
|
||||
onShare = ::shareChapter.takeIf { isHttpSource },
|
||||
|
||||
viewer = state.viewer,
|
||||
@ -565,12 +565,6 @@ class ReaderActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun openChapterInBrowser() {
|
||||
assistUrl?.let {
|
||||
openInBrowser(it.toUri(), forceDefaultBrowser = false)
|
||||
}
|
||||
}
|
||||
|
||||
private fun openChapterInWebView() {
|
||||
val manga = viewModel.manga ?: return
|
||||
val source = viewModel.getSource() ?: return
|
||||
@ -580,6 +574,12 @@ class ReaderActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun openChapterInBrowser() {
|
||||
assistUrl?.let {
|
||||
openInBrowser(it.toUri(), forceDefaultBrowser = false)
|
||||
}
|
||||
}
|
||||
|
||||
private fun shareChapter() {
|
||||
assistUrl?.let {
|
||||
val intent = it.toUri().toShareIntent(this, type = "text/plain")
|
||||
|
1
buildSrc/.gitignore
vendored
1
buildSrc/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
1
core-metadata/.gitignore
vendored
1
core-metadata/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
1
core/archive/.gitignore
vendored
1
core/archive/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
1
core/common/.gitignore
vendored
1
core/common/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
1
data/.gitignore
vendored
1
data/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
@ -49,6 +49,10 @@ class MangaRepositoryImpl(
|
||||
return handler.awaitList { mangasQueries.getFavorites(MangaMapper::mapManga) }
|
||||
}
|
||||
|
||||
override suspend fun getReadMangaNotInLibrary(): List<Manga> {
|
||||
return handler.awaitList { mangasQueries.getReadMangaNotInLibrary(MangaMapper::mapManga) }
|
||||
}
|
||||
|
||||
override suspend fun getLibraryManga(): List<LibraryManga> {
|
||||
return handler.awaitList { libraryViewQueries.library(MangaMapper::mapLibraryManga) }
|
||||
}
|
||||
|
@ -78,6 +78,15 @@ SELECT *
|
||||
FROM mangas
|
||||
WHERE favorite = 1;
|
||||
|
||||
getReadMangaNotInLibrary:
|
||||
SELECT *
|
||||
FROM mangas
|
||||
WHERE favorite = 0 AND _id IN (
|
||||
SELECT DISTINCT chapters.manga_id
|
||||
FROM chapters
|
||||
WHERE read = 1 OR last_page_read != 0
|
||||
);
|
||||
|
||||
getAllManga:
|
||||
SELECT *
|
||||
FROM mangas;
|
||||
|
1
domain/.gitignore
vendored
1
domain/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
@ -17,6 +17,8 @@ interface MangaRepository {
|
||||
|
||||
suspend fun getFavorites(): List<Manga>
|
||||
|
||||
suspend fun getReadMangaNotInLibrary(): List<Manga>
|
||||
|
||||
suspend fun getLibraryManga(): List<LibraryManga>
|
||||
|
||||
fun getLibraryMangaAsFlow(): Flow<List<LibraryManga>>
|
||||
|
0
i18n/.gitignore
vendored
0
i18n/.gitignore
vendored
@ -546,6 +546,7 @@
|
||||
<string name="source_settings">Source settings</string>
|
||||
<string name="extensionRepo_settings">Extension repos</string>
|
||||
<string name="private_settings">Include sensitive settings (e.g., tracker login tokens)</string>
|
||||
<string name="non_library_settings">All read entries</string>
|
||||
<string name="creating_backup">Creating backup</string>
|
||||
<string name="creating_backup_error">Backup failed</string>
|
||||
<string name="missing_storage_permission">Storage permissions not granted</string>
|
||||
|
1
macrobenchmark/.gitignore
vendored
1
macrobenchmark/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
1
presentation-core/.gitignore
vendored
1
presentation-core/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
1
presentation-widget/.gitignore
vendored
1
presentation-widget/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
1
source-api/.gitignore
vendored
1
source-api/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
1
source-local/.gitignore
vendored
1
source-local/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
Reference in New Issue
Block a user