mirror of
https://github.com/moku-project/Moku.git
synced 2026-06-13 09:19:56 -05:00
Feat: Default Library Toggle
This commit is contained in:
@@ -344,7 +344,7 @@
|
|||||||
// 1. Pick the right base list for this tab
|
// 1. Pick the right base list for this tab
|
||||||
let items: Manga[];
|
let items: Manga[];
|
||||||
if (store.libraryFilter === "library") {
|
if (store.libraryFilter === "library") {
|
||||||
items = allManga;
|
items = store.settings.savedIsDefaultCategory ? (categoryMangaMap.get(0) ?? []) : allManga;
|
||||||
} else if (store.libraryFilter === "downloaded") {
|
} else if (store.libraryFilter === "downloaded") {
|
||||||
items = allManga.filter(m => (m.downloadCount ?? 0) > 0);
|
items = allManga.filter(m => (m.downloadCount ?? 0) > 0);
|
||||||
} else {
|
} else {
|
||||||
@@ -424,7 +424,7 @@
|
|||||||
|
|
||||||
const counts = $derived((() => {
|
const counts = $derived((() => {
|
||||||
const m: Record<string, number> = {
|
const m: Record<string, number> = {
|
||||||
library: allManga.length,
|
library: store.settings.savedIsDefaultCategory ? (categoryMangaMap.get(0) ?? []).length : allManga.length,
|
||||||
downloaded: allManga.filter(m => (m.downloadCount ?? 0) > 0).length,
|
downloaded: allManga.filter(m => (m.downloadCount ?? 0) > 0).length,
|
||||||
};
|
};
|
||||||
for (const cat of visibleCategories) {
|
for (const cat of visibleCategories) {
|
||||||
|
|||||||
@@ -1209,6 +1209,10 @@
|
|||||||
<div class="toggle-info"><span class="toggle-label">Crop cover images</span></div>
|
<div class="toggle-info"><span class="toggle-label">Crop cover images</span></div>
|
||||||
<button role="switch" aria-checked={store.settings.libraryCropCovers} aria-label="Crop cover images" class="toggle" class:on={store.settings.libraryCropCovers} onclick={() => updateSettings({ libraryCropCovers: !store.settings.libraryCropCovers })}><span class="toggle-thumb"></span></button>
|
<button role="switch" aria-checked={store.settings.libraryCropCovers} aria-label="Crop cover images" class="toggle" class:on={store.settings.libraryCropCovers} onclick={() => updateSettings({ libraryCropCovers: !store.settings.libraryCropCovers })}><span class="toggle-thumb"></span></button>
|
||||||
</label>
|
</label>
|
||||||
|
<label class="toggle-row">
|
||||||
|
<div class="toggle-info"><span class="toggle-label">Saved shows default folder</span><span class="toggle-desc">Saved tab shows only manga in Suwayomi's uncategorized folder</span></div>
|
||||||
|
<button role="switch" aria-checked={store.settings.savedIsDefaultCategory} aria-label="Saved shows default folder" class="toggle" class:on={store.settings.savedIsDefaultCategory} onclick={() => updateSettings({ savedIsDefaultCategory: !store.settings.savedIsDefaultCategory })}><span class="toggle-thumb"></span></button>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<p class="section-title">Chapters</p>
|
<p class="section-title">Chapters</p>
|
||||||
|
|||||||
@@ -263,6 +263,7 @@ export interface Settings {
|
|||||||
customThemes: CustomTheme[];
|
customThemes: CustomTheme[];
|
||||||
hiddenCategoryIds: number[];
|
hiddenCategoryIds: number[];
|
||||||
defaultLibraryCategoryId: number | null;
|
defaultLibraryCategoryId: number | null;
|
||||||
|
savedIsDefaultCategory: boolean;
|
||||||
nsfwFilteredTags: string[];
|
nsfwFilteredTags: string[];
|
||||||
nsfwAllowedSourceIds: string[];
|
nsfwAllowedSourceIds: string[];
|
||||||
nsfwBlockedSourceIds: string[];
|
nsfwBlockedSourceIds: string[];
|
||||||
@@ -334,6 +335,7 @@ export const DEFAULT_SETTINGS: Settings = {
|
|||||||
customThemes: [],
|
customThemes: [],
|
||||||
hiddenCategoryIds: [],
|
hiddenCategoryIds: [],
|
||||||
defaultLibraryCategoryId: null,
|
defaultLibraryCategoryId: null,
|
||||||
|
savedIsDefaultCategory: false,
|
||||||
nsfwFilteredTags: ["adult", "mature", "hentai", "ecchi", "erotic", "pornograph", "18+", "smut", "lemon", "explicit", "sexual violence"],
|
nsfwFilteredTags: ["adult", "mature", "hentai", "ecchi", "erotic", "pornograph", "18+", "smut", "lemon", "explicit", "sexual violence"],
|
||||||
nsfwAllowedSourceIds: [],
|
nsfwAllowedSourceIds: [],
|
||||||
nsfwBlockedSourceIds: [],
|
nsfwBlockedSourceIds: [],
|
||||||
|
|||||||
Reference in New Issue
Block a user