Merge branch 'dev'

This commit is contained in:
cranci1 2025-07-11 10:12:48 +02:00
commit e609916df6
106 changed files with 9663 additions and 6691 deletions

View file

@ -3,6 +3,10 @@ on:
push:
branches:
- dev
pull_request:
branches:
- dev
jobs:
build-ios:
name: Build IPA

View file

@ -35,17 +35,7 @@
## Installation
You can download Sora on the App Store for stable updates or on Testflight for more updates but maybe some instability. (Testflight is recommended):
<a href="https://apps.apple.com/us/app/sulfur/id6742741043">
<img src="https://askyourself.app/assets/appstore.png" width="170" alt="Build and Release IPA">
</a>
<a href="https://testflight.apple.com/join/qMUCpNaS">
<img src="https://askyourself.app/assets/testflight.png" width="170" alt="Build and Release IPA">
</a>
Additionally, you can install the app using Xcode or using the .ipa file, which you can find in the [Releases](https://github.com/cranci1/Sora/releases) tab or the [nightly](https://nightly.link/cranci1/Sora/workflows/build/dev/Sulfur-IPA.zip) build page.
You can download Sora using Xcode or using the .ipa file, which you can find in the [Releases](https://github.com/cranci1/Sora/releases) tab or the [Nightly](https://nightly.link/cranci1/Sora/workflows/build/dev/Sulfur-IPA.zip) build page.
## Frequently Asked Questions

View file

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "Discord Icon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View file

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "Github Icon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

@ -4,6 +4,7 @@
//
// Created by Francesco on 06/01/25.
//
import SwiftUI
struct ContentView_Previews: PreviewProvider {
@ -16,48 +17,109 @@ struct ContentView_Previews: PreviewProvider {
}
struct ContentView: View {
@StateObject private var tabBarController = TabBarController()
@AppStorage("useNativeTabBar") private var useNativeTabBar: Bool = false
@State var selectedTab: Int = 0
@State var lastTab: Int = 0
@State private var searchQuery: String = ""
@State private var shouldShowTabBar: Bool = true
@State private var tabBarOffset: CGFloat = 0
@State private var tabBarVisible: Bool = true
@State private var lastHideTime: Date = Date()
let tabs: [TabItem] = [
TabItem(icon: "square.stack", title: ""),
TabItem(icon: "arrow.down.circle", title: ""),
TabItem(icon: "gearshape", title: ""),
TabItem(icon: "magnifyingglass", title: "")
TabItem(icon: "square.stack", title: NSLocalizedString("LibraryTab", comment: "")),
TabItem(icon: "arrow.down.circle", title: NSLocalizedString("DownloadsTab", comment: "")),
TabItem(icon: "gearshape", title: NSLocalizedString("SettingsTab", comment: "")),
TabItem(icon: "magnifyingglass", title: NSLocalizedString("SearchTab", comment: ""))
]
var body: some View {
ZStack(alignment: .bottom) {
switch selectedTab {
case 0:
LibraryView()
.environmentObject(tabBarController)
case 1:
DownloadView()
.environmentObject(tabBarController)
case 2:
SettingsView()
.environmentObject(tabBarController)
case 3:
SearchView(searchQuery: $searchQuery)
.environmentObject(tabBarController)
default:
LibraryView()
.environmentObject(tabBarController)
}
TabBar(
tabs: tabs,
selectedTab: $selectedTab,
lastTab: $lastTab,
searchQuery: $searchQuery,
controller: tabBarController
)
private func tabView(for index: Int) -> some View {
switch index {
case 1: return AnyView(DownloadView())
case 2: return AnyView(SettingsView())
case 3: return AnyView(SearchView(searchQuery: $searchQuery))
default: return AnyView(LibraryView())
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .bottom)
.ignoresSafeArea(.keyboard, edges: .bottom)
.padding(.bottom, -20)
}
var body: some View {
if #available(iOS 26, *), useNativeTabBar == true {
TabView {
ForEach(Array(tabs.enumerated()), id: \.offset) { index, item in
tabView(for: index)
.tabItem {
Label(item.title, systemImage: item.icon)
}
}
}
.searchable(text: $searchQuery)
} else {
ZStack(alignment: .bottom) {
ZStack {
tabView(for: selectedTab)
.id(selectedTab)
.transition(.opacity)
.animation(.easeInOut(duration: 0.3), value: selectedTab)
}
.onPreferenceChange(TabBarVisibilityKey.self) { shouldShowTabBar = $0 }
if shouldShowTabBar {
TabBar(
tabs: tabs,
selectedTab: $selectedTab
)
.opacity(shouldShowTabBar && tabBarVisible ? 1 : 0)
.offset(y: tabBarVisible ? 0 : 120)
.animation(.spring(response: 0.15, dampingFraction: 0.7), value: tabBarVisible)
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .bottom)
.ignoresSafeArea(.keyboard, edges: .bottom)
.padding(.bottom, -20)
.onAppear {
setupNotificationObservers()
}
.onDisappear {
removeNotificationObservers()
}
}
}
private func setupNotificationObservers() {
NotificationCenter.default.addObserver(
forName: .hideTabBar,
object: nil,
queue: .main
) { _ in
lastHideTime = Date()
tabBarVisible = false
Logger.shared.log("Tab bar hidden", type: "Debug")
}
NotificationCenter.default.addObserver(
forName: .showTabBar,
object: nil,
queue: .main
) { _ in
let timeSinceHide = Date().timeIntervalSince(lastHideTime)
if timeSinceHide > 0.2 {
tabBarVisible = true
Logger.shared.log("Tab bar shown after \(timeSinceHide) seconds", type: "Debug")
} else {
Logger.shared.log("Tab bar show request ignored, only \(timeSinceHide) seconds since hide", type: "Debug")
}
}
}
private func removeNotificationObservers() {
NotificationCenter.default.removeObserver(self, name: .hideTabBar, object: nil)
NotificationCenter.default.removeObserver(self, name: .showTabBar, object: nil)
}
}
struct TabBarVisibilityKey: PreferenceKey {
static var defaultValue: Bool = true
static func reduce(value: inout Bool, nextValue: () -> Bool) {
value = nextValue()
}
}

View file

@ -6,6 +6,26 @@
<array>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>ar</string>
<string>bos</string>
<string>cs</string>
<string>nl</string>
<string>fr</string>
<string>de</string>
<string>it</string>
<string>kk</string>
<string>mn</string>
<string>nn</string>
<string>ru</string>
<string>sk</string>
<string>es</string>
<string>sv</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>

File diff suppressed because it is too large Load diff

View file

@ -388,3 +388,105 @@
"me frfr" = "me frfr";
"Data" = "البيانات";
"Maximum Quality Available" = "أعلى جودة متاحة";
/* New additions */
"DownloadCountFormat" = "%d من %d";
"Error loading chapter" = "حدث خطأ أثناء تحميل الفصل";
"Font Size: %dpt" = "حجم الخط: %d نقطة";
"Line Spacing: %.1f" = "تباعد الأسطر: %.1f";
"Line Spacing" = "تباعد الأسطر";
"Margin: %dpx" = "الهامش: %d بكسل";
"Margin" = "الهامش";
"Auto Scroll Speed" = "سرعة التمرير التلقائي";
"Speed" = "السرعة";
"Speed: %.1fx" = "السرعة: %.1fx";
"Matched %@: %@" = "%@: %@ متطابق";
"Enter the AniList ID for this series" = "أدخل معرف AniList لهذه السلسلة";
/* New additions */
"Create Collection" = "إنشاء مجموعة";
"Collection Name" = "اسم المجموعة";
"Rename Collection" = "إعادة تسمية المجموعة";
"Rename" = "إعادة تسمية";
"All Reading" = "كل القراءة";
"Recently Added" = "أضيفت مؤخراً";
"Novel Title" = "عنوان الرواية";
"Read Progress" = "تقدم القراءة";
"Date Created" = "تاريخ الإنشاء";
"Name" = "الاسم";
"Item Count" = "عدد العناصر";
"Date Added" = "تاريخ الإضافة";
"Title" = "العنوان";
"Source" = "المصدر";
"Search reading..." = "ابحث في القراءة...";
"Search collections..." = "ابحث في المجموعات...";
"Search bookmarks..." = "ابحث في الإشارات المرجعية...";
"%d items" = "%d عناصر";
"Fetching Data" = "جاري جلب البيانات";
"Please wait while fetching." = "يرجى الانتظار أثناء الجلب.";
"Start Reading" = "ابدأ القراءة";
"Chapters" = "الفصول";
"Completed" = "مكتمل";
"Drag to reorder" = "اسحب لإعادة الترتيب";
"Drag to reorder sections" = "اسحب لإعادة ترتيب الأقسام";
"Library View" = "عرض المكتبة";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "خصص الأقسام المعروضة في مكتبتك. يمكنك إعادة ترتيب الأقسام أو تعطيلها بالكامل.";
"Library Sections Order" = "ترتيب أقسام المكتبة";
"Completion Percentage" = "نسبة الإكمال";
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt." = "بعض الميزات محدودة في مشغل Sora والمشغل الافتراضي فقط، مثل الوضع الأفقي الإجباري، سرعة التثبيت، وزيادات تخطي الوقت المخصصة.\n\nإعداد نسبة الإكمال يحدد عند أي نقطة قبل نهاية الفيديو سيتم اعتبار العمل مكتمل في AniList وTrakt.";
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app." = "ذاكرة التخزين المؤقت تساعد التطبيق على تحميل الصور بشكل أسرع.\n\nمسح مجلد المستندات سيحذف جميع الوحدات التي تم تنزيلها.\n\nمسح بيانات التطبيق سيحذف جميع إعداداتك وبياناتك.";
"Translators" = "المترجمون";
"Paste URL" = "الصق الرابط";
/* New additions */
"Series Title" = "عنوان السلسلة";
"Content Source" = "مصدر المحتوى";
"Watch Progress" = "تقدم المشاهدة";
"Nothing to Continue Reading" = "لا شيء لمتابعة القراءة";
"Your recently read novels will appear here" = "ستظهر الروايات التي قرأتها مؤخرًا هنا";
"No Bookmarks" = "لا توجد إشارات مرجعية";
"Add bookmarks to this collection" = "أضف إشارات مرجعية إلى هذه المجموعة";
"items" = "عناصر";
"All Watching" = "كل المشاهدة";
"No Reading History" = "لا يوجد سجل قراءة";
"Books you're reading will appear here" = "ستظهر الكتب التي تقرأها هنا";
"Create Collection" = "إنشاء مجموعة";
"Collection Name" = "اسم المجموعة";
"Rename Collection" = "إعادة تسمية المجموعة";
"Rename" = "إعادة تسمية";
"Novel Title" = "عنوان الرواية";
"Read Progress" = "تقدم القراءة";
"Date Created" = "تاريخ الإنشاء";
"Name" = "الاسم";
"Item Count" = "عدد العناصر";
"Date Added" = "تاريخ الإضافة";
"Title" = "العنوان";
"Source" = "المصدر";
"Search reading..." = "ابحث في القراءة...";
"Search collections..." = "ابحث في المجموعات...";
"Search bookmarks..." = "ابحث في الإشارات المرجعية...";
"%d items" = "%d عناصر";
"Fetching Data" = "جاري جلب البيانات";
"Please wait while fetching." = "يرجى الانتظار أثناء الجلب.";
"Start Reading" = "ابدأ القراءة";
"Chapters" = "الفصول";
"Completed" = "مكتمل";
"Drag to reorder" = "اسحب لإعادة الترتيب";
"Drag to reorder sections" = "اسحب لإعادة ترتيب الأقسام";
"Library View" = "عرض المكتبة";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "خصص الأقسام المعروضة في مكتبتك. يمكنك إعادة ترتيب الأقسام أو تعطيلها بالكامل.";
"Library Sections Order" = "ترتيب أقسام المكتبة";
"Completion Percentage" = "نسبة الإكمال";
"Translators" = "المترجمون";
"Paste URL" = "الصق الرابط";
/* New additions */
"Collections" = "المجموعات";
"Continue Reading" = "متابعة القراءة";
/* New additions */
"Backup & Restore" = "النسخ الاحتياطي والاستعادة";
"Export Backup" = "تصدير النسخة الاحتياطية";
"Import Backup" = "استيراد النسخة الاحتياطية";
"Notice: This feature is still experimental. Please double-check your data after import/export." = "تنبيه: هذه الميزة لا تزال تجريبية. يرجى التحقق من بياناتك بعد التصدير/الاستيراد.";
"Backup" = "نسخة احتياطية";

View file

@ -41,7 +41,7 @@
"Clear All Downloads" = "Obriši sva preuzimanja";
"Clear Cache" = "Obriši keš";
"Clear Library Only" = "Obriši samo biblioteku";
"Clear Logs" = "Obriši logове";
"Clear Logs" = "Obriši logove";
"Click the plus button to add a module!" = "Kliknite plus dugme da dodate modul!";
"Continue Watching" = "Nastavi gledanje";
"Continue Watching Episode %d" = "Nastavi gledanje epizode %d";
@ -404,3 +404,107 @@ Za metapodatke epizode, odnosi se na sličicu i naslov epizode, jer ponekad mogu
"me frfr" = "ja stvarno";
"Data" = "Podaci";
"Maximum Quality Available" = "Maksimalna dostupna kvaliteta";
/* Additional translations */
"DownloadCountFormat" = "%d od %d";
"Error loading chapter" = "Greška pri učitavanju poglavlja";
"Font Size: %dpt" = "Veličina fonta: %dpt";
"Line Spacing: %.1f" = "Razmak između redova: %.1f";
"Line Spacing" = "Razmak između redova";
"Margin: %dpx" = "Margina: %dpx";
"Margin" = "Margina";
"Auto Scroll Speed" = "Brzina automatskog pomicanja";
"Speed" = "Brzina";
"Speed: %.1fx" = "Brzina: %.1fx";
"Matched %@: %@" = "Poklapanje %@: %@";
"Enter the AniList ID for this series" = "Unesite AniList ID za ovu seriju";
/* Added missing localizations */
"Create Collection" = "Kreiraj kolekciju";
"Collection Name" = "Naziv kolekcije";
"Rename Collection" = "Preimenuj kolekciju";
"Rename" = "Preimenuj";
"All Reading" = "Sva čitanja";
"Recently Added" = "Nedavno dodano";
"Novel Title" = "Naslov romana";
"Read Progress" = "Napredak čitanja";
"Date Created" = "Datum kreiranja";
"Name" = "Naziv";
"Item Count" = "Broj stavki";
"Date Added" = "Datum dodavanja";
"Title" = "Naslov";
"Source" = "Izvor";
"Search reading..." = "Pretraži čitanje...";
"Search collections..." = "Pretraži kolekcije...";
"Search bookmarks..." = "Pretraži oznake...";
"%d items" = "%d stavki";
"Fetching Data" = "Preuzimanje podataka";
"Please wait while fetching." = "Molimo sačekajte dok se preuzima.";
"Start Reading" = "Započni čitanje";
"Chapters" = "Poglavlja";
"Completed" = "Završeno";
"Drag to reorder" = "Povuci za promjenu redoslijeda";
"Drag to reorder sections" = "Povuci za promjenu redoslijeda sekcija";
"Library View" = "Prikaz biblioteke";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Prilagodite sekcije prikazane u vašoj biblioteci. Možete ih preurediti ili potpuno onemogućiti.";
"Library Sections Order" = "Redoslijed sekcija biblioteke";
"Completion Percentage" = "Procenat završetka";
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt." = "Neke funkcije su ograničene na Sora i zadani player, kao što su prisilni pejzaž, držanje brzine i prilagođeni intervali preskakanja.\n\nPostavka procenta završetka određuje u kojoj tački prije kraja videa će aplikacija označiti kao završeno na AniList i Trakt.";
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app." = "Keš aplikacije pomaže bržem učitavanju slika.\n\nBrisanje Documents foldera će ukloniti sve preuzete module.\n\nBrisanje podataka aplikacije briše sve vaše postavke i podatke.";
"Translators" = "Prevoditelji";
"Paste URL" = "Zalijepi URL";
/* New additions */
"Series Title" = "Naslov serije";
"Content Source" = "Izvor sadržaja";
"Watch Progress" = "Napredak gledanja";
"Recent searches" = "Nedavne pretrage";
"All Reading" = "Sve što čitam";
"Nothing to Continue Reading" = "Nema ništa za nastaviti čitanje";
"Your recently read novels will appear here" = "Vaši nedavno pročitani romani će se pojaviti ovdje";
"No Bookmarks" = "Nema zabilješki";
"Add bookmarks to this collection" = "Dodajte zabilješke u ovu kolekciju";
"items" = "stavke";
"All Watching" = "Sve što gledam";
"No Reading History" = "Nema historije čitanja";
"Books you're reading will appear here" = "Knjige koje čitate će se pojaviti ovdje";
"Create Collection" = "Kreiraj kolekciju";
"Collection Name" = "Naziv kolekcije";
"Rename Collection" = "Preimenuj kolekciju";
"Rename" = "Preimenuj";
"Novel Title" = "Naslov romana";
"Read Progress" = "Napredak čitanja";
"Date Created" = "Datum kreiranja";
"Name" = "Ime";
"Item Count" = "Broj stavki";
"Date Added" = "Datum dodavanja";
"Title" = "Naslov";
"Source" = "Izvor";
"Search reading..." = "Pretraži čitanje...";
"Search collections..." = "Pretraži kolekcije...";
"Search bookmarks..." = "Pretraži zabilješke...";
"%d items" = "%d stavki";
"Fetching Data" = "Dohvatanje podataka";
"Please wait while fetching." = "Molimo sačekajte dok se podaci dohvaćaju.";
"Start Reading" = "Započni čitanje";
"Chapters" = "Poglavlja";
"Completed" = "Završeno";
"Drag to reorder" = "Povucite za promjenu redoslijeda";
"Drag to reorder sections" = "Povucite za promjenu redoslijeda sekcija";
"Library View" = "Prikaz biblioteke";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Prilagodite sekcije prikazane u vašoj biblioteci. Možete promijeniti redoslijed ili ih potpuno onemogućiti.";
"Library Sections Order" = "Redoslijed sekcija biblioteke";
"Completion Percentage" = "Procenat završetka";
"Translators" = "Prevodioci";
"Paste URL" = "Zalijepi URL";
/* New additions */
"Collections" = "Kolekcije";
"Continue Reading" = "Nastavi čitanje";
/* Backup & Restore */
"Backup & Restore" = "Sigurnosna kopija i vraćanje";
"Export Backup" = "Izvezi sigurnosnu kopiju";
"Import Backup" = "Uvezi sigurnosnu kopiju";
"Notice: This feature is still experimental. Please double-check your data after import/export." = "Napomena: Ova funkcija je još uvijek eksperimentalna. Molimo provjerite svoje podatke nakon izvoza/uvoza.";
"Backup" = "Sigurnosna kopija";

View file

@ -405,4 +405,107 @@ Metadata epizody se týkají náhledu a názvu epizody, které mohou někdy obsa
"Data" = "Data";
/* New string */
"Maximum Quality Available" = "Maximální dostupná kvalita";
"Maximum Quality Available" = "Maximální dostupná kvalita";
/* Additional translations */
"DownloadCountFormat" = "%d z %d";
"Error loading chapter" = "Chyba při načítání kapitoly";
"Font Size: %dpt" = "Velikost písma: %dpt";
"Line Spacing: %.1f" = "Řádkování: %.1f";
"Line Spacing" = "Řádkování";
"Margin: %dpx" = "Okraj: %dpx";
"Margin" = "Okraj";
"Auto Scroll Speed" = "Rychlost automatického posunu";
"Speed" = "Rychlost";
"Speed: %.1fx" = "Rychlost: %.1fx";
"Matched %@: %@" = "Shoda %@: %@";
"Enter the AniList ID for this series" = "Zadejte AniList ID pro tuto sérii";
/* Added missing localizations */
"Create Collection" = "Vytvořit kolekci";
"Collection Name" = "Název kolekce";
"Rename Collection" = "Přejmenovat kolekci";
"Rename" = "Přejmenovat";
"All Reading" = "Všechny knihy";
"Recently Added" = "Nedávno přidáno";
"Novel Title" = "Název románu";
"Read Progress" = "Postup čtení";
"Date Created" = "Datum vytvoření";
"Name" = "Název";
"Item Count" = "Počet položek";
"Date Added" = "Datum přidání";
"Title" = "Titul";
"Source" = "Zdroj";
"Search reading..." = "Hledat v knihách...";
"Search collections..." = "Hledat v kolekcích...";
"Search bookmarks..." = "Hledat v záložkách...";
"%d items" = "%d položek";
"Fetching Data" = "Načítání dat";
"Please wait while fetching." = "Počkejte prosím během načítání.";
"Start Reading" = "Začít číst";
"Chapters" = "Kapitoly";
"Completed" = "Dokončeno";
"Drag to reorder" = "Přetáhněte pro změnu pořadí";
"Drag to reorder sections" = "Přetáhněte pro změnu pořadí sekcí";
"Library View" = "Zobrazení knihovny";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Přizpůsobte sekce zobrazené ve vaší knihovně. Můžete je přeuspořádat nebo zcela vypnout.";
"Library Sections Order" = "Pořadí sekcí knihovny";
"Completion Percentage" = "Procento dokončení";
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt." = "Některé funkce jsou omezeny na Sora a výchozí přehrávač, například vynucená krajina, podržení rychlosti a vlastní intervaly přeskočení.\n\nNastavení procenta dokončení určuje, v jakém bodě před koncem videa bude aplikace označovat jako dokončené na AniList a Trakt.";
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app." = "Mezipaměť aplikace pomáhá rychlejšímu načítání obrázků.\n\nVymazání složky Documents odstraní všechny stažené moduly.\n\nVymazání dat aplikace smaže všechna vaše nastavení a data.";
"Translators" = "Překladatelé";
"Paste URL" = "Vložit URL";
/* New localizations */
"Series Title" = "Název série";
"Content Source" = "Zdroj obsahu";
"Watch Progress" = "Průběh sledování";
"All Reading" = "Vše ke čtení";
"Nothing to Continue Reading" = "Nic k pokračování ve čtení";
"Your recently read novels will appear here" = "Vaše nedávno čtené romány se zobrazí zde";
"No Bookmarks" = "Žádné záložky";
"Add bookmarks to this collection" = "Přidejte záložky do této kolekce";
"items" = "položky";
"All Watching" = "Vše ke sledování";
"No Reading History" = "Žádná historie čtení";
"Books you're reading will appear here" = "Knihy, které čtete, se zobrazí zde";
"Create Collection" = "Vytvořit kolekci";
"Collection Name" = "Název kolekce";
"Rename Collection" = "Přejmenovat kolekci";
"Rename" = "Přejmenovat";
"Novel Title" = "Název románu";
"Read Progress" = "Průběh čtení";
"Date Created" = "Datum vytvoření";
"Name" = "Jméno";
"Item Count" = "Počet položek";
"Date Added" = "Datum přidání";
"Title" = "Název";
"Source" = "Zdroj";
"Search reading..." = "Hledat ve čtení...";
"Search collections..." = "Hledat v kolekcích...";
"Search bookmarks..." = "Hledat v záložkách...";
"%d items" = "%d položek";
"Fetching Data" = "Načítání dat";
"Please wait while fetching." = "Počkejte prosím, načítají se data.";
"Start Reading" = "Začít číst";
"Chapters" = "Kapitoly";
"Completed" = "Dokončeno";
"Drag to reorder" = "Přetáhněte pro změnu pořadí";
"Drag to reorder sections" = "Přetáhněte pro změnu pořadí sekcí";
"Library View" = "Zobrazení knihovny";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Přizpůsobte sekce zobrazené ve vaší knihovně. Můžete změnit jejich pořadí nebo je úplně vypnout.";
"Library Sections Order" = "Pořadí sekcí knihovny";
"Completion Percentage" = "Procento dokončení";
"Translators" = "Překladatelé";
"Paste URL" = "Vložit URL";
/* New localizations */
"Collections" = "Kolekce";
"Continue Reading" = "Pokračovat ve čtení";
/* Backup & Restore */
"Backup & Restore" = "Zálohování a obnovení";
"Export Backup" = "Exportovat zálohu";
"Import Backup" = "Importovat zálohu";
"Notice: This feature is still experimental. Please double-check your data after import/export." = "Upozornění: Tato funkce je stále experimentální. Po exportu/importu si prosím zkontrolujte svá data.";
"Backup" = "Záloha";

View file

@ -49,6 +49,9 @@
"Copied to Clipboard" = "In die Zwischenablage kopiert";
"Copy to Clipboard" = "In die Zwischenablage kopieren";
"Copy URL" = "URL kopieren";
"Collections" = "Sammlungen";
"No Collections" = "Keine Sammlungen vorhanden";
"Create a collection to organize your bookmarks" = "Erstelle eine Sammlung für mehr Organisation";
/* Episodes */
"%lld Episodes" = "%lld Folgen";
@ -84,7 +87,7 @@
"Download Episode" = "Folge herunterladen";
"Download Summary" = "Download-Übersicht";
"Download This Episode" = "Diese Folge herunterladen";
"Downloaded" = "Heruntergeladen";
"Downloaded" = "Geladen";
"Downloaded Shows" = "Heruntergeladene Serien";
"Downloading" = "Lädt herunter";
"Downloads" = "Downloads";
@ -115,6 +118,7 @@
"General events and activities." = "Allgemeine Aktivitäten.";
"General Preferences" = "Allgemeine Einstellungen";
"Hide Splash Screen" = "Startbildschirm ausblenden";
"Use Native Tab Bar" = "System Bar verwenden";
"HLS video downloading." = "HLS Video-Downloads.";
"Hold Speed" = "Geschwindigkeit halten";
@ -383,8 +387,113 @@
"Library cleared successfully" = "Bibliothek erfolgreich geleert";
"All downloads deleted successfully" = "Alle Downloads erfolgreich gelöscht";
/* TabView */
"LibraryTab" = "Bibliothek";
"DownloadsTab" = "Downloads";
"SettingsTab" = "Einstellungen";
"SearchTab" = "Suchen";
/* New additions */
"Recent searches" = "Letzte Suchanfragen";
"me frfr" = "Ich, ohne Witz";
"Data" = "Daten";
"Maximum Quality Available" = "Maximal verfügbare Qualität";
"Maximum Quality Available" = "Maximal verfügbare Qualität";
"DownloadCountFormat" = "%d von %d";
"Error loading chapter" = "Fehler beim Laden des Kapitels";
"Font Size: %dpt" = "Schriftgröße: %dpt";
"Line Spacing: %.1f" = "Zeilenabstand: %.1f";
"Line Spacing" = "Zeilenabstand";
"Margin: %dpx" = "Rand: %dpx";
"Margin" = "Rand";
"Auto Scroll Speed" = "Automatische Scroll-Geschwindigkeit";
"Speed" = "Geschwindigkeit";
"Speed: %.1fx" = "Geschwindigkeit: %.1fx";
"Matched %@: %@" = "Abgeglichen %@: %@";
"Enter the AniList ID for this series" = "Geben Sie die AniList-ID für diese Serie ein";
/* Added missing localizations */
"Create Collection" = "Sammlung erstellen";
"Collection Name" = "Sammlungsname";
"Rename Collection" = "Sammlung umbenennen";
"Rename" = "Umbenennen";
"All Reading" = "Alles Lesen";
"Recently Added" = "Kürzlich hinzugefügt";
"Novel Title" = "Roman Titel";
"Read Progress" = "Lesefortschritt";
"Date Created" = "Erstellungsdatum";
"Name" = "Name";
"Item Count" = "Anzahl der Elemente";
"Date Added" = "Hinzugefügt am";
"Title" = "Titel";
"Source" = "Quelle";
"Search reading..." = "Lesen durchsuchen...";
"Search collections..." = "Sammlungen durchsuchen...";
"Search bookmarks..." = "Lesezeichen durchsuchen...";
"%d items" = "%d Elemente";
"Fetching Data" = "Daten werden abgerufen";
"Please wait while fetching." = "Bitte warten Sie während des Abrufs.";
"Start Reading" = "Lesen starten";
"Chapters" = "Kapitel";
"Completed" = "Abgeschlossen";
"Drag to reorder" = "Ziehen zum Neuordnen";
"Drag to reorder sections" = "Ziehen zum Neuordnen der Abschnitte";
"Library View" = "Bibliotheksansicht";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Passen Sie die in Ihrer Bibliothek angezeigten Abschnitte an. Sie können Abschnitte neu anordnen oder vollständig deaktivieren.";
"Library Sections Order" = "Reihenfolge der Bibliotheksabschnitte";
"Completion Percentage" = "Abschlussprozentsatz";
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt." = "Einige Funktionen sind nur im Sora- und Standard-Player verfügbar, wie z.B. erzwungene Querformatansicht, Haltegeschwindigkeit und benutzerdefinierte Zeitsprünge.\n\nDie Einstellung des Abschlussprozentsatzes bestimmt, ab welchem Punkt vor dem Ende eines Videos die App es als abgeschlossen auf AniList und Trakt markiert.";
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app." = "Der App-Cache hilft, Bilder schneller zu laden.\n\nDas Löschen des Dokumente-Ordners entfernt alle heruntergeladenen Module.\n\nDas Löschen der App-Daten entfernt alle Ihre Einstellungen und Daten.";
"Translators" = "Übersetzer";
"Paste URL" = "URL einfügen";
/* Added missing localizations */
"Series Title" = "Serientitel";
"Content Source" = "Inhaltsquelle";
"Watch Progress" = "Fortschritt ansehen";
"All Reading" = "Alles Lesen";
"Nothing to Continue Reading" = "Nichts zum Weiterlesen";
"Your recently read novels will appear here" = "Ihre zuletzt gelesenen Romane erscheinen hier";
"No Bookmarks" = "Keine Lesezeichen";
"Add bookmarks to this collection" = "Fügen Sie dieser Sammlung Lesezeichen hinzu";
"items" = "Elemente";
"All Watching" = "Alles Ansehen";
"No Reading History" = "Kein Leseverlauf";
"Books you're reading will appear here" = "Bücher, die Sie lesen, erscheinen hier";
"Create Collection" = "Sammlung erstellen";
"Collection Name" = "Sammlungsname";
"Rename Collection" = "Sammlung umbenennen";
"Rename" = "Umbenennen";
"Novel Title" = "Roman Titel";
"Read Progress" = "Lesefortschritt";
"Date Created" = "Erstellungsdatum";
"Name" = "Name";
"Item Count" = "Anzahl der Elemente";
"Date Added" = "Hinzugefügt am";
"Title" = "Titel";
"Source" = "Quelle";
"Search reading..." = "Lesen durchsuchen...";
"Search collections..." = "Sammlungen durchsuchen...";
"Search bookmarks..." = "Lesezeichen durchsuchen...";
"%d items" = "%d Elemente";
"Fetching Data" = "Daten werden abgerufen";
"Please wait while fetching." = "Bitte warten Sie während des Abrufs.";
"Start Reading" = "Lesen starten";
"Chapters" = "Kapitel";
"Completed" = "Abgeschlossen";
"Drag to reorder" = "Ziehen zum Neuordnen";
"Drag to reorder sections" = "Ziehen zum Neuordnen der Abschnitte";
"Library View" = "Bibliotheksansicht";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Passen Sie die in Ihrer Bibliothek angezeigten Abschnitte an. Sie können Abschnitte neu anordnen oder vollständig deaktivieren.";
"Library Sections Order" = "Reihenfolge der Bibliotheksabschnitte";
"Completion Percentage" = "Abschlussprozentsatz";
"Translators" = "Übersetzer";
"Paste URL" = "URL einfügen";
"Continue Reading" = "Weiterlesen";
"Backup & Restore" = "Sichern & Wiederherstellen";
"Export Backup" = "Backup exportieren";
"Import Backup" = "Backup importieren";
"Notice: This feature is still experimental. Please double-check your data after import/export." = "Hinweis: Diese Funktion ist noch experimentell. Bitte überprüfe deine Daten nach dem Export/Import.";
"Backup" = "Backup";

View file

@ -49,6 +49,9 @@
"Copied to Clipboard" = "Copied to Clipboard";
"Copy to Clipboard" = "Copy to Clipboard";
"Copy URL" = "Copy URL";
"Collections" = "Collections";
"No Collections" = "No Collections";
"Create a collection to organize your bookmarks" = "Create a collection to organize your bookmarks";
/* Episodes */
"%lld Episodes" = "%lld Episodes";
@ -115,6 +118,7 @@
"General events and activities." = "General events and activities.";
"General Preferences" = "General Preferences";
"Hide Splash Screen" = "Hide Splash Screen";
"Use Native Tab Bar" = "Use Native Tabs";
"HLS video downloading." = "HLS video downloading.";
"Hold Speed" = "Hold Speed";
@ -335,7 +339,6 @@
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nDo not erase App Data unless you understand the consequences — it may cause the app to malfunction." = "The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nDo not erase App Data unless you understand the consequences — it may cause the app to malfunction.";
"The episode range controls how many episodes appear on each page. Episodes are grouped into sets (like 125, 2650, and so on), allowing you to navigate through them more easily.\n\nFor episode metadata, it refers to the episode thumbnail and title, since sometimes it can contain spoilers." = "The episode range controls how many episodes appear on each page. Episodes are grouped into sets (like 125, 2650, and so on), allowing you to navigate through them more easily.\n\nFor episode metadata, it refers to the episode thumbnail and title, since sometimes it can contain spoilers.";
"The module provided only a single episode, this is most likely a movie, so we decided to make separate screens for these cases." = "The module provided only a single episode, this is most likely a movie, so we decided to make separate screens for these cases.";
/* Interface */
"Thumbnails Width" = "Thumbnails Width";
"TMDB Match" = "TMDB Match";
@ -384,7 +387,75 @@
"Library cleared successfully" = "Library cleared successfully";
"All downloads deleted successfully" = "All downloads deleted successfully";
/* TabView */
"LibraryTab" = "Library";
"DownloadsTab" = "Downloads";
"SettingsTab" = "Settings";
"SearchTab" = "Search";
/* New additions */
"Recent searches" = "Recent searches";
"me frfr" = "me frfr";
"Data" = "Data";
"Data" = "Data";
"All Reading" = "All Reading";
"No Reading History" = "No Reading History";
"Books you're reading will appear here" = "Books you're reading will appear here";
"All Watching" = "All Watching";
"Continue Reading" = "Continue Reading";
"Nothing to Continue Reading" = "Nothing to Continue Reading";
"Your recently read novels will appear here" = "Your recently read novels will appear here";
"No Bookmarks" = "No Bookmarks";
"Add bookmarks to this collection" = "Add bookmarks to this collection";
"items" = "items";
"Chapter %d" = "Chapter %d";
"Episode %d" = "Episode %d";
"%d%%" = "%d%%";
"%d%% seen" = "%d%% seen";
"DownloadCountFormat" = "%d of %d";
"Error loading chapter" = "Error loading chapter";
"Font Size: %dpt" = "Font Size: %dpt";
"Line Spacing: %.1f" = "Line Spacing: %.1f";
"Line Spacing" = "Line Spacing";
"Margin: %dpx" = "Margin: %dpx";
"Margin" = "Margin";
"Auto Scroll Speed" = "Auto Scroll Speed";
"Speed" = "Speed";
"Speed: %.1fx" = "Speed: %.1fx";
"Matched %@: %@" = "Matched %@: %@";
"Enter the AniList ID for this series" = "Enter the AniList ID for this series";
/* New additions */
"Create Collection" = "Create Collection";
"Collection Name" = "Collection Name";
"Rename Collection" = "Rename Collection";
"Rename" = "Rename";
"All Reading" = "All Reading";
"Recently Added" = "Recently Added";
"Novel Title" = "Novel Title";
"Read Progress" = "Read Progress";
"Date Created" = "Date Created";
"Name" = "Name";
"Item Count" = "Item Count";
"Date Added" = "Date Added";
"Title" = "Title";
"Source" = "Source";
"Search reading..." = "Search reading...";
"Search collections..." = "Search collections...";
"Search bookmarks..." = "Search bookmarks...";
"%d items" = "%d items";
"Fetching Data" = "Fetching Data";
"Please wait while fetching." = "Please wait while fetching.";
"Start Reading" = "Start Reading";
"Chapters" = "Chapters";
"Completed" = "Completed";
"Drag to reorder" = "Drag to reorder";
"Drag to reorder sections" = "Drag to reorder sections";
"Library View" = "Library View";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Customize the sections shown in your library. You can reorder sections or disable them completely.";
"Library Sections Order" = "Library Sections Order";
"Completion Percentage" = "Completion Percentage";
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt." = "Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt.";
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app." = "The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app.";
"Translators" = "Translators";
"Paste URL" = "Paste URL";

View file

@ -404,4 +404,103 @@ Para los metadatos del episodio, se refiere a la miniatura y el título del epis
"me frfr" = "yo frfr";
"Data" = "Datos";
"Maximum Quality Available" = "Calidad máxima disponible";
"DownloadCountFormat" = "%d de %d";
"Error loading chapter" = "Error al cargar el capítulo";
"Font Size: %dpt" = "Tamaño de fuente: %dpt";
"Line Spacing: %.1f" = "Espaciado de línea: %.1f";
"Line Spacing" = "Espaciado de línea";
"Margin: %dpx" = "Margen: %dpx";
"Margin" = "Margen";
"Auto Scroll Speed" = "Velocidad de desplazamiento automático";
"Speed" = "Velocidad";
"Speed: %.1fx" = "Velocidad: %.1fx";
"Matched %@: %@" = "Coincidencia %@: %@";
"Enter the AniList ID for this series" = "Introduce el ID de AniList para esta serie";
/* Added missing localizations */
"Create Collection" = "Crear colección";
"Collection Name" = "Nombre de la colección";
"Rename Collection" = "Renombrar colección";
"Rename" = "Renombrar";
"All Reading" = "Todas las lecturas";
"Recently Added" = "Añadido recientemente";
"Novel Title" = "Título de la novela";
"Read Progress" = "Progreso de lectura";
"Date Created" = "Fecha de creación";
"Name" = "Nombre";
"Item Count" = "Cantidad de elementos";
"Date Added" = "Fecha de añadido";
"Title" = "Título";
"Source" = "Fuente";
"Search reading..." = "Buscar en lecturas...";
"Search collections..." = "Buscar en colecciones...";
"Search bookmarks..." = "Buscar en marcadores...";
"%d items" = "%d elementos";
"Fetching Data" = "Obteniendo datos";
"Please wait while fetching." = "Por favor, espere mientras se obtienen los datos.";
"Start Reading" = "Comenzar a leer";
"Chapters" = "Capítulos";
"Completed" = "Completado";
"Drag to reorder" = "Arrastrar para reordenar";
"Drag to reorder sections" = "Arrastrar para reordenar secciones";
"Library View" = "Vista de biblioteca";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Personaliza las secciones que se muestran en tu biblioteca. Puedes reordenarlas o desactivarlas completamente.";
"Library Sections Order" = "Orden de secciones de la biblioteca";
"Completion Percentage" = "Porcentaje de finalización";
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt." = "Algunas funciones están limitadas al reproductor Sora y al predeterminado, como el modo horizontal forzado, la velocidad de retención y los saltos de tiempo personalizados.\n\nEl ajuste del porcentaje de finalización determina en qué punto antes del final de un vídeo la app lo marcará como completado en AniList y Trakt.";
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app." = "La caché de la app ayuda a cargar imágenes más rápido.\n\nBorrar la carpeta Documentos eliminará todos los módulos descargados.\n\nBorrar los datos de la app eliminará todos tus ajustes y datos.";
"Translators" = "Traductores";
"Paste URL" = "Pegar URL";
/* Added missing localizations */
"Series Title" = "Título de la serie";
"Content Source" = "Fuente de contenido";
"Watch Progress" = "Progreso de visualización";
"All Reading" = "Todo lo que lees";
"Nothing to Continue Reading" = "Nada para continuar leyendo";
"Your recently read novels will appear here" = "Tus novelas leídas recientemente aparecerán aquí";
"No Bookmarks" = "Sin marcadores";
"Add bookmarks to this collection" = "Agrega marcadores a esta colección";
"items" = "elementos";
"All Watching" = "Todo lo que ves";
"No Reading History" = "Sin historial de lectura";
"Books you're reading will appear here" = "Los libros que estás leyendo aparecerán aquí";
"Create Collection" = "Crear colección";
"Collection Name" = "Nombre de la colección";
"Rename Collection" = "Renombrar colección";
"Rename" = "Renombrar";
"Novel Title" = "Título de la novela";
"Read Progress" = "Progreso de lectura";
"Date Created" = "Fecha de creación";
"Name" = "Nombre";
"Item Count" = "Cantidad de elementos";
"Date Added" = "Fecha de agregado";
"Title" = "Título";
"Source" = "Fuente";
"Search reading..." = "Buscar en lecturas...";
"Search collections..." = "Buscar en colecciones...";
"Search bookmarks..." = "Buscar en marcadores...";
"%d items" = "%d elementos";
"Fetching Data" = "Obteniendo datos";
"Please wait while fetching." = "Por favor, espera mientras se obtienen los datos.";
"Start Reading" = "Comenzar a leer";
"Chapters" = "Capítulos";
"Completed" = "Completado";
"Drag to reorder" = "Arrastra para reordenar";
"Drag to reorder sections" = "Arrastra para reordenar secciones";
"Library View" = "Vista de biblioteca";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Personaliza las secciones que se muestran en tu biblioteca. Puedes reordenar secciones o deshabilitarlas completamente.";
"Library Sections Order" = "Orden de secciones de la biblioteca";
"Completion Percentage" = "Porcentaje de finalización";
"Translators" = "Traductores";
"Paste URL" = "Pegar URL";
"Collections" = "Colecciones";
"Continue Reading" = "Continuar leyendo";
"Backup & Restore" = "Copia de seguridad y restaurar";
"Export Backup" = "Exportar copia de seguridad";
"Import Backup" = "Importar copia de seguridad";
"Notice: This feature is still experimental. Please double-check your data after import/export." = "Aviso: Esta función aún es experimental. Por favor, verifica tus datos después de exportar/importar.";
"Backup" = "Copia de seguridad";

View file

@ -388,3 +388,107 @@
"me frfr" = "moi frfr";
"Data" = "Données";
"Maximum Quality Available" = "Qualité maximale disponible";
/* Additional translations */
"DownloadCountFormat" = "%d sur %d";
"Error loading chapter" = "Erreur lors du chargement du chapitre";
"Font Size: %dpt" = "Taille de police : %dpt";
"Line Spacing: %.1f" = "Interligne : %.1f";
"Line Spacing" = "Interligne";
"Margin: %dpx" = "Marge : %dpx";
"Margin" = "Marge";
"Auto Scroll Speed" = "Vitesse de défilement automatique";
"Speed" = "Vitesse";
"Speed: %.1fx" = "Vitesse : %.1fx";
"Matched %@: %@" = "Correspondance %@ : %@";
"Enter the AniList ID for this series" = "Entrez l'ID AniList pour cette série";
/* Added missing localizations */
"Create Collection" = "Créer une collection";
"Collection Name" = "Nom de la collection";
"Rename Collection" = "Renommer la collection";
"Rename" = "Renommer";
"All Reading" = "Toutes les lectures";
"Recently Added" = "Ajouté récemment";
"Novel Title" = "Titre du roman";
"Read Progress" = "Progression de la lecture";
"Date Created" = "Date de création";
"Name" = "Nom";
"Item Count" = "Nombre d'éléments";
"Date Added" = "Date d'ajout";
"Title" = "Titre";
"Source" = "Source";
"Search reading..." = "Rechercher dans les lectures...";
"Search collections..." = "Rechercher dans les collections...";
"Search bookmarks..." = "Rechercher dans les favoris...";
"%d items" = "%d éléments";
"Fetching Data" = "Récupération des données";
"Please wait while fetching." = "Veuillez patienter pendant la récupération.";
"Start Reading" = "Commencer la lecture";
"Chapters" = "Chapitres";
"Completed" = "Terminé";
"Drag to reorder" = "Glisser pour réorganiser";
"Drag to reorder sections" = "Glisser pour réorganiser les sections";
"Library View" = "Vue de la bibliothèque";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Personnalisez les sections affichées dans votre bibliothèque. Vous pouvez réorganiser ou désactiver complètement les sections.";
"Library Sections Order" = "Ordre des sections de la bibliothèque";
"Completion Percentage" = "Pourcentage d'achèvement";
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt." = "Certaines fonctionnalités sont limitées au lecteur Sora et au lecteur par défaut, comme le mode paysage forcé, la vitesse de maintien et les sauts de temps personnalisés.\n\nLe réglage du pourcentage d'achèvement détermine à quel moment avant la fin d'une vidéo l'application la marquera comme terminée sur AniList et Trakt.";
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app." = "Le cache de l'application aide à charger les images plus rapidement.\n\nVider le dossier Documents supprimera tous les modules téléchargés.\n\nEffacer les données de l'application supprimera tous vos paramètres et données.";
"Translators" = "Traducteurs";
"Paste URL" = "Coller l'URL";
/* New additions */
"Series Title" = "Titre de la série";
"Content Source" = "Source du contenu";
"Watch Progress" = "Progression de visionnage";
"Recent searches" = "Recherches récentes";
"All Reading" = "Tout ce que vous lisez";
"Nothing to Continue Reading" = "Rien à continuer à lire";
"Your recently read novels will appear here" = "Vos romans récemment lus apparaîtront ici";
"No Bookmarks" = "Aucun favori";
"Add bookmarks to this collection" = "Ajoutez des favoris à cette collection";
"items" = "éléments";
"All Watching" = "Tout ce que vous regardez";
"No Reading History" = "Aucun historique de lecture";
"Books you're reading will appear here" = "Les livres que vous lisez apparaîtront ici";
"Create Collection" = "Créer une collection";
"Collection Name" = "Nom de la collection";
"Rename Collection" = "Renommer la collection";
"Rename" = "Renommer";
"Novel Title" = "Titre du roman";
"Read Progress" = "Progression de lecture";
"Date Created" = "Date de création";
"Name" = "Nom";
"Item Count" = "Nombre d'éléments";
"Date Added" = "Date d'ajout";
"Title" = "Titre";
"Source" = "Source";
"Search reading..." = "Rechercher dans les lectures...";
"Search collections..." = "Rechercher dans les collections...";
"Search bookmarks..." = "Rechercher dans les favoris...";
"%d items" = "%d éléments";
"Fetching Data" = "Récupération des données";
"Please wait while fetching." = "Veuillez patienter pendant la récupération.";
"Start Reading" = "Commencer la lecture";
"Chapters" = "Chapitres";
"Completed" = "Terminé";
"Drag to reorder" = "Faites glisser pour réorganiser";
"Drag to reorder sections" = "Faites glisser pour réorganiser les sections";
"Library View" = "Vue de la bibliothèque";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Personnalisez les sections affichées dans votre bibliothèque. Vous pouvez réorganiser les sections ou les désactiver complètement.";
"Library Sections Order" = "Ordre des sections de la bibliothèque";
"Completion Percentage" = "Pourcentage d'achèvement";
"Translators" = "Traducteurs";
"Paste URL" = "Coller l'URL";
/* New additions */
"Collections" = "Collections";
"Continue Reading" = "Continuer la lecture";
/* Backup & Restore */
"Backup & Restore" = "Sauvegarde & Restauration";
"Export Backup" = "Exporter la sauvegarde";
"Import Backup" = "Importer la sauvegarde";
"Notice: This feature is still experimental. Please double-check your data after import/export." = "Remarque : Cette fonctionnalité est encore expérimentale. Veuillez vérifier vos données après l'export/import.";
"Backup" = "Sauvegarde";

View file

@ -0,0 +1,425 @@
/* General */
"About" = "informazioni";
"About Sora" = "Informazioni su Sora";
"Active" = "Attivi";
"Active Downloads" = "Download Attivi";
"Actively downloading media can be tracked from here." = "I Download Attivi si possono trovare qui";
"Add Module" = "Aggiungi Modulo";
"Adjust the number of media items per row in portrait and landscape modes." = "Imposta il numero dei media per riga in vista orizzontale e in vista verticale";
"Advanced" = "Avanzate";
"AKA Sulfur" = "Aka Sulfur";
"All Bookmarks" = "Tutti i Preferiti";
"All Watching" = "Tutti i Guardati";
"Also known as Sulfur" = "Conosciuta anche come Sulfur";
"AniList" = "AniList";
"AniList ID" = "AniList ID";
"AniList Match" = "AniList Match";
"AniList.co" = "AniList.co";
"Anonymous data is collected to improve the app. No personal information is collected. This can be disabled at any time." = "Vengono raccolti dati anonimi per il miglioramento dell'App, Nessun Dato Personale viene Registrato, Questa opzione può essere disabilitata in ogni momento";
"App Info" = "Informazioni App";
"App Language" = "Lingua App";
"App Storage" = "Memoria Utilizzata dall'app";
"Appearance" = "Aspetto";
/* Alerts and Actions */
"Are you sure you want to clear all cached data? This will help free up storage space." = "Sei sicuro di voler rimuovere tutti i dati presenti nella cache? Questo aiuterà a liberare spazio";
"Are you sure you want to delete '%@'?" = "Sei sicuro di volere rimuovere '%@'?";
"Are you sure you want to delete all %1$d episodes in '%2$@'?" = "Sei sicuro di voler eliminare tutti %1$d episodi in '%2$@'?";
"Are you sure you want to delete all downloaded assets? You can choose to clear only the library while preserving the downloaded files for future use." = "Siete sicuri di voler eliminare tutte le risorse scaricate? È possibile scegliere di cancellare solo la libreria, conservando i file scaricati per un uso futuro.";
"Are you sure you want to erase all app data? This action cannot be undone." = "Sei sicuro di voler eliminare tutti i dati dell'app, questa azione non può essere cancellata";
/* Features */
"Background Enabled" = "Background Abilitato";
"Bookmark items for an easier access later." = "Imposta Preferiti per un accesso Più veloce dopo";
"Bookmarks" = "Preferiti";
"Bottom Padding" = "Distanza Sottotitoli";
"Cancel" = "Cancella";
"Cellular Quality" = "Qualità Dati Cellulare";
"Check out some community modules here!" = "Cerca i moduli della community qui!";
"Choose preferred video resolution for WiFi and cellular connections. Higher resolutions use more data but provide better quality. If the exact quality isn't available, the closest option will be selected automatically.\n\nNote: Not all video sources and players support quality selection. This feature works best with HLS streams using the Sora player." = "Seleziona la Risoluzione video preferita per WiFi e Dati Mobili. Una Risoluzione più alta consuma più dati ma fornisce una qualità migliore. Se la stessa qualità non é disponibile la soluzione più vicina verrà scelta automaticamente \n\nNota:Non tutte le fonti e player supportano la scelta della qualità video.Questa Feature funziona meglio usando il Player integrato di Sora";
"Clear" = "Pulisci";
"Clear All Downloads" = "Pulisci Tutti i Download";
"Clear Cache" = "Pulisci Cache";
"Clear Library Only" = "Pulisci Solo La Libreria";
"Clear Logs" = "Pulisci Log";
"Click the plus button to add a module!" = "Premi il più per aggiungere un modulo";
"Continue Watching" = "Continua a Guardare";
"Continue Watching Episode %d" = "Continua a guardare %d";
"Contributors" = "Collaboratori";
"Copied to Clipboard" = "Copiato Negli Appunti";
"Copy to Clipboard" = "Copia negli Appunti";
"Copy URL" = "Copia URL";
/* Episodes */
"%lld Episodes" = "%lld Episodi";
"%lld of %lld" = "%lld di %lld";
"%lld-%lld" = "%lld-%lld";
"%lld%% seen" = "%lld%% visti";
"Episode %lld" = "Episodio %lld";
"Episodes" = "Episodi";
"Episodes might not be available yet or there could be an issue with the source." = "Gli episodi potrebbero non essere ancora disponibili o potrebbe esserci un errore con la fonte";
"Episodes Range" = "Range Episodi";
/* System */
"cranci1" = "cranc1";
"Dark" = "Dark";
"DATA & LOGS" = "DATA & LOGS";
"Debug" = "Debug";
"Debugging and troubleshooting." = "Debugging e Risoluzione Problemi";
/* Actions */
"Delete" = "Elimina";
"Delete All" = "Elimina Tutto";
"Delete All Downloads" = "Elimina Tutti I Download";
"Delete All Episodes" = "Elimina Tutti Gli Episodi";
"Delete Download" = "Elimina Download";
"Delete Episode" = "Elimina Episodio";
/* Player */
"Double Tap to Seek" = "Doppio Tap Per (Seek)";
"Double tapping the screen on it's sides will skip with the short tap setting." = "Se l'opzione per saltare é abilitata, con questo premendo nei lati due volte é possibile skippare";
/* Downloads */
"Download" = "Scarica";
"Download Episode" = "Scarica Episodio";
"Download Summary" = "Scarica Riassunto";
"Download This Episode" = "Scarica questo Episodio";
"Downloaded" = "Scaricato";
"Downloaded Shows" = "Serie Scaricate";
"Downloading" = "Download in Corso";
"Downloads" = "Scaricati";
/* Settings */
"Enable Analytics" = "Attiva Analytics";
"Enable Subtitles" = "Attiva Sottotitoli";
/* Data Management */
"Erase" = "Cancella";
"Erase all App Data" = "Cancella Tutti i Dati dell'App";
"Erase App Data" = "Cancella Dati App";
/* Errors */
"Error" = "Errore";
"Error Fetching Results" = "Errore nella ricerca dei risultati";
"Errors and critical issues." = "Errori e Problemi Critici";
"Failed to load contributors" = "impossibile caricare i collaboratori";
/* Features */
"Fetch Episode metadata" = "Cercando i Metadata";
"Files Downloaded" = "File Scaricati";
"Font Size" = "Dimensione Carattere";
/* Interface */
"Force Landscape" = "Forza Vista Orizzontale";
"General" = "Generali";
"General events and activities." = "Eventi e Attività Generali";
"General Preferences" = "Preferenze Generali";
"Hide Splash Screen" = "Nascondi Splash Screen";
"HLS video downloading." = "Scaricamento Video HLS";
"Hold Speed" = "Mantieni per Velocizzare";
/* Info */
"Info" = "Info";
"INFOS" = "INFORMAZIONI";
"Installed Modules" = "Moduli Installati";
"Interface" = "Interfaccia";
/* Social */
"Join the Discord" = "Entra Nel Nostro Discord!";
/* Layout */
"Landscape Columns" = "Colonne in Vista Orizzontale";
"Language" = "Lingua";
"LESS" = "Mostra Meno";
/* Library */
"Library" = "Libreria";
"License (GPLv3.0)" = "Licenza (GPLv3.0)";
"Light" = "Tema Chiaro";
/* Loading States */
"Loading Episode %lld..." = "Caricando Gli Episodi %lld...";
"Loading logs..." = "Caricando i Logs";
"Loading module information..." = "Caricando le Informazioni del modulo";
"Loading Stream" = "Caricando lo Stream";
/* Logging */
"Log Debug Info" = "Info Log Debug";
"Log Filters" = "Filtri Log";
"Log In with AniList" = "Accedi a AniList";
"Log In with Trakt" = "Accedi a Trakt";
"Log Out from AniList" = "Esci da AniList";
"Log Out from Trakt" = "Esci da Trakt";
"Log Types" = "Tipo Log";
"Logged in as" = "Accesso Effettuato come";
"Logged in as " = "Accesso Effettuato come";
/* Logs and Settings */
"Logs" = "Logs";
"Long press Skip" = "Tener premuto per Skippare";
"MAIN" = "PRINCIPALE";
"Main Developer" = "Sviluppatore Principale";
"MAIN SETTINGS" = "Impostazioni principali";
/* Media Actions */
"Mark All Previous Watched" = "Segna Tutti I Precedenti Come visti";
"Mark as Watched" = "Segna Come Visto";
"Mark Episode as Watched" = "Segna Episodio come Visto";
"Mark Previous Episodes as Watched" = "Segna episodi precedenti come visti";
"Mark watched" = "Segna Come Completato";
"Match with AniList" = "Match with AniList";
"Match with TMDB" = "Match with TMDB";
"Matched ID: %lld" = "Matched ID: %lld";
"Matched with: %@" = "Matched with:%@";
"Max Concurrent Downloads" = "Download massimi in Contemporanea";
/* Media Interface */
"Media Grid Layout" = "Layout della Griglia dei Media";
"Media Player" = "Media Player";
"Media View" = "Vista media";
"Metadata Provider" = "Provider Metadata";
"Metadata Providers Order" = "Ordine dei Provider Metadata";
"Module Removed" = "Modulo Rimosso";
"Modules" = "Moduli";
/* Headers */
"MODULES" = "MODULI";
"MORE" = "PIÙ";
/* Status Messages */
"No Active Downloads" = "Nessun Download Attivo";
"No AniList matches found" = "Nessun";
"No Data Available" = "Nessun Dato Disponibile";
"No Downloads" = "Nessun Download";
"No episodes available" = "Nessun Episodio Disponibile";
"No Episodes Available" = "Nessun Episodio Disponibile";
"No items to continue watching." = "Nessun Contenuto da continuare a guardare";
"No matches found" = "Nessun Elemento Trovato";
"No Module Selected" = "Nessun Modulo Selezionato";
"No Modules" = "Nessun Modulo";
"No Results Found" = "Nessun Risultato Trovato";
"No Search Results Found" = "Nessun risultato di ricerca trovato";
"Nothing to Continue Watching" = "Nulla da Continuare a Guardare";
/* Notes and Messages */
"Note that the modules will be replaced only if there is a different version string inside the JSON file." = "Si noti che i moduli saranno sostituiti solo se c'è una stringa di versione diversa all'interno del file JSON";
/* Actions */
"OK" = "OK";
"Open Community Library" = "Apri Libreria Community";
/* External Services */
"Open in AniList" = "Apri in AniList";
"Original Poster" = "Poster Originale";
/* Playback */
"Paused" = "Pausa";
"Play" = "Play";
"Player" = "Player";
/* System Messages */
"Please restart the app to apply the language change." = "Riavvia l'app per effettuare i cambiamenti";
"Please select a module from settings" = "Seleziona un Modulo dalle impostazioni";
/* Interface */
"Portrait Columns" = "Colonne in Vista Verticale";
"Progress bar Marker Color" = "Colore Barra di Progresso";
"Provider: %@" = "Provider: %@";
/* Queue */
"Queue" = "Coda";
"Queued" = "In Coda";
/* Content */
"Recently watched content will appear here." = "I Contenuti Precedentemente Visti Appariranno qui";
/* Settings */
"Refresh Modules on Launch" = "Aggiorna i Moduli al Lancio";
"Refresh Storage Info" = "Aggiorna informazioni storage";
"Remember Playback speed" = "Ricorda Velocità Playback";
/* Actions */
"Remove" = "Rimuovi";
"Remove All Cache" = "Pulisci Cache";
/* File Management */
"Remove All Documents" = "Rimuovi Tutti i Documenti";
"Remove Documents" = "Rimuovi Documenti";
"Remove Downloaded Media" = "Rimuovi Media Scaricati";
"Remove Downloads" = "Rimuovi Scaricati";
"Remove from Bookmarks" = "Rimuovi dai Preferiti";
"Remove Item" = "Rimuovi Elemento";
/* Support */
"Report an Issue" = "Segnala un Problema";
/* Reset Options */
"Reset" = "Reimposta";
"Reset AniList ID" = "Reimposta AniList ID";
"Reset Episode Progress" = "Reimposta";
"Reset progress" = "Reimposta Progressi";
"Reset Progress" = "Reimposta Progressi";
/* System */
"Restart Required" = "Riavvio Richiesto";
"Running Sora %@ - cranci1" = "Running Sora %@ - cranc1";
/* Actions */
"Save" = "Salva";
"Search" = "Cerca";
/* Search */
"Search downloads" = "Cerca Download";
"Search for something..." = "Cerca Qualcosa...";
"Search..." = "Cerca...";
/* Content */
"Season %d" = "Stagione %d";
"Season %lld" = "Stagione %lld";
"Segments Color" = "Colore Segmenti";
/* Modules */
"Select Module" = "Seleziona Modulo";
"Set Custom AniList ID" = "Imposta Custom AniList ID";
/* Interface */
"Settings" = "Impostazioni";
"Shadow" = "Ombra";
"Show More (%lld more characters)" = "Mostra Di Più (%lld più Caratteri)";
"Show PiP Button" = "Mostra Bottone PiP";
"Show Skip 85s Button" = "Mostra Skip 85s";
"Show Skip Intro / Outro Buttons" = "Mostra Bottoni Skip Intro/Outro";
"Shows" = "Serie";
"Size (%@)" = "Dimensione (%@)";
"Skip Settings" = "Salta Impostazioni";
/* Player Features */
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments." = "Qualche Features sono limitate a Sora e al Default Player, Come Forza Visualizzazione Orizzontale, Mantieni per Velocizzare e Skip di Tempo Custom";
/* App Info */
"Sora" = "Sora";
"Sora %@ by cranci1" = "Sora %@ by cranci1";
"Sora and cranci1 are not affiliated with AniList or Trakt in any way. Also note that progress updates may not be 100% accurate." = "Sora e Cranc1 non sono affiliati in nessun modo con AniList o Trakt.";
"Sora GitHub Repository" = "Repository GitHub di Sora";
"Sora/Sulfur will always remain free with no ADs!" = "Sora/Sulfur rimarrà sempre gratis e senza pubblicità";
/* Interface */
"Sort" = "Filtra";
"Speed Settings" = "Impostazioni velocità";
/* Playback */
"Start Watching" = "Inizia a Guardare";
"Start Watching Episode %d" = "Guarda Episodio %d";
"Storage Used" = "Memoria Usata";
"Stream" = "Stream";
"Streaming and video playback." = "Streaming e VideoPlayBack";
/* Subtitles */
"Subtitle Color" = "Colore Sottotitoli";
"Subtitle Settings" = "Impostazioni Sottotitoli";
/* Sync */
"Sync anime progress" = "Sincronizza Progressi Anime";
"Sync TV shows progress" = "Sincronizza Progressi Serie Tv";
/* System */
"System" = "Sistema";
/* Instructions */
"Tap a title to override the current match." = "Premi per Sovrascrivere il";
"Tap Skip" = "Premi per Saltare";
"Tap to manage your modules" = "Premi Per Gestire i Tuoi Moduli";
"Tap to select a module" = "Premi per Selezionare un Modulo";
/* App Information */
"The app cache helps the app load images faster. Clearing the Documents folder will delete all downloaded modules. Do not erase App Data unless you understand the consequences — it may cause the app to malfunction." = "La Cache dell'App serve a caricare le immagini più velocemente, pulire la cartella dei documenti eliminerà tutti i moduli scaricati. Non cancellare i Dati dell'App senza aver capito le conseguenze- potrebbe causare malfunzionamenti all'app";
"The episode range controls how many episodes appear on each page. Episodes are grouped into sets (like 125, 2650, and so on), allowing you to navigate through them more easily. For episode metadata, it refers to the episode thumbnail and title, since sometimes it can contain spoilers." = "Il range degli episodi controlla quanti episodi appaiono in ogni pagina.Gli episodi sono raggruppati in set (tipo 1-25,26-50 e così via), permettendo di accedere ad essi più facilmente";
"The module provided only a single episode, this is most likely a movie, so we decided to make separate screens for these cases." = "";
/* Interface */
"Thumbnails Width" = "Grandezza Miniature";
"TMDB Match" = "TMDB Match";
"Trackers" = "Trackers";
"Trakt" = "Trakt";
"Trakt.tv" = "Trakt.tv";
/* Search */
"Try different keywords" = "Prova diverse Parole Chiave";
"Try different search terms" = "Prova diversi Termini di Ricerca";
/* Player Controls */
"Two Finger Hold for Pause" = "Mantieni con Due Dita Per Mettere in Pausa";
"Unable to fetch matches. Please try again later." = "Impossibile trovare i match. Riprovare più tardi.";
"Use TMDB Poster Image" = "Usa i poster di IMDB";
/* Version */
"v%@" = "v%@";
"Video Player" = "Video Player";
/* Video Settings */
"Video Quality Preferences" = "Preferenze qualità video";
"View All" = "Vedi Tutti";
"Watched" = "Guardati";
"Why am I not seeing any episodes?" = "Perché non sto vedendo nessun episodio?";
"WiFi Quality" = "Qualità WiFi";
/* User Status */
"You are not logged in" = "Non sei Loggato";
"You have no items saved." = "Non hai Elementi Salvati";
"Your downloaded episodes will appear here" = "I Tuoi Download appariranno Qui";
"Your recently watched content will appear here" = "I Contenuti Guardati Recentemente Appariranno Qui";
/* Download Settings */
"Download Settings" = "Impostazioni Download";
"Max concurrent downloads controls how many episodes can download simultaneously. Higher values may use more bandwidth and device resources." = "Il valore massimo di download contemporanei controlla il numero di episodi che possono essere scaricati simultaneamente. Valori più alti possono utilizzare più larghezza di banda e risorse del dispositivo.";
"Quality" = "Qualità";
"Max Concurrent Downloads" = "Download Massimi in Contemporanea";
"Allow Cellular Downloads" = "Permetti il download con Connessione Dati";
"Quality Information" = "Informazioni Qualità";
/* Storage */
"Storage Management" = "Gestione Memoria";
"Storage Used" = "Memoria Usata";
"Library cleared successfully" = "Libreria Pulita con Successo";
"All downloads deleted successfully" = "Tutti i Download Sono Stati Eliminati Correttamente";
/* New additions */
"Recent searches" = "Ricerche Recenti";
"me frfr" = "me frfr";
"Data" = "Dati";
"Maximum Quality Available" = "Qualità Massima Disponibile";
"DownloadCountFormat" = "%d di %d";
"Error loading chapter" = "Errore nel caricamento del capitolo";
"Font Size: %dpt" = "Dimensione carattere: %dpt";
"Line Spacing: %.1f" = "Interlinea: %.1f";
"Line Spacing" = "Interlinea";
"Margin: %dpx" = "Margine: %dpx";
"Margin" = "Margine";
"Auto Scroll Speed" = "Velocità di scorrimento automatico";
"Speed" = "Velocità";
"Speed: %.1fx" = "Velocità: %.1fx";
"Matched %@: %@" = "Corrispondenza %@: %@";
"Enter the AniList ID for this series" = "Inserisci l'ID AniList per questa serie";
/* Added missing localizations */
"Create Collection" = "Crea raccolta";
"Collection Name" = "Nome raccolta";
"Rename Collection" = "Rinomina raccolta";
"Rename" = "Rinomina";
"All Reading" = "Tutte le letture";
"Recently Added" = "Aggiunti di recente";
"Novel Title" = "Titolo del romanzo";
"Read Progress" = "Progresso lettura";
"Date Created" = "Data di creazione";
"Name" = "Nome";
"Item Count" = "Numero di elementi";
"Date Added" = "Data di aggiunta";
"Title" = "Titolo";
"Source" = "Fonte";
"Search reading..." = "Cerca nelle letture...";
"Search collections..." = "Cerca nelle raccolte...";
"Search bookmarks..." = "Cerca nei segnalibri...";
"%d items" = "%d elementi";
"Fetching Data" = "Recupero dati";
"Please wait while fetching." = "Attendere durante il recupero.";
"Start Reading" = "Inizia a leggere";
"Chapters" = "Capitoli";
"Completed" = "Completato";
"Drag to reorder" = "Trascina per riordinare";
"Drag to reorder sections" = "Trascina per riordinare le sezioni";
"Library View" = "Vista libreria";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Personalizza le sezioni mostrate nella tua libreria. Puoi riordinare le sezioni o disabilitarle completamente.";
"Library Sections Order" = "Ordine delle sezioni della libreria";
"Completion Percentage" = "Percentuale di completamento";
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt." = "Alcune funzioni sono limitate al player Sora e a quello predefinito, come la forzatura del paesaggio, la velocità di mantenimento e gli intervalli di salto personalizzati.\n\nL'impostazione della percentuale di completamento determina in quale punto prima della fine di un video l'app lo segnerà come completato su AniList e Trakt.";
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app." = "La cache dell'app aiuta a caricare le immagini più velocemente.\n\nCancellare la cartella Documenti eliminerà tutti i moduli scaricati.\n\nCancellare i dati dell'app eliminerà tutte le tue impostazioni e dati.";
"Translators" = "Traduttori";
"Paste URL" = "Incolla URL";
"Series Title" = "Titolo della serie";
"Content Source" = "Fonte del contenuto";
"Watch Progress" = "Progresso di visione";
"Recent searches" = "Ricerche recenti";
"All Reading" = "Tutto ciò che leggi";
"Nothing to Continue Reading" = "Niente da continuare a leggere";
"Your recently read novels will appear here" = "I tuoi romanzi letti di recente appariranno qui";
"No Bookmarks" = "Nessun segnalibro";
"Add bookmarks to this collection" = "Aggiungi segnalibri a questa raccolta";
"items" = "elementi";
"All Watching" = "Tutto ciò che guardi";
"No Reading History" = "Nessuna cronologia di lettura";
"Books you're reading will appear here" = "I libri che stai leggendo appariranno qui";
"Create Collection" = "Crea raccolta";
"Collection Name" = "Nome raccolta";
"Rename Collection" = "Rinomina raccolta";
"Rename" = "Rinomina";
"Novel Title" = "Titolo del romanzo";
"Read Progress" = "Progresso di lettura";
"Date Created" = "Data di creazione";
"Name" = "Nome";
"Item Count" = "Numero di elementi";
"Date Added" = "Data di aggiunta";
"Title" = "Titolo";
"Source" = "Fonte";
"Search reading..." = "Cerca nelle letture...";
"Search collections..." = "Cerca nelle raccolte...";
"Search bookmarks..." = "Cerca nei segnalibri...";
"%d items" = "%d elementi";
"Fetching Data" = "Recupero dati";
"Please wait while fetching." = "Attendere durante il recupero.";
"Start Reading" = "Inizia a leggere";
"Chapters" = "Capitoli";
"Completed" = "Completato";
"Drag to reorder" = "Trascina per riordinare";
"Drag to reorder sections" = "Trascina per riordinare le sezioni";
"Library View" = "Vista libreria";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Personalizza le sezioni mostrate nella tua libreria. Puoi riordinare le sezioni o disabilitarle completamente.";
"Library Sections Order" = "Ordine delle sezioni della libreria";
"Completion Percentage" = "Percentuale di completamento";
"Translators" = "Traduttori";
"Paste URL" = "Incolla URL";
"Collections" = "Raccolte";
"Continue Reading" = "Continua a leggere";
"Backup & Restore" = "Backup e ripristino";
"Export Backup" = "Esporta backup";
"Import Backup" = "Importa backup";
"Notice: This feature is still experimental. Please double-check your data after import/export." = "Nota: Questa funzione è ancora sperimentale. Si prega di ricontrollare i dati dopo esportazione/importazione.";
"Backup" = "Backup";

View file

@ -397,10 +397,110 @@ For episode metadata, it refers to the episode thumbnail and title, since someti
"Storage Management" = "Қойма басқаруы";
"Storage Used" = "Пайдаланылған қойма";
"Library cleared successfully" = "Кітапхана сәтті тазартылды";
"All downloads deleted successfully" = "Барлық жүктеулер сәтті жойылды";
"All downloads deleted successfully" = "Барлық жүктеулер сәтті жойылды";
/* New additions */
"Recent searches" = "Соңғы іздеулер";
"me frfr" = "мен шынында";
"Data" = "Деректер";
"Maximum Quality Available" = "Қолжетімді максималды сапа";
"Maximum Quality Available" = "Қолжетімді максималды сапа";
"DownloadCountFormat" = "%d / %d";
"Error loading chapter" = "Тарауды жүктеу қатесі";
"Font Size: %dpt" = "Қаріп өлшемі: %dpt";
"Line Spacing: %.1f" = "Жоларалық қашықтық: %.1f";
"Line Spacing" = "Жоларалық қашықтық";
"Margin: %dpx" = "Шеткі өріс: %dpx";
"Margin" = "Шеткі өріс";
"Auto Scroll Speed" = "Автоматты айналдыру жылдамдығы";
"Speed" = "Жылдамдық";
"Speed: %.1fx" = "Жылдамдық: %.1fx";
"Matched %@: %@" = "Сәйкестік %@: %@";
"Enter the AniList ID for this series" = "Осы серия үшін AniList ID енгізіңіз";
/* Added missing localizations */
"Create Collection" = "Жинақ құру";
"Collection Name" = "Жинақ атауы";
"Rename Collection" = "Жинақты қайта атау";
"Rename" = "Қайта атау";
"All Reading" = "Барлық оқу";
"Recently Added" = "Жуырда қосылған";
"Novel Title" = "Роман атауы";
"Read Progress" = "Оқу барысы";
"Date Created" = "Құрылған күні";
"Name" = "Атауы";
"Item Count" = "Элементтер саны";
"Date Added" = "Қосылған күні";
"Title" = "Тақырып";
"Source" = "Дереккөз";
"Search reading..." = "Оқуды іздеу...";
"Search collections..." = "Жинақтарды іздеу...";
"Search bookmarks..." = "Бетбелгілерді іздеу...";
"%d items" = "%d элемент";
"Fetching Data" = "Деректерді алу";
"Please wait while fetching." = "Алу барысында күтіңіз.";
"Start Reading" = "Оқуды бастау";
"Chapters" = "Тараулар";
"Completed" = "Аяқталды";
"Drag to reorder" = "Ретін өзгерту үшін сүйреңіз";
"Drag to reorder sections" = "Бөлімдердің ретін өзгерту үшін сүйреңіз";
"Library View" = "Кітапхана көрінісі";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Кітапханаңызда көрсетілетін бөлімдерді баптаңыз. Бөлімдерді қайта реттеуге немесе толықтай өшіруге болады.";
"Library Sections Order" = "Кітапхана бөлімдерінің реті";
"Completion Percentage" = "Аяқталу пайызы";
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt." = "Кейбір функциялар тек Sora және әдепкі ойнатқышта ғана қолжетімді, мысалы, ландшафтты мәжбүрлеу, жылдамдықты ұстау және уақытты өткізіп жіберу.\n\nАяқталу пайызы параметрі бейне соңына дейін қай жерде аяқталған деп белгіленетінін анықтайды (AniList және Trakt).";
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app." = "Қолданба кэші суреттерді жылдам жүктеуге көмектеседі.\n\nDocuments қалтасын тазалау барлық жүктелген модульдерді өшіреді.\n\nҚолданба деректерін өшіру барлық баптауларыңызды және деректеріңізді өшіреді.";
"Translators" = "Аудармашылар";
"Paste URL" = "URL қою";
/* Added missing localizations */
"Series Title" = "Серия атауы";
"Content Source" = "Мазмұн көзі";
"Watch Progress" = "Көру барысы";
"Nothing to Continue Reading" = "Оқуды жалғастыруға ештеңе жоқ";
"Your recently read novels will appear here" = "Соңғы оқылған романдар осында көрсетіледі";
"No Bookmarks" = "Бетбелгілер жоқ";
"Add bookmarks to this collection" = "Бұл жинаққа бетбелгілерді қосыңыз";
"items" = "элементтер";
"All Watching" = "Барлық көру";
"No Reading History" = "Оқу тарихы жоқ";
"Books you're reading will appear here" = "Сіз оқып жатқан кітаптар осында көрсетіледі";
"Create Collection" = "Жинақ құру";
"Collection Name" = "Жинақ атауы";
"Rename Collection" = "Жинақты қайта атау";
"Rename" = "Қайта атау";
"Novel Title" = "Роман атауы";
"Read Progress" = "Оқу барысы";
"Date Created" = "Жасалған күні";
"Name" = "Аты";
"Item Count" = "Элементтер саны";
"Date Added" = "Қосылған күні";
"Title" = "Атауы";
"Source" = "Дереккөз";
"Search reading..." = "Оқуды іздеу...";
"Search collections..." = "Жинақтарды іздеу...";
"Search bookmarks..." = "Бетбелгілерді іздеу...";
"%d items" = "%d элемент";
"Fetching Data" = "Деректерді алу";
"Please wait while fetching." = "Алу кезінде күтіңіз.";
"Start Reading" = "Оқуды бастау";
"Chapters" = "Тараулар";
"Completed" = "Аяқталды";
"Drag to reorder" = "Қайта реттеу үшін сүйреңіз";
"Drag to reorder sections" = "Бөлімдерді қайта реттеу үшін сүйреңіз";
"Library View" = "Кітапхана көрінісі";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Кітапханаңызда көрсетілетін бөлімдерді реттеңіз. Бөлімдерді қайта реттеуге немесе толықтай өшіруге болады.";
"Library Sections Order" = "Кітапхана бөлімдерінің реті";
"Completion Percentage" = "Аяқталу пайызы";
"Translators" = "Аудармашылар";
"Paste URL" = "URL қою";
/* Added missing localizations */
"Collections" = "Жинақтар";
"Continue Reading" = "Оқуды жалғастыру";
/* Backup & Restore */
"Backup & Restore" = "Сақтық көшірме және қалпына келтіру";
"Export Backup" = "Сақтық көшірмені экспорттау";
"Import Backup" = "Сақтық көшірмені импорттау";
"Notice: This feature is still experimental. Please double-check your data after import/export." = "Ескерту: Бұл мүмкіндік әлі де тәжірибелік. Экспорт/импорттан кейін деректеріңізді тексеріңіз.";
"Backup" = "Сақтық көшірме";

View file

@ -0,0 +1,467 @@
/* General */
"About" = "Бидний тухайд";
"About Sora" = "Sora аппын тухай";
"Active" = "Идэвхтэй";
"Active Downloads" = "Татаж байна";
"Actively downloading media can be tracked from here." = "Татаж байгаа үзвэрүүдийг эндээс харж болно";
"Add Module" = "Модул нэмэх";
"Adjust the number of media items per row in portrait and landscape modes." = "Хэвтээ болон босоо загварын нэг мөрөн харуулах үзвэрийн тоо";
"Advanced" = "Нарийн тохиргоо";
"AKA Sulfur" = "өөрөөр Sulfur";
"All Bookmarks" = "Бүх хадгалсан үзвэрүүд";
"All Watching" = "Үзэж буй үзвэрүүд";
"Also known as Sulfur" = "өөрөөр Sulfur гэж нэрлэдэг";
"AniList" = "AniList";
"AniList ID" = "AniList ХД";
"AniList Match" = "AniList тохирол";
"AniList.co" = "AniList.co";
"Anonymous data is collected to improve the app. No personal information is collected. This can be disabled at any time." = "Аппыг сайжруулах зорилгоор мэдээллийг нууцалж цуглуулдаг. Таны хувийн мэдээллийг цуглуулдаггүй болно. Мөн хүссэн үедээ мэдээлэл цуглуулахыг цуцалж болно.";
"App Info" = "Аппын мэдээлэл ";
"App Language" = "Хэл";
"App Storage" = "Багтаамж";
"Appearance" = "Харагдах байдал";
/* Alerts and Actions */
"Are you sure you want to clear all cached data? This will help free up storage space." = "Та хадгалагдсан өгөгдлийн устгахдаа итгэлтэй байна уу? Устгасан тохиолдолд багтаамж чөлөөлөгдөнө.";
"Are you sure you want to delete '%@'?" = "Та '%@' үзвэрийг устгахдаа итгэлтэй байна уу?";
"Are you sure you want to delete all %1$d episodes in '%2$@'?" = "Та '%2$@' үзвэрийн %1$d ангиудыг устгахдаа итгэлтэй байна уу?";
"Are you sure you want to delete all downloaded assets? You can choose to clear only the library while preserving the downloaded files for future use." = "Та бүх татаж авсан үзвэрийг устгахдаа итгэлтэй байна уу? Зөвхөн сангаа цэврэлсэнээр, татаж авсан үзвэрүүдээ устгахгүй байж болно.";
"Are you sure you want to erase all app data? This action cannot be undone." = "Та аппын бүх өгөгдлийг утгахдаа итгэлтэй байна уу? Энэ үйлдлийг буцаах боломжгүй.";
/* Features */
"Background Enabled" = "Аппыг идэвхгүй үед татах";
"Bookmark items for an easier access later." = "Үзвэрийг хадгалсанаар дараа нь олоход хялбар болно";
"Bookmarks" = "Хадгалсан үзвэр";
"Bottom Padding" = "Доод зай";
"Cancel" = "Цуцлах";
"Cellular Quality" = "Утасны дата бичлэгийн чанар";
"Check out some community modules here!" = "Илүү олон модулиудыг эндээс олоорой!";
"Choose preferred video resolution for WiFi and cellular connections. Higher resolutions use more data but provide better quality. If the exact quality isn't available, the closest option will be selected automatically.\n\nNote: Not all video sources and players support quality selection. This feature works best with HLS streams using the Sora player." = "Өөрийн WiFi болон утасны датанд тааруулж бичлэгийн чанарыг сонгоорой. Өндөр чанартай бичлэг нь илүү их дата ашиглана. Хэрэв таны сонгосон бичлэгийн чанар байхгүй бол хамгийн ойролцоо чанарыг сонгож тоглуулна.\n\nТэмдэглэл: Бүх үзвэрүүд болон бичлэг тоглуулагч нь чанар сонгох үйлдэлгүй байдаг. Бичлэгийн чанар сонгох үйлдлийг HLS төрлийн үзвэрийг Sora тоглуулагч ашиглан үзэж байгаа тохиолдолд ашиглахад хамгийн тохиромжтой байдаг.";
"Clear" = "Устгах";
"Clear All Downloads" = "Бүх таталтыг устгах";
"Clear Cache" = "Кэш цэвэрлэх";
"Clear Library Only" = "Зөвхөн санг цэвэрлэх";
"Clear Logs" = "Лог цэвэрлэх";
"Click the plus button to add a module!" = "Нэмэх тэмдэг дээр дарж шинэ модуль нэмнэ үү!";
"Continue Watching" = "Үргэлжлүүлж үзэх";
"Continue Watching Episode %d" = "%d ангийг үргэлжлүүлж үзэх";
"Contributors" = "Хувь нэмэр оруулсан";
"Copied to Clipboard" = "Хуулсан";
"Copy to Clipboard" = "Хуулсан";
"Copy URL" = "Холбоосыг хуулах";
/* Episodes */
"%lld Episodes" = "%lld анги";
"%lld of %lld" = "%lld-ийн %lld";
"%lld-%lld" = "%lld-%lld";
"%lld%% seen" = "%lld%% үзсэн";
"Episode %lld" = "%lld-р анги";
"Episodes" = "Ангиуд";
"Episodes might not be available yet or there could be an issue with the source." = " ";
"Episodes Range" = " ";
/* System */
"cranci1" = "cranci1";
"Dark" = "Хар";
"DATA & LOGS" = "Өгөгдөл ба лог";
"Debug" = "Алдаа илрүүлэх";
"Debugging and troubleshooting." = "Алдааг илрүүлэх ба асуудал олох";
/* Actions */
"Delete" = "Устгах";
"Delete All" = "Бүгдийг устгах";
"Delete All Downloads" = "Бүх таталтыг устгах";
"Delete All Episodes" = "Бүх ангийг устгах";
"Delete Download" = "Таталт устгах";
"Delete Episode" = "Анги устгах";
/* Player */
"Double Tap to Seek" = "Хоёр дарж гүйлгэх";
"Double tapping the screen on it's sides will skip with the short tap setting." = "Дэлгэцийн хоёр талд хоёр удаа хурдан дарвал богино хугацаагаар бичлэгийг гүйлгэнэ.";
/* Downloads */
"Download" = "Татах";
"Download Episode" = "Анги татах";
"Download Summary" = "Таталтын түүх";
"Download This Episode" = "Энэ ангийг татах";
"Downloaded" = "Татсан";
"Downloaded Shows" = "Татсан үзвэрүүд";
"Downloading" = "Татаж байна";
"Downloads" = "Таталтууд";
/* Settings */
"Enable Analytics" = "Аналитик ажилуулах";
"Enable Subtitles" = "Хадмал харуулах";
/* Data Management */
"Erase" = "Арилгах";
"Erase all App Data" = "Аппын бүх өгөгдлийг арилгах";
"Erase App Data" = "Аппын өгөгдлийг арилгах";
/* Errors */
"Error" = "Алдаа";
"Error Fetching Results" = "Илэрцийг олоход гарсан алдаа";
"Errors and critical issues." = "Алдаанууд болон ноцтой асуудлууд";
"Failed to load contributors" = "Контрибуторуудыг ачааллаж чадсангүй";
/* Features */
"Fetch Episode metadata" = "Ангийн мета мэдээллийг татах";
"Files Downloaded" = "Татаж авсан файлууд";
"Font Size" = "Үсгийн хэмжээ";
/* Interface */
"Force Landscape" = "Байнга хэвтээ байлгах";
"General" = "Ерөнхий";
"General events and activities." = "Ерөнхий эвэнт ба үйл ажиллагаанууд";
"General Preferences" = "Ерөнхий тохиргоо";
"Hide Splash Screen" = "Эхлэлийн дэлгэцийг нуух";
"HLS video downloading." = "HLS бичлэг таталт";
"Hold Speed" = "Дарах хурд";
/* Info */
"Info" = "Мэдээлэл";
"INFOS" = "МЭДЭЭЛЛҮҮД";
"Installed Modules" = "Суулгасан модулиуд";
"Interface" = "Харилцах хэсэг";
/* Social */
"Join the Discord" = "Дискорд сувагт нэгдэх";
/* Layout */
"Landscape Columns" = "Хэвтээ багана";
"Language" = "Хэл";
"LESS" = "БАГАСГАХ";
/* Library */
"Library" = "Сан";
"License (GPLv3.0)" = "Лиценз (GPLх3.0)";
"Light" = "Цагаан";
/* Loading States */
"Loading Episode %lld..." = "%lld-р ангийг ачаалж байна...";
"Loading logs..." = "Логийг ачаалж байна...";
"Loading module information..." = "Модулийн мэдээллийг ачаалж байна...";
"Loading Stream" = "Үзвэрийг ачаалж байна";
/* Logging */
"Log Debug Info" = "Дибаг мэдээллийг бичих";
"Log Filters" = "Лог шүүлтүүрүүд";
"Log In with AniList" = "AniList-ээр нэвтрэх";
"Log In with Trakt" = "Trakt-аар нэвтрэх";
"Log Out from AniList" = "AniList-ээс гарах";
"Log Out from Trakt" = "Trakt-аас гарах";
"Log Types" = "Логийн төрлүүд";
"Logged in as" = "Нэвтэрсэн байна";
"Logged in as " = " нэвтэрсэн байна";
/* Logs and Settings */
"Logs" = "Логууд";
"Long press Skip" = "Удаан дарж алгасах";
"MAIN" = "ҮНДСЭН";
"Main Developer" = "Үндсэн Хөгжүүлэгч";
"MAIN SETTINGS" = "ҮНДСЭН ТОХИРГООНУУД";
/* Media Actions */
"Mark All Previous Watched" = "Өмнөх бүгдийг үзсэнээр тэмдэглэх";
"Mark as Watched" = "Үзсэнээр тэмдэглэх";
"Mark Episode as Watched" = "Ангийг үзсэнээр тэмдэглэх";
"Mark Previous Episodes as Watched" = "Өмнөх бүх ангийг үзсэнээр тэмдэглэх";
"Mark watched" = "Үзсэнийг тэмдэглэх";
"Match with AniList" = "Anilist-тэй тааруулах";
"Match with TMDB" = "TMDB-тэй тааруулах";
"Matched ID: %lld" = "Тааруулсан ХД: %lld";
"Matched with: %@" = "Тааруулсан: %@";
"Max Concurrent Downloads" = "Зэрэг татах дээд хэмжээ";
/* Media Interface */
"Media Grid Layout" = "Медиа грид байршил";
"Media Player" = "Медиа тоглуулагч";
"Media View" = "Медиа харагдац";
"Metadata Provider" = "Нэмэлт мэдээлэл нийлүүлэгч";
"Metadata Providers Order" = "Нэмэлт мэдээлэл нийлүүлэгчид";
"Module Removed" = "Модуль устсан";
"Modules" = "Модулиуд";
/* Headers */
"MODULES" = "МОДУЛИУД";
"MORE" = "ИЛҮҮ";
/* Status Messages */
"No Active Downloads" = "Идэвхтэй таталт байхгүй байна";
"No AniList matches found" = "Anilist дээр олдсонгүй";
"No Data Available" = "Мэдээлэл байхгүй байна";
"No Downloads" = "Таталт байхгүй байна";
"No episodes available" = "Анги олдсонгүй";
"No Episodes Available" = "Анги Олдсонгүй";
"No items to continue watching." = "Үргэлүүлж үзэх зүйл байхгүй";
"No matches found" = "Илэрц олдсонгүй";
"No Module Selected" = "Модуль сонгоогүй байна";
"No Modules" = "Модуль байгүй";
"No Results Found" = "Хайлт олдсонгүй";
"No Search Results Found" = "Хайлтын Үр Дүн Олдсонгүй";
"Nothing to Continue Watching" = "Үргэлжлүүлж Үзэх Зүйл Байхгүй";
/* Notes and Messages */
"Note that the modules will be replaced only if there is a different version string inside the JSON file." = "Модулийн JSON файл доторх хувилбарийн нэр өөрчлөгдсөн тохиолдолд л модуль шинэчлэгдэнэ.";
/* Actions */
"OK" = "ЗА";
"Open Community Library" = "Нийтлэг Санг Нээх";
/* External Services */
"Open in AniList" = "Anilist дотор нээх";
"Original Poster" = "Жинхэнэ Постлогч";
/* Playback */
"Paused" = "Зогсоосон";
"Play" = "Тоглуулах";
"Player" = "Тоглуулагч";
/* System Messages */
"Please restart the app to apply the language change." = "Аппаас гарч дахин орсноор хэл солигдоно";
"Please select a module from settings" = "Тохиргооны хэсгээс модуль сонгоно уу";
/* Interface */
"Portrait Columns" = "Босоо Баганууд";
"Progress bar Marker Color" = "Явцын зурвасын тэмдэглэгээний өнгө";
"Provider: %@" = "Нийлүүлэгч: %@";
/* Queue */
"Queue" = "Дараалал";
"Queued" = "Хүлээлтэд орсон";
/* Content */
"Recently watched content will appear here." = "Сүүлд үзсэн үзвэрүүд энд харагдана";
/* Settings */
"Refresh Modules on Launch" = "Апп нээгдэх болгонд модуль шинэчлэх";
"Refresh Storage Info" = "Багтаамжийн мэдээллийг шинэчлэх";
"Remember Playback speed" = "Тоглуулах хурдыг сануулах";
/* Actions */
"Remove" = "Устгах";
"Remove All Cache" = "Бүх Кэшийг Устгах";
/* File Management */
"Remove All Documents" = "Бүх мэдээлийг устгах";
"Remove Documents" = "Мэдээллийг Устгах";
"Remove Downloaded Media" = "Татаж авсан үзвэрийг устгах";
"Remove Downloads" = "Таталтуудыг Устгах";
"Remove from Bookmarks" = "Хадгалахаа болих";
"Remove Item" = "Анги Устгах";
/* Support */
"Report an Issue" = "Алдаа мэдээлэх";
/* Reset Options */
"Reset" = "Анхны төлөвт оруулах";
"Reset AniList ID" = "AniList ХД анхны төлөвт оруулах";
"Reset Episode Progress" = "Эхнээс нь үзэх";
"Reset progress" = "Анхны төлөвт оруулах явц";
"Reset Progress" = "Явцыг ахний төлөвт оруулах";
/* System */
"Restart Required" = "Дахин ачааллах шаардлагатай";
"Running Sora %@ - cranci1" = "Sora %@ ачаалж байна - cranci1";
/* Actions */
"Save" = "Хадгалах";
"Search" = "Хайа";
/* Search */
"Search downloads" = "Татсан үзвэр хайх";
"Search for something..." = "Үзвэр хайх...";
"Search..." = "Хайх...";
/* Content */
"Season %d" = "%d-р Улирал";
"Season %lld" = "%lld-р Улирал";
"Segments Color" = "Ерөнхий өнгө";
/* Modules */
"Select Module" = "Модуль сонгох";
"Set Custom AniList ID" = "AniList ХД харуулах";
/* Interface */
"Settings" = "Тохиргоо";
"Shadow" = "Сүүдэр";
"Show More (%lld more characters)" = "Илүү харуулах (%lld тэмдэгт харагдана)";
"Show PiP Button" = "PiP товч харуулах";
"Show Skip 85s Button" = "85с алгасах товч харуулах";
"Show Skip Intro / Outro Buttons" = "Эхлэл/Төгсгөлийн дууг алгасах точ хөруулах";
"Shows" = "Харуулах";
"Size (%@)" = "Хэмжээ (%d)";
"Skip Settings" = "Алгасах тохиргоо";
/* Player Features */
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments." = "Зарим үйлдлүүд нь зөвхөн Sora болон Үндсэн тоглуулагч дээр ажилладаг, тухайлбал Үргэлж хэвтээ байдлаар үзэх, удаан дарж хурд удирдах болон алгасах хугацаа нь тохиргоо";
/* App Info */
"Sora" = "Sora";
"Sora %@ by cranci1" = "Sora %@ by cranci1";
"Sora and cranci1 are not affiliated with AniList or Trakt in any way.
Also note that progress updates may not be 100% accurate." = "
Sora ба cranci1 нь AniList эсвэл Trakt-тэй ямар ч хамааралгүй болно.
Мөн явцын шинэчлэлтүүд 100% үнэн зөв байж чадахгүй гэдгийг анхаарна уу.";
"Sora GitHub Repository" = "Sora GitHub хуудас";
"Sora/Sulfur will always remain free with no ADs!" = "Sora/Sulfur нь үргэлж үнэ төлбөргүй, зар сурталчилгаагүй байх болно!";
/* Interface */
"Sort" = "Эрэмблэх";
"Speed Settings" = "Тоглуулах хурд";
/* Playback */
"Start Watching" = "Үзэх";
"Start Watching Episode %d" = "%d ангийг үзэх";
"Storage Used" = "Ашигласан багтаамж";
"Stream" = "Үзвэр";
"Streaming and video playback." = "Үзвэр ба бичлэг";
/* Subtitles */
"Subtitle Color" = "Хадмалын өнгө";
"Subtitle Settings" = "Хадмалын тохиргоо";
/* Sync */
"Sync anime progress" = "Аниме үзсэн ангиудыг тэмдэглэх";
"Sync TV shows progress" = "Цувралын үзсэн ангиудыг тэмдэглэх";
/* System */
"System" = "Систем";
/* Instructions */
"Tap a title to override the current match." = "Нэр дээр дарж одоогийн хайлтыг солино уу";
"Tap Skip" = "Энд дарж гүйлгэнэ үү";
"Tap to manage your modules" = "Энд дарж модуль солино уу";
"Tap to select a module" = "Энд дарж модуль сонгоно уу";
/* App Information */
"The app cache helps the app load images faster. Clearing the Documents folder will delete all downloaded modules. Do not erase App Data unless you understand the consequences — it may cause the app to malfunction." = " Аппын кэш нь зургуудийг илүү хурдан ачаалахад тусалдаг. Documents хавтасыг устгавал бүх татсан үзвэрүүдийг утгана. Гарах үр дагаврыг нь ойлголгүйгээр Апп датаг бүү устга - Энэ нь дараа нь аппыг буруу ажиллахад нөлөөлөх боломжтой";
"The episode range controls how many episodes appear on each page. Episodes are grouped into sets (like 125, 2650, and so on), allowing you to navigate through them more easily. For episode metadata, it refers to the episode thumbnail and title, since sometimes it can contain spoilers." = " Ангийн хязгаар нь нэг хуудсанд хэдэн харагдахыг тохируулдаг. Ингэснээр ангиуд нь багцлагдаж (Жишээ нь 1-25, 26-50 гэх мэт), үзэх ангиа сонгоход илүү хялбар болгоно. Ангийн мета өгөгдөл нь тухайн ангийн харагдац зураг болон нэрийг хадгалдаг тул зарим тохиолдолд спойлер агуулдаг.";
"The module provided only a single episode, this is most likely a movie, so we decided to make separate screens for these cases." = "Модуль зөвхөн нэг анги агуулсан байсан тул, кино байх боломжтой гэж үзээд тусгай дэлгэц хийхээр шийдсэн.";
/* Interface */
"Thumbnails Width" = "Үзвэрийн зургийн урт";
"TMDB Match" = "ТМДБ тохирол";
"Trackers" = "Тракерууд";
"Trakt" = "Trakt";
"Trakt.tv" = "Trakt.tv";
/* Search */
"Try different keywords" = "Өөр үгээр хайж үзнэ үү";
"Try different search terms" = "Өөр төрлөөр хайж үзнэ үү";
/* Player Controls */
"Two Finger Hold for Pause" = "Хоёр хуруугаар дарж бичлэгийг зогсоох";
"Unable to fetch matches. Please try again later." = "Илэрц олж чадсангүй. Дараа дахин оролдоно уу?";
"Use TMDB Poster Image" = "ТМДБ нүүр зураг ашиглах";
/* Version */
"v%@" = "х%@";
"Video Player" = "Бичлэг тоглуулагч";
/* Video Settings */
"Video Quality Preferences" = "Бичлэгийн чанарын тохиргоо";
"View All" = "Бүгдийг харах";
"Watched" = "Үзсэн";
"Why am I not seeing any episodes?" = "Яагаад нэг ч анги байхгүй байна?";
"WiFi Quality" = "WiFi чанар";
/* User Status */
"You are not logged in" = "Та нэвтрээгүй байна";
"You have no items saved." = "Танд хадгалсан үзвэр байхгүй байна";
"Your downloaded episodes will appear here" = "Таны татсан үзвэрийн ангиуд энд харагдана";
"Your recently watched content will appear here" = "Таны сүүлд үзсэн үзвэрүүд энд харагдана";
/* Download Settings */
"Download Settings" = "Таталтын тохиргоо";
"Max concurrent downloads controls how many episodes can download simultaneously. Higher values may use more bandwidth and device resources." = "Зэрэг таталт хийх хязгаар нь зэрэг татах ангийн тоо юм. Өндөр байх тусам илүү их дата болон утасны нөөцийг ашиглана.";
"Quality" = "Чанар";
"Max Concurrent Downloads" = "Зэрэг таталт хийх хязгаар";
"Allow Cellular Downloads" = "Утасны датагаар татах";
"Quality Information" = "Чанарын мэдээлэл";
/* Storage */
"Storage Management" = "Багтаамж удирдах";
"Storage Used" = "Ашигласан багтаамж";
"Library cleared successfully" = "Санг амжилттай цэвэрлэлээ";
"All downloads deleted successfully" = "Бүх татсан үзвэрүүдийг амжилттай устлаа";
/* New additions */
"Recent searches" = "Сүүлд хайсан";
"me frfr" = "me frfr";
"Data" = "Мэдээлэл";
"Maximum Quality Available" = "Хамгийн өндөр чанартай";
"All Reading" = "Бүх унших зүйл";
"No Reading History" = "Унших түүх байхгүй";
"Books you're reading will appear here" = "Таны уншиж байгаа номууд энд харагдана";
"All Watching" = "Бүх үзэх зүйл";
"Continue Reading" = "Унших үргэлжлүүлэх";
"Nothing to Continue Reading" = "Үргэлжлүүлж унших зүйл байхгүй";
"Your recently read novels will appear here" = "Таны саяхан уншсан зохиолууд энд харагдана";
"No Bookmarks" = "Хадгалсан зүйл байхгүй";
"Add bookmarks to this collection" = "Энэ цуглуулгад хадгалсан зүйл нэмэх";
"items" = "зүйл";
"Chapter %d" = "Бүлэг %d";
"Episode %d" = "Анги %d";
"%d%%" = "%d%%";
"%d%% seen" = "%d%% үзсэн";
"DownloadCountFormat" = "Татаж авсан: %d";
"Error loading chapter" = "Бүлэг ачаалахад алдаа гарлаа";
"Font Size: %dpt" = "Фонтын хэмжээ: %dpt";
"Line Spacing: %.1f" = "Мөр хоорондын зай: %.1f";
"Line Spacing" = "Мөр хоорондын зай";
"Margin: %dpx" = "Захын зай: %dpx";
"Margin" = "Захын зай";
"Auto Scroll Speed" = "Автомат гүйлгэх хурд";
"Speed" = "Хурд";
"Speed: %.1fx" = "Хурд: %.1fx";
"Matched %@: %@" = "Таарсан %@: %@";
"Enter the AniList ID for this series" = "Энэ цувралын AniList ID-г оруулна уу";
/* New additions */
"Create Collection" = "Цуглуулга үүсгэх";
"Collection Name" = "Цуглуулгын нэр";
"Rename Collection" = "Цуглуулгын нэр солих";
"Rename" = "Нэр солих";
"All Reading" = "Бүх унших зүйл";
"Recently Added" = "Саяхан нэмэгдсэн";
"Novel Title" = "Зохиолын гарчиг";
"Read Progress" = "Уншсан явц";
"Date Created" = "Үүсгэсэн огноо";
"Name" = "Нэр";
"Item Count" = "Зүйлийн тоо";
"Date Added" = "Нэмсэн огноо";
"Title" = "Гарчиг";
"Source" = "Эх сурвалж";
"Search reading..." = "Унж байгаа зүйл хайх...";
"Search collections..." = "Цуглуулга хайх...";
"Search bookmarks..." = "Хадгалсан зүйл хайх...";
"%d items" = "%d зүйл";
"Fetching Data" = "Өгөгдөл татаж байна";
"Please wait while fetching." = "Татаж байна, хүлээнэ үү.";
"Start Reading" = "Унж эхлэх";
"Chapters" = "Бүлгүүд";
"Completed" = "Дууссан";
"Drag to reorder" = "Дарааллаар байрлуулахын тулд чирнэ үү";
"Drag to reorder sections" = "Хэсгүүдийг дарааллаар байрлуулахын тулд чирнэ үү";
"Library View" = "Сангийн харагдац";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Сангийн харагдах хэсгүүдийг тохируулна уу. Хэсгүүдийг дахин эрэмбэлж эсвэл бүрэн идэвхгүй болгож болно.";
"Library Sections Order" = "Сангийн хэсгүүдийн дараалал";
"Completion Percentage" = "Дуусгах хувь";
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt." = "Зарим үйлдлүүд нь зөвхөн Sora болон Үндсэн тоглуулагч дээр ажилладаг, тухайлбал Үргэлж хэвтээ байдлаар үзэх, удаан дарж хурд удирдах болон алгасах хугацаа нь тохиргоо\n\nДуусгах хувь нь бичлэгийн төгсгөлөөс хэдэн хувийн өмнө AniList болон Trakt дээр үзсэнээр тэмдэглэхээ тодорхойлно.";
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app." = "Аппын кэш нь зургуудийг илүү хурдан ачаалахад тусалдаг.\n\nDocuments хавтасыг устгавал бүх татсан үзвэрүүдийг утгана.\n\nАпп датаг устгавал аппын бүх тохиргоо болон өгөгдөл устана.";
"Translators" = "Орчуулагчид";
"Paste URL" = "Холбоосыг буулгах";
/* Added missing localizations */
"Series Title" = "Цувралын гарчиг";
"Content Source" = "Агуулгын эх сурвалж";
"Watch Progress" = "Үзсэн явц";
"Recent searches" = "Саяхны хайлт";
"Collections" = "Цуглуулгууд";
"Continue Reading" = "Унших үргэлжлүүлэх";

View file

@ -387,4 +387,102 @@
"Recent searches" = "Recente zoekopdrachten";
"me frfr" = "ik frfr";
"Data" = "Gegevens";
"Maximum Quality Available" = "Maximale beschikbare kwaliteit";
"Maximum Quality Available" = "Maximale beschikbare kwaliteit";
"DownloadCountFormat" = "%d van %d";
"Error loading chapter" = "Fout bij het laden van hoofdstuk";
"Font Size: %dpt" = "Lettergrootte: %dpt";
"Line Spacing: %.1f" = "Regelafstand: %.1f";
"Line Spacing" = "Regelafstand";
"Margin: %dpx" = "Marge: %dpx";
"Margin" = "Marge";
"Auto Scroll Speed" = "Automatische scrollsnelheid";
"Speed" = "Snelheid";
"Speed: %.1fx" = "Snelheid: %.1fx";
"Matched %@: %@" = "Overeenkomst %@: %@";
"Enter the AniList ID for this series" = "Voer de AniList-ID voor deze serie in";
/* Added missing localizations */
"Create Collection" = "Collectie aanmaken";
"Collection Name" = "Collectienaam";
"Rename Collection" = "Collectie hernoemen";
"Rename" = "Hernoemen";
"All Reading" = "Alles wat je leest";
"Recently Added" = "Recent toegevoegd";
"Novel Title" = "Roman titel";
"Read Progress" = "Leesvoortgang";
"Date Created" = "Aanmaakdatum";
"Name" = "Naam";
"Item Count" = "Aantal items";
"Date Added" = "Datum toegevoegd";
"Title" = "Titel";
"Source" = "Bron";
"Search reading..." = "Zoek in lezen...";
"Search collections..." = "Zoek in collecties...";
"Search bookmarks..." = "Zoek in bladwijzers...";
"%d items" = "%d items";
"Fetching Data" = "Gegevens ophalen";
"Please wait while fetching." = "Even geduld tijdens het ophalen.";
"Start Reading" = "Begin met lezen";
"Chapters" = "Hoofdstukken";
"Completed" = "Voltooid";
"Drag to reorder" = "Sleep om te herschikken";
"Drag to reorder sections" = "Sleep om secties te herschikken";
"Library View" = "Bibliotheekweergave";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Pas de secties aan die in je bibliotheek worden weergegeven. Je kunt secties herschikken of volledig uitschakelen.";
"Library Sections Order" = "Volgorde van bibliotheeksecties";
"Completion Percentage" = "Voltooiingspercentage";
"Translators" = "Vertalers";
"Paste URL" = "URL plakken";
/* Added missing localizations */
"Series Title" = "Serietitel";
"Content Source" = "Inhoudsbron";
"Watch Progress" = "Kijkvoortgang";
"Nothing to Continue Reading" = "Niets om verder te lezen";
"Your recently read novels will appear here" = "Je recent gelezen romans verschijnen hier";
"No Bookmarks" = "Geen bladwijzers";
"Add bookmarks to this collection" = "Voeg bladwijzers toe aan deze collectie";
"items" = "items";
"All Watching" = "Alles wat je kijkt";
"No Reading History" = "Geen leeshistorie";
"Books you're reading will appear here" = "Boeken die je leest verschijnen hier";
"Create Collection" = "Collectie aanmaken";
"Collection Name" = "Collectienaam";
"Rename Collection" = "Collectie hernoemen";
"Rename" = "Hernoemen";
"Novel Title" = "Roman titel";
"Read Progress" = "Leesvoortgang";
"Date Created" = "Aanmaakdatum";
"Name" = "Naam";
"Item Count" = "Aantal items";
"Date Added" = "Datum toegevoegd";
"Title" = "Titel";
"Source" = "Bron";
"Search reading..." = "Zoek in lezen...";
"Search collections..." = "Zoek in collecties...";
"Search bookmarks..." = "Zoek in bladwijzers...";
"%d items" = "%d items";
"Fetching Data" = "Gegevens ophalen";
"Please wait while fetching." = "Even geduld tijdens het ophalen.";
"Start Reading" = "Begin met lezen";
"Chapters" = "Hoofdstukken";
"Completed" = "Voltooid";
"Drag to reorder" = "Sleep om te herschikken";
"Drag to reorder sections" = "Sleep om secties te herschikken";
"Library View" = "Bibliotheekweergave";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Pas de secties aan die in je bibliotheek worden weergegeven. Je kunt secties herschikken of volledig uitschakelen.";
"Library Sections Order" = "Volgorde van bibliotheeksecties";
"Completion Percentage" = "Voltooiingspercentage";
"Translators" = "Vertalers";
"Paste URL" = "URL plakken";
/* Added missing localizations */
"Collections" = "Collecties";
"Continue Reading" = "Doorgaan met lezen";
/* Backup & Restore */
"Backup & Restore" = "Back-up & Herstellen";
"Export Backup" = "Back-up exporteren";
"Import Backup" = "Back-up importeren";
"Notice: This feature is still experimental. Please double-check your data after import/export." = "Let op: Deze functie is nog experimenteel. Controleer je gegevens na export/import.";
"Backup" = "Back-up";

View file

@ -381,4 +381,108 @@
"Storage Management" = "Lagringsadministrasjon";
"Storage Used" = "Brukt Lagring";
"Library cleared successfully" = "Bibliotek tømt";
"All downloads deleted successfully" = "Alle nedlastinger slettet";
"All downloads deleted successfully" = "Alle nedlastinger slettet";
/* New keys from English localization */
"DownloadCountFormat" = "%d av %d";
"Error loading chapter" = "Feil ved lasting av kapittel";
"Font Size: %dpt" = "Skriftstorleik: %dpt";
"Line Spacing: %.1f" = "Linjeavstand: %.1f";
"Line Spacing" = "Linjeavstand";
"Margin: %dpx" = "Marg: %dpx";
"Margin" = "Marg";
"Auto Scroll Speed" = "Fart på automatisk rulling";
"Speed" = "Fart";
"Speed: %.1fx" = "Fart: %.1fx";
"Matched %@: %@" = "Treff %@: %@";
"Enter the AniList ID for this series" = "Skriv inn AniList-ID for denne serien";
/* Added missing localizations */
"Create Collection" = "Opprett samling";
"Collection Name" = "Samlingens navn";
"Rename Collection" = "Gi nytt navn til samling";
"Rename" = "Gi nytt navn";
"All Reading" = "All lesing";
"Recently Added" = "Nylig lagt til";
"Novel Title" = "Roman tittel";
"Read Progress" = "Lesefremgang";
"Date Created" = "Opprettelsesdato";
"Name" = "Navn";
"Item Count" = "Antall elementer";
"Date Added" = "Dato lagt til";
"Title" = "Tittel";
"Source" = "Kilde";
"Search reading..." = "Søk i lesing...";
"Search collections..." = "Søk i samlinger...";
"Search bookmarks..." = "Søk i bokmerker...";
"%d items" = "%d elementer";
"Fetching Data" = "Henter data";
"Please wait while fetching." = "Vennligst vent mens det hentes.";
"Start Reading" = "Start lesing";
"Chapters" = "Kapitler";
"Completed" = "Fullført";
"Drag to reorder" = "Dra for å endre rekkefølge";
"Drag to reorder sections" = "Dra for å endre rekkefølge på seksjoner";
"Library View" = "Bibliotekvisning";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Tilpass seksjonene som vises i biblioteket ditt. Du kan endre rekkefølge eller deaktivere seksjoner helt.";
"Library Sections Order" = "Rekkefølge på bibliotekseksjoner";
"Completion Percentage" = "Fullføringsprosent";
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt." = "Noen funksjoner er begrenset til Sora- og standardspilleren, som tvunget landskap, holdhastighet og tilpassede tidshopp.\n\nFullføringsprosenten bestemmer når før slutten av en video appen markerer den som fullført på AniList og Trakt.";
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app." = "Appens cache hjelper med å laste inn bilder raskere.\n\nÅ tømme Dokumenter-mappen sletter alle nedlastede moduler.\n\nÅ slette appdata sletter alle innstillinger og data.";
"Translators" = "Oversettere";
"Paste URL" = "Lim inn URL";
/* Added missing localizations */
"Series Title" = "Serietittel";
"Content Source" = "Innhaldskjelde";
"Watch Progress" = "Framdrift for vising";
"Recent searches" = "Nylege søk";
"All Reading" = "Alt du les";
"Nothing to Continue Reading" = "Ingenting å fortsetje å lese";
"Your recently read novels will appear here" = "Dine nyleg lesne romanar vil visast her";
"No Bookmarks" = "Ingen bokmerke";
"Add bookmarks to this collection" = "Legg til bokmerke i denne samlinga";
"items" = "element";
"All Watching" = "Alt du ser på";
"No Reading History" = "Ingen leseloggar";
"Books you're reading will appear here" = "Bøker du les vil visast her";
"Create Collection" = "Opprett samling";
"Collection Name" = "Samlingnamn";
"Rename Collection" = "Endre namn på samling";
"Rename" = "Endre namn";
"Novel Title" = "Roman tittel";
"Read Progress" = "Leseframdrift";
"Date Created" = "Oppretta dato";
"Name" = "Namn";
"Item Count" = "Tal på element";
"Date Added" = "Dato lagt til";
"Title" = "Tittel";
"Source" = "Kjelde";
"Search reading..." = "Søk i lesing...";
"Search collections..." = "Søk i samlingar...";
"Search bookmarks..." = "Søk i bokmerke...";
"%d items" = "%d element";
"Fetching Data" = "Hentar data";
"Please wait while fetching." = "Vent medan data vert henta.";
"Start Reading" = "Start lesing";
"Chapters" = "Kapittel";
"Completed" = "Fullført";
"Drag to reorder" = "Dra for å endre rekkefølgje";
"Drag to reorder sections" = "Dra for å endre rekkefølgje på seksjonar";
"Library View" = "Bibliotekvising";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Tilpass seksjonane som vert viste i biblioteket ditt. Du kan endre rekkefølgje eller slå dei heilt av.";
"Library Sections Order" = "Rekkefølgje på bibliotekseksjonar";
"Completion Percentage" = "Fullføringsprosent";
"Translators" = "Omsetjarar";
"Paste URL" = "Lim inn URL";
/* Added missing localizations */
"Collections" = "Samlingar";
"Continue Reading" = "Hald fram med å lese";
/* Backup & Restore */
"Backup & Restore" = "Sikkerhetskopi og gjenoppretting";
"Export Backup" = "Eksporter sikkerhetskopi";
"Import Backup" = "Importer sikkerhetskopi";
"Notice: This feature is still experimental. Please double-check your data after import/export." = "Merk: Denne funksjonen er fortsatt eksperimentell. Vennligst dobbeltsjekk dataene dine etter eksport/import.";
"Backup" = "Sikkerhetskopi";

View file

@ -405,4 +405,108 @@ For episode metadata, it refers to the episode thumbnail and title, since someti
"Data" = "Данные";
/* New string */
"Maximum Quality Available" = "Максимальное доступное качество";
"Maximum Quality Available" = "Максимальное доступное качество";
/* Additional translations */
"DownloadCountFormat" = "%d из %d";
"Error loading chapter" = "Ошибка загрузки главы";
"Font Size: %dpt" = "Размер шрифта: %dpt";
"Line Spacing: %.1f" = "Межстрочный интервал: %.1f";
"Line Spacing" = "Межстрочный интервал";
"Margin: %dpx" = "Поле: %dpx";
"Margin" = "Поле";
"Auto Scroll Speed" = "Скорость автопрокрутки";
"Speed" = "Скорость";
"Speed: %.1fx" = "Скорость: %.1fx";
"Matched %@: %@" = "Совпадение %@: %@";
"Enter the AniList ID for this series" = "Введите AniList ID для этой серии";
/* Added missing localizations */
"Create Collection" = "Создать коллекцию";
"Collection Name" = "Название коллекции";
"Rename Collection" = "Переименовать коллекцию";
"Rename" = "Переименовать";
"All Reading" = "Все чтения";
"Recently Added" = "Недавно добавленные";
"Novel Title" = "Название романа";
"Read Progress" = "Прогресс чтения";
"Date Created" = "Дата создания";
"Name" = "Имя";
"Item Count" = "Количество элементов";
"Date Added" = "Дата добавления";
"Title" = "Заголовок";
"Source" = "Источник";
"Search reading..." = "Поиск по чтению...";
"Search collections..." = "Поиск по коллекциям...";
"Search bookmarks..." = "Поиск по закладкам...";
"%d items" = "%d элементов";
"Fetching Data" = "Получение данных";
"Please wait while fetching." = "Пожалуйста, подождите, идет получение данных.";
"Start Reading" = "Начать чтение";
"Chapters" = "Главы";
"Completed" = "Завершено";
"Drag to reorder" = "Перетащите для изменения порядка";
"Drag to reorder sections" = "Перетащите для изменения порядка разделов";
"Library View" = "Вид библиотеки";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Настройте разделы, отображаемые в вашей библиотеке. Вы можете изменить порядок разделов или полностью их отключить.";
"Library Sections Order" = "Порядок разделов библиотеки";
"Completion Percentage" = "Процент завершения";
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt." = "Некоторые функции доступны только в Sora и стандартном плеере, такие как принудительный ландшафт, удержание скорости и пользовательские интервалы пропуска.\n\nНастройка процента завершения определяет, в какой момент до конца видео приложение отметит его как завершенное на AniList и Trakt.";
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app." = "Кэш приложения помогает быстрее загружать изображения.\n\nОчистка папки Documents удалит все загруженные модули.\n\nСтирание данных приложения удалит все ваши настройки и данные.";
"Translators" = "Переводчики";
"Paste URL" = "Вставить URL";
/* Added missing localizations */
"Series Title" = "Название серии";
"Content Source" = "Источник контента";
"Watch Progress" = "Прогресс просмотра";
"Recent searches" = "Недавние поиски";
"All Reading" = "Всё для чтения";
"Nothing to Continue Reading" = "Нечего продолжать читать";
"Your recently read novels will appear here" = "Ваши недавно прочитанные романы появятся здесь";
"No Bookmarks" = "Нет закладок";
"Add bookmarks to this collection" = "Добавьте закладки в эту коллекцию";
"items" = "элементы";
"All Watching" = "Всё для просмотра";
"No Reading History" = "Нет истории чтения";
"Books you're reading will appear here" = "Книги, которые вы читаете, появятся здесь";
"Create Collection" = "Создать коллекцию";
"Collection Name" = "Название коллекции";
"Rename Collection" = "Переименовать коллекцию";
"Rename" = "Переименовать";
"Novel Title" = "Название романа";
"Read Progress" = "Прогресс чтения";
"Date Created" = "Дата создания";
"Name" = "Имя";
"Item Count" = "Количество элементов";
"Date Added" = "Дата добавления";
"Title" = "Заголовок";
"Source" = "Источник";
"Search reading..." = "Поиск по чтению...";
"Search collections..." = "Поиск по коллекциям...";
"Search bookmarks..." = "Поиск по закладкам...";
"%d items" = "%d элементов";
"Fetching Data" = "Получение данных";
"Please wait while fetching." = "Пожалуйста, подождите, идет получение данных.";
"Start Reading" = "Начать чтение";
"Chapters" = "Главы";
"Completed" = "Завершено";
"Drag to reorder" = "Перетащите для изменения порядка";
"Drag to reorder sections" = "Перетащите для изменения порядка разделов";
"Library View" = "Вид библиотеки";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Настройте разделы, отображаемые в вашей библиотеке. Вы можете изменить порядок разделов или полностью их отключить.";
"Library Sections Order" = "Порядок разделов библиотеки";
"Completion Percentage" = "Процент завершения";
"Translators" = "Переводчики";
"Paste URL" = "Вставить URL";
/* Added missing localizations */
"Collections" = "Коллекции";
"Continue Reading" = "Продолжить чтение";
/* Backup & Restore */
"Backup & Restore" = "Резервное копирование и восстановление";
"Export Backup" = "Экспорт резервной копии";
"Import Backup" = "Импорт резервной копии";
"Notice: This feature is still experimental. Please double-check your data after import/export." = "Внимание: Эта функция все еще экспериментальная. Пожалуйста, проверьте свои данные после экспорта/импорта.";
"Backup" = "Резервная копия";

View file

@ -404,3 +404,105 @@ For episode metadata, it refers to the episode thumbnail and title, since someti
"me frfr" = "me frfr";
"Data" = "Dáta";
"Maximum Quality Available" = "Maximálna dostupná kvalita";
/* New additions */
"DownloadCountFormat" = "%d z %d";
"Error loading chapter" = "Chyba pri načítaní kapitoly";
"Font Size: %dpt" = "Veľkosť písma: %dpt";
"Line Spacing: %.1f" = "Riadkovanie: %.1f";
"Line Spacing" = "Riadkovanie";
"Margin: %dpx" = "Okraj: %dpx";
"Margin" = "Okraj";
"Auto Scroll Speed" = "Rýchlosť automatického posúvania";
"Speed" = "Rýchlosť";
"Speed: %.1fx" = "Rýchlosť: %.1fx";
"Matched %@: %@" = "Zhoda %@: %@";
"Enter the AniList ID for this series" = "Zadajte AniList ID pre túto sériu";
/* Added missing localizations */
"Create Collection" = "Vytvoriť kolekciu";
"Collection Name" = "Názov kolekcie";
"Rename Collection" = "Premenovať kolekciu";
"Rename" = "Premenovať";
"All Reading" = "Všetko na čítanie";
"Recently Added" = "Nedávno pridané";
"Novel Title" = "Názov románu";
"Read Progress" = "Priebeh čítania";
"Date Created" = "Dátum vytvorenia";
"Name" = "Meno";
"Item Count" = "Počet položiek";
"Date Added" = "Dátum pridania";
"Title" = "Názov";
"Source" = "Zdroj";
"Search reading..." = "Hľadať v čítaní...";
"Search collections..." = "Hľadať v kolekciách...";
"Search bookmarks..." = "Hľadať v záložkách...";
"%d items" = "%d položiek";
"Fetching Data" = "Načítavanie údajov";
"Please wait while fetching." = "Počkajte, kým sa údaje načítajú.";
"Start Reading" = "Začať čítať";
"Chapters" = "Kapitoly";
"Completed" = "Dokončené";
"Drag to reorder" = "Potiahnite na zmenu poradia";
"Drag to reorder sections" = "Potiahnite na zmenu poradia sekcií";
"Library View" = "Zobrazenie knižnice";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Prispôsobte sekcie zobrazené vo vašej knižnici. Môžete zmeniť ich poradie alebo ich úplne vypnúť.";
"Library Sections Order" = "Poradie sekcií knižnice";
"Completion Percentage" = "Percento dokončenia";
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt." = "Niektoré funkcie sú obmedzené na Sora a predvolený prehrávač, ako je vynútená krajina, podržanie rýchlosti a vlastné intervaly preskočenia.\n\nNastavenie percenta dokončenia určuje, v ktorom bode pred koncom videa aplikácia označí ako dokončené na AniList a Trakt.";
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app." = "Vyrovnávacia pamäť aplikácie pomáha rýchlejšiemu načítaniu obrázkov.\n\nVymazanie priečinka Documents odstráni všetky stiahnuté moduly.\n\nVymazanie údajov aplikácie odstráni všetky vaše nastavenia a údaje.";
"Translators" = "Prekladatelia";
"Paste URL" = "Vložiť URL";
/* New additions */
"Series Title" = "Názov série";
"Content Source" = "Zdroj obsahu";
"Watch Progress" = "Priebeh sledovania";
"Nothing to Continue Reading" = "Nič na pokračovanie v čítaní";
"Your recently read novels will appear here" = "Vaše nedávno čítané romány sa zobrazia tu";
"No Bookmarks" = "Žiadne záložky";
"Add bookmarks to this collection" = "Pridajte záložky do tejto kolekcie";
"items" = "položky";
"All Watching" = "Všetko na sledovanie";
"No Reading History" = "Žiadna história čítania";
"Books you're reading will appear here" = "Knihy, ktoré čítate, sa zobrazia tu";
"Create Collection" = "Vytvoriť kolekciu";
"Collection Name" = "Názov kolekcie";
"Rename Collection" = "Premenovať kolekciu";
"Rename" = "Premenovať";
"Novel Title" = "Názov románu";
"Read Progress" = "Priebeh čítania";
"Date Created" = "Dátum vytvorenia";
"Name" = "Meno";
"Item Count" = "Počet položiek";
"Date Added" = "Dátum pridania";
"Title" = "Názov";
"Source" = "Zdroj";
"Search reading..." = "Hľadať v čítaní...";
"Search collections..." = "Hľadať v kolekciách...";
"Search bookmarks..." = "Hľadať v záložkách...";
"%d items" = "%d položiek";
"Fetching Data" = "Načítavanie údajov";
"Please wait while fetching." = "Počkajte, kým sa údaje načítajú.";
"Start Reading" = "Začať čítať";
"Chapters" = "Kapitoly";
"Completed" = "Dokončené";
"Drag to reorder" = "Potiahnite na zmenu poradia";
"Drag to reorder sections" = "Potiahnite na zmenu poradia sekcií";
"Library View" = "Zobrazenie knižnice";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Prispôsobte sekcie zobrazené vo vašej knižnici. Môžete zmeniť ich poradie alebo ich úplne vypnúť.";
"Library Sections Order" = "Poradie sekcií knižnice";
"Completion Percentage" = "Percento dokončenia";
"Translators" = "Prekladatelia";
"Paste URL" = "Vložiť URL";
/* New additions */
"Collections" = "Kolekcie";
"Continue Reading" = "Pokračovať v čítaní";
/* Backup & Restore */
"Backup & Restore" = "Záloha a obnovenie";
"Export Backup" = "Exportovať zálohu";
"Import Backup" = "Importovať zálohu";
"Notice: This feature is still experimental. Please double-check your data after import/export." = "Upozornenie: Táto funkcia je stále experimentálna. Po exporte/importe si prosím skontrolujte svoje údaje.";
"Backup" = "Záloha";

View file

@ -381,4 +381,107 @@
"Storage Management" = "Lagringshantering";
"Storage Used" = "Använt Lagringsutrymme";
"Library cleared successfully" = "Biblioteket rensat";
"All downloads deleted successfully" = "Alla nedladdningar borttagna";
"All downloads deleted successfully" = "Alla nedladdningar borttagna";
/* New keys from English localization */
"DownloadCountFormat" = "%d av %d";
"Error loading chapter" = "Fel vid inläsning av kapitel";
"Font Size: %dpt" = "Teckenstorlek: %dpt";
"Line Spacing: %.1f" = "Radavstånd: %.1f";
"Line Spacing" = "Radavstånd";
"Margin: %dpx" = "Marginal: %dpx";
"Margin" = "Marginal";
"Auto Scroll Speed" = "Automatisk rullningshastighet";
"Speed" = "Hastighet";
"Speed: %.1fx" = "Hastighet: %.1fx";
"Matched %@: %@" = "Matchning %@: %@";
"Enter the AniList ID for this series" = "Ange AniList-ID för denna serie";
/* Added missing localizations */
"Create Collection" = "Skapa samling";
"Collection Name" = "Samlingens namn";
"Rename Collection" = "Byt namn på samling";
"Rename" = "Byt namn";
"All Reading" = "All läsning";
"Recently Added" = "Nyligen tillagda";
"Novel Title" = "Romanens titel";
"Read Progress" = "Läsningsframsteg";
"Date Created" = "Skapad datum";
"Name" = "Namn";
"Item Count" = "Antal objekt";
"Date Added" = "Datum tillagt";
"Title" = "Titel";
"Source" = "Källa";
"Search reading..." = "Sök i läsning...";
"Search collections..." = "Sök i samlingar...";
"Search bookmarks..." = "Sök i bokmärken...";
"%d items" = "%d objekt";
"Fetching Data" = "Hämtar data";
"Please wait while fetching." = "Vänligen vänta under hämtning.";
"Start Reading" = "Börja läsa";
"Chapters" = "Kapitel";
"Completed" = "Slutförd";
"Drag to reorder" = "Dra för att ändra ordning";
"Drag to reorder sections" = "Dra för att ändra ordning på sektioner";
"Library View" = "Biblioteksvisning";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Anpassa sektionerna som visas i ditt bibliotek. Du kan ändra ordning eller inaktivera sektioner helt.";
"Library Sections Order" = "Ordning på bibliotekets sektioner";
"Completion Percentage" = "Slutförandeprocent";
"Some features are limited to the Sora and Default player, such as ForceLandscape, holdSpeed and custom time skip increments.\n\nThe completion percentage setting determines at what point before the end of a video the app will mark it as completed on AniList and Trakt." = "Vissa funktioner är begränsade till Sora- och standardspelaren, såsom tvingat landskap, hållhastighet och anpassade tidshopp.\n\nInställningen för slutförandeprocent avgör vid vilken punkt före slutet av en video appen markerar den som slutförd på AniList och Trakt.";
"The app cache helps the app load images faster.\n\nClearing the Documents folder will delete all downloaded modules.\n\nErasing the App Data will clears all your settings and data of the app." = "Appens cache hjälper till att ladda bilder snabbare.\n\nAtt rensa mappen Dokument tar bort alla nedladdade moduler.\n\nAtt radera appdata tar bort alla dina inställningar och data.";
"Translators" = "Översättare";
"Paste URL" = "Klistra in URL";
/* Added missing localizations */
"Series Title" = "Serietitel";
"Content Source" = "Innehållskälla";
"Watch Progress" = "Tittarframsteg";
"Recent searches" = "Senaste sökningar";
"Nothing to Continue Reading" = "Inget att fortsätta läsa";
"Your recently read novels will appear here" = "Dina nyligen lästa romaner visas här";
"No Bookmarks" = "Inga bokmärken";
"Add bookmarks to this collection" = "Lägg till bokmärken i denna samling";
"items" = "objekt";
"All Watching" = "Allt du tittar på";
"No Reading History" = "Ingen läshistorik";
"Books you're reading will appear here" = "Böcker du läser visas här";
"Create Collection" = "Skapa samling";
"Collection Name" = "Samlingens namn";
"Rename Collection" = "Byt namn på samling";
"Rename" = "Byt namn";
"Novel Title" = "Roman titel";
"Read Progress" = "Läsframsteg";
"Date Created" = "Skapad datum";
"Name" = "Namn";
"Item Count" = "Antal objekt";
"Date Added" = "Datum tillagt";
"Title" = "Titel";
"Source" = "Källa";
"Search reading..." = "Sök i läsning...";
"Search collections..." = "Sök i samlingar...";
"Search bookmarks..." = "Sök i bokmärken...";
"%d items" = "%d objekt";
"Fetching Data" = "Hämtar data";
"Please wait while fetching." = "Vänligen vänta medan data hämtas.";
"Start Reading" = "Börja läsa";
"Chapters" = "Kapitel";
"Completed" = "Slutförd";
"Drag to reorder" = "Dra för att ändra ordning";
"Drag to reorder sections" = "Dra för att ändra ordning på sektioner";
"Library View" = "Biblioteksvy";
"Customize the sections shown in your library. You can reorder sections or disable them completely." = "Anpassa sektionerna som visas i ditt bibliotek. Du kan ändra ordning eller inaktivera dem helt.";
"Library Sections Order" = "Bibliotekssektioners ordning";
"Completion Percentage" = "Slutförandeprocent";
"Translators" = "Översättare";
"Paste URL" = "Klistra in URL";
/* Added missing localizations */
"Collections" = "Samlingar";
"Continue Reading" = "Fortsätt läsa";
/* Backup & Restore */
"Backup & Restore" = "Säkerhetskopiera & Återställ";
"Export Backup" = "Exportera säkerhetskopia";
"Import Backup" = "Importera säkerhetskopia";
"Notice: This feature is still experimental. Please double-check your data after import/export." = "Observera: Denna funktion är fortfarande experimentell. Kontrollera dina data efter export/import.";
"Backup" = "Säkerhetskopia";

View file

@ -0,0 +1,48 @@
//
// ContinueReadingItem.swift
// Sora
//
// Created by paul on 26/06/25.
//
import Foundation
struct ContinueReadingItem: Identifiable, Codable {
let id: UUID
let mediaTitle: String
let chapterTitle: String
let chapterNumber: Int
let imageUrl: String
let href: String
let moduleId: String
let progress: Double
let totalChapters: Int
let lastReadDate: Date
let cachedHtml: String?
init(
id: UUID = UUID(),
mediaTitle: String,
chapterTitle: String,
chapterNumber: Int,
imageUrl: String,
href: String,
moduleId: String,
progress: Double = 0.0,
totalChapters: Int = 0,
lastReadDate: Date = Date(),
cachedHtml: String? = nil
) {
self.id = id
self.mediaTitle = mediaTitle
self.chapterTitle = chapterTitle
self.chapterNumber = chapterNumber
self.imageUrl = imageUrl
self.href = href
self.moduleId = moduleId
self.progress = progress
self.totalChapters = totalChapters
self.lastReadDate = lastReadDate
self.cachedHtml = cachedHtml
}
}

View file

@ -0,0 +1,275 @@
//
// ContinueReadingManager.swift
// Sora
//
// Created by paul on 26/06/25.
//
import Foundation
class ContinueReadingManager {
static let shared = ContinueReadingManager()
private let userDefaults = UserDefaults.standard
private let continueReadingKey = "continueReadingItems"
private init() {}
func extractTitleFromURL(_ url: String) -> String? {
guard let url = URL(string: url) else { return nil }
let pathComponents = url.pathComponents
for (index, component) in pathComponents.enumerated() {
if component == "book" || component == "novel" {
if index + 1 < pathComponents.count {
let bookTitle = pathComponents[index + 1]
.replacingOccurrences(of: "-", with: " ")
.replacingOccurrences(of: "_", with: " ")
.capitalized
if !bookTitle.isEmpty {
return bookTitle
}
}
}
}
return nil
}
func fetchItems() -> [ContinueReadingItem] {
guard let data = userDefaults.data(forKey: continueReadingKey) else {
Logger.shared.log("No continue reading items found in UserDefaults", type: "Debug")
return []
}
do {
let items = try JSONDecoder().decode([ContinueReadingItem].self, from: data)
Logger.shared.log("Fetched \(items.count) continue reading items", type: "Debug")
for (index, item) in items.enumerated() {
Logger.shared.log("Item \(index): \(item.mediaTitle), Image URL: \(item.imageUrl)", type: "Debug")
}
return items.sorted(by: { $0.lastReadDate > $1.lastReadDate })
} catch {
Logger.shared.log("Error decoding continue reading items: \(error)", type: "Error")
return []
}
}
func save(item: ContinueReadingItem, htmlContent: String? = nil) {
var items = fetchItems()
items.removeAll { $0.href == item.href }
if item.progress >= 0.98 {
userDefaults.set(item.progress, forKey: "readingProgress_\(item.href)")
do {
let data = try JSONEncoder().encode(items)
userDefaults.set(data, forKey: continueReadingKey)
} catch {
Logger.shared.log("Error encoding continue reading items: \(error)", type: "Error")
}
return
}
var updatedItem = item
if item.mediaTitle.contains("-") && item.mediaTitle.count >= 30 || item.mediaTitle.contains("Unknown") {
if let betterTitle = extractTitleFromURL(item.href) {
updatedItem = ContinueReadingItem(
id: item.id,
mediaTitle: betterTitle,
chapterTitle: item.chapterTitle,
chapterNumber: item.chapterNumber,
imageUrl: item.imageUrl,
href: item.href,
moduleId: item.moduleId,
progress: item.progress,
totalChapters: item.totalChapters,
lastReadDate: item.lastReadDate,
cachedHtml: htmlContent ?? item.cachedHtml
)
}
}
Logger.shared.log("Incoming item image URL: \(updatedItem.imageUrl)", type: "Debug")
if updatedItem.imageUrl.isEmpty {
let defaultImageUrl = "https://raw.githubusercontent.com/cranci1/Sora/refs/heads/main/assets/novel_cover.jpg"
updatedItem = ContinueReadingItem(
id: updatedItem.id,
mediaTitle: updatedItem.mediaTitle,
chapterTitle: updatedItem.chapterTitle,
chapterNumber: updatedItem.chapterNumber,
imageUrl: defaultImageUrl,
href: updatedItem.href,
moduleId: updatedItem.moduleId,
progress: updatedItem.progress,
totalChapters: updatedItem.totalChapters,
lastReadDate: updatedItem.lastReadDate,
cachedHtml: htmlContent ?? updatedItem.cachedHtml
)
Logger.shared.log("Using default image URL: \(defaultImageUrl)", type: "Debug")
}
if !updatedItem.imageUrl.isEmpty {
if URL(string: updatedItem.imageUrl) == nil {
Logger.shared.log("Invalid image URL format: \(updatedItem.imageUrl)", type: "Warning")
if let encodedUrl = updatedItem.imageUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed),
let _ = URL(string: encodedUrl) {
updatedItem = ContinueReadingItem(
id: updatedItem.id,
mediaTitle: updatedItem.mediaTitle,
chapterTitle: updatedItem.chapterTitle,
chapterNumber: updatedItem.chapterNumber,
imageUrl: encodedUrl,
href: updatedItem.href,
moduleId: updatedItem.moduleId,
progress: updatedItem.progress,
totalChapters: updatedItem.totalChapters,
lastReadDate: updatedItem.lastReadDate,
cachedHtml: htmlContent ?? updatedItem.cachedHtml
)
Logger.shared.log("Fixed image URL with encoding: \(encodedUrl)", type: "Debug")
} else {
let defaultImageUrl = "https://raw.githubusercontent.com/cranci1/Sora/refs/heads/main/assets/novel_cover.jpg"
updatedItem = ContinueReadingItem(
id: updatedItem.id,
mediaTitle: updatedItem.mediaTitle,
chapterTitle: updatedItem.chapterTitle,
chapterNumber: updatedItem.chapterNumber,
imageUrl: defaultImageUrl,
href: updatedItem.href,
moduleId: updatedItem.moduleId,
progress: updatedItem.progress,
totalChapters: updatedItem.totalChapters,
lastReadDate: updatedItem.lastReadDate,
cachedHtml: htmlContent ?? updatedItem.cachedHtml
)
Logger.shared.log("Using default image URL after encoding failed: \(defaultImageUrl)", type: "Debug")
}
}
}
Logger.shared.log("Saving item with image URL: \(updatedItem.imageUrl)", type: "Debug")
items.append(updatedItem)
if items.count > 20 {
items = Array(items.sorted(by: { $0.lastReadDate > $1.lastReadDate }).prefix(20))
}
do {
let data = try JSONEncoder().encode(items)
userDefaults.set(data, forKey: continueReadingKey)
Logger.shared.log("Successfully saved continue reading item", type: "Debug")
} catch {
Logger.shared.log("Error encoding continue reading items: \(error)", type: "Error")
}
}
func remove(item: ContinueReadingItem) {
var items = fetchItems()
items.removeAll { $0.id == item.id }
do {
let data = try JSONEncoder().encode(items)
userDefaults.set(data, forKey: continueReadingKey)
} catch {
Logger.shared.log("Error encoding continue reading items: \(error)", type: "Error")
}
}
func updateProgress(for href: String, progress: Double, htmlContent: String? = nil) {
var items = fetchItems()
if let index = items.firstIndex(where: { $0.href == href }) {
let updatedItem = items[index]
if progress >= 0.98 {
let cachedHtml = htmlContent ?? updatedItem.cachedHtml
if let html = cachedHtml, !html.isEmpty && !html.contains("undefined") && html.count > 50 {
let completedChapterKey = "completedChapterHtml_\(href)"
UserDefaults.standard.set(html, forKey: completedChapterKey)
Logger.shared.log("Saved HTML content for completed chapter \(href)", type: "Debug")
}
items.remove(at: index)
userDefaults.set(progress, forKey: "readingProgress_\(href)")
do {
let data = try JSONEncoder().encode(items)
userDefaults.set(data, forKey: continueReadingKey)
} catch {
Logger.shared.log("Error encoding continue reading items: \(error)", type: "Error")
}
return
}
var mediaTitle = updatedItem.mediaTitle
if mediaTitle.contains("-") && mediaTitle.count >= 30 || mediaTitle.contains("Unknown") {
if let betterTitle = extractTitleFromURL(href) {
mediaTitle = betterTitle
}
}
let newItem = ContinueReadingItem(
id: updatedItem.id,
mediaTitle: mediaTitle,
chapterTitle: updatedItem.chapterTitle,
chapterNumber: updatedItem.chapterNumber,
imageUrl: updatedItem.imageUrl,
href: updatedItem.href,
moduleId: updatedItem.moduleId,
progress: progress,
totalChapters: updatedItem.totalChapters,
lastReadDate: Date(),
cachedHtml: htmlContent ?? updatedItem.cachedHtml
)
Logger.shared.log("Updating item with image URL: \(newItem.imageUrl)", type: "Debug")
items[index] = newItem
do {
let data = try JSONEncoder().encode(items)
userDefaults.set(data, forKey: continueReadingKey)
} catch {
Logger.shared.log("Error encoding continue reading items: \(error)", type: "Error")
}
}
}
func isChapterCompleted(href: String) -> Bool {
let progress = UserDefaults.standard.double(forKey: "readingProgress_\(href)")
if progress >= 0.98 {
return true
}
let items = fetchItems()
if let item = items.first(where: { $0.href == href }) {
return item.progress >= 0.98
}
return false
}
func getCachedHtml(for href: String) -> String? {
let completedChapterKey = "completedChapterHtml_\(href)"
if let completedHtml = UserDefaults.standard.string(forKey: completedChapterKey),
!completedHtml.isEmpty && !completedHtml.contains("undefined") && completedHtml.count > 50 {
Logger.shared.log("Using cached HTML for completed chapter \(href)", type: "Debug")
return completedHtml
}
let items = fetchItems()
if let item = items.first(where: { $0.href == href }) {
return item.cachedHtml
}
return nil
}
}

View file

@ -11,49 +11,49 @@ class ContinueWatchingManager {
static let shared = ContinueWatchingManager()
private let storageKey = "continueWatchingItems"
private let lastCleanupKey = "lastContinueWatchingCleanup"
private init() {
NotificationCenter.default.addObserver(self, selector: #selector(handleiCloudSync), name: .iCloudSyncDidComplete, object: nil)
performCleanupIfNeeded()
}
@objc private func handleiCloudSync() {
NotificationCenter.default.post(name: .ContinueWatchingDidUpdate, object: nil)
}
private func performCleanupIfNeeded() {
let lastCleanup = UserDefaults.standard.double(forKey: lastCleanupKey)
let currentTime = Date().timeIntervalSince1970
if currentTime - lastCleanup > 86400 {
cleanupOldEpisodes()
UserDefaults.standard.set(currentTime, forKey: lastCleanupKey)
}
}
private func cleanupOldEpisodes() {
var items = fetchItems()
var itemsToRemove: Set<UUID> = []
let groupedItems = Dictionary(grouping: items) { item in
let title = item.mediaTitle.replacingOccurrences(of: "Episode \\d+.*$", with: "", options: .regularExpression)
.trimmingCharacters(in: .whitespacesAndNewlines)
return title
}
for (_, showEpisodes) in groupedItems {
let sortedEpisodes = showEpisodes.sorted { $0.episodeNumber < $1.episodeNumber }
for i in 0..<sortedEpisodes.count - 1 {
let currentEpisode = sortedEpisodes[i]
let nextEpisode = sortedEpisodes[i + 1]
if currentEpisode.progress >= 0.8 && nextEpisode.episodeNumber > currentEpisode.episodeNumber {
itemsToRemove.insert(currentEpisode.id)
}
}
}
if !itemsToRemove.isEmpty {
items.removeAll { itemsToRemove.contains($0.id) }
if let data = try? JSONEncoder().encode(items) {
@ -61,14 +61,14 @@ class ContinueWatchingManager {
}
}
}
func save(item: ContinueWatchingItem) {
// Use real playback times
let lastKey = "lastPlayedTime_\(item.fullUrl)"
let totalKey = "totalTime_\(item.fullUrl)"
let lastPlayed = UserDefaults.standard.double(forKey: lastKey)
let totalTime = UserDefaults.standard.double(forKey: totalKey)
// Compute up-to-date progress
let actualProgress: Double
if totalTime > 0 {
@ -76,44 +76,44 @@ class ContinueWatchingManager {
} else {
actualProgress = item.progress
}
// If watched 90%, remove it
if actualProgress >= 0.9 {
remove(item: item)
return
}
// Otherwise update progress and remove old episodes from the same show
var updatedItem = item
updatedItem.progress = actualProgress
var items = fetchItems()
let showTitle = item.mediaTitle.replacingOccurrences(of: "Episode \\d+.*$", with: "", options: .regularExpression)
.trimmingCharacters(in: .whitespacesAndNewlines)
items.removeAll { existingItem in
let existingShowTitle = existingItem.mediaTitle.replacingOccurrences(of: "Episode \\d+.*$", with: "", options: .regularExpression)
.trimmingCharacters(in: .whitespacesAndNewlines)
return showTitle == existingShowTitle &&
existingItem.episodeNumber < item.episodeNumber &&
existingItem.progress >= 0.8
existingItem.episodeNumber < item.episodeNumber &&
existingItem.progress >= 0.8
}
items.removeAll { existing in
existing.fullUrl == item.fullUrl &&
existing.episodeNumber == item.episodeNumber &&
existing.module.metadata.sourceName == item.module.metadata.sourceName
}
items.append(updatedItem)
if let data = try? JSONEncoder().encode(items) {
UserDefaults.standard.set(data, forKey: storageKey)
}
}
func fetchItems() -> [ContinueWatchingItem] {
guard
let data = UserDefaults.standard.data(forKey: storageKey),
@ -121,7 +121,7 @@ class ContinueWatchingManager {
else {
return []
}
var seen = Set<String>()
let unique = raw.reversed().filter { item in
let key = "\(item.fullUrl)|\(item.module.metadata.sourceName)|\(item.episodeNumber)"
@ -132,10 +132,10 @@ class ContinueWatchingManager {
return true
}
}.reversed()
return Array(unique)
}
func remove(item: ContinueWatchingItem) {
var items = fetchItems()
items.removeAll { $0.id == item.id }

View file

@ -33,32 +33,8 @@ struct MusicProgressSlider<T: BinaryFloatingPoint>: View {
VStack(spacing: 8) {
ZStack(alignment: .center) {
ZStack(alignment: .center) {
// Intro Segments
ForEach(introSegments, id: \.self) { segment in
HStack(spacing: 0) {
Spacer()
.frame(width: bounds.size.width * CGFloat(segment.lowerBound))
Rectangle()
.fill(introColor.opacity(0.5))
.frame(width: bounds.size.width * CGFloat(segment.upperBound - segment.lowerBound))
Spacer()
}
}
// Outro Segments
ForEach(outroSegments, id: \.self) { segment in
HStack(spacing: 0) {
Spacer()
.frame(width: bounds.size.width * CGFloat(segment.lowerBound))
Rectangle()
.fill(outroColor.opacity(0.5))
.frame(width: bounds.size.width * CGFloat(segment.upperBound - segment.lowerBound))
Spacer()
}
}
Capsule()
.fill(emptyColor)
.fill(.ultraThinMaterial)
}
.clipShape(Capsule())
@ -77,6 +53,28 @@ struct MusicProgressSlider<T: BinaryFloatingPoint>: View {
Spacer(minLength: 0)
}
})
ForEach(introSegments, id: \.self) { segment in
HStack(spacing: 0) {
Spacer()
.frame(width: bounds.size.width * CGFloat(segment.lowerBound))
Rectangle()
.fill(introColor.opacity(0.5))
.frame(width: bounds.size.width * CGFloat(segment.upperBound - segment.lowerBound))
Spacer()
}
}
ForEach(outroSegments, id: \.self) { segment in
HStack(spacing: 0) {
Spacer()
.frame(width: bounds.size.width * CGFloat(segment.lowerBound))
Rectangle()
.fill(outroColor.opacity(0.5))
.frame(width: bounds.size.width * CGFloat(segment.upperBound - segment.lowerBound))
Spacer()
}
}
}
HStack {

View file

@ -21,6 +21,7 @@ struct VolumeSlider<T: BinaryFloatingPoint>: View {
@State private var localTempProgress: T = 0
@State private var lastVolumeValue: T = 0
@GestureState private var isActive: Bool = false
@State private var isAtEnd: Bool = false
var body: some View {
GeometryReader { bounds in
@ -51,8 +52,9 @@ struct VolumeSlider<T: BinaryFloatingPoint>: View {
handleIconTap()
}
}
.frame(width: isActive ? bounds.size.width * 1.02 : bounds.size.width, alignment: .center)
.frame(width: getStretchWidth(bounds: bounds), alignment: .center)
.animation(animation, value: isActive)
.animation(animation, value: isAtEnd)
}
.frame(width: bounds.size.width, height: bounds.size.height)
.gesture(
@ -61,16 +63,26 @@ struct VolumeSlider<T: BinaryFloatingPoint>: View {
.onChanged { gesture in
let delta = gesture.translation.width / bounds.size.width
localTempProgress = T(delta)
let totalProgress = localRealProgress + localTempProgress
if totalProgress <= 0.0 || totalProgress >= 1.0 {
isAtEnd = true
} else {
isAtEnd = false
}
value = sliderValueInRange()
}
.onEnded { _ in
localRealProgress = max(min(localRealProgress + localTempProgress, 1), 0)
localTempProgress = 0
isAtEnd = false
}
)
.onChange(of: isActive) { newValue in
if !newValue {
value = sliderValueInRange()
isAtEnd = false
}
onEditingChanged(newValue)
}
@ -91,7 +103,7 @@ struct VolumeSlider<T: BinaryFloatingPoint>: View {
}
}
}
.frame(height: isActive ? height * 1.25 : height)
.frame(height: getStretchHeight())
}
private var getIconName: String {
@ -133,9 +145,12 @@ struct VolumeSlider<T: BinaryFloatingPoint>: View {
}
private var animation: Animation {
isActive
? .spring()
: .spring(response: 0.5, dampingFraction: 0.5, blendDuration: 0.6)
.interpolatingSpring(
mass: 1.0,
stiffness: 100,
damping: 15,
initialVelocity: 0.0
)
}
private func progress(for val: T) -> T {
@ -150,4 +165,25 @@ struct VolumeSlider<T: BinaryFloatingPoint>: View {
+ inRange.lowerBound
return max(min(rawVal, inRange.upperBound), inRange.lowerBound)
}
private func getStretchWidth(bounds: GeometryProxy) -> CGFloat {
let baseWidth = bounds.size.width
if isAtEnd {
return baseWidth * 1.08
} else if isActive {
return baseWidth * 1.04
} else {
return baseWidth
}
}
private func getStretchHeight() -> CGFloat {
if isAtEnd {
return height * 1.35
} else if isActive {
return height * 1.25
} else {
return height
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -320,8 +320,10 @@ class VideoPlayerViewController: UIViewController {
}
let remainingPercentage = (duration - currentTime) / duration
let remainingTimePercentage = UserDefaults.standard.object(forKey: "remainingTimePercentage") != nil ? UserDefaults.standard.double(forKey: "remainingTimePercentage") : 90.0
let threshold = (100.0 - remainingTimePercentage) / 100.0
if remainingPercentage < 0.1 {
if remainingPercentage <= threshold {
if self.aniListID != 0 && !self.aniListUpdateSent {
self.sendAniListUpdate()
}

View file

@ -1,7 +0,0 @@
struct EpisodeLink: Identifiable {
let id = UUID()
let number: Int
let title: String
let href: String
let duration: Int?
}

View file

@ -23,9 +23,9 @@ struct SoraApp: App {
TraktToken.checkAuthenticationStatus { isAuthenticated in
if isAuthenticated {
Logger.shared.log("Trakt authentication is valid")
Logger.shared.log("Trakt authentication is valid", type: "Debug")
} else {
Logger.shared.log("Trakt authentication required", type: "Error")
Logger.shared.log("Trakt authentication required", type: "Debug")
}
}
}

View file

@ -159,8 +159,8 @@ class TraktToken {
guard status == errSecSuccess,
let tokenData = result as? Data,
let token = String(data: tokenData, encoding: .utf8) else {
return nil
}
return nil
}
return token
}
@ -179,8 +179,8 @@ class TraktToken {
guard status == errSecSuccess,
let tokenData = result as? Data,
let token = String(data: tokenData, encoding: .utf8) else {
return nil
}
return nil
}
return token
}

View file

@ -1,223 +0,0 @@
//
// DownloadManager.swift
// Sulfur
//
// Created by Francesco on 29/04/25.
//
import SwiftUI
import AVKit
import Foundation
import AVFoundation
struct DownloadedAsset: Identifiable, Codable {
let id: UUID
var name: String
let downloadDate: Date
let originalURL: URL
let localURL: URL
var fileSize: Int64?
let module: ScrapingModule
init(id: UUID = UUID(), name: String, downloadDate: Date, originalURL: URL, localURL: URL, module: ScrapingModule) {
self.id = id
self.name = name
self.downloadDate = downloadDate
self.originalURL = originalURL
self.localURL = localURL
self.module = module
self.fileSize = getFileSize()
}
func getFileSize() -> Int64? {
do {
let values = try localURL.resourceValues(forKeys: [.fileSizeKey])
return Int64(values.fileSize ?? 0)
} catch {
return nil
}
}
}
class DownloadManager: NSObject, ObservableObject {
@Published var activeDownloads: [ActiveDownload] = []
@Published var savedAssets: [DownloadedAsset] = []
private var assetDownloadURLSession: AVAssetDownloadURLSession!
private var activeDownloadTasks: [URLSessionTask: (URL, ScrapingModule)] = [:]
override init() {
super.init()
initializeDownloadSession()
loadSavedAssets()
reconcileFileSystemAssets()
}
private func initializeDownloadSession() {
let configuration = URLSessionConfiguration.background(withIdentifier: "downloader-\(UUID().uuidString)")
assetDownloadURLSession = AVAssetDownloadURLSession(
configuration: configuration,
assetDownloadDelegate: self,
delegateQueue: .main
)
}
func downloadAsset(from url: URL, module: ScrapingModule, headers: [String: String]? = nil) {
var urlRequest = URLRequest(url: url)
if let headers = headers {
for (key, value) in headers {
urlRequest.addValue(value, forHTTPHeaderField: key)
}
} else {
urlRequest.addValue(module.metadata.baseUrl, forHTTPHeaderField: "Origin")
urlRequest.addValue(module.metadata.baseUrl, forHTTPHeaderField: "Referer")
}
urlRequest.addValue("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36", forHTTPHeaderField: "User-Agent")
let asset = AVURLAsset(url: urlRequest.url!, options: ["AVURLAssetHTTPHeaderFieldsKey": urlRequest.allHTTPHeaderFields ?? [:]])
let task = assetDownloadURLSession.makeAssetDownloadTask(
asset: asset,
assetTitle: url.lastPathComponent,
assetArtworkData: nil,
options: [AVAssetDownloadTaskMinimumRequiredMediaBitrateKey: 2_000_000]
)
let download = ActiveDownload(
id: UUID(),
originalURL: url,
progress: 0,
task: task!
)
activeDownloads.append(download)
activeDownloadTasks[task!] = (url, module)
task?.resume()
}
func deleteAsset(_ asset: DownloadedAsset) {
do {
try FileManager.default.removeItem(at: asset.localURL)
savedAssets.removeAll { $0.id == asset.id }
saveAssets()
} catch {
Logger.shared.log("Error deleting asset: \(error)")
}
}
func renameAsset(_ asset: DownloadedAsset, newName: String) {
guard let index = savedAssets.firstIndex(where: { $0.id == asset.id }) else { return }
savedAssets[index].name = newName
saveAssets()
}
private func saveAssets() {
do {
let data = try JSONEncoder().encode(savedAssets)
UserDefaults.standard.set(data, forKey: "savedAssets")
} catch {
Logger.shared.log("Error saving assets: \(error)")
}
}
private func loadSavedAssets() {
guard let data = UserDefaults.standard.data(forKey: "savedAssets") else { return }
do {
savedAssets = try JSONDecoder().decode([DownloadedAsset].self, from: data)
} catch {
Logger.shared.log("Error loading saved assets: \(error)")
}
}
private func reconcileFileSystemAssets() {
guard let documents = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else { return }
do {
let fileURLs = try FileManager.default.contentsOfDirectory(
at: documents,
includingPropertiesForKeys: [.creationDateKey, .fileSizeKey],
options: .skipsHiddenFiles
)
} catch {
Logger.shared.log("Error reconciling files: \(error)")
}
}
}
extension DownloadManager: AVAssetDownloadDelegate {
func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didFinishDownloadingTo location: URL) {
guard let (originalURL, module) = activeDownloadTasks[assetDownloadTask] else { return }
let newAsset = DownloadedAsset(
name: originalURL.lastPathComponent,
downloadDate: Date(),
originalURL: originalURL,
localURL: location,
module: module
)
savedAssets.append(newAsset)
saveAssets()
cleanupDownloadTask(assetDownloadTask)
}
func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
guard let error = error else { return }
Logger.shared.log("Download error: \(error.localizedDescription)")
cleanupDownloadTask(task)
}
func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didLoad timeRange: CMTimeRange, totalTimeRangesLoaded loadedTimeRanges: [NSValue], timeRangeExpectedToLoad: CMTimeRange) {
guard let (originalURL, _) = activeDownloadTasks[assetDownloadTask], let downloadIndex = activeDownloads.firstIndex(where: { $0.originalURL == originalURL }) else { return }
let progress = loadedTimeRanges
.map { $0.timeRangeValue.duration.seconds / timeRangeExpectedToLoad.duration.seconds }
.reduce(0, +)
activeDownloads[downloadIndex].progress = progress
}
private func cleanupDownloadTask(_ task: URLSessionTask) {
activeDownloadTasks.removeValue(forKey: task)
activeDownloads.removeAll { $0.task == task }
}
}
struct DownloadProgressView: View {
let download: ActiveDownload
var body: some View {
VStack(alignment: .leading) {
Text(download.originalURL.lastPathComponent)
.font(.subheadline)
ProgressView(value: download.progress)
.progressViewStyle(LinearProgressViewStyle())
Text("\(Int(download.progress * 100))%")
.font(.caption)
}
}
}
struct AssetRowView: View {
let asset: DownloadedAsset
var body: some View {
VStack(alignment: .leading) {
Text(asset.name)
.font(.headline)
Text("\(asset.fileSize ?? 0) bytes • \(asset.downloadDate.formatted())")
.font(.caption)
.foregroundColor(.secondary)
}
}
}
struct ActiveDownload: Identifiable {
let id: UUID
let originalURL: URL
var progress: Double
let task: URLSessionTask
}

View file

@ -1,16 +0,0 @@
//
// Notification+Name.swift
// Sulfur
//
// Created by Francesco on 17/04/25.
//
import Foundation
extension Notification.Name {
static let iCloudSyncDidComplete = Notification.Name("iCloudSyncDidComplete")
static let iCloudSyncDidFail = Notification.Name("iCloudSyncDidFail")
static let ContinueWatchingDidUpdate = Notification.Name("ContinueWatchingDidUpdate")
static let DownloadManagerStatusUpdate = Notification.Name("DownloadManagerStatusUpdate")
static let modulesSyncDidComplete = Notification.Name("modulesSyncDidComplete")
}

View file

@ -1,267 +0,0 @@
//
// TabBar.swift
// SoraPrototype
//
// Created by Inumaki on 26/04/2025.
//
import SwiftUI
extension Color {
init(hex: String) {
let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
var int: UInt64 = 0
Scanner(string: hex).scanHexInt64(&int)
let r, g, b, a: UInt64
switch hex.count {
case 6:
(r, g, b, a) = (int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF, 255)
case 8:
(r, g, b, a) = (int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF, int >> 24 & 0xFF)
default:
(r, g, b, a) = (1, 1, 1, 1)
}
self.init(
.sRGB,
red: Double(r) / 255,
green: Double(g) / 255,
blue: Double(b) / 255,
opacity: Double(a) / 255
)
}
}
struct TabBar: View {
let tabs: [TabItem]
@Binding var selectedTab: Int
@Binding var lastTab: Int
@State var showSearch: Bool = false
@State var searchLocked: Bool = false
@FocusState var keyboardFocus: Bool
@State var keyboardHidden: Bool = true
@Binding var searchQuery: String
@ObservedObject var controller: TabBarController
@State private var keyboardHeight: CGFloat = 0
private var gradientOpacity: CGFloat {
let accentColor = UIColor(Color.accentColor)
var white: CGFloat = 0
accentColor.getWhite(&white, alpha: nil)
return white > 0.5 ? 0.5 : 0.3
}
@Namespace private var animation
func slideDown() {
controller.hideTabBar()
}
func slideUp() {
controller.showTabBar()
}
var body: some View {
HStack {
if showSearch && keyboardHidden {
Button(action: {
keyboardFocus = false
withAnimation(.bouncy(duration: 0.3)) {
selectedTab = lastTab
showSearch = false
}
}) {
Image(systemName: "xmark")
.font(.system(size: 20))
.foregroundStyle(.gray)
.frame(width: 20, height: 20)
.matchedGeometryEffect(id: "xmark", in: animation)
.padding(16)
.background(
Circle()
.fill(.ultraThinMaterial)
.overlay(
Circle()
.stroke(
LinearGradient(
gradient: Gradient(stops: [
.init(color: Color.accentColor.opacity(gradientOpacity), location: 0),
.init(color: Color.accentColor.opacity(0), location: 1)
]),
startPoint: .top,
endPoint: .bottom
),
lineWidth: 0.5
)
)
.matchedGeometryEffect(id: "background_circle", in: animation)
)
}
.disabled(!keyboardHidden || searchLocked)
}
HStack {
if showSearch {
HStack {
Image(systemName: "magnifyingglass")
.font(.footnote)
.foregroundStyle(.gray)
.opacity(0.7)
TextField("Search for something...", text: $searchQuery)
.textFieldStyle(.plain)
.font(.footnote)
.foregroundStyle(Color.accentColor)
.frame(maxWidth: .infinity, alignment: .leading)
.focused($keyboardFocus)
.onChange(of: keyboardFocus) { newValue in
withAnimation(.bouncy(duration: 0.3)) {
keyboardHidden = !newValue
}
}
.onDisappear {
keyboardFocus = false
}
if !searchQuery.isEmpty {
Button(action: {
searchQuery = ""
}) {
Image(systemName: "xmark.circle.fill")
.font(.system(size: 16))
.foregroundStyle(.gray)
.opacity(0.7)
}
.buttonStyle(PlainButtonStyle())
}
}
.frame(height: 24)
.padding(8)
} else {
ForEach(0..<tabs.count, id: \.self) { index in
let tab = tabs[index]
tabButton(for: tab, index: index)
}
}
}
.padding(.horizontal, 12)
.padding(.vertical, 8)
.background(
Capsule()
.fill(.ultraThinMaterial)
)
.clipShape(Capsule())
.overlay(
Capsule()
.strokeBorder(
LinearGradient(
gradient: Gradient(stops: [
.init(color: Color.accentColor.opacity(gradientOpacity), location: 0),
.init(color: Color.accentColor.opacity(0), location: 1)
]),
startPoint: .top,
endPoint: .bottom
),
lineWidth: 0.5
)
)
}
.padding(.horizontal, 20)
.padding(.bottom, 20)
.background {
ProgressiveBlurView()
.blur(radius: 10)
.padding(.horizontal, -20)
.padding(.bottom, -100)
.padding(.top, -10)
.opacity(controller.isHidden ? 0 : 1) // Animate opacity
.animation(.easeInOut(duration: 0.15), value: controller.isHidden)
}
.offset(y: controller.isHidden ? 120 : (keyboardFocus ? -keyboardHeight + 36 : 0))
.animation(.spring(response: 0.3, dampingFraction: 0.8), value: keyboardHeight)
.animation(.easeInOut(duration: 0.15), value: controller.isHidden)
.onChange(of: keyboardHeight) { newValue in
withAnimation(.spring(response: 0.3, dampingFraction: 0.8)) {
}
}
.onAppear {
NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillShowNotification, object: nil, queue: .main) { notification in
if let keyboardFrame = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect {
keyboardHeight = keyboardFrame.height
}
}
NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillHideNotification, object: nil, queue: .main) { _ in
keyboardHeight = 0
}
}
}
@ViewBuilder
private func tabButton(for tab: TabItem, index: Int) -> some View {
Button(action: {
if index == tabs.count - 1 {
searchLocked = true
withAnimation(.bouncy(duration: 0.3)) {
lastTab = selectedTab
selectedTab = index
showSearch = true
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
searchLocked = false
}
} else {
if !searchLocked {
withAnimation(.bouncy(duration: 0.3)) {
lastTab = selectedTab
selectedTab = index
}
}
}
}) {
if tab.title.isEmpty {
Image(systemName: tab.icon + (selectedTab == index ? ".fill" : ""))
.frame(width: 28, height: 28)
.matchedGeometryEffect(id: tab.icon, in: animation)
.foregroundStyle(selectedTab == index ? .black : .gray)
.padding(.vertical, 8)
.padding(.horizontal, 10)
.frame(width: 70)
.opacity(selectedTab == index ? 1 : 0.5)
} else {
VStack {
Image(systemName: tab.icon + (selectedTab == index ? ".fill" : ""))
.frame(width: 36, height: 18)
.matchedGeometryEffect(id: tab.icon, in: animation)
.foregroundStyle(selectedTab == index ? .black : .gray)
Text(tab.title)
.font(.caption)
.frame(width: 60)
.lineLimit(1)
.truncationMode(.tail)
}
.padding(.vertical, 8)
.padding(.horizontal, 10)
.frame(width: 80)
.opacity(selectedTab == index ? 1 : 0.5)
}
}
.background(
selectedTab == index ?
Capsule()
.fill(.white)
.shadow(color: .black.opacity(0.2), radius: 6)
.matchedGeometryEffect(id: "background_capsule", in: animation)
: nil
)
}
}

View file

@ -1,24 +0,0 @@
//
// TabBarController.swift
// Sulfur
//
// Created by Mac on 28/05/2025.
//
import SwiftUI
class TabBarController: ObservableObject {
@Published var isHidden = false
func hideTabBar() {
withAnimation(.easeInOut(duration: 0.15)) {
isHidden = true
}
}
func showTabBar() {
withAnimation(.easeInOut(duration: 0.10)) {
isHidden = false
}
}
}

View file

@ -23,12 +23,17 @@ class DownloadManager: NSObject, ObservableObject {
}
private func initializeDownloadSession() {
let configuration = URLSessionConfiguration.background(withIdentifier: "hls-downloader")
assetDownloadURLSession = AVAssetDownloadURLSession(
configuration: configuration,
assetDownloadDelegate: self,
delegateQueue: .main
)
#if targetEnvironment(simulator)
Logger.shared.log("Download Sessions are not available on Simulator", type: "Error")
#else
let configuration = URLSessionConfiguration.background(withIdentifier: "hls-downloader")
assetDownloadURLSession = AVAssetDownloadURLSession(
configuration: configuration,
assetDownloadDelegate: self,
delegateQueue: .main
)
#endif
}
func downloadAsset(from url: URL) {

View file

@ -76,7 +76,7 @@ extension JSContext {
}
func setupFetchV2() {
let fetchV2NativeFunction: @convention(block) (String, [String: String]?, String?, String?, ObjCBool, String?, JSValue, JSValue) -> Void = { urlString, headers, method, body, redirect, encoding, resolve, reject in
let fetchV2NativeFunction: @convention(block) (String, Any?, String?, String?, ObjCBool, String?, JSValue, JSValue) -> Void = { urlString, headersAny, method, body, redirect, encoding, resolve, reject in
guard let url = URL(string: urlString) else {
Logger.shared.log("Invalid URL", type: "Error")
DispatchQueue.main.async {
@ -85,6 +85,51 @@ extension JSContext {
return
}
var headers: [String: String]? = nil
if let headersAny = headersAny {
if headersAny is NSNull {
headers = nil
} else if let headersDict = headersAny as? [String: Any] {
var safeHeaders: [String: String] = [:]
for (key, value) in headersDict {
let stringValue: String
if let str = value as? String {
stringValue = str
} else if let num = value as? NSNumber {
stringValue = num.stringValue
} else if value is NSNull {
continue
} else {
stringValue = String(describing: value)
}
safeHeaders[key] = stringValue
}
headers = safeHeaders.isEmpty ? nil : safeHeaders
} else if let headersDict = headersAny as? [AnyHashable: Any] {
var safeHeaders: [String: String] = [:]
for (key, value) in headersDict {
let stringKey = String(describing: key)
let stringValue: String
if let str = value as? String {
stringValue = str
} else if let num = value as? NSNumber {
stringValue = num.stringValue
} else if value is NSNull {
continue
} else {
stringValue = String(describing: value)
}
safeHeaders[stringKey] = stringValue
}
headers = safeHeaders.isEmpty ? nil : safeHeaders
} else {
Logger.shared.log("Headers argument is not a dictionary, type: \(type(of: headersAny))", type: "Warning")
headers = nil
}
}
let httpMethod = method ?? "GET"
var request = URLRequest(url: url)
request.httpMethod = httpMethod
@ -117,7 +162,9 @@ extension JSContext {
let textEncoding = getEncoding(from: encoding)
if httpMethod == "GET", let body = body, !body.isEmpty, body != "null", body != "undefined" {
let bodyIsEmpty = body == nil || (body)?.isEmpty == true || body == "null" || body == "undefined"
if httpMethod == "GET" && !bodyIsEmpty {
Logger.shared.log("GET request must not have a body", type: "Error")
DispatchQueue.main.async {
reject.call(withArguments: ["GET request must not have a body"])
@ -125,8 +172,13 @@ extension JSContext {
return
}
if httpMethod != "GET", let body = body, !body.isEmpty, body != "null", body != "undefined" {
request.httpBody = body.data(using: .utf8)
if httpMethod != "GET" && !bodyIsEmpty {
if let bodyString = body {
request.httpBody = bodyString.data(using: .utf8)
} else {
let bodyString = String(describing: body!)
request.httpBody = bodyString.data(using: .utf8)
}
}
if let headers = headers {
@ -134,7 +186,8 @@ extension JSContext {
request.setValue(value, forHTTPHeaderField: key)
}
}
Logger.shared.log("Redirect value is \(redirect.boolValue)", type: "Error")
Logger.shared.log("Redirect value is \(redirect.boolValue)", type: "Debug")
let session = URLSession.fetchData(allowRedirects: redirect.boolValue)
let task = session.downloadTask(with: request) { tempFileURL, response, error in
@ -166,8 +219,13 @@ extension JSContext {
var safeHeaders: [String: String] = [:]
if let httpResponse = response as? HTTPURLResponse {
for (key, value) in httpResponse.allHeaderFields {
if let keyString = key as? String,
let valueString = value as? String {
if let keyString = key as? String {
let valueString: String
if let str = value as? String {
valueString = str
} else {
valueString = String(describing: value)
}
safeHeaders[keyString] = valueString
}
}
@ -210,43 +268,45 @@ extension JSContext {
task.resume()
}
self.setObject(fetchV2NativeFunction, forKeyedSubscript: "fetchV2Native" as NSString)
let fetchv2Definition = """
function fetchv2(url, headers = {}, method = "GET", body = null, redirect = true, encoding ) {
var processedBody = null;
if(method != "GET")
{
processedBody = (body && (typeof body === 'object')) ? JSON.stringify(body) : (body || null)
}
var finalEncoding = encoding || "utf-8";
return new Promise(function(resolve, reject) {
fetchV2Native(url, headers, method, processedBody, redirect, finalEncoding, function(rawText) {
const responseObj = {
headers: rawText.headers,
status: rawText.status,
_data: rawText.body,
text: function() {
return Promise.resolve(this._data);
},
json: function() {
try {
return Promise.resolve(JSON.parse(this._data));
} catch (e) {
return Promise.reject("JSON parse error: " + e.message);
}
}
};
resolve(responseObj);
}, reject);
});
}
function fetchv2(url, headers = {}, method = "GET", body = null, redirect = true, encoding) {
var processedBody = null;
if(method != "GET") {
processedBody = (body && (typeof body === 'object')) ? JSON.stringify(body) : (body || null)
}
var finalEncoding = encoding || "utf-8";
// Ensure headers is an object and not null/undefined
var processedHeaders = {};
if (headers && typeof headers === 'object' && !Array.isArray(headers)) {
processedHeaders = headers;
}
return new Promise(function(resolve, reject) {
fetchV2Native(url, processedHeaders, method, processedBody, redirect, finalEncoding, function(rawText) {
const responseObj = {
headers: rawText.headers,
status: rawText.status,
_data: rawText.body,
text: function() {
return Promise.resolve(this._data);
},
json: function() {
try {
return Promise.resolve(JSON.parse(this._data));
} catch (e) {
return Promise.reject("JSON parse error: " + e.message);
}
}
};
resolve(responseObj);
}, reject);
});
}
"""
self.evaluateScript(fetchv2Definition)
}

View file

@ -0,0 +1,26 @@
//
// Notification+Name.swift
// Sulfur
//
// Created by Francesco on 17/04/25.
//
import Foundation
import UIKit
extension Notification.Name {
static let iCloudSyncDidComplete = Notification.Name("iCloudSyncDidComplete")
static let iCloudSyncDidFail = Notification.Name("iCloudSyncDidFail")
static let ContinueWatchingDidUpdate = Notification.Name("ContinueWatchingDidUpdate")
static let DownloadManagerStatusUpdate = Notification.Name("DownloadManagerStatusUpdate")
static let modulesSyncDidComplete = Notification.Name("modulesSyncDidComplete")
static let moduleRemoved = Notification.Name("moduleRemoved")
static let didReceiveNewModule = Notification.Name("didReceiveNewModule")
static let didUpdateModules = Notification.Name("didUpdateModules")
static let didUpdateDownloads = Notification.Name("didUpdateDownloads")
static let didUpdateBookmarks = Notification.Name("didUpdateBookmarks")
static let hideTabBar = Notification.Name("hideTabBar")
static let showTabBar = Notification.Name("showTabBar")
static let searchQueryChanged = Notification.Name("searchQueryChanged")
static let tabBarSearchQueryUpdated = Notification.Name("tabBarSearchQueryUpdated")
}

View file

@ -6,6 +6,7 @@
//
import SwiftUI
import UIKit
struct ScrollViewBottomPadding: ViewModifier {
func body(content: Content) -> some View {

View file

@ -43,24 +43,29 @@ extension JSController {
private static var progressUpdateTimer: Timer?
func initializeDownloadSession() {
// Create a unique identifier for the background session
let sessionIdentifier = "hls-downloader-\(UUID().uuidString)"
let configuration = URLSessionConfiguration.background(withIdentifier: sessionIdentifier)
// Configure session
configuration.allowsCellularAccess = true
configuration.shouldUseExtendedBackgroundIdleMode = true
configuration.waitsForConnectivity = true
// Create session with configuration
downloadURLSession = AVAssetDownloadURLSession(
configuration: configuration,
assetDownloadDelegate: self,
delegateQueue: .main
)
print("Download session initialized with ID: \(sessionIdentifier)")
#if targetEnvironment(simulator)
Logger.shared.log("Download Sessions are not available on Simulator", type: "Error")
#else
// Create a unique identifier for the background session
let sessionIdentifier = "hls-downloader-\(UUID().uuidString)"
let configuration = URLSessionConfiguration.background(withIdentifier: sessionIdentifier)
// Configure session
configuration.allowsCellularAccess = true
configuration.shouldUseExtendedBackgroundIdleMode = true
configuration.waitsForConnectivity = true
// Create session with configuration
downloadURLSession = AVAssetDownloadURLSession(
configuration: configuration,
assetDownloadDelegate: self,
delegateQueue: .main
)
print("Download session initialized with ID: \(sessionIdentifier)")
#endif
loadSavedAssets()
}
@ -1192,7 +1197,7 @@ extension JSController: AVAssetDownloadDelegate {
let download = activeDownloads[downloadIndex]
// Move the downloaded file to Application Support directory for persistence
guard let persistentURL = moveToApplicationSupportDirectory(from: location, filename: download.title ?? download.originalURL.lastPathComponent) else {
guard let persistentURL = moveToApplicationSupportDirectory(from: location, filename: download.title ?? download.originalURL.lastPathComponent, originalURL: download.originalURL) else {
print("Failed to move downloaded file to persistent storage")
return
}
@ -1240,8 +1245,9 @@ extension JSController: AVAssetDownloadDelegate {
/// - Parameters:
/// - location: The original location from the download task
/// - filename: Name to use for the file
/// - originalURL: The original download URL to determine proper file extension
/// - Returns: URL to the new persistent location or nil if move failed
private func moveToApplicationSupportDirectory(from location: URL, filename: String) -> URL? {
private func moveToApplicationSupportDirectory(from location: URL, filename: String, originalURL: URL) -> URL? {
let fileManager = FileManager.default
// Get Application Support directory
@ -1264,23 +1270,31 @@ extension JSController: AVAssetDownloadDelegate {
let safeFilename = filename.replacingOccurrences(of: "/", with: "-")
.replacingOccurrences(of: ":", with: "-")
// Determine file extension based on the source location
// Determine file extension based on the original download URL, not the downloaded file
let fileExtension: String
if location.pathExtension.isEmpty {
// If no extension from the source, check if it's likely an HLS download (which becomes .movpkg)
// or preserve original URL extension
if safeFilename.contains(".m3u8") || safeFilename.contains("hls") {
fileExtension = "movpkg"
print("Using .movpkg extension for HLS download: \(safeFilename)")
} else {
fileExtension = "mp4" // Default for direct video downloads
print("Using .mp4 extension for direct video download: \(safeFilename)")
}
// Check the original URL to determine if this was an HLS stream or direct MP4
let originalURLString = originalURL.absoluteString.lowercased()
let originalPathExtension = originalURL.pathExtension.lowercased()
if originalURLString.contains(".m3u8") || originalURLString.contains("/hls/") || originalURLString.contains("m3u8") {
// This was an HLS stream, keep as .movpkg
fileExtension = "movpkg"
print("Using .movpkg extension for HLS download: \(safeFilename)")
} else if originalPathExtension == "mp4" || originalURLString.contains(".mp4") || originalURLString.contains("download") {
// This was a direct MP4 download, use .mp4 extension regardless of what AVAssetDownloadTask created
fileExtension = "mp4"
print("Using .mp4 extension for direct MP4 download: \(safeFilename)")
} else {
// Use the extension from the downloaded file
// Fallback: check the downloaded file extension
let sourceExtension = location.pathExtension.lowercased()
fileExtension = (sourceExtension == "movpkg") ? "movpkg" : "mp4"
print("Using extension from source file: \(sourceExtension) -> \(fileExtension)")
if sourceExtension == "movpkg" && originalURLString.contains("m3u8") {
fileExtension = "movpkg"
print("Using .movpkg extension for HLS stream: \(safeFilename)")
} else {
fileExtension = "mp4"
print("Using .mp4 extension as fallback: \(safeFilename)")
}
}
print("Final destination will be: \(safeFilename)-\(uniqueID).\(fileExtension)")

View file

@ -9,7 +9,6 @@ import Foundation
import JavaScriptCore
extension JSController {
func fetchDetails(url: String, completion: @escaping ([MediaItem], [EpisodeLink]) -> Void) {
guard let url = URL(string: url) else {
completion([], [])
@ -65,24 +64,25 @@ extension JSController {
func fetchDetailsJS(url: String, completion: @escaping ([MediaItem], [EpisodeLink]) -> Void) {
guard let url = URL(string: url) else {
Logger.shared.log("Invalid URL in fetchDetailsJS: \(url)", type: "Error")
completion([], [])
return
}
if let exception = context.exception {
Logger.shared.log("JavaScript exception: \(exception)",type: "Error")
Logger.shared.log("JavaScript exception: \(exception)", type: "Error")
completion([], [])
return
}
guard let extractDetailsFunction = context.objectForKeyedSubscript("extractDetails") else {
Logger.shared.log("No JavaScript function extractDetails found",type: "Error")
Logger.shared.log("No JavaScript function extractDetails found", type: "Error")
completion([], [])
return
}
guard let extractEpisodesFunction = context.objectForKeyedSubscript("extractEpisodes") else {
Logger.shared.log("No JavaScript function extractEpisodes found",type: "Error")
Logger.shared.log("No JavaScript function extractEpisodes found", type: "Error")
completion([], [])
return
}
@ -93,41 +93,64 @@ extension JSController {
let dispatchGroup = DispatchGroup()
dispatchGroup.enter()
var hasLeftDetailsGroup = false
let detailsGroupQueue = DispatchQueue(label: "details.group")
let promiseValueDetails = extractDetailsFunction.call(withArguments: [url.absoluteString])
guard let promiseDetails = promiseValueDetails else {
Logger.shared.log("extractDetails did not return a Promise",type: "Error")
Logger.shared.log("extractDetails did not return a Promise", type: "Error")
detailsGroupQueue.sync {
guard !hasLeftDetailsGroup else { return }
hasLeftDetailsGroup = true
dispatchGroup.leave()
}
completion([], [])
return
}
let thenBlockDetails: @convention(block) (JSValue) -> Void = { result in
Logger.shared.log(result.toString(),type: "Debug")
if let jsonOfDetails = result.toString(),
let dataDetails = jsonOfDetails.data(using: .utf8) {
do {
if let array = try JSONSerialization.jsonObject(with: dataDetails, options: []) as? [[String: Any]] {
resultItems = array.map { item -> MediaItem in
MediaItem(
description: item["description"] as? String ?? "",
aliases: item["aliases"] as? String ?? "",
airdate: item["airdate"] as? String ?? ""
)
}
} else {
Logger.shared.log("Failed to parse JSON of extractDetails",type: "Error")
}
} catch {
Logger.shared.log("JSON parsing error of extract details: \(error)",type: "Error")
detailsGroupQueue.sync {
guard !hasLeftDetailsGroup else {
Logger.shared.log("extractDetails: thenBlock called but group already left", type: "Debug")
return
}
} else {
Logger.shared.log("Result is not a string of extractDetails",type: "Error")
hasLeftDetailsGroup = true
if let jsonOfDetails = result.toString(),
let dataDetails = jsonOfDetails.data(using: .utf8) {
do {
if let array = try JSONSerialization.jsonObject(with: dataDetails, options: []) as? [[String: Any]] {
resultItems = array.map { item -> MediaItem in
MediaItem(
description: item["description"] as? String ?? "",
aliases: item["aliases"] as? String ?? "",
airdate: item["airdate"] as? String ?? ""
)
}
} else {
Logger.shared.log("Failed to parse JSON of extractDetails", type: "Error")
}
} catch {
Logger.shared.log("JSON parsing error of extract details: \(error)", type: "Error")
}
} else {
Logger.shared.log("Result is not a string of extractDetails", type: "Error")
}
dispatchGroup.leave()
}
dispatchGroup.leave()
}
let catchBlockDetails: @convention(block) (JSValue) -> Void = { error in
Logger.shared.log("Promise rejected of extractDetails: \(String(describing: error.toString()))",type: "Error")
dispatchGroup.leave()
detailsGroupQueue.sync {
guard !hasLeftDetailsGroup else {
Logger.shared.log("extractDetails: catchBlock called but group already left", type: "Debug")
return
}
hasLeftDetailsGroup = true
Logger.shared.log("Promise rejected of extractDetails: \(String(describing: error.toString()))", type: "Error")
dispatchGroup.leave()
}
}
let thenFunctionDetails = JSValue(object: thenBlockDetails, in: context)
@ -138,41 +161,81 @@ extension JSController {
dispatchGroup.enter()
let promiseValueEpisodes = extractEpisodesFunction.call(withArguments: [url.absoluteString])
var hasLeftEpisodesGroup = false
let episodesGroupQueue = DispatchQueue(label: "episodes.group")
let timeoutWorkItem = DispatchWorkItem {
Logger.shared.log("Timeout for extractEpisodes", type: "Warning")
episodesGroupQueue.sync {
guard !hasLeftEpisodesGroup else {
Logger.shared.log("extractEpisodes: timeout called but group already left", type: "Debug")
return
}
hasLeftEpisodesGroup = true
dispatchGroup.leave()
}
}
DispatchQueue.main.asyncAfter(deadline: .now() + 5.0, execute: timeoutWorkItem)
guard let promiseEpisodes = promiseValueEpisodes else {
Logger.shared.log("extractEpisodes did not return a Promise",type: "Error")
Logger.shared.log("extractEpisodes did not return a Promise", type: "Error")
timeoutWorkItem.cancel()
episodesGroupQueue.sync {
guard !hasLeftEpisodesGroup else { return }
hasLeftEpisodesGroup = true
dispatchGroup.leave()
}
completion([], [])
return
}
let thenBlockEpisodes: @convention(block) (JSValue) -> Void = { result in
Logger.shared.log(result.toString(),type: "Debug")
if let jsonOfEpisodes = result.toString(),
let dataEpisodes = jsonOfEpisodes.data(using: .utf8) {
do {
if let array = try JSONSerialization.jsonObject(with: dataEpisodes, options: []) as? [[String: Any]] {
episodeLinks = array.map { item -> EpisodeLink in
EpisodeLink(
number: item["number"] as? Int ?? 0,
title: "",
href: item["href"] as? String ?? "",
duration: nil
)
}
} else {
Logger.shared.log("Failed to parse JSON of extractEpisodes",type: "Error")
}
} catch {
Logger.shared.log("JSON parsing error of extractEpisodes: \(error)",type: "Error")
timeoutWorkItem.cancel()
episodesGroupQueue.sync {
guard !hasLeftEpisodesGroup else {
Logger.shared.log("extractEpisodes: thenBlock called but group already left", type: "Debug")
return
}
} else {
Logger.shared.log("Result is not a string of extractEpisodes",type: "Error")
hasLeftEpisodesGroup = true
if let jsonOfEpisodes = result.toString(),
let dataEpisodes = jsonOfEpisodes.data(using: .utf8) {
do {
if let array = try JSONSerialization.jsonObject(with: dataEpisodes, options: []) as? [[String: Any]] {
episodeLinks = array.map { item -> EpisodeLink in
EpisodeLink(
number: item["number"] as? Int ?? 0,
title: "",
href: item["href"] as? String ?? "",
duration: nil
)
}
} else {
Logger.shared.log("Failed to parse JSON of extractEpisodes", type: "Error")
}
} catch {
Logger.shared.log("JSON parsing error of extractEpisodes: \(error)", type: "Error")
}
} else {
Logger.shared.log("Result is not a string of extractEpisodes", type: "Error")
}
dispatchGroup.leave()
}
dispatchGroup.leave()
}
let catchBlockEpisodes: @convention(block) (JSValue) -> Void = { error in
Logger.shared.log("Promise rejected of extractEpisodes: \(String(describing: error.toString()))",type: "Error")
dispatchGroup.leave()
timeoutWorkItem.cancel()
episodesGroupQueue.sync {
guard !hasLeftEpisodesGroup else {
Logger.shared.log("extractEpisodes: catchBlock called but group already left", type: "Debug")
return
}
hasLeftEpisodesGroup = true
Logger.shared.log("Promise rejected of extractEpisodes: \(String(describing: error.toString()))", type: "Error")
dispatchGroup.leave()
}
}
let thenFunctionEpisodes = JSValue(object: thenBlockEpisodes, in: context)

View file

@ -0,0 +1,356 @@
//
// JSController-Novel.swift
// Sora
//
// Created by paul on 20/06/25.
//
import Foundation
import JavaScriptCore
enum JSError: Error {
case moduleNotFound
case invalidResponse
case emptyContent
case redirectError
case jsException(String)
var localizedDescription: String {
switch self {
case .moduleNotFound:
return "Module not found"
case .invalidResponse:
return "Invalid response from server"
case .emptyContent:
return "No content received"
case .redirectError:
return "Redirect error occurred"
case .jsException(let message):
return "JavaScript error: \(message)"
}
}
}
extension JSController {
@MainActor
func extractChapters(moduleId: String, href: String) async throws -> [[String: Any]] {
guard ModuleManager().modules.first(where: { $0.id.uuidString == moduleId }) != nil else {
throw JSError.moduleNotFound
}
return await withCheckedContinuation { (continuation: CheckedContinuation<[[String: Any]], Never>) in
DispatchQueue.main.async { [weak self] in
guard let self = self else {
continuation.resume(returning: [])
return
}
guard let extractChaptersFunction = self.context.objectForKeyedSubscript("extractChapters") else {
Logger.shared.log("extractChapters: function not found", type: "Error")
continuation.resume(returning: [])
return
}
let result = extractChaptersFunction.call(withArguments: [href])
if result?.isUndefined == true || result == nil {
Logger.shared.log("extractChapters: result is undefined or nil", type: "Error")
continuation.resume(returning: [])
return
}
if let result = result, result.hasProperty("then") {
let group = DispatchGroup()
group.enter()
var chaptersArr: [[String: Any]] = []
var hasLeftGroup = false
let groupQueue = DispatchQueue(label: "extractChapters.group")
let thenBlock: @convention(block) (JSValue) -> Void = { jsValue in
Logger.shared.log("extractChapters thenBlock: \(jsValue)", type: "Debug")
groupQueue.sync {
guard !hasLeftGroup else {
Logger.shared.log("extractChapters: thenBlock called but group already left", type: "Debug")
return
}
hasLeftGroup = true
if let arr = jsValue.toArray() as? [[String: Any]] {
Logger.shared.log("extractChapters: parsed as array, count = \(arr.count)", type: "Debug")
chaptersArr = arr
} else if let jsonString = jsValue.toString(), let data = jsonString.data(using: .utf8) {
do {
if let arr = try JSONSerialization.jsonObject(with: data) as? [[String: Any]] {
Logger.shared.log("extractChapters: parsed as JSON string, count = \(arr.count)", type: "Debug")
chaptersArr = arr
} else {
Logger.shared.log("extractChapters: JSON string did not parse to array", type: "Error")
}
} catch {
Logger.shared.log("JSON parsing error of extractChapters: \(error)", type: "Error")
}
} else {
Logger.shared.log("extractChapters: could not parse result", type: "Error")
}
group.leave()
}
}
let catchBlock: @convention(block) (JSValue) -> Void = { jsValue in
Logger.shared.log("extractChapters catchBlock: \(jsValue)", type: "Error")
groupQueue.sync {
guard !hasLeftGroup else {
Logger.shared.log("extractChapters: catchBlock called but group already left", type: "Debug")
return
}
hasLeftGroup = true
group.leave()
}
}
result.invokeMethod("then", withArguments: [thenBlock])
result.invokeMethod("catch", withArguments: [catchBlock])
group.notify(queue: .main) {
continuation.resume(returning: chaptersArr)
}
} else {
if let arr = result?.toArray() as? [[String: Any]] {
Logger.shared.log("extractChapters: direct array, count = \(arr.count)", type: "Debug")
continuation.resume(returning: arr)
} else if let jsonString = result?.toString(), let data = jsonString.data(using: .utf8) {
do {
if let arr = try JSONSerialization.jsonObject(with: data) as? [[String: Any]] {
Logger.shared.log("extractChapters: direct JSON string, count = \(arr.count)", type: "Debug")
continuation.resume(returning: arr)
} else {
Logger.shared.log("extractChapters: direct JSON string did not parse to array", type: "Error")
continuation.resume(returning: [])
}
} catch {
Logger.shared.log("JSON parsing error of extractChapters: \(error)", type: "Error")
continuation.resume(returning: [])
}
} else {
Logger.shared.log("extractChapters: could not parse direct result", type: "Error")
continuation.resume(returning: [])
}
}
}
}
}
@MainActor
func extractText(moduleId: String, href: String) async throws -> String {
guard let module = ModuleManager().modules.first(where: { $0.id.uuidString == moduleId }) else {
throw JSError.moduleNotFound
}
return try await withCheckedThrowingContinuation { (continuation: CheckedContinuation<String, Error>) in
let workItem = DispatchWorkItem { [weak self] in
guard let self = self else {
continuation.resume(throwing: JSError.invalidResponse)
return
}
if self.context.objectForKeyedSubscript("extractText") == nil {
Logger.shared.log("extractText function not found, attempting to load module script", type: "Debug")
do {
let moduleContent = try ModuleManager().getModuleContent(module)
self.loadScript(moduleContent)
Logger.shared.log("Successfully loaded module script", type: "Debug")
} catch {
Logger.shared.log("Failed to load module script: \(error)", type: "Error")
}
}
guard let function = self.context.objectForKeyedSubscript("extractText") else {
Logger.shared.log("extractText function not available after loading module script", type: "Error")
let task = Task<String, Error> {
return try await self.fetchContentDirectly(from: href)
}
Task {
do {
let content = try await task.value
continuation.resume(returning: content)
} catch {
continuation.resume(throwing: JSError.invalidResponse)
}
}
return
}
let result = function.call(withArguments: [href])
if let exception = self.context.exception {
Logger.shared.log("Error extracting text: \(exception)", type: "Error")
let task = Task<String, Error> {
return try await self.fetchContentDirectly(from: href)
}
Task {
do {
let content = try await task.value
continuation.resume(returning: content)
} catch {
continuation.resume(throwing: JSError.jsException(exception.toString() ?? "Unknown JS error"))
}
}
return
}
if let result = result, result.hasProperty("then") {
let group = DispatchGroup()
group.enter()
var extractedText = ""
var extractError: Error? = nil
var hasLeftGroup = false
let groupQueue = DispatchQueue(label: "extractText.group")
let thenBlock: @convention(block) (JSValue) -> Void = { jsValue in
Logger.shared.log("extractText thenBlock: received value", type: "Debug")
groupQueue.sync {
guard !hasLeftGroup else {
Logger.shared.log("extractText: thenBlock called but group already left", type: "Debug")
return
}
hasLeftGroup = true
if let text = jsValue.toString(), !text.isEmpty {
Logger.shared.log("extractText: successfully extracted text", type: "Debug")
extractedText = text
} else {
extractError = JSError.emptyContent
}
group.leave()
}
}
let catchBlock: @convention(block) (JSValue) -> Void = { jsValue in
Logger.shared.log("extractText catchBlock: \(jsValue)", type: "Error")
groupQueue.sync {
guard !hasLeftGroup else {
Logger.shared.log("extractText: catchBlock called but group already left", type: "Debug")
return
}
hasLeftGroup = true
if extractedText.isEmpty {
extractError = JSError.jsException(jsValue.toString() ?? "Unknown error")
}
group.leave()
}
}
result.invokeMethod("then", withArguments: [thenBlock])
result.invokeMethod("catch", withArguments: [catchBlock])
let notifyWorkItem = DispatchWorkItem {
if !extractedText.isEmpty {
continuation.resume(returning: extractedText)
} else if extractError != nil {
let fetchTask = Task<String, Error> {
return try await self.fetchContentDirectly(from: href)
}
Task {
do {
let content = try await fetchTask.value
continuation.resume(returning: content)
} catch {
continuation.resume(throwing: error)
}
}
} else {
let fetchTask = Task<String, Error> {
return try await self.fetchContentDirectly(from: href)
}
Task {
do {
let content = try await fetchTask.value
continuation.resume(returning: content)
} catch _ {
continuation.resume(throwing: JSError.emptyContent)
}
}
}
}
group.notify(queue: .main, work: notifyWorkItem)
} else {
if let text = result?.toString(), !text.isEmpty {
Logger.shared.log("extractText: direct string result", type: "Debug")
continuation.resume(returning: text)
} else {
Logger.shared.log("extractText: could not parse direct result, trying direct fetch", type: "Error")
let task = Task<String, Error> {
return try await self.fetchContentDirectly(from: href)
}
Task {
do {
let content = try await task.value
continuation.resume(returning: content)
} catch {
continuation.resume(throwing: JSError.emptyContent)
}
}
}
}
}
DispatchQueue.main.async(execute: workItem)
}
}
private func fetchContentDirectly(from url: String) async throws -> String {
guard let url = URL(string: url) else {
throw JSError.invalidResponse
}
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.addValue("Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Mobile/15E148 Safari/604.1", forHTTPHeaderField: "User-Agent")
Logger.shared.log("Attempting direct fetch from: \(url.absoluteString)", type: "Debug")
let (data, response) = try await URLSession.shared.data(for: request)
guard let httpResponse = response as? HTTPURLResponse,
(200...299).contains(httpResponse.statusCode) else {
Logger.shared.log("Direct fetch failed with status code: \((response as? HTTPURLResponse)?.statusCode ?? -1)", type: "Error")
throw JSError.invalidResponse
}
guard let htmlString = String(data: data, encoding: .utf8) else {
Logger.shared.log("Failed to decode response data", type: "Error")
throw JSError.invalidResponse
}
var content = ""
if let contentRange = htmlString.range(of: "<article", options: .caseInsensitive),
let endRange = htmlString.range(of: "</article>", options: .caseInsensitive) {
let startIndex = contentRange.lowerBound
let endIndex = endRange.upperBound
content = String(htmlString[startIndex..<endIndex])
} else if let contentRange = htmlString.range(of: "<div class=\"chapter-content\"", options: .caseInsensitive),
let endRange = htmlString.range(of: "</div>", options: .caseInsensitive, range: contentRange.upperBound..<htmlString.endIndex) {
let startIndex = contentRange.lowerBound
let endIndex = endRange.upperBound
content = String(htmlString[startIndex..<endIndex])
} else if let contentRange = htmlString.range(of: "<div class=\"content\"", options: .caseInsensitive),
let endRange = htmlString.range(of: "</div>", options: .caseInsensitive, range: contentRange.upperBound..<htmlString.endIndex) {
let startIndex = contentRange.lowerBound
let endIndex = endRange.upperBound
content = String(htmlString[startIndex..<endIndex])
} else if let bodyRange = htmlString.range(of: "<body", options: .caseInsensitive),
let endBodyRange = htmlString.range(of: "</body>", options: .caseInsensitive) {
let startIndex = bodyRange.lowerBound
let endIndex = endBodyRange.upperBound
content = String(htmlString[startIndex..<endIndex])
} else {
content = htmlString
}
Logger.shared.log("Direct fetch successful, content length: \(content.count)", type: "Debug")
return content
}
}

View file

@ -5,11 +5,11 @@
// Created by Francesco on 05/01/25.
//
import JavaScriptCore
import Foundation
import SwiftUI
import AVKit
import SwiftUI
import Foundation
import AVFoundation
import JavaScriptCore
typealias Module = ScrapingModule
@ -42,6 +42,33 @@ class JSController: NSObject, ObservableObject {
func setupContext() {
context.setupJavaScriptEnvironment()
let asyncChaptersHelper = """
function extractChaptersWithCallback(href, callback) {
try {
console.log('[JS] extractChaptersWithCallback called with href:', href);
var result = extractChapters(href);
if (result && typeof result.then === 'function') {
result.then(function(arr) {
console.log('[JS] extractChaptersWithCallback Promise resolved, arr.length:', arr && arr.length);
callback(arr);
}).catch(function(e) {
console.log('[JS] extractChaptersWithCallback Promise rejected:', e);
callback([]);
});
} else {
console.log('[JS] extractChaptersWithCallback result is not a Promise:', result);
callback(result);
}
} catch (e) {
console.log('[JS] extractChaptersWithCallback threw:', e);
callback([]);
}
}
"""
context.evaluateScript(asyncChaptersHelper)
context.exceptionHandler = { context, exception in
print("[JS Exception]", exception?.toString() ?? "unknown")
}
setupDownloadSession()
}
@ -72,10 +99,6 @@ class JSController: NSObject, ObservableObject {
self?.processDownloadQueue()
}
}
} else {
Logger.shared.log("No queued downloads to process or queue is already being processed")
}
}
}

View file

@ -15,7 +15,7 @@ private struct ModuleLink: Identifiable {
struct CommunityLibraryView: View {
@EnvironmentObject var moduleManager: ModuleManager
@EnvironmentObject var tabBarController: TabBarController
@AppStorage("lastCommunityURL") private var inputURL: String = ""
@State private var webURL: URL?
@ -40,10 +40,6 @@ struct CommunityLibraryView: View {
}
.onAppear {
loadURL()
tabBarController.hideTabBar()
}
.onDisappear {
tabBarController.showTabBar()
}
.sheet(item: $moduleLinkToAdd) { link in
ModuleAdditionSettingsView(moduleUrl: link.url)

View file

@ -196,6 +196,8 @@ class ModuleManager: ObservableObject {
modules.removeAll { $0.id == module.id }
saveModules()
Logger.shared.log("Deleted module: \(module.metadata.sourceName)")
NotificationCenter.default.post(name: .moduleRemoved, object: module.id.uuidString)
}
func getModuleContent(_ module: ScrapingModule) throws -> String {

View file

@ -24,6 +24,7 @@ struct ModuleMetadata: Codable, Hashable {
let multiStream: Bool?
let multiSubs: Bool?
let type: String?
let novel: Bool?
struct Author: Codable, Hashable {
let name: String

View file

@ -0,0 +1,370 @@
//
// TabBar.swift
// SoraPrototype
//
// Created by Inumaki on 26/04/2025.
//
import SwiftUI
import Combine
extension Color {
init(hex: String) {
let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
var int: UInt64 = 0
Scanner(string: hex).scanHexInt64(&int)
let r, g, b, a: UInt64
switch hex.count {
case 6:
(r, g, b, a) = (int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF, 255)
case 8:
(r, g, b, a) = (int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF, int >> 24 & 0xFF)
default:
(r, g, b, a) = (1, 1, 1, 1)
}
self.init(
.sRGB,
red: Double(r) / 255,
green: Double(g) / 255,
blue: Double(b) / 255,
opacity: Double(a) / 255
)
}
}
struct TabBar: View {
var tabs: [TabItem]
@Binding var selectedTab: Int
@State private var lastTab: Int = 0
@State private var showSearch: Bool = false
@State private var searchQuery: String = ""
@FocusState private var keyboardFocus: Bool
@State private var keyboardHidden: Bool = true
@State private var searchLocked: Bool = false
@State private var keyboardHeight: CGFloat = 0
@GestureState private var isHolding: Bool = false
@State private var dragOffset: CGFloat = 0
@State private var isDragging: Bool = false
@State private var dragTargetIndex: Int? = nil
@State private var jellyScale: CGFloat = 1.0
@State private var lastDragTranslation: CGFloat = 0
@State private var previousDragOffset: CGFloat = 0
@State private var lastUpdateTime: Date = Date()
@State private var capsuleOffset: CGFloat = 0
private var gradientOpacity: CGFloat {
let accentColor = UIColor(Color.accentColor)
var white: CGFloat = 0
accentColor.getWhite(&white, alpha: nil)
return white > 0.5 ? 0.5 : 0.3
}
@Namespace private var animation
private let tabWidth: CGFloat = 70
var body: some View {
HStack {
if showSearch && keyboardHidden {
Button(action: {
keyboardFocus = false
withAnimation(.bouncy(duration: 0.3)) {
selectedTab = lastTab
showSearch = false
}
}) {
Image(systemName: "xmark")
.font(.system(size: 20))
.foregroundStyle(.gray)
.frame(width: 20, height: 20)
.matchedGeometryEffect(id: "xmark", in: animation)
.padding(16)
.background(
Circle()
.fill(.ultraThinMaterial)
.overlay(
Circle()
.stroke(
LinearGradient(
gradient: Gradient(stops: [
.init(color: Color.accentColor.opacity(0.25), location: 0),
.init(color: Color.accentColor.opacity(0), location: 1)
]),
startPoint: .top,
endPoint: .bottom
),
lineWidth: 0.5
)
)
.matchedGeometryEffect(id: "background_circle", in: animation)
)
}
.disabled(!keyboardHidden || searchLocked)
}
HStack {
if showSearch {
HStack {
Image(systemName: "magnifyingglass")
.font(.footnote)
.foregroundStyle(.gray)
.opacity(0.7)
TextField("Search for something...", text: $searchQuery)
.textFieldStyle(.plain)
.font(.footnote)
.foregroundStyle(Color.accentColor)
.frame(maxWidth: .infinity, alignment: .leading)
.focused($keyboardFocus)
.onChange(of: keyboardFocus) { newValue in
withAnimation(.bouncy(duration: 0.3)) {
keyboardHidden = !newValue
}
}
.onChange(of: searchQuery) { newValue in
NotificationCenter.default.post(
name: .searchQueryChanged,
object: nil,
userInfo: ["searchQuery": newValue]
)
}
.onDisappear {
keyboardFocus = false
}
if !searchQuery.isEmpty {
Button(action: {
searchQuery = ""
}) {
Image(systemName: "xmark.circle.fill")
.font(.system(size: 16))
.foregroundStyle(.gray)
.opacity(0.7)
}
.buttonStyle(PlainButtonStyle())
}
}
.frame(height: 24)
.padding(8)
} else {
ZStack(alignment: .leading) {
let isActuallyMoving = abs(jellyScale - 1.0) > 0.01
Capsule()
.fill(.white)
.shadow(color: .black.opacity(0.2), radius: 6)
.frame(width: tabWidth, height: 44)
.scaleEffect(x: isActuallyMoving ? jellyScale : 1.0, y: isActuallyMoving ? (2.0 - jellyScale) : 1.0, anchor: .center)
.scaleEffect(isDragging || isHolding ? 1.15 : 1.0)
.offset(x: capsuleOffset)
.zIndex(1)
let capsuleIndex: Int = isDragging ? Int(round(dragOffset / tabWidth)) : selectedTab
HStack(spacing: 0) {
ForEach(0..<tabs.count, id: \ .self) { index in
let tab = tabs[index]
let shouldEnlarge = isDragging && index == capsuleIndex
let isSelected = (index == selectedTab)
let isActive = (isDragging && index == capsuleIndex) || (!isDragging && index == selectedTab)
if selectedTab == index {
tabButton(for: tab, index: index, scale: shouldEnlarge ? 1.35 : 1.0, isActive: isActive, isSelected: isSelected)
.frame(width: tabWidth, height: 44)
.contentShape(Rectangle())
.gesture(
DragGesture(minimumDistance: 0)
.onChanged { value in
if !isDragging {
dragOffset = CGFloat(selectedTab) * tabWidth
capsuleOffset = dragOffset
isDragging = true
dragTargetIndex = selectedTab
}
if isDragging && selectedTab == index {
let now = Date()
let dt = now.timeIntervalSince(lastUpdateTime)
lastDragTranslation = value.translation.width
let totalWidth = tabWidth * CGFloat(tabs.count)
let startX = CGFloat(selectedTab) * tabWidth
let newOffset = startX + value.translation.width
dragOffset = min(max(newOffset, 0), totalWidth - tabWidth)
capsuleOffset = dragOffset
dragTargetIndex = dragTargetIndex(selectedTab: selectedTab, dragOffset: dragOffset, tabCount: tabs.count, tabWidth: tabWidth)
var velocity: CGFloat = 0
if dt > 0 {
velocity = (dragOffset - previousDragOffset) / CGFloat(dt)
}
let absVelocity = abs(velocity)
let scaleX = min(1.0 + min(absVelocity / 1200, 0.18), 1.18)
withAnimation(.interpolatingSpring(stiffness: 200, damping: 18)) {
jellyScale = scaleX
}
previousDragOffset = dragOffset
lastUpdateTime = now
}
}
.onEnded { value in
if isDragging && selectedTab == index {
previousDragOffset = 0
lastUpdateTime = Date()
lastDragTranslation = 0
let totalWidth = tabWidth * CGFloat(tabs.count)
let startX = CGFloat(selectedTab) * tabWidth
let newOffset = startX + value.translation.width
let target = dragTargetIndex(selectedTab: selectedTab, dragOffset: newOffset, tabCount: tabs.count, tabWidth: tabWidth)
withAnimation(.interpolatingSpring(stiffness: 110, damping: 19)) {
selectedTab = target
jellyScale = 1.0
capsuleOffset = CGFloat(target) * tabWidth
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.32) {
dragOffset = 0
isDragging = false
dragTargetIndex = nil
capsuleOffset = CGFloat(selectedTab) * tabWidth
}
if target == tabs.count - 1 {
searchLocked = true
withAnimation(.bouncy(duration: 0.3)) {
lastTab = index
showSearch = true
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
searchLocked = false
}
}
}
}
)
} else {
tabButton(for: tab, index: index, scale: shouldEnlarge ? 1.35 : 1.0, isActive: isActive, isSelected: isSelected)
.frame(width: tabWidth, height: 44)
.contentShape(Rectangle())
}
}
}
.zIndex(2)
.animation(.spring(response: 0.25, dampingFraction: 0.7), value: isDragging)
}
}
}
.padding(.horizontal, 12)
.padding(.vertical, 8)
.background(
Capsule()
.fill(.ultraThinMaterial)
)
.clipShape(Capsule())
.overlay(
Capsule()
.strokeBorder(
LinearGradient(
gradient: Gradient(stops: [
.init(color: Color.accentColor.opacity(0.25), location: 0),
.init(color: Color.accentColor.opacity(0), location: 1)
]),
startPoint: .top,
endPoint: .bottom
),
lineWidth: 0.5
)
)
}
.padding(.horizontal, 20)
.padding(.bottom, 20)
.background {
ProgressiveBlurView()
.blur(radius: 10)
.padding(.horizontal, -20)
.padding(.bottom, -100)
.padding(.top, -10)
}
.offset(y: keyboardFocus ? -keyboardHeight + 40 : 0)
.animation(.spring(response: 0.3, dampingFraction: 0.8), value: keyboardHeight)
.animation(.spring(response: 0.3, dampingFraction: 0.8), value: keyboardFocus)
.onChange(of: keyboardHeight) { newValue in
withAnimation(.spring(response: 0.3, dampingFraction: 0.8)) {
}
}
.onAppear {
capsuleOffset = CGFloat(selectedTab) * tabWidth
NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillShowNotification, object: nil, queue: .main) { notification in
if let keyboardFrame = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect {
keyboardHeight = keyboardFrame.height
}
}
NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillHideNotification, object: nil, queue: .main) { _ in
keyboardHeight = 0
}
NotificationCenter.default.addObserver(forName: .tabBarSearchQueryUpdated, object: nil, queue: .main) { notification in
if let query = notification.userInfo?["searchQuery"] as? String {
searchQuery = query
}
}
}
.onDisappear {
NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillHideNotification, object: nil)
NotificationCenter.default.removeObserver(self, name: .tabBarSearchQueryUpdated, object: nil)
}
.onChange(of: selectedTab) { newValue in
if !isDragging {
withAnimation(.interpolatingSpring(stiffness: 320, damping: 22)) {
capsuleOffset = CGFloat(newValue) * tabWidth
}
}
}
}
@ViewBuilder
private func tabButton(for tab: TabItem, index: Int, scale: CGFloat = 1.0, isActive: Bool, isSelected: Bool) -> some View {
let icon = Image(systemName: tab.icon + (isActive ? ".fill" : ""))
.frame(width: 28, height: 28)
.matchedGeometryEffect(id: tab.icon, in: animation)
.foregroundStyle(isActive ? .black : .gray)
.padding(.vertical, 8)
.padding(.horizontal, 10)
.frame(width: tabWidth)
.opacity(isActive ? 1 : 0.5)
.scaleEffect(scale)
return icon
.contentShape(Rectangle())
.simultaneousGesture(
TapGesture()
.onEnded {
if isDragging || isHolding { return }
if index == tabs.count - 1 {
searchLocked = true
withAnimation(.bouncy(duration: 0.3)) {
lastTab = selectedTab
selectedTab = index
showSearch = true
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
searchLocked = false
}
} else {
if (!searchLocked) {
withAnimation(.bouncy(duration: 0.3)) {
lastTab = selectedTab
selectedTab = index
}
}
}
}
)
}
private func enlargedTabIndex(selectedTab: Int, dragOffset: CGFloat, tabCount: Int, tabWidth: CGFloat) -> Int {
let index = Int(round(dragOffset / tabWidth))
return min(max(index, 0), tabCount - 1)
}
private func dragTargetIndex(selectedTab: Int, dragOffset: CGFloat, tabCount: Int, tabWidth: CGFloat) -> Int {
let index = Int(round(dragOffset / tabWidth))
return min(max(index, 0), tabCount - 1)
}
}

View file

@ -137,8 +137,8 @@ struct DownloadView: View {
private var emptyActiveDownloadsView: some View {
VStack(spacing: 20) {
Image(systemName: "arrow.down.circle")
.font(.system(size: 64, weight: .ultraLight))
.foregroundStyle(.tertiary)
.font(.largeTitle)
.foregroundStyle(.secondary)
VStack(spacing: 8) {
Text(NSLocalizedString("No Active Downloads", comment: ""))
@ -158,9 +158,9 @@ struct DownloadView: View {
private var emptyDownloadsView: some View {
VStack(spacing: 20) {
Image(systemName: "arrow.down.circle")
.font(.system(size: 64, weight: .ultraLight))
.foregroundStyle(.tertiary)
Image(systemName: "arrow.down.circle")
.font(.largeTitle)
.foregroundStyle(.secondary)
VStack(spacing: 8) {
Text(NSLocalizedString("No Downloads", comment: ""))
@ -232,7 +232,8 @@ struct DownloadView: View {
softsub: nil,
multiStream: nil,
multiSubs: nil,
type: nil
type: nil,
novel: false
)
let dummyModule = ScrapingModule(
@ -241,7 +242,6 @@ struct DownloadView: View {
metadataUrl: ""
)
// Always use CustomMediaPlayerViewController for consistency
let customPlayer = CustomMediaPlayerViewController(
module: dummyModule,
urlString: asset.localURL.absoluteString,
@ -985,7 +985,6 @@ struct EnhancedShowEpisodesView: View {
@State private var showDeleteAllAlert = false
@State private var assetToDelete: DownloadedAsset?
@EnvironmentObject var jsController: JSController
@EnvironmentObject var tabBarController: TabBarController
@Environment(\.colorScheme) private var colorScheme
@Environment(\.dismiss) private var dismiss
@ -1025,17 +1024,18 @@ struct EnhancedShowEpisodesView: View {
navigationOverlay
}
.onAppear {
tabBarController.hideTabBar()
// Enable swipe-to-go-back gesture
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first,
let navigationController = window.rootViewController?.children.first as? UINavigationController {
navigationController.interactivePopGestureRecognizer?.isEnabled = true
navigationController.interactivePopGestureRecognizer?.delegate = nil
}
NotificationCenter.default.post(name: .hideTabBar, object: nil)
}
.onDisappear {
tabBarController.showTabBar()
NotificationCenter.default.post(name: .showTabBar, object: nil)
UIScrollView.appearance().bounces = true
}
.navigationBarBackButtonHidden(true)
}
@ -1045,7 +1045,6 @@ struct EnhancedShowEpisodesView: View {
VStack {
HStack {
Button(action: {
tabBarController.showTabBar()
dismiss()
}) {
Image(systemName: "chevron.left")

View file

@ -1,325 +0,0 @@
//
// AllBookmarks.swift
// Sulfur
//
// Created by paul on 29/04/2025.
//
import UIKit
import NukeUI
import SwiftUI
extension View {
func circularGradientOutlineTwo() -> some View {
self.background(
Circle()
.stroke(
LinearGradient(
gradient: Gradient(stops: [
.init(color: Color.accentColor.opacity(0.25), location: 0),
.init(color: Color.accentColor.opacity(0), location: 1)
]),
startPoint: .top,
endPoint: .bottom
),
lineWidth: 0.5
)
)
}
}
struct AllBookmarks: View {
@EnvironmentObject var libraryManager: LibraryManager
@EnvironmentObject var moduleManager: ModuleManager
@State private var searchText: String = ""
@State private var isSearchActive: Bool = false
@State private var sortOption: SortOption = .title
@State private var isSelecting: Bool = false
@State private var selectedBookmarks: Set<LibraryItem.ID> = []
enum SortOption: String, CaseIterable {
case title = "Title"
case dateAdded = "Date Added"
case source = "Source"
}
var filteredAndSortedBookmarks: [LibraryItem] {
let filtered = searchText.isEmpty ? libraryManager.bookmarks : libraryManager.bookmarks.filter { item in
item.title.localizedCaseInsensitiveContains(searchText) ||
item.moduleName.localizedCaseInsensitiveContains(searchText)
}
switch sortOption {
case .title:
return filtered.sorted { $0.title.lowercased() < $1.title.lowercased() }
case .dateAdded:
return filtered
case .source:
return filtered.sorted { $0.moduleName < $1.moduleName }
}
}
var body: some View {
VStack(alignment: .leading) {
HStack {
Button(action: { }) {
Image(systemName: "chevron.left")
.font(.system(size: 24))
.foregroundColor(.primary)
}
Button(action: { }) {
Text("All Bookmarks")
.font(.title3)
.fontWeight(.bold)
.foregroundColor(.primary)
}
Spacer()
HStack(spacing: 16) {
Button(action: {
withAnimation(.easeInOut(duration: 0.3)) {
isSearchActive.toggle()
}
if !isSearchActive {
searchText = ""
}
}) {
Image(systemName: isSearchActive ? "xmark.circle.fill" : "magnifyingglass")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.accentColor)
.padding(10)
.background(
Circle()
.fill(Color.gray.opacity(0.2))
.shadow(color: .accentColor.opacity(0.2), radius: 2)
)
.circularGradientOutlineTwo()
}
Menu {
ForEach(SortOption.allCases, id: \.self) { option in
Button {
sortOption = option
} label: {
HStack {
Text(option.rawValue)
if option == sortOption {
Image(systemName: "checkmark")
.foregroundColor(.accentColor)
}
}
}
}
} label: {
Image(systemName: "line.3.horizontal.decrease.circle")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.accentColor)
.padding(10)
.background(
Circle()
.fill(Color.gray.opacity(0.2))
.shadow(color: .accentColor.opacity(0.2), radius: 2)
)
.circularGradientOutlineTwo()
}
Button(action: {
if isSelecting {
if !selectedBookmarks.isEmpty {
for id in selectedBookmarks {
if let item = libraryManager.bookmarks.first(where: { $0.id == id }) {
libraryManager.removeBookmark(item: item)
}
}
selectedBookmarks.removeAll()
}
isSelecting = false
} else {
isSelecting = true
}
}) {
Image(systemName: isSelecting ? "trash" : "checkmark.circle")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(isSelecting ? .red : .accentColor)
.padding(10)
.background(
Circle()
.fill(Color.gray.opacity(0.2))
.shadow(color: .accentColor.opacity(0.2), radius: 2)
)
.circularGradientOutlineTwo()
}
}
}
.padding(.horizontal)
.padding(.top)
if isSearchActive {
HStack(spacing: 12) {
HStack(spacing: 12) {
Image(systemName: "magnifyingglass")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.secondary)
TextField("Search bookmarks...", text: $searchText)
.textFieldStyle(PlainTextFieldStyle())
.foregroundColor(.primary)
if !searchText.isEmpty {
Button(action: {
searchText = ""
}) {
Image(systemName: "xmark.circle.fill")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.secondary)
}
}
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
.background(.ultraThinMaterial)
.clipShape(RoundedRectangle(cornerRadius: 12))
.overlay(
RoundedRectangle(cornerRadius: 12)
.strokeBorder(
LinearGradient(
gradient: Gradient(stops: [
.init(color: Color.accentColor.opacity(0.25), location: 0),
.init(color: Color.accentColor.opacity(0), location: 1)
]),
startPoint: .top,
endPoint: .bottom
),
lineWidth: 1.5
)
)
}
.padding(.horizontal)
.padding(.bottom, 8)
.transition(.asymmetric(
insertion: .move(edge: .top).combined(with: .opacity),
removal: .move(edge: .top).combined(with: .opacity)
))
}
BookmarkGridView(
bookmarks: filteredAndSortedBookmarks,
moduleManager: moduleManager,
isSelecting: isSelecting,
selectedBookmarks: $selectedBookmarks
)
.withGridPadding()
Spacer()
}
.navigationBarBackButtonHidden(true)
.navigationBarTitleDisplayMode(.inline)
.onAppear(perform: setupNavigationController)
}
private func setupNavigationController() {
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first,
let navigationController = window.rootViewController?.children.first as? UINavigationController {
navigationController.interactivePopGestureRecognizer?.isEnabled = true
navigationController.interactivePopGestureRecognizer?.delegate = nil
}
}
}
struct BookmarkCell: View {
let bookmark: LibraryItem
@EnvironmentObject private var moduleManager: ModuleManager
@EnvironmentObject private var libraryManager: LibraryManager
var body: some View {
if let module = moduleManager.modules.first(where: { $0.id.uuidString == bookmark.moduleId }) {
ZStack {
LazyImage(url: URL(string: bookmark.imageUrl)) { state in
if let uiImage = state.imageContainer?.image {
Image(uiImage: uiImage)
.resizable()
.aspectRatio(0.72, contentMode: .fill)
.frame(width: 162, height: 243)
.cornerRadius(12)
.clipped()
} else {
RoundedRectangle(cornerRadius: 12)
.fill(Color.gray.opacity(0.3))
.frame(width: 162, height: 243)
}
}
.overlay(
ZStack {
Circle()
.fill(Color.black.opacity(0.5))
.frame(width: 28, height: 28)
.overlay(
LazyImage(url: URL(string: module.metadata.iconUrl)) { state in
if let uiImage = state.imageContainer?.image {
Image(uiImage: uiImage)
.resizable()
.scaledToFill()
.frame(width: 32, height: 32)
.clipShape(Circle())
} else {
Circle()
.fill(Color.gray.opacity(0.3))
.frame(width: 32, height: 32)
}
}
)
}
.padding(8),
alignment: .topLeading
)
VStack {
Spacer()
Text(bookmark.title)
.frame(maxWidth: .infinity, alignment: .leading)
.lineLimit(2)
.foregroundColor(.white)
.padding(12)
.background(
LinearGradient(
colors: [
.black.opacity(0.7),
.black.opacity(0.0)
],
startPoint: .bottom,
endPoint: .top
)
.shadow(color: .black, radius: 4, x: 0, y: 2)
)
}
.frame(width: 162)
}
.clipShape(RoundedRectangle(cornerRadius: 12))
.padding(4)
.contextMenu {
Button(role: .destructive, action: {
libraryManager.removeBookmark(item: bookmark)
}) {
Label("Remove from Bookmarks", systemImage: "trash")
}
}
}
}
}
private extension View {
func withNavigationBarModifiers() -> some View {
self
.navigationBarBackButtonHidden(true)
.navigationBarTitleDisplayMode(.inline)
}
func withGridPadding() -> some View {
self
.padding(.top)
.padding()
.scrollViewBottomPadding()
}
}

View file

@ -0,0 +1,448 @@
//
// AllReading.swift
// Sora
//
// Created by paul on 26/06/25.
//
import SwiftUI
import NukeUI
struct AllReadingView: View {
@Environment(\.dismiss) private var dismiss
@State private var continueReadingItems: [ContinueReadingItem] = []
@State private var isRefreshing: Bool = false
@State private var sortOption: SortOption = .dateAdded
@State private var searchText: String = ""
@State private var isSearchActive: Bool = false
@State private var isSelecting: Bool = false
@State private var selectedItems: Set<ContinueReadingItem.ID> = []
@Environment(\.scenePhase) private var scenePhase
enum SortOption: String, CaseIterable {
case dateAdded = "Recently Added"
case title = "Novel Title"
case progress = "Read Progress"
}
var filteredAndSortedItems: [ContinueReadingItem] {
let filtered = searchText.isEmpty ? continueReadingItems : continueReadingItems.filter { item in
item.mediaTitle.localizedCaseInsensitiveContains(searchText)
}
switch sortOption {
case .dateAdded:
return filtered.sorted { $0.lastReadDate > $1.lastReadDate }
case .title:
return filtered.sorted { $0.mediaTitle.lowercased() < $1.mediaTitle.lowercased() }
case .progress:
return filtered.sorted { $0.progress > $1.progress }
}
}
var body: some View {
VStack(alignment: .leading) {
HStack {
Button(action: {
dismiss()
}) {
Image(systemName: "chevron.left")
.font(.system(size: 24))
.foregroundColor(.primary)
}
Button(action: {
dismiss()
}) {
Text(LocalizedStringKey("All Reading"))
.font(.title3)
.fontWeight(.bold)
.foregroundColor(.primary)
}
Spacer()
HStack(spacing: 16) {
Button(action: {
withAnimation(.easeInOut(duration: 0.3)) {
isSearchActive.toggle()
}
if !isSearchActive {
searchText = ""
}
}) {
Image(systemName: isSearchActive ? "xmark.circle.fill" : "magnifyingglass")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.accentColor)
.padding(10)
.background(
Circle()
.fill(Color.gray.opacity(0.2))
.shadow(color: .accentColor.opacity(0.2), radius: 2)
)
.circularGradientOutline()
}
Menu {
ForEach(SortOption.allCases, id: \.self) { option in
Button {
sortOption = option
} label: {
HStack {
Text(NSLocalizedString(option.rawValue, comment: ""))
if option == sortOption {
Image(systemName: "checkmark")
.foregroundColor(.accentColor)
}
}
}
}
} label: {
Image(systemName: "line.3.horizontal.decrease.circle")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.accentColor)
.padding(10)
.background(
Circle()
.fill(Color.gray.opacity(0.2))
.shadow(color: .accentColor.opacity(0.2), radius: 2)
)
.circularGradientOutline()
}
Button(action: {
if isSelecting {
if !selectedItems.isEmpty {
for id in selectedItems {
if let item = continueReadingItems.first(where: { $0.id == id }) {
ContinueReadingManager.shared.remove(item: item)
}
}
selectedItems.removeAll()
fetchContinueReading()
}
isSelecting = false
} else {
isSelecting = true
}
}) {
Image(systemName: isSelecting ? "trash" : "checkmark.circle")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(isSelecting ? .red : .accentColor)
.padding(10)
.background(
Circle()
.fill(Color.gray.opacity(0.2))
.shadow(color: .accentColor.opacity(0.2), radius: 2)
)
.circularGradientOutline()
}
}
}
.padding(.horizontal)
.padding(.top)
if isSearchActive {
HStack(spacing: 12) {
HStack(spacing: 12) {
Image(systemName: "magnifyingglass")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.secondary)
TextField(LocalizedStringKey("Search reading..."), text: $searchText)
.textFieldStyle(PlainTextFieldStyle())
.foregroundColor(.primary)
if !searchText.isEmpty {
Button(action: {
searchText = ""
}) {
Image(systemName: "xmark.circle.fill")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.secondary)
}
}
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
.background(.ultraThinMaterial)
.clipShape(RoundedRectangle(cornerRadius: 12))
.overlay(
RoundedRectangle(cornerRadius: 12)
.strokeBorder(
LinearGradient(
gradient: Gradient(stops: [
.init(color: Color.accentColor.opacity(0.25), location: 0),
.init(color: Color.accentColor.opacity(0), location: 1)
]),
startPoint: .top,
endPoint: .bottom
),
lineWidth: 1.5
)
)
}
.padding(.horizontal)
.padding(.bottom, 8)
.transition(.asymmetric(
insertion: .move(edge: .top).combined(with: .opacity),
removal: .move(edge: .top).combined(with: .opacity)
))
}
ScrollView {
LazyVStack(spacing: 12) {
if filteredAndSortedItems.isEmpty {
emptyStateView
} else {
ForEach(filteredAndSortedItems) { item in
FullWidthContinueReadingCell(
item: item,
markAsRead: {
markContinueReadingItemAsRead(item: item)
},
removeItem: {
removeContinueReadingItem(item: item)
},
isSelecting: isSelecting,
selectedItems: $selectedItems
)
}
}
}
.padding(.top)
.padding(.horizontal)
}
.scrollViewBottomPadding()
}
.navigationBarBackButtonHidden(true)
.navigationBarTitleDisplayMode(.inline)
.onAppear {
fetchContinueReading()
NotificationCenter.default.post(name: .showTabBar, object: nil)
}
.onChange(of: scenePhase) { newPhase in
if newPhase == .active {
fetchContinueReading()
}
}
.refreshable {
isRefreshing = true
fetchContinueReading()
isRefreshing = false
}
}
private var emptyStateView: some View {
VStack(spacing: 16) {
Image(systemName: "book.closed")
.font(.system(size: 50))
.foregroundColor(.gray)
Text("No Reading History")
.font(.title2)
.fontWeight(.bold)
Text("Books you're reading will appear here")
.font(.body)
.foregroundColor(.secondary)
.multilineTextAlignment(.center)
}
.frame(maxWidth: .infinity)
.padding(.vertical, 60)
}
private func fetchContinueReading() {
continueReadingItems = ContinueReadingManager.shared.fetchItems()
for (index, item) in continueReadingItems.enumerated() {
print("Reading item \(index): Title: \(item.mediaTitle), Image URL: \(item.imageUrl)")
}
}
private func markContinueReadingItemAsRead(item: ContinueReadingItem) {
UserDefaults.standard.set(1.0, forKey: "readingProgress_\(item.href)")
ContinueReadingManager.shared.updateProgress(for: item.href, progress: 1.0)
fetchContinueReading()
}
private func removeContinueReadingItem(item: ContinueReadingItem) {
ContinueReadingManager.shared.remove(item: item)
fetchContinueReading()
}
}
struct FullWidthContinueReadingCell: View {
let item: ContinueReadingItem
var markAsRead: () -> Void
var removeItem: () -> Void
var isSelecting: Bool
var selectedItems: Binding<Set<ContinueReadingItem.ID>>
var isSelected: Bool {
selectedItems.wrappedValue.contains(item.id)
}
private var imageURL: URL {
print("Processing image URL: \(item.imageUrl)")
if !item.imageUrl.isEmpty {
if let url = URL(string: item.imageUrl) {
print("Valid URL: \(url)")
return url
}
if let encodedUrlString = item.imageUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed),
let url = URL(string: encodedUrlString) {
print("Using encoded URL: \(encodedUrlString)")
return url
}
}
print("Using fallback URL")
return URL(string: "https://raw.githubusercontent.com/cranci1/Sora/refs/heads/main/assets/banner2.png")!
}
@MainActor
var body: some View {
Group {
if isSelecting {
Button(action: {
if isSelected {
selectedItems.wrappedValue.remove(item.id)
} else {
selectedItems.wrappedValue.insert(item.id)
}
}) {
ZStack(alignment: .topTrailing) {
cellContent
if isSelected {
Image(systemName: "checkmark.circle.fill")
.resizable()
.frame(width: 32, height: 32)
.foregroundColor(.black)
.background(Color.white.clipShape(Circle()).opacity(0.8))
.offset(x: -8, y: 8)
}
}
}
} else {
NavigationLink(destination: ReaderView(
moduleId: item.moduleId,
chapterHref: item.href,
chapterTitle: item.chapterTitle,
mediaTitle: item.mediaTitle,
chapterNumber: item.chapterNumber
)) {
cellContent
}
.simultaneousGesture(TapGesture().onEnded {
UserDefaults.standard.set(true, forKey: "navigatingToReaderView")
})
}
}
.contextMenu {
Button(action: { markAsRead() }) {
Label("Mark as Read", systemImage: "checkmark.circle")
}
Button(role: .destructive, action: { removeItem() }) {
Label("Remove from Continue Reading", systemImage: "trash")
}
}
}
@MainActor
private var cellContent: some View {
GeometryReader { geometry in
ZStack {
LazyImage(url: imageURL) { state in
if let image = state.imageContainer?.image {
Image(uiImage: image)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: geometry.size.width, height: 157.03)
.blur(radius: 3)
.opacity(0.7)
} else {
Rectangle()
.fill(Color.gray.opacity(0.3))
.frame(width: geometry.size.width, height: 157.03)
}
}
.onAppear {
print("Background image loading: \(imageURL)")
}
Rectangle()
.fill(LinearGradient(
gradient: Gradient(colors: [Color.black.opacity(0.7), Color.black.opacity(0.4)]),
startPoint: .leading,
endPoint: .trailing
))
.frame(width: geometry.size.width, height: 157.03)
HStack(spacing: 0) {
VStack(alignment: .leading, spacing: 4) {
Text("\(Int(item.progress * 100))%")
.font(.caption)
.fontWeight(.semibold)
.foregroundColor(.white)
.padding(.vertical, 4)
.padding(.horizontal, 8)
.background(Color.black.opacity(0.6))
.cornerRadius(4)
Spacer()
VStack(alignment: .leading, spacing: 4) {
Text("Chapter \(item.chapterNumber)")
.font(.caption)
.foregroundColor(.white.opacity(0.9))
Text(item.mediaTitle)
.font(.headline)
.fontWeight(.bold)
.foregroundColor(.white)
.lineLimit(2)
}
}
.padding(12)
.frame(width: geometry.size.width * 0.6, alignment: .leading)
LazyImage(url: imageURL) { state in
if let image = state.imageContainer?.image {
Image(uiImage: image)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: geometry.size.width * 0.4, height: 157.03)
.clipped()
} else {
Rectangle()
.fill(Color.gray.opacity(0.3))
.frame(width: geometry.size.width * 0.4, height: 157.03)
}
}
.onAppear {
print("Right image loading: \(imageURL)")
}
.frame(width: geometry.size.width * 0.4, height: 157.03)
}
}
.frame(height: 157.03)
.cornerRadius(10)
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(Color.gray.opacity(0.3), lineWidth: 0.5)
)
}
.frame(height: 157.03)
}
}

View file

@ -113,7 +113,7 @@ struct AllWatchingView: View {
sortOption = option
} label: {
HStack {
Text(option.rawValue)
Text(NSLocalizedString(option.rawValue, comment: ""))
if option == sortOption {
Image(systemName: "checkmark")
.foregroundColor(.accentColor)
@ -246,7 +246,6 @@ struct AllWatchingView: View {
.onAppear {
loadContinueWatchingItems()
// Enable swipe back gesture
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first,
let navigationController = window.rootViewController?.children.first as? UINavigationController {

View file

@ -0,0 +1,96 @@
//
// BookmarkCell.swift
// Sora
//
// Created by paul on 18/06/25.
//
import SwiftUI
import NukeUI
struct BookmarkCell: View {
let bookmark: LibraryItem
@EnvironmentObject private var moduleManager: ModuleManager
@EnvironmentObject private var libraryManager: LibraryManager
var body: some View {
if let module = moduleManager.modules.first(where: { $0.id.uuidString == bookmark.moduleId }) {
ZStack {
LazyImage(url: URL(string: bookmark.imageUrl)) { state in
if let uiImage = state.imageContainer?.image {
Image(uiImage: uiImage)
.resizable()
.aspectRatio(0.72, contentMode: .fill)
.frame(width: 162, height: 243)
.cornerRadius(12)
.clipped()
} else {
RoundedRectangle(cornerRadius: 12)
.fill(Color.gray.opacity(0.3))
.frame(width: 162, height: 243)
}
}
.overlay(
ZStack {
Circle()
.fill(Color.black.opacity(0.5))
.frame(width: 28, height: 28)
.overlay(
LazyImage(url: URL(string: module.metadata.iconUrl)) { state in
if let uiImage = state.imageContainer?.image {
Image(uiImage: uiImage)
.resizable()
.scaledToFill()
.frame(width: 32, height: 32)
.clipShape(Circle())
} else {
Circle()
.fill(Color.gray.opacity(0.3))
.frame(width: 32, height: 32)
}
}
)
}
.padding(8),
alignment: .topLeading
)
VStack {
Spacer()
Text(bookmark.title)
.frame(maxWidth: .infinity, alignment: .leading)
.lineLimit(2)
.foregroundColor(.white)
.padding(12)
.background(
LinearGradient(
colors: [
.black.opacity(0.7),
.black.opacity(0.0)
],
startPoint: .bottom,
endPoint: .top
)
.shadow(color: .black, radius: 4, x: 0, y: 2)
)
}
.frame(width: 162)
}
.clipShape(RoundedRectangle(cornerRadius: 12))
.padding(4)
.contextMenu {
Button(role: .destructive, action: {
// Find which collection contains this bookmark
for collection in libraryManager.collections {
if collection.bookmarks.contains(where: { $0.id == bookmark.id }) {
libraryManager.removeBookmarkFromCollection(bookmarkId: bookmark.id, collectionId: collection.id)
break
}
}
}) {
Label("Remove from Bookmarks", systemImage: "trash")
}
}
}
}
}

View file

@ -0,0 +1,86 @@
//
// BookmarkCollectionGridCell.swift
// Sora
//
// Created by paul on 18/06/25.
//
import SwiftUI
import NukeUI
struct BookmarkCollectionGridCell: View {
let collection: BookmarkCollection
let width: CGFloat
let height: CGFloat
private var recentBookmarks: [LibraryItem] {
Array(collection.bookmarks.prefix(4))
}
var body: some View {
let gap: CGFloat = 2
let cellWidth = (width - gap) / 2
let cellHeight = (height - gap) / 2
VStack(alignment: .leading, spacing: 8) {
ZStack {
if recentBookmarks.isEmpty {
RoundedRectangle(cornerRadius: 12)
.fill(Color.gray.opacity(0.3))
.frame(width: width, height: height)
.overlay(
Image(systemName: "folder.fill")
.resizable()
.scaledToFit()
.frame(width: width/3)
.foregroundColor(.gray.opacity(0.5))
)
} else {
LazyVGrid(
columns: [
GridItem(.flexible(), spacing: gap),
GridItem(.flexible(), spacing: gap)
],
spacing: gap
) {
ForEach(0..<4) { index in
if index < recentBookmarks.count {
LazyImage(url: URL(string: recentBookmarks[index].imageUrl)) { state in
if let image = state.imageContainer?.image {
Image(uiImage: image)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: cellWidth, height: cellHeight)
.clipped()
} else {
Rectangle()
.fill(Color.gray.opacity(0.3))
.frame(width: cellWidth, height: cellHeight)
}
}
} else {
Rectangle()
.fill(Color.gray.opacity(0.3))
.frame(width: cellWidth, height: cellHeight)
}
}
}
.frame(width: width, height: height)
.clipShape(RoundedRectangle(cornerRadius: 12))
}
}
VStack(alignment: .leading, spacing: 4) {
Text(collection.name)
.font(.headline)
.lineLimit(1)
.truncationMode(.tail)
.layoutPriority(1)
.frame(maxWidth: .infinity, alignment: .leading)
Text("\(collection.bookmarks.count) items")
.font(.caption)
.foregroundColor(.secondary)
}
.padding(.horizontal, 4)
}
}
}

View file

@ -1,53 +1,98 @@
//
// MediaInfoView.swift
// BookmarkGridItemView.swift
// Sora
//
// Created by paul on 28/05/25.
//
import SwiftUI
import NukeUI
struct BookmarkGridItemView: View {
let bookmark: LibraryItem
let moduleManager: ModuleManager
let isSelecting: Bool
@Binding var selectedBookmarks: Set<LibraryItem.ID>
let item: LibraryItem
let module: Module
var isSelected: Bool {
selectedBookmarks.contains(bookmark.id)
var isNovel: Bool {
module.metadata.novel ?? false
}
var body: some View {
Group {
if let module = moduleManager.modules.first(where: { $0.id.uuidString == bookmark.moduleId }) {
if isSelecting {
Button(action: {
if isSelected {
selectedBookmarks.remove(bookmark.id)
} else {
selectedBookmarks.insert(bookmark.id)
}
}) {
ZStack(alignment: .topTrailing) {
BookmarkCell(bookmark: bookmark)
if isSelected {
Image(systemName: "checkmark.circle.fill")
.resizable()
.frame(width: 32, height: 32)
.foregroundColor(.accentColor)
.background(Color.white.clipShape(Circle()).opacity(0.8))
.offset(x: -8, y: 8)
}
}
}
ZStack {
LazyImage(url: URL(string: item.imageUrl)) { state in
if let uiImage = state.imageContainer?.image {
Image(uiImage: uiImage)
.resizable()
.aspectRatio(0.72, contentMode: .fill)
.frame(width: 162, height: 243)
.cornerRadius(12)
.clipped()
} else {
BookmarkLink(
bookmark: bookmark,
module: module
)
RoundedRectangle(cornerRadius: 12)
.fill(Color.gray.opacity(0.3))
.aspectRatio(2/3, contentMode: .fit)
.redacted(reason: .placeholder)
}
}
.overlay(
ZStack(alignment: .bottomTrailing) {
Circle()
.fill(Color.black.opacity(0.5))
.frame(width: 28, height: 28)
.overlay(
LazyImage(url: URL(string: module.metadata.iconUrl)) { state in
if let uiImage = state.imageContainer?.image {
Image(uiImage: uiImage)
.resizable()
.scaledToFill()
.frame(width: 32, height: 32)
.clipShape(Circle())
} else {
Circle()
.fill(Color.gray.opacity(0.3))
.frame(width: 32, height: 32)
}
}
)
ZStack {
Circle()
.fill(Color.gray.opacity(0.8))
.shadow(color: .accentColor.opacity(0.2), radius: 2)
.frame(width: 20, height: 20)
Image(systemName: isNovel ? "book.fill" : "tv.fill")
.resizable()
.scaledToFit()
.frame(width: 10, height: 10)
.foregroundColor(.white)
}
.circularGradientOutline()
.offset(x: 6, y: 6)
}
.padding(8),
alignment: .topLeading
)
VStack {
Spacer()
Text(item.title)
.frame(maxWidth: .infinity, alignment: .leading)
.lineLimit(2)
.foregroundColor(.white)
.padding(12)
.background(
LinearGradient(
colors: [
.black.opacity(0.7),
.black.opacity(0.0)
],
startPoint: .bottom,
endPoint: .top
)
.shadow(color: .black, radius: 4, x: 0, y: 2)
)
}
}
.frame(width: 162, height: 243)
.clipShape(RoundedRectangle(cornerRadius: 12))
}
}

View file

@ -8,29 +8,62 @@
import SwiftUI
struct BookmarkGridView: View {
@EnvironmentObject private var libraryManager: LibraryManager
@EnvironmentObject private var moduleManager: ModuleManager
let bookmarks: [LibraryItem]
let moduleManager: ModuleManager
let isSelecting: Bool
@Binding var selectedBookmarks: Set<LibraryItem.ID>
private let columns = [
GridItem(.adaptive(minimum: 150))
GridItem(.adaptive(minimum: 150), spacing: 16)
]
var body: some View {
ScrollView(showsIndicators: false) {
LazyVGrid(columns: columns, spacing: 16) {
ForEach(bookmarks) { bookmark in
BookmarkGridItemView(
bookmark: bookmark,
moduleManager: moduleManager,
isSelecting: isSelecting,
selectedBookmarks: $selectedBookmarks
)
LazyVGrid(columns: columns, spacing: 16) {
ForEach(bookmarks) { bookmark in
if let module = moduleManager.modules.first(where: { $0.id.uuidString == bookmark.moduleId }) {
if isSelecting {
Button(action: {
if selectedBookmarks.contains(bookmark.id) {
selectedBookmarks.remove(bookmark.id)
} else {
selectedBookmarks.insert(bookmark.id)
}
}) {
NavigationLink(destination: MediaInfoView(
title: bookmark.title,
imageUrl: bookmark.imageUrl,
href: bookmark.href,
module: module
)) {
BookmarkGridItemView(item: bookmark, module: module)
.overlay(
selectedBookmarks.contains(bookmark.id) ?
Image(systemName: "checkmark.circle.fill")
.resizable()
.frame(width: 32, height: 32)
.foregroundColor(.accentColor)
.background(Color.white.clipShape(Circle()))
.padding(8)
: nil,
alignment: .topTrailing
)
}
}
} else {
NavigationLink(destination: MediaInfoView(
title: bookmark.title,
imageUrl: bookmark.imageUrl,
href: bookmark.href,
module: module
)) {
BookmarkGridItemView(item: bookmark, module: module)
}
}
}
}
.padding()
.scrollViewBottomPadding()
}
.padding()
}
}

View file

@ -1,5 +1,5 @@
//
// MediaInfoView.swift
// BookmarkLink.swift
// Sora
//
// Created by paul on 28/05/25.

View file

@ -1,5 +1,5 @@
//
// MediaInfoView.swift
// BookmarksDetailView.swift
// Sora
//
// Created by paul on 28/05/25.
@ -13,35 +13,34 @@ struct BookmarksDetailView: View {
@EnvironmentObject private var libraryManager: LibraryManager
@EnvironmentObject private var moduleManager: ModuleManager
@Binding var bookmarks: [LibraryItem]
@State private var sortOption: SortOption = .dateAdded
@State private var sortOption: SortOption = .dateCreated
@State private var searchText: String = ""
@State private var isSearchActive: Bool = false
@State private var isSelecting: Bool = false
@State private var selectedBookmarks: Set<LibraryItem.ID> = []
@State private var selectedCollections: Set<UUID> = []
@State private var isShowingCreateCollection: Bool = false
@State private var newCollectionName: String = ""
@State private var isShowingRenamePrompt: Bool = false
@State private var collectionToRename: BookmarkCollection? = nil
@State private var renameCollectionName: String = ""
enum SortOption: String, CaseIterable {
case dateAdded = "Date Added"
case title = "Title"
case source = "Source"
case dateCreated = "Date Created"
case name = "Name"
case itemCount = "Item Count"
}
var filteredAndSortedBookmarks: [LibraryItem] {
let filtered = searchText.isEmpty ? bookmarks : bookmarks.filter { item in
item.title.localizedCaseInsensitiveContains(searchText) ||
item.moduleName.localizedCaseInsensitiveContains(searchText)
var filteredAndSortedCollections: [BookmarkCollection] {
let filtered = searchText.isEmpty ? libraryManager.collections : libraryManager.collections.filter { collection in
collection.name.localizedCaseInsensitiveContains(searchText)
}
switch sortOption {
case .dateAdded:
return filtered
case .title:
return filtered.sorted { $0.title.lowercased() < $1.title.lowercased() }
case .source:
return filtered.sorted { item1, item2 in
let module1 = moduleManager.modules.first { $0.id.uuidString == item1.moduleId }
let module2 = moduleManager.modules.first { $0.id.uuidString == item2.moduleId }
return (module1?.metadata.sourceName ?? "") < (module2?.metadata.sourceName ?? "")
}
case .dateCreated:
return filtered.sorted { $0.dateCreated > $1.dateCreated }
case .name:
return filtered.sorted { $0.name.lowercased() < $1.name.lowercased() }
case .itemCount:
return filtered.sorted { $0.bookmarks.count > $1.bookmarks.count }
}
}
@ -54,12 +53,15 @@ struct BookmarksDetailView: View {
.foregroundColor(.primary)
}
Button(action: { dismiss() }) {
Text("All Bookmarks")
Text(LocalizedStringKey("Collections"))
.font(.title3)
.fontWeight(.bold)
.foregroundColor(.primary)
.lineLimit(1)
.truncationMode(.tail)
.layoutPriority(1)
.frame(maxWidth: .infinity, alignment: .leading)
}
Spacer()
HStack(spacing: 16) {
Button(action: {
withAnimation(.easeInOut(duration: 0.3)) {
@ -88,7 +90,7 @@ struct BookmarksDetailView: View {
sortOption = option
} label: {
HStack {
Text(option.rawValue)
Text(NSLocalizedString(option.rawValue, comment: ""))
if option == sortOption {
Image(systemName: "checkmark")
.foregroundColor(.accentColor)
@ -112,14 +114,11 @@ struct BookmarksDetailView: View {
}
Button(action: {
if isSelecting {
// If trash icon tapped
if !selectedBookmarks.isEmpty {
for id in selectedBookmarks {
if let item = bookmarks.first(where: { $0.id == id }) {
libraryManager.removeBookmark(item: item)
}
if !selectedCollections.isEmpty {
for id in selectedCollections {
libraryManager.deleteCollection(id: id)
}
selectedBookmarks.removeAll()
selectedCollections.removeAll()
}
isSelecting = false
} else {
@ -139,10 +138,28 @@ struct BookmarksDetailView: View {
)
.circularGradientOutline()
}
Button(action: {
isShowingCreateCollection = true
}) {
Image(systemName: "folder.badge.plus")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.accentColor)
.padding(10)
.background(
Circle()
.fill(Color.gray.opacity(0.2))
.shadow(color: .accentColor.opacity(0.2), radius: 2)
)
.circularGradientOutline()
}
}
.layoutPriority(0)
}
.padding(.horizontal)
.padding(.top)
if isSearchActive {
HStack(spacing: 12) {
HStack(spacing: 12) {
@ -151,7 +168,7 @@ struct BookmarksDetailView: View {
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.secondary)
TextField("Search bookmarks...", text: $searchText)
TextField(LocalizedStringKey("Search collections..."), text: $searchText)
.textFieldStyle(PlainTextFieldStyle())
.foregroundColor(.primary)
if !searchText.isEmpty {
@ -192,15 +209,115 @@ struct BookmarksDetailView: View {
removal: .move(edge: .top).combined(with: .opacity)
))
}
BookmarksDetailGrid(
bookmarks: filteredAndSortedBookmarks,
moduleManager: moduleManager,
isSelecting: isSelecting,
selectedBookmarks: $selectedBookmarks
)
if filteredAndSortedCollections.isEmpty {
VStack(spacing: 8) {
Image(systemName: "folder")
.font(.largeTitle)
.foregroundColor(.secondary)
Text(LocalizedStringKey("No Collections"))
.font(.headline)
Text(LocalizedStringKey("Create a collection to organize your bookmarks"))
.font(.caption)
.foregroundColor(.secondary)
}
.padding()
.frame(maxWidth: .infinity, maxHeight: .infinity)
} else {
ScrollView(showsIndicators: false) {
LazyVGrid(columns: [GridItem(.adaptive(minimum: 162), spacing: 16)], spacing: 16) {
ForEach(filteredAndSortedCollections) { collection in
if isSelecting {
Button(action: {
if selectedCollections.contains(collection.id) {
selectedCollections.remove(collection.id)
} else {
selectedCollections.insert(collection.id)
}
}) {
BookmarkCollectionGridCell(collection: collection, width: 162, height: 162)
.overlay(
selectedCollections.contains(collection.id) ?
ZStack {
Circle()
.fill(Color.white)
.frame(width: 32, height: 32)
Image(systemName: "checkmark")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.black)
}
.padding(8)
: nil,
alignment: .topTrailing
)
}
.contextMenu {
Button(LocalizedStringKey("Rename")) {
collectionToRename = collection
renameCollectionName = collection.name
isShowingRenamePrompt = true
}
Button(role: .destructive) {
libraryManager.deleteCollection(id: collection.id)
} label: {
Label(LocalizedStringKey("Delete"), systemImage: "trash")
}
}
} else {
NavigationLink(destination: CollectionDetailView(collection: collection)) {
BookmarkCollectionGridCell(collection: collection, width: 162, height: 162)
}
.contextMenu {
Button(LocalizedStringKey("Rename")) {
collectionToRename = collection
renameCollectionName = collection.name
isShowingRenamePrompt = true
}
Button(role: .destructive) {
libraryManager.deleteCollection(id: collection.id)
} label: {
Label(LocalizedStringKey("Delete"), systemImage: "trash")
}
}
}
}
}
.padding(.horizontal, 20)
.padding(.top)
.scrollViewBottomPadding()
}
}
}
.navigationBarBackButtonHidden(true)
.navigationBarTitleDisplayMode(.inline)
.alert(LocalizedStringKey("Create Collection"), isPresented: $isShowingCreateCollection) {
TextField(LocalizedStringKey("Collection Name"), text: $newCollectionName)
Button(LocalizedStringKey("Cancel"), role: .cancel) {
newCollectionName = ""
}
Button(LocalizedStringKey("Create")) {
if !newCollectionName.isEmpty {
libraryManager.createCollection(name: newCollectionName)
newCollectionName = ""
}
}
}
.alert(LocalizedStringKey("Rename Collection"), isPresented: $isShowingRenamePrompt, presenting: collectionToRename) { collection in
TextField(LocalizedStringKey("Collection Name"), text: $renameCollectionName)
Button(LocalizedStringKey("Cancel"), role: .cancel) {
collectionToRename = nil
renameCollectionName = ""
}
Button(LocalizedStringKey("Rename")) {
if let collection = collectionToRename, !renameCollectionName.isEmpty {
libraryManager.renameCollection(id: collection.id, newName: renameCollectionName)
collectionToRename = nil
renameCollectionName = ""
}
}
} message: { _ in EmptyView() }
.onAppear {
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first,
@ -221,7 +338,7 @@ private struct SortMenu: View {
sortOption = option
} label: {
HStack {
Text(option.rawValue)
Text(NSLocalizedString(option.rawValue, comment: ""))
if option == sortOption {
Image(systemName: "checkmark")
.foregroundColor(.accentColor)
@ -285,12 +402,17 @@ private struct BookmarksDetailGridCell: View {
ZStack(alignment: .topTrailing) {
BookmarkCell(bookmark: bookmark)
if isSelected {
Image(systemName: "checkmark.circle.fill")
.resizable()
.frame(width: 32, height: 32)
.foregroundColor(.black)
.background(Color.white.clipShape(Circle()).opacity(0.8))
.offset(x: -8, y: 8)
ZStack {
Circle()
.fill(Color.white)
.frame(width: 32, height: 32)
Image(systemName: "checkmark")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.accentColor)
}
.offset(x: -8, y: 8)
}
}
}

View file

@ -0,0 +1,324 @@
//
// CollectionDetailView.swift
// Sora
//
// Created by paul on 18/06/25.
//
import SwiftUI
import NukeUI
struct CollectionDetailView: View {
@Environment(\.dismiss) private var dismiss
@EnvironmentObject private var libraryManager: LibraryManager
@EnvironmentObject private var moduleManager: ModuleManager
let collection: BookmarkCollection
@State private var sortOption: SortOption = .dateAdded
@State private var searchText: String = ""
@State private var isSearchActive: Bool = false
@State private var isSelecting: Bool = false
@State private var selectedBookmarks: Set<LibraryItem.ID> = []
@State private var isActive: Bool = false
enum SortOption: String, CaseIterable {
case dateAdded = "Date Added"
case title = "Title"
case source = "Source"
}
private var filteredAndSortedBookmarks: [LibraryItem] {
let validBookmarks = collection.bookmarks.filter { bookmark in
moduleManager.modules.contains { $0.id.uuidString == bookmark.moduleId }
}
let filtered = searchText.isEmpty ? validBookmarks : validBookmarks.filter { item in
item.title.localizedCaseInsensitiveContains(searchText) ||
item.moduleName.localizedCaseInsensitiveContains(searchText)
}
switch sortOption {
case .dateAdded:
return filtered
case .title:
return filtered.sorted { $0.title.lowercased() < $1.title.lowercased() }
case .source:
return filtered.sorted { item1, item2 in
let module1 = moduleManager.modules.first { $0.id.uuidString == item1.moduleId }
let module2 = moduleManager.modules.first { $0.id.uuidString == item2.moduleId }
return (module1?.metadata.sourceName ?? "") < (module2?.metadata.sourceName ?? "")
}
}
}
var body: some View {
VStack(alignment: .leading) {
HStack(spacing: 8) {
Button(action: { dismiss() }) {
Image(systemName: "chevron.left")
.font(.system(size: 24))
.foregroundColor(.primary)
}
Button(action: { dismiss() }) {
Text(collection.name)
.font(.title3)
.fontWeight(.bold)
.foregroundColor(.primary)
.lineLimit(1)
.truncationMode(.tail)
.layoutPriority(1)
.frame(maxWidth: .infinity, alignment: .leading)
}
HStack(spacing: 16) {
Button(action: {
withAnimation(.easeInOut(duration: 0.3)) {
isSearchActive.toggle()
}
if !isSearchActive {
searchText = ""
}
}) {
Image(systemName: isSearchActive ? "xmark.circle.fill" : "magnifyingglass")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.accentColor)
.padding(10)
.background(
Circle()
.fill(Color.gray.opacity(0.2))
.shadow(color: .accentColor.opacity(0.2), radius: 2)
)
.circularGradientOutline()
}
Menu {
ForEach(SortOption.allCases, id: \.self) { option in
Button {
sortOption = option
} label: {
HStack {
Text(NSLocalizedString(option.rawValue, comment: ""))
if option == sortOption {
Image(systemName: "checkmark")
.foregroundColor(.accentColor)
}
}
}
}
} label: {
Image(systemName: "line.3.horizontal.decrease.circle")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.accentColor)
.padding(10)
.background(
Circle()
.fill(Color.gray.opacity(0.2))
.shadow(color: .accentColor.opacity(0.2), radius: 2)
)
.circularGradientOutline()
}
Button(action: {
if isSelecting {
if !selectedBookmarks.isEmpty {
for id in selectedBookmarks {
if collection.bookmarks.contains(where: { $0.id == id }) {
libraryManager.removeBookmarkFromCollection(bookmarkId: id, collectionId: collection.id)
}
}
selectedBookmarks.removeAll()
}
isSelecting = false
} else {
isSelecting = true
}
}) {
Image(systemName: isSelecting ? "trash" : "checkmark.circle")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(isSelecting ? .red : .accentColor)
.padding(10)
.background(
Circle()
.fill(Color.gray.opacity(0.2))
.shadow(color: .accentColor.opacity(0.2), radius: 2)
)
.circularGradientOutline()
}
}
.layoutPriority(0)
}
.padding(.horizontal)
.padding(.top)
if isSearchActive {
HStack(spacing: 12) {
HStack(spacing: 12) {
Image(systemName: "magnifyingglass")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.secondary)
TextField(LocalizedStringKey("Search bookmarks..."), text: $searchText)
.textFieldStyle(PlainTextFieldStyle())
.foregroundColor(.primary)
if !searchText.isEmpty {
Button(action: {
searchText = ""
}) {
Image(systemName: "xmark.circle.fill")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.secondary)
}
}
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
.background(.ultraThinMaterial)
.clipShape(RoundedRectangle(cornerRadius: 12))
.overlay(
RoundedRectangle(cornerRadius: 12)
.strokeBorder(
LinearGradient(
gradient: Gradient(stops: [
.init(color: Color.accentColor.opacity(0.25), location: 0),
.init(color: Color.accentColor.opacity(0), location: 1)
]),
startPoint: .top,
endPoint: .bottom
),
lineWidth: 1.5
)
)
}
.padding(.horizontal)
.padding(.bottom, 8)
.transition(.asymmetric(
insertion: .move(edge: .top).combined(with: .opacity),
removal: .move(edge: .top).combined(with: .opacity)
))
}
if filteredAndSortedBookmarks.isEmpty {
VStack(spacing: 8) {
Image(systemName: "bookmark")
.font(.largeTitle)
.foregroundColor(.secondary)
Text("No Bookmarks")
.font(.headline)
Text("Add bookmarks to this collection")
.font(.caption)
.foregroundColor(.secondary)
}
.padding()
.frame(maxWidth: .infinity, maxHeight: .infinity)
} else {
ScrollView(showsIndicators: false) {
LazyVGrid(columns: [GridItem(.adaptive(minimum: 150))], spacing: 16) {
ForEach(filteredAndSortedBookmarks) { bookmark in
if let module = moduleManager.modules.first(where: { $0.id.uuidString == bookmark.moduleId }) {
if isSelecting {
Button(action: {
if selectedBookmarks.contains(bookmark.id) {
selectedBookmarks.remove(bookmark.id)
} else {
selectedBookmarks.insert(bookmark.id)
}
}) {
BookmarkGridItemView(item: bookmark, module: module)
.overlay(
selectedBookmarks.contains(bookmark.id) ?
ZStack {
Circle()
.fill(Color.white)
.frame(width: 32, height: 32)
Image(systemName: "checkmark")
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
.foregroundColor(.black)
}
.padding(8)
: nil,
alignment: .topTrailing
)
}
.contextMenu {
Button(role: .destructive) {
libraryManager.removeBookmarkFromCollection(bookmarkId: bookmark.id, collectionId: collection.id)
} label: {
Label("Delete", systemImage: "trash")
}
}
} else {
NavigationLink(destination: MediaInfoView(
title: bookmark.title,
imageUrl: bookmark.imageUrl,
href: bookmark.href,
module: module
)) {
BookmarkGridItemView(item: bookmark, module: module)
}
.isDetailLink(true)
.contextMenu {
Button(role: .destructive) {
libraryManager.removeBookmarkFromCollection(bookmarkId: bookmark.id, collectionId: collection.id)
} label: {
Label("Delete", systemImage: "trash")
}
}
}
}
}
}
.padding()
.scrollViewBottomPadding()
}
}
}
.navigationBarBackButtonHidden(true)
.navigationBarTitleDisplayMode(.inline)
.onAppear {
isActive = true
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first,
let navigationController = window.rootViewController?.children.first as? UINavigationController {
navigationController.interactivePopGestureRecognizer?.isEnabled = true
navigationController.interactivePopGestureRecognizer?.delegate = nil
}
let isMediaInfoActive = UserDefaults.standard.bool(forKey: "isMediaInfoActive")
let isReaderActive = UserDefaults.standard.bool(forKey: "isReaderActive")
if !isMediaInfoActive && !isReaderActive {
NotificationCenter.default.post(name: .showTabBar, object: nil)
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.02) {
let isMediaInfoActive = UserDefaults.standard.bool(forKey: "isMediaInfoActive")
let isReaderActive = UserDefaults.standard.bool(forKey: "isReaderActive")
if !isMediaInfoActive && !isReaderActive {
NotificationCenter.default.post(name: .showTabBar, object: nil)
}
}
}
.onReceive(Timer.publish(every: 0.1, on: .main, in: .common).autoconnect()) { _ in
let isMediaInfoActive = UserDefaults.standard.bool(forKey: "isMediaInfoActive")
let isReaderActive = UserDefaults.standard.bool(forKey: "isReaderActive")
if isActive && !isMediaInfoActive && !isReaderActive {
NotificationCenter.default.post(name: .showTabBar, object: nil)
}
}
.onReceive(NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)) { _ in
isActive = true
let isMediaInfoActive = UserDefaults.standard.bool(forKey: "isMediaInfoActive")
let isReaderActive = UserDefaults.standard.bool(forKey: "isReaderActive")
if !isMediaInfoActive && !isReaderActive {
NotificationCenter.default.post(name: .showTabBar, object: nil)
}
}
}
}

View file

@ -0,0 +1,73 @@
//
// LibraryManager.swift
// Sora
//
// Created by paul on 18/06/25.
//
import SwiftUI
struct CollectionPickerView: View {
@Environment(\.dismiss) private var dismiss
@EnvironmentObject private var libraryManager: LibraryManager
let bookmark: LibraryItem
@State private var newCollectionName: String = ""
@State private var isShowingNewCollectionField: Bool = false
var body: some View {
NavigationView {
List {
if isShowingNewCollectionField {
Section {
HStack {
TextField(LocalizedStringKey("Collection name"), text: $newCollectionName)
Button(LocalizedStringKey("Create")) {
if !newCollectionName.isEmpty {
libraryManager.createCollection(name: newCollectionName)
if let newCollection = libraryManager.collections.first(where: { $0.name == newCollectionName }) {
libraryManager.addBookmarkToCollection(bookmark: bookmark, collectionId: newCollection.id)
}
dismiss()
}
}
.disabled(newCollectionName.isEmpty)
}
}
}
Section {
ForEach(libraryManager.collections) { collection in
Button(action: {
libraryManager.addBookmarkToCollection(bookmark: bookmark, collectionId: collection.id)
dismiss()
}) {
HStack {
Image(systemName: "folder")
Text(collection.name)
Spacer()
Text("\(collection.bookmarks.count)")
.foregroundColor(.secondary)
}
}
}
}
}
.navigationTitle(LocalizedStringKey("Add to Collection"))
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
Button(LocalizedStringKey("Cancel")) {
dismiss()
}
}
ToolbarItem(placement: .navigationBarTrailing) {
Button(action: {
isShowingNewCollectionField.toggle()
}) {
Image(systemName: "folder.badge.plus")
}
}
}
}
}
}

View file

@ -0,0 +1,181 @@
//
// ContinueReadingSection.swift
// Sora
//
// Created by paul on 26/06/25.
//
import SwiftUI
import NukeUI
struct ContinueReadingSection: View {
@Binding var items: [ContinueReadingItem]
var markAsRead: (ContinueReadingItem) -> Void
var removeItem: (ContinueReadingItem) -> Void
var body: some View {
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 12) {
ForEach(Array(items.prefix(5))) { item in
ContinueReadingCell(item: item, markAsRead: {
markAsRead(item)
}, removeItem: {
removeItem(item)
})
}
}
.padding(.horizontal, 20)
.frame(height: 157.03)
}
}
}
struct ContinueReadingCell: View {
let item: ContinueReadingItem
var markAsRead: () -> Void
var removeItem: () -> Void
@Environment(\.colorScheme) private var colorScheme
@State private var imageLoadError: Bool = false
private var imageURL: URL {
print("Processing image URL in ContinueReadingCell: \(item.imageUrl)")
if !item.imageUrl.isEmpty {
if let url = URL(string: item.imageUrl) {
print("Valid direct URL: \(url)")
return url
}
if let encodedUrlString = item.imageUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed),
let url = URL(string: encodedUrlString) {
print("Using encoded URL: \(encodedUrlString)")
return url
}
if item.imageUrl.hasPrefix("http://") {
let httpsUrl = "https://" + item.imageUrl.dropFirst(7)
if let url = URL(string: httpsUrl) {
print("Using https URL: \(httpsUrl)")
return url
}
}
}
print("Using fallback URL")
return URL(string: "https://raw.githubusercontent.com/cranci1/Sora/refs/heads/main/assets/banner2.png")!
}
var body: some View {
NavigationLink(destination: ReaderView(
moduleId: item.moduleId,
chapterHref: item.href,
chapterTitle: item.chapterTitle,
chapters: [],
mediaTitle: item.mediaTitle,
chapterNumber: item.chapterNumber
)) {
ZStack {
LazyImage(url: imageURL) { state in
if let image = state.imageContainer?.image {
Image(uiImage: image)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 280, height: 157.03)
.blur(radius: 3)
.opacity(0.7)
} else {
Rectangle()
.fill(Color.gray.opacity(0.3))
.frame(width: 280, height: 157.03)
}
}
.onAppear {
print("Background image loading: \(imageURL)")
}
Rectangle()
.fill(LinearGradient(
gradient: Gradient(colors: [Color.black.opacity(0.7), Color.black.opacity(0.4)]),
startPoint: .leading,
endPoint: .trailing
))
.frame(width: 280, height: 157.03)
HStack(spacing: 0) {
VStack(alignment: .leading, spacing: 4) {
Text("\(Int(item.progress * 100))%")
.font(.caption)
.fontWeight(.semibold)
.foregroundColor(.white)
.padding(.vertical, 4)
.padding(.horizontal, 8)
.background(Color.black.opacity(0.6))
.cornerRadius(4)
Spacer()
VStack(alignment: .leading, spacing: 4) {
Text("Chapter \(item.chapterNumber)")
.font(.caption)
.foregroundColor(.white.opacity(0.9))
Text(item.mediaTitle)
.font(.headline)
.fontWeight(.bold)
.foregroundColor(.white)
.lineLimit(2)
}
}
.padding(12)
.frame(width: 170, alignment: .leading)
LazyImage(url: imageURL) { state in
if let image = state.imageContainer?.image {
Image(uiImage: image)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 110, height: 157.03)
.clipped()
} else {
Rectangle()
.fill(Color.gray.opacity(0.3))
.frame(width: 110, height: 157.03)
}
}
.onAppear {
print("Right image loading: \(imageURL)")
}
.onDisappear {
print("Right image disappeared")
}
.frame(width: 110, height: 157.03)
}
}
.frame(width: 280, height: 157.03)
.cornerRadius(10)
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(Color.gray.opacity(0.3), lineWidth: 0.5)
)
}
.contextMenu {
Button(action: {
markAsRead()
}) {
Label("Mark as Read", systemImage: "checkmark.circle")
}
Button(role: .destructive, action: {
removeItem()
}) {
Label("Remove Item", systemImage: "trash")
}
}
.onAppear {
print("ContinueReadingCell appeared for: \(item.mediaTitle)")
print("Image URL: \(item.imageUrl)")
print("Chapter: \(item.chapterNumber)")
print("Progress: \(item.progress)")
}
}
}

View file

@ -6,6 +6,23 @@
//
import Foundation
import SwiftUI
import NukeUI
import Nuke
struct BookmarkCollection: Codable, Identifiable {
let id: UUID
let name: String
var bookmarks: [LibraryItem]
let dateCreated: Date
init(name: String, bookmarks: [LibraryItem] = []) {
self.id = UUID()
self.name = name
self.bookmarks = bookmarks
self.dateCreated = Date()
}
}
struct LibraryItem: Codable, Identifiable {
let id: UUID
@ -28,62 +45,156 @@ struct LibraryItem: Codable, Identifiable {
}
class LibraryManager: ObservableObject {
@Published var bookmarks: [LibraryItem] = []
private let bookmarksKey = "bookmarkedItems"
@Published var collections: [BookmarkCollection] = []
@Published var isShowingCollectionPicker: Bool = false
@Published var bookmarkToAdd: LibraryItem?
private let collectionsKey = "bookmarkCollections"
private let oldBookmarksKey = "bookmarkedItems"
init() {
loadBookmarks()
migrateOldBookmarks()
loadCollections()
NotificationCenter.default.addObserver(self, selector: #selector(handleiCloudSync), name: .iCloudSyncDidComplete, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleModuleRemoval), name: .moduleRemoved, object: nil)
}
@objc private func handleiCloudSync() {
DispatchQueue.main.async {
self.loadBookmarks()
self.loadCollections()
}
}
func removeBookmark(item: LibraryItem) {
if let index = bookmarks.firstIndex(where: { $0.id == item.id }) {
bookmarks.remove(at: index)
Logger.shared.log("Removed series \(item.id) from bookmarks.",type: "Debug")
saveBookmarks()
@objc private func handleModuleRemoval(_ notification: Notification) {
if let moduleId = notification.object as? String {
cleanupBookmarksForModule(moduleId: moduleId)
}
}
private func loadBookmarks() {
guard let data = UserDefaults.standard.data(forKey: bookmarksKey) else {
Logger.shared.log("No bookmarks data found in UserDefaults.", type: "Debug")
private func cleanupBookmarksForModule(moduleId: String) {
var didChange = false
for (collectionIndex, collection) in collections.enumerated() {
let originalCount = collection.bookmarks.count
collections[collectionIndex].bookmarks.removeAll { $0.moduleId == moduleId }
if collections[collectionIndex].bookmarks.count != originalCount {
didChange = true
}
}
if didChange {
ImagePipeline.shared.cache.removeAll()
saveCollections()
}
}
private func migrateOldBookmarks() {
guard let data = UserDefaults.standard.data(forKey: oldBookmarksKey) else {
return
}
do {
bookmarks = try JSONDecoder().decode([LibraryItem].self, from: data)
let oldBookmarks = try JSONDecoder().decode([LibraryItem].self, from: data)
if !oldBookmarks.isEmpty {
if let existingIndex = collections.firstIndex(where: { $0.name == "Old Bookmarks" }) {
for bookmark in oldBookmarks {
if !collections[existingIndex].bookmarks.contains(where: { $0.href == bookmark.href }) {
collections[existingIndex].bookmarks.insert(bookmark, at: 0)
}
}
} else {
let oldCollection = BookmarkCollection(name: "Old Bookmarks", bookmarks: oldBookmarks)
collections.append(oldCollection)
}
saveCollections()
}
UserDefaults.standard.removeObject(forKey: oldBookmarksKey)
} catch {
Logger.shared.log("Failed to decode bookmarks: \(error.localizedDescription)", type: "Error")
Logger.shared.log("Failed to migrate old bookmarks: \(error)", type: "Error")
}
}
private func saveBookmarks() {
private func loadCollections() {
guard let data = UserDefaults.standard.data(forKey: collectionsKey) else {
Logger.shared.log("No collections data found in UserDefaults.", type: "Debug")
return
}
do {
let encoded = try JSONEncoder().encode(bookmarks)
UserDefaults.standard.set(encoded, forKey: bookmarksKey)
collections = try JSONDecoder().decode([BookmarkCollection].self, from: data)
} catch {
Logger.shared.log("Failed to save bookmarks: \(error)", type: "Error")
Logger.shared.log("Failed to decode collections: \(error.localizedDescription)", type: "Error")
}
}
private func saveCollections() {
do {
let encoded = try JSONEncoder().encode(collections)
UserDefaults.standard.set(encoded, forKey: collectionsKey)
} catch {
Logger.shared.log("Failed to save collections: \(error)", type: "Error")
}
}
func createCollection(name: String) {
let newCollection = BookmarkCollection(name: name)
collections.append(newCollection)
saveCollections()
}
func deleteCollection(id: UUID) {
collections.removeAll { $0.id == id }
saveCollections()
}
func addBookmarkToCollection(bookmark: LibraryItem, collectionId: UUID) {
if let index = collections.firstIndex(where: { $0.id == collectionId }) {
if !collections[index].bookmarks.contains(where: { $0.href == bookmark.href }) {
collections[index].bookmarks.insert(bookmark, at: 0)
saveCollections()
}
}
}
func removeBookmarkFromCollection(bookmarkId: UUID, collectionId: UUID) {
if let collectionIndex = collections.firstIndex(where: { $0.id == collectionId }) {
collections[collectionIndex].bookmarks.removeAll { $0.id == bookmarkId }
saveCollections()
}
}
func isBookmarked(href: String, moduleName: String) -> Bool {
bookmarks.contains { $0.href == href }
for collection in collections {
if collection.bookmarks.contains(where: { $0.href == href }) {
return true
}
}
return false
}
func toggleBookmark(title: String, imageUrl: String, href: String, moduleId: String, moduleName: String) {
if let index = bookmarks.firstIndex(where: { $0.href == href }) {
bookmarks.remove(at: index)
} else {
let bookmark = LibraryItem(title: title, imageUrl: imageUrl, href: href, moduleId: moduleId, moduleName: moduleName)
bookmarks.insert(bookmark, at: 0)
for (collectionIndex, collection) in collections.enumerated() {
if let bookmarkIndex = collection.bookmarks.firstIndex(where: { $0.href == href }) {
collections[collectionIndex].bookmarks.remove(at: bookmarkIndex)
saveCollections()
return
}
}
let bookmark = LibraryItem(title: title, imageUrl: imageUrl, href: href, moduleId: moduleId, moduleName: moduleName)
bookmarkToAdd = bookmark
isShowingCollectionPicker = true
}
func renameCollection(id: UUID, newName: String) {
if let index = collections.firstIndex(where: { $0.id == id }) {
var updated = collections[index]
updated = BookmarkCollection(name: newName, bookmarks: updated.bookmarks)
collections[index] = BookmarkCollection(name: newName, bookmarks: updated.bookmarks)
saveCollections()
}
saveBookmarks()
}
}

View file

@ -12,21 +12,34 @@ import SwiftUI
struct LibraryView: View {
@EnvironmentObject private var libraryManager: LibraryManager
@EnvironmentObject private var moduleManager: ModuleManager
@Environment(\.scenePhase) private var scenePhase
@AppStorage("mediaColumnsPortrait") private var mediaColumnsPortrait: Int = 2
@AppStorage("mediaColumnsLandscape") private var mediaColumnsLandscape: Int = 4
@AppStorage("librarySectionsOrderData") private var librarySectionsOrderData: Data = {
try! JSONEncoder().encode(["continueWatching", "continueReading", "collections"])
}()
@AppStorage("disabledLibrarySectionsData") private var disabledLibrarySectionsData: Data = {
try! JSONEncoder().encode([String]())
}()
@Environment(\.verticalSizeClass) var verticalSizeClass
@Environment(\.horizontalSizeClass) var horizontalSizeClass
@State private var selectedBookmark: LibraryItem? = nil
@State private var isDetailActive: Bool = false
@State private var continueWatchingItems: [ContinueWatchingItem] = []
@State private var continueReadingItems: [ContinueReadingItem] = []
@State private var isLandscape: Bool = UIDevice.current.orientation.isLandscape
@State private var selectedTab: Int = 0
private var librarySectionsOrder: [String] {
(try? JSONDecoder().decode([String].self, from: librarySectionsOrderData)) ?? ["continueWatching", "continueReading", "collections"]
}
private var disabledLibrarySections: [String] {
(try? JSONDecoder().decode([String].self, from: disabledLibrarySectionsData)) ?? []
}
private let columns = [
GridItem(.adaptive(minimum: 150), spacing: 12)
]
@ -58,106 +71,28 @@ struct LibraryView: View {
ZStack {
ScrollView(showsIndicators: false) {
VStack(alignment: .leading, spacing: 20) {
Text("Library")
Text(LocalizedStringKey("Library"))
.font(.largeTitle)
.fontWeight(.bold)
.padding(.horizontal, 20)
.padding(.top, 20)
HStack {
HStack(spacing: 4) {
Image(systemName: "play.fill")
.font(.subheadline)
Text("Continue Watching")
.font(.title3)
.fontWeight(.semibold)
}
Spacer()
NavigationLink(destination: AllWatchingView()) {
Text("View All")
.font(.subheadline)
.padding(.horizontal, 12)
.padding(.vertical, 6)
.background(Color.gray.opacity(0.2))
.cornerRadius(15)
.gradientOutline()
ForEach(librarySectionsOrder, id: \.self) { section in
if !disabledLibrarySections.contains(section) {
switch section {
case "continueWatching":
continueWatchingSection
case "continueReading":
continueReadingSection
case "collections":
collectionsSection
default:
EmptyView()
}
}
}
.padding(.horizontal, 20)
if continueWatchingItems.isEmpty {
VStack(spacing: 8) {
Image(systemName: "play.circle")
.font(.largeTitle)
.foregroundColor(.secondary)
Text("Nothing to Continue Watching")
.font(.headline)
Text("Your recently watched content will appear here")
.font(.caption)
.foregroundColor(.secondary)
}
.padding()
.frame(maxWidth: .infinity)
} else {
ContinueWatchingSection(items: $continueWatchingItems, markAsWatched: {
item in
markContinueWatchingItemAsWatched(item: item)
}, removeItem: {
item in
removeContinueWatchingItem(item: item)
})
}
HStack {
HStack(spacing: 4) {
Image(systemName: "bookmark.fill")
.font(.subheadline)
Text("Bookmarks")
.font(.title3)
.fontWeight(.semibold)
}
Spacer()
NavigationLink(destination: BookmarksDetailView(bookmarks: $libraryManager.bookmarks)) {
Text("View All")
.font(.subheadline)
.padding(.horizontal, 12)
.padding(.vertical, 6)
.background(Color.gray.opacity(0.2))
.cornerRadius(15)
.gradientOutline()
}
}
.padding(.horizontal, 20)
BookmarksSection(
selectedBookmark: $selectedBookmark,
isDetailActive: $isDetailActive
)
Spacer().frame(height: 100)
NavigationLink(
destination: Group {
if let bookmark = selectedBookmark,
let module = moduleManager.modules.first(where: {
$0.id.uuidString == bookmark.moduleId
}) {
MediaInfoView(title: bookmark.title,
imageUrl: bookmark.imageUrl,
href: bookmark.href,
module: module)
} else {
Text("No Data Available")
}
},
isActive: $isDetailActive
) {
EmptyView()
}
}
.padding(.bottom, 20)
}
@ -165,15 +100,160 @@ struct LibraryView: View {
.deviceScaled()
.onAppear {
fetchContinueWatching()
fetchContinueReading()
NotificationCenter.default.post(name: .showTabBar, object: nil)
}
.onChange(of: scenePhase) { newPhase in
if newPhase == .active {
fetchContinueWatching()
fetchContinueReading()
}
}
}
}
.navigationViewStyle(StackNavigationViewStyle())
}
// MARK: - Section Views
private var continueWatchingSection: some View {
VStack(alignment: .leading, spacing: 0) {
HStack {
HStack(spacing: 4) {
Image(systemName: "play.fill")
.font(.subheadline)
Text(LocalizedStringKey("Continue Watching"))
.font(.title3)
.fontWeight(.semibold)
}
Spacer()
NavigationLink(destination: AllWatchingView()) {
Text(LocalizedStringKey("View All"))
.font(.subheadline)
.padding(.horizontal, 12)
.padding(.vertical, 6)
.background(Color.gray.opacity(0.2))
.cornerRadius(15)
.gradientOutline()
}
}
.padding(.horizontal, 20)
.padding(.bottom, 10)
if continueWatchingItems.isEmpty {
VStack(spacing: 8) {
Image(systemName: "play.circle")
.font(.largeTitle)
.foregroundColor(.secondary)
Text(LocalizedStringKey("Nothing to Continue Watching"))
.font(.headline)
Text(LocalizedStringKey("Your recently watched content will appear here"))
.font(.caption)
.foregroundColor(.secondary)
}
.padding()
.frame(maxWidth: .infinity)
} else {
ContinueWatchingSection(items: $continueWatchingItems, markAsWatched: {
item in
markContinueWatchingItemAsWatched(item: item)
}, removeItem: {
item in
removeContinueWatchingItem(item: item)
})
}
Spacer().frame(height: 20)
}
}
private var continueReadingSection: some View {
VStack(alignment: .leading, spacing: 0) {
HStack {
HStack(spacing: 4) {
Image(systemName: "book.fill")
.font(.subheadline)
Text(LocalizedStringKey("Continue Reading"))
.font(.title3)
.fontWeight(.semibold)
}
Spacer()
NavigationLink(destination: AllReadingView()) {
Text(LocalizedStringKey("View All"))
.font(.subheadline)
.padding(.horizontal, 12)
.padding(.vertical, 6)
.background(Color.gray.opacity(0.2))
.cornerRadius(15)
.gradientOutline()
}
}
.padding(.horizontal, 20)
.padding(.bottom, 10)
if continueReadingItems.isEmpty {
VStack(spacing: 8) {
Image(systemName: "book.closed")
.font(.largeTitle)
.foregroundColor(.secondary)
Text(LocalizedStringKey("Nothing to Continue Reading"))
.font(.headline)
Text(LocalizedStringKey("Your recently read novels will appear here"))
.font(.caption)
.foregroundColor(.secondary)
}
.padding()
.frame(maxWidth: .infinity)
} else {
ContinueReadingSection(items: $continueReadingItems, markAsRead: {
item in
markContinueReadingItemAsRead(item: item)
}, removeItem: {
item in
removeContinueReadingItem(item: item)
})
}
Spacer().frame(height: 20)
}
}
private var collectionsSection: some View {
VStack(alignment: .leading, spacing: 0) {
HStack {
HStack(spacing: 4) {
Image(systemName: "folder.fill")
.font(.subheadline)
Text(LocalizedStringKey("Collections"))
.font(.title3)
.fontWeight(.semibold)
}
Spacer()
NavigationLink(destination: BookmarksDetailView()) {
Text(LocalizedStringKey("View All"))
.font(.subheadline)
.padding(.horizontal, 12)
.padding(.vertical, 6)
.background(Color.gray.opacity(0.2))
.cornerRadius(15)
.gradientOutline()
}
}
.padding(.horizontal, 20)
.padding(.bottom, 10)
BookmarksSection()
Spacer().frame(height: 20)
}
}
private func fetchContinueWatching() {
@ -198,6 +278,30 @@ struct LibraryView: View {
}
}
private func fetchContinueReading() {
continueReadingItems = ContinueReadingManager.shared.fetchItems()
Logger.shared.log("Fetched \(continueReadingItems.count) continue reading items", type: "Debug")
if !continueReadingItems.isEmpty {
for (index, item) in continueReadingItems.enumerated() {
Logger.shared.log("Reading item \(index): \(item.mediaTitle), chapter \(item.chapterNumber), progress \(item.progress)", type: "Debug")
}
}
}
private func markContinueReadingItemAsRead(item: ContinueReadingItem) {
UserDefaults.standard.set(1.0, forKey: "readingProgress_\(item.href)")
ContinueReadingManager.shared.updateProgress(for: item.href, progress: 1.0)
fetchContinueReading()
}
private func removeContinueReadingItem(item: ContinueReadingItem) {
ContinueReadingManager.shared.remove(item: item)
continueReadingItems.removeAll {
$0.id == item.id
}
}
private func updateOrientation() {
DispatchQueue.main.async {
isLandscape = UIDevice.current.orientation.isLandscape
@ -462,33 +566,66 @@ extension View {
struct BookmarksSection: View {
@EnvironmentObject private var libraryManager: LibraryManager
@EnvironmentObject private var moduleManager: ModuleManager
@Binding var selectedBookmark: LibraryItem?
@Binding var isDetailActive: Bool
@State private var isShowingRenamePrompt: Bool = false
@State private var collectionToRename: BookmarkCollection? = nil
@State private var renameCollectionName: String = ""
var body: some View {
VStack(alignment: .leading, spacing: 16) {
if libraryManager.bookmarks.isEmpty {
if libraryManager.collections.isEmpty {
EmptyBookmarksView()
} else {
BookmarksGridView(
selectedBookmark: $selectedBookmark,
isDetailActive: $isDetailActive
)
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 12) {
ForEach(Array(libraryManager.collections.prefix(5))) { collection in
NavigationLink(destination: CollectionDetailView(collection: collection)) {
BookmarkCollectionGridCell(collection: collection, width: 162, height: 162)
}
.contextMenu {
Button("Rename") {
collectionToRename = collection
renameCollectionName = collection.name
isShowingRenamePrompt = true
}
Button(role: .destructive) {
libraryManager.deleteCollection(id: collection.id)
} label: {
Label("Delete", systemImage: "trash")
}
}
}
}
.padding(.horizontal, 20)
.frame(height: 220)
}
}
}
.alert("Rename Collection", isPresented: $isShowingRenamePrompt, presenting: collectionToRename) { collection in
TextField("Collection Name", text: $renameCollectionName)
Button("Cancel", role: .cancel) {
collectionToRename = nil
renameCollectionName = ""
}
Button("Rename") {
if !renameCollectionName.isEmpty {
libraryManager.renameCollection(id: collection.id, newName: renameCollectionName)
}
collectionToRename = nil
renameCollectionName = ""
}
} message: { _ in EmptyView() }
}
}
struct EmptyBookmarksView: View {
var body: some View {
VStack(spacing: 8) {
Image(systemName: "magazine")
Image(systemName: "folder")
.font(.largeTitle)
.foregroundColor(.secondary)
Text("You have no items saved.")
Text("No Collections")
.font(.headline)
Text("Bookmark items for an easier access later.")
Text("Create a collection to organize your bookmarks")
.font(.caption)
.foregroundColor(.secondary)
}
@ -496,120 +633,3 @@ struct EmptyBookmarksView: View {
.frame(maxWidth: .infinity)
}
}
struct BookmarksGridView: View {
@EnvironmentObject private var libraryManager: LibraryManager
@EnvironmentObject private var moduleManager: ModuleManager
@Binding var selectedBookmark: LibraryItem?
@Binding var isDetailActive: Bool
private var recentBookmarks: [LibraryItem] {
Array(libraryManager.bookmarks.prefix(5))
}
var body: some View {
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 12) {
ForEach(recentBookmarks) { item in
BookmarkItemView(
item: item,
selectedBookmark: $selectedBookmark,
isDetailActive: $isDetailActive
)
}
}
.padding(.horizontal, 20)
.frame(height: 243)
}
}
}
struct BookmarkItemView: View {
@EnvironmentObject private var libraryManager: LibraryManager
@EnvironmentObject private var moduleManager: ModuleManager
let item: LibraryItem
@Binding var selectedBookmark: LibraryItem?
@Binding var isDetailActive: Bool
var body: some View {
if let module = moduleManager.modules.first(where: { $0.id.uuidString == item.moduleId }) {
Button(action: {
selectedBookmark = item
isDetailActive = true
}) {
ZStack {
LazyImage(url: URL(string: item.imageUrl)) { state in
if let uiImage = state.imageContainer?.image {
Image(uiImage: uiImage)
.resizable()
.aspectRatio(0.72, contentMode: .fill)
.frame(width: 162, height: 243)
.cornerRadius(12)
.clipped()
} else {
RoundedRectangle(cornerRadius: 12)
.fill(Color.gray.opacity(0.3))
.aspectRatio(2/3, contentMode: .fit)
.redacted(reason: .placeholder)
}
}
.overlay(
ZStack {
Circle()
.fill(Color.black.opacity(0.5))
.frame(width: 28, height: 28)
.overlay(
LazyImage(url: URL(string: module.metadata.iconUrl)) { state in
if let uiImage = state.imageContainer?.image {
Image(uiImage: uiImage)
.resizable()
.scaledToFill()
.frame(width: 32, height: 32)
.clipShape(Circle())
} else {
Circle()
.fill(Color.gray.opacity(0.3))
.frame(width: 32, height: 32)
}
}
)
}
.padding(8),
alignment: .topLeading
)
VStack {
Spacer()
Text(item.title)
.frame(maxWidth: .infinity, alignment: .leading)
.lineLimit(2)
.foregroundColor(.white)
.padding(12)
.background(
LinearGradient(
colors: [
.black.opacity(0.7),
.black.opacity(0.0)
],
startPoint: .bottom,
endPoint: .top
)
.shadow(color: .black, radius: 4, x: 0, y: 2)
)
}
}
.frame(width: 162, height: 243)
.clipShape(RoundedRectangle(cornerRadius: 12))
}
.contextMenu {
Button(role: .destructive, action: {
libraryManager.removeBookmark(item: item)
}) {
Label("Remove from Bookmarks", systemImage: "trash")
}
}
}
}
}

View file

@ -0,0 +1,125 @@
//
// ChapterCell.swift
// Sora
//
// Created by paul on 20/06/25.
//
import SwiftUI
struct ChapterCell: View {
let chapterNumber: String
let chapterTitle: String
let isCurrentChapter: Bool
var progress: Double = 0.0
var href: String = ""
private var progressText: String {
if progress >= 0.98 {
return "Completed"
} else if progress > 0 {
return "\(Int(progress * 100))%"
} else {
return "New"
}
}
private var progressColor: Color {
if progress >= 0.98 {
return .green
} else if progress > 0 {
return .blue
} else {
return .secondary
}
}
var body: some View {
HStack(alignment: .center, spacing: 12) {
VStack(alignment: .leading, spacing: 3) {
HStack(alignment: .center, spacing: 6) {
Text("Chapter \(chapterNumber)")
.font(.system(size: 17, weight: .semibold))
.foregroundColor(.primary)
.lineLimit(1)
if progress > 0 {
Text(progressText)
.font(.system(size: 12, weight: .medium))
.foregroundColor(progressColor)
.padding(.horizontal, 8)
.padding(.vertical, 3)
.background(
RoundedRectangle(cornerRadius: 6)
.fill(progressColor.opacity(0.18))
)
}
Spacer(minLength: 0)
}
Text(chapterTitle)
.font(.system(size: 15))
.foregroundColor(.secondary)
.lineLimit(2)
if progress > 0 && progress < 0.98 {
ProgressView(value: progress)
.progressViewStyle(LinearProgressViewStyle())
.frame(height: 3)
.padding(.top, 4)
}
}
Spacer()
}
.padding(.vertical, 10)
.padding(.horizontal, 14)
.background(
RoundedRectangle(cornerRadius: 16)
.fill(Color(UIColor.systemBackground))
.overlay(
RoundedRectangle(cornerRadius: 16)
.fill(Color.accentColor.opacity(0.08))
)
)
.overlay(
RoundedRectangle(cornerRadius: 16)
.stroke(
LinearGradient(
gradient: Gradient(stops: [
.init(color: Color.accentColor.opacity(0.35), location: 0),
.init(color: Color.accentColor.opacity(0), location: 1)
]),
startPoint: .top,
endPoint: .bottom
),
lineWidth: 1.2
)
)
.clipShape(RoundedRectangle(cornerRadius: 16))
}
}
#Preview {
VStack(spacing: 16) {
ChapterCell(
chapterNumber: "1",
chapterTitle: "Chapter 1: The Beginning",
isCurrentChapter: false,
progress: 0.0
)
ChapterCell(
chapterNumber: "2",
chapterTitle: "Chapter 2: The Journey",
isCurrentChapter: false,
progress: 0.45
)
ChapterCell(
chapterNumber: "3",
chapterTitle: "Chapter 3: The Conclusion",
isCurrentChapter: false,
progress: 1.0
)
}
.padding()
}

View file

@ -24,7 +24,10 @@ struct CircularProgressBar: View {
.rotationEffect(Angle(degrees: 270.0))
.animation(.linear, value: progress)
if progress >= 0.9 {
let remainingTimePercentage = UserDefaults.standard.object(forKey: "remainingTimePercentage") != nil ? UserDefaults.standard.double(forKey: "remainingTimePercentage") : 90.0
let threshold = (100.0 - remainingTimePercentage) / 100.0
if progress >= threshold {
Image(systemName: "checkmark")
.font(.system(size: 12))
} else {

View file

@ -149,6 +149,10 @@ private extension EpisodeCell {
episodeThumbnail
episodeInfo
Spacer()
if case .downloaded = downloadStatus {
downloadedIndicator
.padding(.trailing, 8)
}
CircularProgressBar(progress: currentProgress)
.frame(width: 40, height: 40)
.padding(.trailing, 4)
@ -228,6 +232,12 @@ private extension EpisodeCell {
}
}
var downloadedIndicator: some View {
Image(systemName: "externaldrive.fill.badge.checkmark")
.foregroundColor(.accentColor)
.font(.system(size: 18))
}
var contextMenuContent: some View {
Group {
if progress <= 0.9 {

View file

@ -28,6 +28,7 @@ struct MediaInfoView: View {
@State private var synopsis: String = ""
@State private var airdate: String = ""
@State private var episodeLinks: [EpisodeLink] = []
@State private var chapters: [[String: Any]] = []
@State private var itemID: Int?
@State private var tmdbID: Int?
@State private var tmdbType: TMDBFetcher.MediaType? = nil
@ -46,7 +47,7 @@ struct MediaInfoView: View {
@State private var selectedSeason: Int = 0
@State private var selectedRange: Range<Int> = {
let size = UserDefaults.standard.integer(forKey: "episodeChunkSize")
let chunk = size == 0 ? 100 : size
let chunk = size == 0 ? 50 : size
return 0..<chunk
}()
@ -75,24 +76,24 @@ struct MediaInfoView: View {
private var selectedSeasonKey: String { "selectedSeason_\(href)" }
@AppStorage("externalPlayer") private var externalPlayer: String = "Default"
@AppStorage("episodeChunkSize") private var episodeChunkSize: Int = 100
@AppStorage("episodeChunkSize") private var episodeChunkSize: Int = 50
@AppStorage("selectedAppearance") private var selectedAppearance: Appearance = .system
@ObservedObject private var jsController = JSController.shared
@EnvironmentObject var moduleManager: ModuleManager
@EnvironmentObject private var libraryManager: LibraryManager
@EnvironmentObject var tabBarController: TabBarController
@ObservedObject private var navigator = ChapterNavigator.shared
@Environment(\.dismiss) private var dismiss
@Environment(\.colorScheme) private var colorScheme
@Environment(\.verticalSizeClass) private var verticalSizeClass
@AppStorage("metadataProvidersOrder") private var metadataProvidersOrderData: Data = {
try! JSONEncoder().encode(["AniList","TMDB"])
try! JSONEncoder().encode(["TMDB","AniList"])
}()
private var metadataProvidersOrder: [String] {
get { (try? JSONDecoder().decode([String].self, from: metadataProvidersOrderData)) ?? ["AniList","TMDB"] }
get { (try? JSONDecoder().decode([String].self, from: metadataProvidersOrderData)) ?? ["TMDB","AniList"] }
set { metadataProvidersOrderData = try! JSONEncoder().encode(newValue) }
}
@ -119,29 +120,37 @@ struct MediaInfoView: View {
return isCompactLayout ? 20 : 16
}
private var startWatchingText: String {
let indices = finishedAndUnfinishedIndices()
let finished = indices.finished
let unfinished = indices.unfinished
if episodeLinks.count == 1 {
if let _ = unfinished {
return NSLocalizedString("Continue Watching", comment: "")
private var startActionText: String {
if module.metadata.novel == true {
let lastReadChapter = UserDefaults.standard.string(forKey: "lastReadChapter")
if let lastRead = lastReadChapter, chapters.contains(where: { $0["href"] as! String == lastRead }) {
return NSLocalizedString("Continue Reading", comment: "")
}
return NSLocalizedString("Start Reading", comment: "")
} else {
let indices = finishedAndUnfinishedIndices()
let finished = indices.finished
let unfinished = indices.unfinished
if episodeLinks.count == 1 {
if let _ = unfinished {
return NSLocalizedString("Continue Watching", comment: "")
}
return NSLocalizedString("Start Watching", comment: "")
}
if let finishedIndex = finished, finishedIndex < episodeLinks.count - 1 {
let nextEp = episodeLinks[finishedIndex + 1]
return String(format: NSLocalizedString("Start Watching Episode %d", comment: ""), nextEp.number)
}
if let unfinishedIndex = unfinished {
let currentEp = episodeLinks[unfinishedIndex]
return String(format: NSLocalizedString("Continue Watching Episode %d", comment: ""), currentEp.number)
}
return NSLocalizedString("Start Watching", comment: "")
}
if let finishedIndex = finished, finishedIndex < episodeLinks.count - 1 {
let nextEp = episodeLinks[finishedIndex + 1]
return String(format: NSLocalizedString("Start Watching Episode %d", comment: ""), nextEp.number)
}
if let unfinishedIndex = unfinished {
let currentEp = episodeLinks[unfinishedIndex]
return String(format: NSLocalizedString("Continue Watching Episode %d", comment: ""), currentEp.number)
}
return NSLocalizedString("Start Watching", comment: "")
}
private var singleEpisodeWatchText: String {
@ -154,6 +163,14 @@ struct MediaInfoView: View {
return NSLocalizedString("Mark watched", comment: "")
}
@State private var selectedChapterRange: Range<Int> = {
let size = UserDefaults.standard.integer(forKey: "episodeChunkSize")
let chunk = size == 0 ? 50 : size
return 0..<chunk
}()
@AppStorage("chapterChunkSize") private var chapterChunkSize: Int = 50
private var selectedChapterRangeKey: String { "selectedChapterRangeStart_\(href)" }
var body: some View {
ZStack {
Group {
@ -168,6 +185,16 @@ struct MediaInfoView: View {
.ignoresSafeArea(.container, edges: .top)
.onAppear {
setupViewOnAppear()
NotificationCenter.default.post(name: .hideTabBar, object: nil)
UserDefaults.standard.set(true, forKey: "isMediaInfoActive")
// swipe back
/*
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first,
let navigationController = window.rootViewController?.children.first as? UINavigationController {
navigationController.interactivePopGestureRecognizer?.isEnabled = false
}
*/
}
.onChange(of: selectedRange) { newValue in
UserDefaults.standard.set(newValue.lowerBound, forKey: selectedRangeKey)
@ -175,10 +202,14 @@ struct MediaInfoView: View {
.onChange(of: selectedSeason) { newValue in
UserDefaults.standard.set(newValue, forKey: selectedSeasonKey)
}
.onChange(of: selectedChapterRange) { newValue in
UserDefaults.standard.set(newValue.lowerBound, forKey: selectedChapterRangeKey)
}
.onDisappear {
tabBarController.showTabBar()
currentFetchTask?.cancel()
activeFetchID = nil
UserDefaults.standard.set(false, forKey: "isMediaInfoActive")
UIScrollView.appearance().bounces = true
}
.task {
await setupInitialData()
@ -197,21 +228,25 @@ struct MediaInfoView: View {
navigationOverlay
}
.sheet(isPresented: $libraryManager.isShowingCollectionPicker) {
if let bookmark = libraryManager.bookmarkToAdd {
CollectionPickerView(bookmark: bookmark)
}
}
}
@ViewBuilder
private var navigationOverlay: some View {
VStack {
HStack {
Button(action: {
tabBarController.showTabBar()
Button(action: {
dismiss()
}) {
Image(systemName: "chevron.left")
.font(.system(size: 24))
.foregroundColor(.primary)
.padding(12)
.background(Color.gray.opacity(0.2))
.background(Color(.systemBackground).opacity(0.8))
.clipShape(Circle())
.circularGradientOutline()
}
@ -277,10 +312,26 @@ struct MediaInfoView: View {
VStack(alignment: .leading, spacing: 16) {
headerSection
if !episodeLinks.isEmpty {
episodesSection
if !aliases.isEmpty && !(module.metadata.novel ?? false) {
Text(aliases)
.font(.system(size: 14, weight: .bold))
.foregroundColor(.secondary)
.padding(.top, 4)
}
if module.metadata.novel ?? false {
if !chapters.isEmpty {
chaptersSection
} else {
noContentSection
}
} else {
noEpisodesSection
if !episodeLinks.isEmpty {
episodesSection
} else {
noContentSection
}
}
}
.padding()
@ -313,7 +364,7 @@ struct MediaInfoView: View {
Image(systemName: "calendar")
.foregroundColor(.accentColor)
Text(airdate)
.font(.system(size: 14))
.font(.system(size: 14, weight: .bold))
.foregroundColor(.accentColor)
Spacer()
}
@ -322,12 +373,18 @@ struct MediaInfoView: View {
Text(title)
.font(.system(size: 28, weight: .bold))
.foregroundColor(.primary)
.lineLimit(3)
.fixedSize(horizontal: false, vertical: true)
.multilineTextAlignment(.leading)
.lineLimit(nil)
.onLongPressGesture {
copyTitleToClipboard()
}
if !synopsis.isEmpty {
if !synopsis.isEmpty && !(module.metadata.novel ?? false) {
synopsisSection
}
if module.metadata.novel ?? false && !synopsis.isEmpty {
synopsisSection
}
@ -341,17 +398,20 @@ struct MediaInfoView: View {
@ViewBuilder
private var synopsisSection: some View {
HStack(alignment: .bottom) {
VStack(alignment: .leading, spacing: 2) {
Text(synopsis)
.font(.system(size: 16))
.font(.system(size: 16, weight: .bold))
.foregroundColor(.secondary)
.lineLimit(showFullSynopsis ? nil : 3)
.animation(nil, value: showFullSynopsis)
Text(showFullSynopsis ? NSLocalizedString("LESS", comment: "") : NSLocalizedString("MORE", comment: ""))
.font(.system(size: 16, weight: .bold))
.foregroundColor(.accentColor)
.animation(.easeInOut(duration: 0.3), value: showFullSynopsis)
HStack {
Spacer()
Text(showFullSynopsis ? NSLocalizedString("LESS", comment: "") : NSLocalizedString("MORE", comment: ""))
.font(.system(size: 16, weight: .bold))
.foregroundColor(.accentColor)
.animation(.easeInOut(duration: 0.3), value: showFullSynopsis)
}
}
.onTapGesture {
withAnimation(.easeInOut(duration: 0.3)) {
@ -367,8 +427,8 @@ struct MediaInfoView: View {
HStack(spacing: 8) {
Image(systemName: "play.fill")
.foregroundColor(colorScheme == .dark ? .black : .white)
Text(startWatchingText)
.font(.system(size: 16, weight: .medium))
Text(startActionText)
.font(.system(size: 16, weight: .bold))
.foregroundColor(colorScheme == .dark ? .black : .white)
}
.frame(maxWidth: .infinity)
@ -427,7 +487,7 @@ struct MediaInfoView: View {
.cornerRadius(15)
.gradientOutline()
}
Button(action: { openSafariViewController(with: href) }) {
Image(systemName: "safari")
.resizable()
@ -476,6 +536,7 @@ struct MediaInfoView: View {
@ViewBuilder
private var episodesSection: some View {
let _ = Logger.shared.log("episodesSection: episodeLinks count = \(episodeLinks.count)", type: "Debug")
if episodeLinks.count != 1 {
VStack(alignment: .leading, spacing: 16) {
episodesSectionHeader
@ -484,6 +545,52 @@ struct MediaInfoView: View {
}
}
@ViewBuilder
private var seasonSelectorStyled: some View {
let seasons = groupedEpisodes()
if seasons.count > 1 {
Menu {
ForEach(0..<seasons.count, id: \..self) { index in
Button(action: { selectedSeason = index }) {
Text(String(format: NSLocalizedString("Season %d", comment: ""), index + 1))
}
}
} label: {
HStack(spacing: 4) {
Text("Season \(selectedSeason + 1)")
.font(.system(size: 15, weight: .bold))
.foregroundColor(.accentColor)
Image(systemName: "chevron.down")
.font(.system(size: 13, weight: .bold))
.foregroundColor(.accentColor)
}
.padding(.vertical, 2)
}
}
}
@ViewBuilder
private var rangeSelectorStyled: some View {
Menu {
ForEach(generateRanges(), id: \..self) { range in
Button(action: { selectedRange = range }) {
Text("\(range.lowerBound + 1)-\(range.upperBound)")
}
}
} label: {
HStack(spacing: 4) {
Text("\(selectedRange.lowerBound + 1)-\(selectedRange.upperBound)")
.font(.system(size: 15, weight: .bold))
.foregroundColor(.accentColor)
Image(systemName: "chevron.down")
.font(.system(size: 13, weight: .bold))
.foregroundColor(.accentColor)
}
.padding(.vertical, 2)
.padding(.horizontal, 4)
}
}
@ViewBuilder
private var episodesSectionHeader: some View {
HStack {
@ -493,61 +600,27 @@ struct MediaInfoView: View {
Spacer()
episodeNavigationSection
HStack(spacing: 4) {
if isGroupedBySeasons || episodeLinks.count > episodeChunkSize {
HStack(spacing: 8) {
if isGroupedBySeasons {
seasonSelectorStyled
}
Spacer()
if episodeLinks.count > episodeChunkSize {
rangeSelectorStyled
.padding(.trailing, 4)
}
}
.padding(.top, -8)
}
sourceButton
menuButton
}
}
}
@ViewBuilder
private var episodeNavigationSection: some View {
Group {
if !isGroupedBySeasons && episodeLinks.count <= episodeChunkSize {
EmptyView()
} else if !isGroupedBySeasons && episodeLinks.count > episodeChunkSize {
rangeSelectionMenu
} else if isGroupedBySeasons {
seasonSelectionMenu
}
}
}
@ViewBuilder
private var rangeSelectionMenu: some View {
Menu {
ForEach(generateRanges(), id: \.self) { range in
Button(action: { selectedRange = range }) {
Text("\(range.lowerBound + 1)-\(range.upperBound)")
}
}
} label: {
Text("\(selectedRange.lowerBound + 1)-\(selectedRange.upperBound)")
.font(.system(size: 14))
.foregroundColor(.accentColor)
}
}
@ViewBuilder
private var seasonSelectionMenu: some View {
let seasons = groupedEpisodes()
if seasons.count > 1 {
Menu {
ForEach(0..<seasons.count, id: \.self) { index in
Button(action: { selectedSeason = index }) {
Text(String(format: NSLocalizedString("Season %d", comment: ""), index + 1))
}
}
} label: {
Text("Season \(selectedSeason + 1)")
.font(.system(size: 14))
.foregroundColor(.accentColor)
}
}
}
@ViewBuilder
private var episodeListSection: some View {
Group {
@ -619,22 +692,149 @@ struct MediaInfoView: View {
}
@ViewBuilder
private var noEpisodesSection: some View {
private var chaptersSection: some View {
let _ = Logger.shared.log("chaptersSection: chapters count = \(chapters.count)", type: "Debug")
VStack(alignment: .leading, spacing: 16) {
if !airdate.isEmpty && airdate != "N/A" && airdate != "No Data" {
HStack(spacing: 4) {
Image(systemName: "calendar")
.foregroundColor(.accentColor)
Text(airdate)
.font(.system(size: 14, weight: .bold))
.foregroundColor(.accentColor)
Spacer()
}
}
if !aliases.isEmpty {
Text(aliases)
.font(.system(size: 14, weight: .bold))
.foregroundColor(.secondary)
}
HStack {
Text(NSLocalizedString("Chapters", comment: ""))
.font(.system(size: 22, weight: .bold))
.foregroundColor(.primary)
Spacer()
HStack(spacing: 4) {
if chapters.count > chapterChunkSize {
HStack {
Spacer()
chapterRangeSelectorStyled
}
.padding(.bottom, 0)
}
sourceButton
menuButton
}
}
LazyVStack(spacing: 15) {
ForEach(chapters.indices.filter { selectedChapterRange.contains($0) }, id: \..self) { i in
let chapter = chapters[i]
let _ = refreshTrigger
if let href = chapter["href"] as? String,
let number = chapter["number"] as? Int,
let title = chapter["title"] as? String {
NavigationLink(
destination: ReaderView(
moduleId: module.id.uuidString,
chapterHref: href,
chapterTitle: title,
chapters: chapters,
mediaTitle: self.title,
chapterNumber: number
)
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
ChapterNavigator.shared.currentChapter = nil
}
}
) {
ChapterCell(
chapterNumber: String(number),
chapterTitle: title,
isCurrentChapter: false,
progress: UserDefaults.standard.double(forKey: "readingProgress_\(href)"),
href: href
)
}
.simultaneousGesture(TapGesture().onEnded {
UserDefaults.standard.set(true, forKey: "navigatingToReaderView")
ChapterNavigator.shared.currentChapter = (
moduleId: module.id.uuidString,
href: href,
title: title,
chapters: chapters,
mediaTitle: self.title,
chapterNumber: number
)
})
.contextMenu {
Button(action: {
markChapterAsRead(href: href, number: number)
}) {
Label("Mark as Read", systemImage: "checkmark.circle")
}
Button(action: {
resetChapterProgress(href: href)
}) {
Label("Reset Progress", systemImage: "arrow.counterclockwise")
}
Button(action: {
markAllPreviousChaptersAsRead(currentNumber: number)
}) {
Label("Mark Previous as Read", systemImage: "checkmark.circle.badge.plus")
}
}
.buttonStyle(PlainButtonStyle())
}
}
}
}
}
@ViewBuilder
private var chapterRangeSelectorStyled: some View {
Menu {
ForEach(generateChapterRanges(), id: \..self) { range in
Button(action: { selectedChapterRange = range }) {
Text("\(range.lowerBound + 1)-\(range.upperBound)")
}
}
} label: {
HStack(spacing: 4) {
Text("\(selectedChapterRange.lowerBound + 1)-\(selectedChapterRange.upperBound)")
.font(.system(size: 15, weight: .bold))
.foregroundColor(.accentColor)
Image(systemName: "chevron.down")
.font(.system(size: 13, weight: .bold))
.foregroundColor(.accentColor)
}
.padding(.vertical, 2)
.padding(.horizontal, 4)
}
}
@ViewBuilder
private var noContentSection: some View {
VStack(spacing: 8) {
Image(systemName: "tv.slash")
Image(systemName: module.metadata.novel == true ? "book.slash" : "tv.slash")
.font(.system(size: 48))
.foregroundColor(.secondary)
Text(NSLocalizedString("No Episodes Available", comment: ""))
Text(module.metadata.novel == true ? NSLocalizedString("No Chapters Available", comment: "") : NSLocalizedString("No Episodes Available", comment: ""))
.font(.title2)
.fontWeight(.semibold)
.foregroundColor(.primary)
Text(NSLocalizedString("Episodes might not be available yet or there could be an issue with the source.", comment: ""))
Text(module.metadata.novel == true ? NSLocalizedString("Chapters might not be available yet or there could be an issue with the source.", comment: "") : NSLocalizedString("Episodes might not be available yet or there could be an issue with the source.", comment: ""))
.font(.body)
.lineLimit(0)
.foregroundColor(.secondary)
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
.padding(.horizontal)
}
.padding(.vertical, 50)
@ -671,7 +871,7 @@ struct MediaInfoView: View {
.sheet(isPresented: $isMatchingPresented) {
AnilistMatchPopupView(seriesTitle: title) { id, matched in
handleAniListMatch(selectedID: id)
matchedTitle = matched // now in scope
matchedTitle = matched
fetchMetadataIDIfNeeded()
}
}
@ -679,7 +879,7 @@ struct MediaInfoView: View {
TMDBMatchPopupView(seriesTitle: title) { id, type, matched in
tmdbID = id
tmdbType = type
matchedTitle = matched // now in scope
matchedTitle = matched
fetchMetadataIDIfNeeded()
}
}
@ -739,7 +939,6 @@ struct MediaInfoView: View {
private func setupViewOnAppear() {
buttonRefreshTrigger.toggle()
tabBarController.hideTabBar()
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first,
@ -750,37 +949,108 @@ struct MediaInfoView: View {
}
private func setupInitialData() async {
guard !hasFetched else { return }
let savedCustomID = UserDefaults.standard.integer(forKey: "custom_anilist_id_\(href)")
if savedCustomID != 0 { customAniListID = savedCustomID }
if let savedPoster = UserDefaults.standard.string(forKey: "tmdbPosterURL_\(href)") {
imageUrl = savedPoster
do {
Logger.shared.log("setupInitialData: module.metadata.novel = \(String(describing: module.metadata.novel))", type: "Debug")
UserDefaults.standard.set(imageUrl, forKey: "mediaInfoImageUrl_\(module.id.uuidString)")
Logger.shared.log("Saved MediaInfoView image URL: \(imageUrl) for module \(module.id.uuidString)", type: "Debug")
if module.metadata.novel == true {
if !hasFetched {
DispatchQueue.main.async {
DropManager.shared.showDrop(
title: "Fetching Data",
subtitle: "Please wait while fetching.",
duration: 0.5,
icon: UIImage(systemName: "arrow.triangle.2.circlepath")
)
}
}
let jsContent = try? moduleManager.getModuleContent(module)
if let jsContent = jsContent {
jsController.loadScript(jsContent)
}
await withTaskGroup(of: Void.self) { group in
var chaptersLoaded = false
var detailsLoaded = false
group.addTask {
let fetchedChapters = try? await JSController.shared.extractChapters(moduleId: module.id.uuidString, href: href)
await MainActor.run {
if let fetchedChapters = fetchedChapters {
Logger.shared.log("setupInitialData: fetchedChapters count = \(fetchedChapters.count)", type: "Debug")
Logger.shared.log("setupInitialData: fetchedChapters = \(fetchedChapters)", type: "Debug")
self.chapters = fetchedChapters
}
chaptersLoaded = true
}
}
group.addTask {
await MainActor.run {
self.fetchDetails()
}
await withCheckedContinuation { (continuation: CheckedContinuation<Void, Never>) in
func checkDetails() {
Task { @MainActor in
if !(self.synopsis.isEmpty && self.aliases.isEmpty && self.airdate.isEmpty) {
detailsLoaded = true
continuation.resume()
} else {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
checkDetails()
}
}
}
}
checkDetails()
}
}
while true {
let loaded = await MainActor.run { chaptersLoaded && detailsLoaded }
if loaded { break }
try? await Task.sleep(nanoseconds: 100_000_000)
}
}
DispatchQueue.main.async {
self.hasFetched = true
self.isLoading = false
}
} else {
let savedCustomID = UserDefaults.standard.integer(forKey: "custom_anilist_id_\(href)")
if savedCustomID != 0 { customAniListID = savedCustomID }
if let savedPoster = UserDefaults.standard.string(forKey: "tmdbPosterURL_\(href)") {
imageUrl = savedPoster
}
if !hasFetched {
DropManager.shared.showDrop(
title: "Fetching Data",
subtitle: "Please wait while fetching.",
duration: 0.5,
icon: UIImage(systemName: "arrow.triangle.2.circlepath")
)
}
fetchDetails()
if savedCustomID != 0 {
itemID = savedCustomID
activeProvider = "AniList"
UserDefaults.standard.set("AniList", forKey: "metadataProviders")
} else {
fetchMetadataIDIfNeeded()
}
hasFetched = true
AnalyticsManager.shared.sendEvent(
event: "MediaInfoView",
additionalData: ["title": title]
)
}
} catch let loadError {
isError = true
isLoading = false
Logger.shared.log("Error loading media info: \(loadError)", type: "Error")
}
DropManager.shared.showDrop(
title: "Fetching Data",
subtitle: "Please wait while fetching.",
duration: 0.5,
icon: UIImage(systemName: "arrow.triangle.2.circlepath")
)
fetchDetails()
if savedCustomID != 0 {
itemID = savedCustomID
activeProvider = "AniList"
UserDefaults.standard.set("AniList", forKey: "metadataProviders")
} else {
fetchMetadataIDIfNeeded()
}
hasFetched = true
AnalyticsManager.shared.sendEvent(
event: "MediaInfoView",
additionalData: ["title": title]
)
}
private func cancelCurrentFetch() {
@ -1162,37 +1432,22 @@ struct MediaInfoView: View {
}
}
func fetchDetails() {
Logger.shared.log("fetchDetails: called", type: "Debug")
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
Task {
do {
let jsContent = try moduleManager.getModuleContent(module)
jsController.loadScript(jsContent)
let completion: (Any?, [EpisodeLink]) -> Void = { items, episodes in
self.handleFetchDetailsResponse(items: items, episodes: episodes)
}
if module.metadata.asyncJS == true {
jsController.fetchDetailsJS(url: href) { items, episodes in
if let item = items.first {
self.synopsis = item.description
self.aliases = item.aliases
self.airdate = item.airdate
}
self.episodeLinks = episodes
self.restoreSelectionState()
self.isLoading = false
self.isRefetching = false
}
jsController.fetchDetailsJS(url: href, completion: completion)
} else {
jsController.fetchDetails(url: href) { items, episodes in
if let item = items.first {
self.synopsis = item.description
self.aliases = item.aliases
self.airdate = item.airdate
}
self.episodeLinks = episodes
self.restoreSelectionState()
self.isLoading = false
self.isRefetching = false
}
jsController.fetchDetails(url: href, completion: completion)
}
} catch {
Logger.shared.log("Error loading module: \(error)", type: "Error")
@ -1203,6 +1458,53 @@ struct MediaInfoView: View {
}
}
private func handleFetchDetailsResponse(items: Any?, episodes: [EpisodeLink]) {
Logger.shared.log("fetchDetails: items = \(items)", type: "Debug")
Logger.shared.log("fetchDetails: episodes = \(episodes)", type: "Debug")
processItemsResponse(items)
if module.metadata.novel ?? false {
Logger.shared.log("fetchDetails: (novel) chapters count = \(chapters.count)", type: "Debug")
} else {
Logger.shared.log("fetchDetails: (episodes) episodes count = \(episodes.count)", type: "Debug")
episodeLinks = episodes
restoreSelectionState()
}
isLoading = false
isRefetching = false
}
private func processItemsResponse(_ items: Any?) {
if let mediaItems = items as? [MediaItem], let item = mediaItems.first {
synopsis = item.description
aliases = item.aliases
airdate = item.airdate
} else if let str = items as? String {
parseStringResponse(str)
} else if let dict = items as? [String: Any] {
extractMetadataFromDict(dict)
} else if let arr = items as? [[String: Any]], let dict = arr.first {
extractMetadataFromDict(dict)
} else {
Logger.shared.log("Failed to process items of type: \(type(of: items))", type: "Error")
}
}
private func parseStringResponse(_ str: String) {
guard let data = str.data(using: .utf8),
let arr = try? JSONSerialization.jsonObject(with: data) as? [[String: Any]],
let dict = arr.first else { return }
extractMetadataFromDict(dict)
}
private func extractMetadataFromDict(_ dict: [String: Any]) {
synopsis = dict["description"] as? String ?? ""
aliases = dict["aliases"] as? String ?? ""
airdate = dict["airdate"] as? String ?? ""
}
private func fetchAniListPosterImageAndSet() {
guard let listID = itemID, listID > 0 else { return }
AniListMutation().fetchCoverImage(animeId: listID) { result in
@ -1252,7 +1554,7 @@ struct MediaInfoView: View {
func checkCompletion() {
guard aniListCompleted && tmdbCompleted else { return }
let primaryProvider = order.first ?? "AniList"
let primaryProvider = order.first ?? "TMDB"
if primaryProvider == "AniList" && aniListSuccess {
activeProvider = "AniList"
@ -1383,7 +1685,6 @@ struct MediaInfoView: View {
}.resume()
}
func fetchStream(href: String) {
let fetchID = UUID()
activeFetchID = fetchID
@ -1628,7 +1929,6 @@ struct MediaInfoView: View {
}
}
private func downloadSingleEpisodeDirectly(episode: EpisodeLink) {
if isSingleEpisodeDownloading { return }
@ -1914,7 +2214,6 @@ struct MediaInfoView: View {
}.resume()
}
private func presentAlert(_ alert: UIAlertController) {
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first,
@ -1936,4 +2235,83 @@ struct MediaInfoView: View {
findTopViewController.findViewController(rootVC).present(alert, animated: true)
}
}
private func generateChapterRanges() -> [Range<Int>] {
let chunkSize = chapterChunkSize
let totalChapters = chapters.count
var ranges: [Range<Int>] = []
for i in stride(from: 0, to: totalChapters, by: chunkSize) {
let end = min(i + chunkSize, totalChapters)
ranges.append(i..<end)
}
return ranges
}
private func markChapterAsRead(href: String, number: Int) {
UserDefaults.standard.set(1.0, forKey: "readingProgress_\(href)")
UserDefaults.standard.set(1.0, forKey: "scrollPosition_\(href)")
ContinueReadingManager.shared.updateProgress(for: href, progress: 1.0)
DropManager.shared.showDrop(
title: "Chapter \(number) Marked as Read",
subtitle: "",
duration: 1.0,
icon: UIImage(systemName: "checkmark.circle.fill")
)
refreshTrigger.toggle()
}
private func resetChapterProgress(href: String) {
UserDefaults.standard.set(0.0, forKey: "readingProgress_\(href)")
UserDefaults.standard.removeObject(forKey: "scrollPosition_\(href)")
ContinueReadingManager.shared.updateProgress(for: href, progress: 0.0)
DropManager.shared.showDrop(
title: "Progress Reset",
subtitle: "",
duration: 1.0,
icon: UIImage(systemName: "arrow.counterclockwise")
)
refreshTrigger.toggle()
}
private func markAllPreviousChaptersAsRead(currentNumber: Int) {
let userDefaults = UserDefaults.standard
var markedCount = 0
for chapter in chapters {
if let number = chapter["number"] as? Int,
let href = chapter["href"] as? String {
if number < currentNumber {
userDefaults.set(1.0, forKey: "readingProgress_\(href)")
userDefaults.set(1.0, forKey: "scrollPosition_\(href)")
ContinueReadingManager.shared.updateProgress(for: href, progress: 1.0)
markedCount += 1
}
}
}
userDefaults.synchronize()
DropManager.shared.showDrop(
title: "Marked \(markedCount) Chapters as Read",
subtitle: "",
duration: 1.0,
icon: UIImage(systemName: "checkmark.circle.fill")
)
refreshTrigger.toggle()
}
private func simultaneousGesture(for item: NavigationLink<some View, some View>) -> some View {
item.simultaneousGesture(TapGesture().onEnded {
UserDefaults.standard.set(true, forKey: "navigatingToReaderView")
})
}
}

File diff suppressed because it is too large Load diff

View file

@ -14,6 +14,7 @@ struct SearchResultsGrid: View {
@Environment(\.verticalSizeClass) var verticalSizeClass
@EnvironmentObject private var libraryManager: LibraryManager
@EnvironmentObject private var moduleManager: ModuleManager
@State private var showBookmarkToast: Bool = false
@State private var toastMessage: String = ""
@ -35,7 +36,12 @@ struct SearchResultsGrid: View {
ZStack {
LazyVGrid(columns: Array(repeating: GridItem(.flexible(), spacing: 12), count: columnsCount), spacing: 12) {
ForEach(items) { item in
NavigationLink(destination: MediaInfoView(title: item.title, imageUrl: item.imageUrl, href: item.href, module: selectedModule)) {
NavigationLink(destination:
MediaInfoView(title: item.title, imageUrl: item.imageUrl, href: item.href, module: selectedModule)
.onDisappear {
}
) {
ZStack {
LazyImage(url: URL(string: item.imageUrl)) { state in
if let uiImage = state.imageContainer?.image {
@ -81,6 +87,7 @@ struct SearchResultsGrid: View {
.clipShape(RoundedRectangle(cornerRadius: 12))
.padding(4)
}
.isDetailLink(true)
.id(item.href)
.contextMenu {
Button(action: {
@ -127,5 +134,10 @@ struct SearchResultsGrid: View {
}
}
}
.sheet(isPresented: $libraryManager.isShowingCollectionPicker) {
if let bookmark = libraryManager.bookmarkToAdd {
CollectionPickerView(bookmark: bookmark)
}
}
}
}

View file

@ -23,6 +23,7 @@ struct SearchView: View {
@StateObject private var jsController = JSController.shared
@EnvironmentObject var moduleManager: ModuleManager
@Environment(\.verticalSizeClass) var verticalSizeClass
@Binding public var searchQuery: String
@ -37,6 +38,7 @@ struct SearchView: View {
@State private var isSearchFieldFocused = false
@State private var saveDebounceTimer: Timer?
@State private var searchDebounceTimer: Timer?
@State private var isActive: Bool = false
init(searchQuery: Binding<String>) {
self._searchQuery = searchQuery
@ -74,7 +76,7 @@ struct SearchView: View {
private var mainContent: some View {
VStack(alignment: .leading) {
HStack {
Text("Search")
Text(LocalizedStringKey("Search"))
.font(.largeTitle)
.fontWeight(.bold)
@ -106,6 +108,12 @@ struct SearchView: View {
cellWidth: cellWidth,
onHistoryItemSelected: { query in
searchQuery = query
searchDebounceTimer?.invalidate()
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
NotificationCenter.default.post(name: .tabBarSearchQueryUpdated, object: nil, userInfo: ["searchQuery": query])
performSearch()
},
onHistoryItemDeleted: { index in
removeFromHistory(at: index)
@ -137,10 +145,51 @@ struct SearchView: View {
}
}
.onAppear {
isActive = true
loadSearchHistory()
if !searchQuery.isEmpty {
performSearch()
}
let isMediaInfoActive = UserDefaults.standard.bool(forKey: "isMediaInfoActive")
let isReaderActive = UserDefaults.standard.bool(forKey: "isReaderActive")
if !isMediaInfoActive && !isReaderActive {
NotificationCenter.default.post(name: .showTabBar, object: nil)
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.02) {
let isMediaInfoActive = UserDefaults.standard.bool(forKey: "isMediaInfoActive")
let isReaderActive = UserDefaults.standard.bool(forKey: "isReaderActive")
if !isMediaInfoActive && !isReaderActive {
NotificationCenter.default.post(name: .showTabBar, object: nil)
}
}
NotificationCenter.default.addObserver(
forName: .searchQueryChanged,
object: nil,
queue: .main
) { notification in
if let query = notification.userInfo?["searchQuery"] as? String {
searchQuery = query
}
}
}
.onDisappear {
NotificationCenter.default.removeObserver(self, name: .searchQueryChanged, object: nil)
}
.onReceive(Timer.publish(every: 0.1, on: .main, in: .common).autoconnect()) { _ in
let isMediaInfoActive = UserDefaults.standard.bool(forKey: "isMediaInfoActive")
let isReaderActive = UserDefaults.standard.bool(forKey: "isReaderActive")
if isActive && !isMediaInfoActive && !isReaderActive {
NotificationCenter.default.post(name: .showTabBar, object: nil)
}
}
.onReceive(NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)) { _ in
isActive = true
let isMediaInfoActive = UserDefaults.standard.bool(forKey: "isMediaInfoActive")
let isReaderActive = UserDefaults.standard.bool(forKey: "isReaderActive")
if !isMediaInfoActive && !isReaderActive {
NotificationCenter.default.post(name: .showTabBar, object: nil)
}
}
.onChange(of: selectedModuleId) { _ in
if !searchQuery.isEmpty {
@ -300,6 +349,7 @@ struct SearchView: View {
}
}
struct SearchBar: View {
@State private var debounceTimer: Timer?
@Binding var text: String
@ -308,7 +358,7 @@ struct SearchBar: View {
var body: some View {
HStack {
TextField("Search...", text: $text, onEditingChanged: { isEditing in
TextField(LocalizedStringKey("Search..."), text: $text, onEditingChanged: { isEditing in
isFocused = isEditing
}, onCommit: onSearchButtonClicked)
.padding(7)

View file

@ -1,251 +0,0 @@
//
// SettingsSharedComponents.swift
// Sora
//
import SwiftUI
// MARK: - Settings Section
struct SettingsSection<Content: View>: View {
let title: String
let footer: String?
let content: Content
init(title: String, footer: String? = nil, @ViewBuilder content: () -> Content) {
self.title = title
self.footer = footer
self.content = content()
}
var body: some View {
VStack(alignment: .leading, spacing: 4) {
Text(title.uppercased())
.font(.footnote)
.foregroundStyle(.gray)
.padding(.horizontal, 20)
VStack(spacing: 0) {
content
}
.background(.ultraThinMaterial)
.clipShape(RoundedRectangle(cornerRadius: 12))
.overlay(
RoundedRectangle(cornerRadius: 12)
.strokeBorder(
LinearGradient(
gradient: Gradient(stops: [
.init(color: Color.accentColor.opacity(0.3), location: 0),
.init(color: Color.accentColor.opacity(0), location: 1)
]),
startPoint: .top,
endPoint: .bottom
),
lineWidth: 0.5
)
)
.padding(.horizontal, 20)
if let footer = footer {
Text(footer)
.font(.footnote)
.foregroundStyle(.gray)
.padding(.horizontal, 20)
.padding(.top, 4)
}
}
}
}
// MARK: - Settings Row
struct SettingsRow: View {
let icon: String
let title: String
var value: String? = nil
var isExternal: Bool = false
var textColor: Color = .primary
var showDivider: Bool = true
init(icon: String, title: String, value: String? = nil, isExternal: Bool = false, textColor: Color = .primary, showDivider: Bool = true) {
self.icon = icon
self.title = title
self.value = value
self.isExternal = isExternal
self.textColor = textColor
self.showDivider = showDivider
}
var body: some View {
VStack(spacing: 0) {
HStack {
Image(systemName: icon)
.frame(width: 24, height: 24)
.foregroundStyle(textColor)
Text(title)
.foregroundStyle(textColor)
Spacer()
if let value = value {
Text(value)
.foregroundStyle(.gray)
}
if isExternal {
Image(systemName: "arrow.up.forward")
.foregroundStyle(.gray)
.font(.footnote)
} else {
Image(systemName: "chevron.right")
.foregroundStyle(.gray)
.font(.footnote)
}
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
if showDivider {
Divider()
.padding(.horizontal, 16)
}
}
}
}
// MARK: - Settings Toggle Row
struct SettingsToggleRow: View {
let icon: String
let title: String
@Binding var isOn: Bool
var showDivider: Bool = true
init(icon: String, title: String, isOn: Binding<Bool>, showDivider: Bool = true) {
self.icon = icon
self.title = title
self._isOn = isOn
self.showDivider = showDivider
}
var body: some View {
VStack(spacing: 0) {
HStack {
Image(systemName: icon)
.frame(width: 24, height: 24)
.foregroundStyle(.primary)
Text(title)
.foregroundStyle(.primary)
Spacer()
Toggle("", isOn: $isOn)
.labelsHidden()
.tint(.accentColor)
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
if showDivider {
Divider()
.padding(.horizontal, 16)
}
}
}
}
// MARK: - Settings Picker Row
struct SettingsPickerRow<T: Hashable>: View {
let icon: String
let title: String
let options: [T]
let optionToString: (T) -> String
@Binding var selection: T
var showDivider: Bool = true
init(icon: String, title: String, options: [T], optionToString: @escaping (T) -> String, selection: Binding<T>, showDivider: Bool = true) {
self.icon = icon
self.title = title
self.options = options
self.optionToString = optionToString
self._selection = selection
self.showDivider = showDivider
}
var body: some View {
VStack(spacing: 0) {
HStack {
Image(systemName: icon)
.frame(width: 24, height: 24)
.foregroundStyle(.primary)
Text(title)
.foregroundStyle(.primary)
Spacer()
Menu {
ForEach(options, id: \.self) { option in
Button(action: { selection = option }) {
Text(optionToString(option))
}
}
} label: {
Text(optionToString(selection))
.foregroundStyle(.gray)
}
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
if showDivider {
Divider()
.padding(.horizontal, 16)
}
}
}
}
// MARK: - Settings Stepper Row
struct SettingsStepperRow: View {
let icon: String
let title: String
@Binding var value: Double
let range: ClosedRange<Double>
let step: Double
var formatter: (Double) -> String = { "\(Int($0))" }
var showDivider: Bool = true
init(icon: String, title: String, value: Binding<Double>, range: ClosedRange<Double>, step: Double, formatter: @escaping (Double) -> String = { "\(Int($0))" }, showDivider: Bool = true) {
self.icon = icon
self.title = title
self._value = value
self.range = range
self.step = step
self.formatter = formatter
self.showDivider = showDivider
}
var body: some View {
VStack(spacing: 0) {
HStack {
Image(systemName: icon)
.frame(width: 24, height: 24)
.foregroundStyle(.primary)
Text(title)
.foregroundStyle(.primary)
Spacer()
Stepper(formatter(value), value: $value, in: range, step: step)
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
if showDivider {
Divider()
.padding(.horizontal, 16)
}
}
}
}

View file

@ -1,246 +0,0 @@
//
// SettingsComponents.swift
// Sora
//
import SwiftUI
internal struct SettingsSection<Content: View>: View {
internal let title: String
internal let footer: String?
internal let content: Content
internal init(title: String, footer: String? = nil, @ViewBuilder content: () -> Content) {
self.title = title
self.footer = footer
self.content = content()
}
internal var body: some View {
VStack(alignment: .leading, spacing: 4) {
Text(title.uppercased())
.font(.footnote)
.foregroundStyle(.gray)
.padding(.horizontal, 20)
VStack(spacing: 0) {
content
}
.background(.ultraThinMaterial)
.clipShape(RoundedRectangle(cornerRadius: 12))
.overlay(
RoundedRectangle(cornerRadius: 12)
.strokeBorder(
LinearGradient(
gradient: Gradient(stops: [
.init(color: Color.accentColor.opacity(0.3), location: 0),
.init(color: Color.accentColor.opacity(0), location: 1)
]),
startPoint: .top,
endPoint: .bottom
),
lineWidth: 0.5
)
)
.padding(.horizontal, 20)
if let footer = footer {
Text(footer)
.font(.footnote)
.foregroundStyle(.gray)
.padding(.horizontal, 20)
.padding(.top, 4)
}
}
}
}
internal struct SettingsRow: View {
internal let icon: String
internal let title: String
internal var value: String? = nil
internal var isExternal: Bool = false
internal var textColor: Color = .primary
internal var showDivider: Bool = true
internal init(icon: String, title: String, value: String? = nil, isExternal: Bool = false, textColor: Color = .primary, showDivider: Bool = true) {
self.icon = icon
self.title = title
self.value = value
self.isExternal = isExternal
self.textColor = textColor
self.showDivider = showDivider
}
internal var body: some View {
VStack(spacing: 0) {
HStack {
Image(systemName: icon)
.frame(width: 24, height: 24)
.foregroundStyle(textColor)
Text(title)
.foregroundStyle(textColor)
Spacer()
if let value = value {
Text(value)
.foregroundStyle(.gray)
}
if isExternal {
Image(systemName: "arrow.up.forward")
.foregroundStyle(.gray)
.font(.footnote)
} else {
Image(systemName: "chevron.right")
.foregroundStyle(.gray)
.font(.footnote)
}
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
if showDivider {
Divider()
.padding(.horizontal, 16)
}
}
}
}
internal struct SettingsToggleRow: View {
internal let icon: String
internal let title: String
@Binding internal var isOn: Bool
internal var showDivider: Bool = true
internal init(icon: String, title: String, isOn: Binding<Bool>, showDivider: Bool = true) {
self.icon = icon
self.title = title
self._isOn = isOn
self.showDivider = showDivider
}
internal var body: some View {
VStack(spacing: 0) {
HStack {
Image(systemName: icon)
.frame(width: 24, height: 24)
.foregroundStyle(.primary)
Text(title)
.foregroundStyle(.primary)
Spacer()
Toggle("", isOn: $isOn)
.labelsHidden()
.tint(.accentColor)
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
if showDivider {
Divider()
.padding(.horizontal, 16)
}
}
}
}
internal struct SettingsPickerRow<T: Hashable>: View {
internal let icon: String
internal let title: String
internal let options: [T]
internal let optionToString: (T) -> String
@Binding internal var selection: T
internal var showDivider: Bool = true
internal init(icon: String, title: String, options: [T], optionToString: @escaping (T) -> String, selection: Binding<T>, showDivider: Bool = true) {
self.icon = icon
self.title = title
self.options = options
self.optionToString = optionToString
self._selection = selection
self.showDivider = showDivider
}
internal var body: some View {
VStack(spacing: 0) {
HStack {
Image(systemName: icon)
.frame(width: 24, height: 24)
.foregroundStyle(.primary)
Text(title)
.foregroundStyle(.primary)
Spacer()
Menu {
ForEach(options, id: \.self) { option in
Button(action: { selection = option }) {
Text(optionToString(option))
}
}
} label: {
Text(optionToString(selection))
.foregroundStyle(.gray)
}
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
if showDivider {
Divider()
.padding(.horizontal, 16)
}
}
}
}
internal struct SettingsStepperRow: View {
internal let icon: String
internal let title: String
@Binding internal var value: Double
internal let range: ClosedRange<Double>
internal let step: Double
internal var formatter: (Double) -> String = { "\(Int($0))" }
internal var showDivider: Bool = true
internal init(icon: String, title: String, value: Binding<Double>, range: ClosedRange<Double>, step: Double, formatter: @escaping (Double) -> String = { "\(Int($0))" }, showDivider: Bool = true) {
self.icon = icon
self.title = title
self._value = value
self.range = range
self.step = step
self.formatter = formatter
self.showDivider = showDivider
}
internal var body: some View {
VStack(spacing: 0) {
HStack {
Image(systemName: icon)
.frame(width: 24, height: 24)
.foregroundStyle(.primary)
Text(title)
.foregroundStyle(.primary)
Spacer()
Stepper(formatter(value), value: $value, in: range, step: step)
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
if showDivider {
Divider()
.padding(.horizontal, 16)
}
}
}
}

View file

@ -78,10 +78,10 @@ struct SettingsViewAbout: View {
}
VStack(alignment: .leading, spacing: 8) {
Text("Sora")
Text(LocalizedStringKey("Sora"))
.font(.title)
.bold()
Text("Also known as Sulfur")
Text(LocalizedStringKey("Also known as Sulfur"))
.font(.caption)
.foregroundColor(.secondary)
}
@ -111,10 +111,10 @@ struct SettingsViewAbout: View {
}
VStack(alignment: .leading) {
Text("cranci1")
Text(LocalizedStringKey("cranci1"))
.font(.headline)
.foregroundColor(.indigo)
Text("me frfr")
Text(LocalizedStringKey("me frfr"))
.font(.subheadline)
.foregroundColor(.secondary)
}
@ -137,7 +137,7 @@ struct SettingsViewAbout: View {
}
.padding(.vertical, 20)
}
.navigationTitle("About")
.navigationTitle(LocalizedStringKey("About"))
.scrollViewBottomPadding()
}
}
@ -157,7 +157,7 @@ struct ContributorsView: View {
}
.padding(.vertical, 12)
} else if error != nil {
Text("Failed to load contributors")
Text(LocalizedStringKey("Failed to load contributors"))
.foregroundColor(.secondary)
.padding(.vertical, 12)
} else {
@ -191,11 +191,6 @@ struct ContributorsView: View {
id: 71751652,
login: "qooode",
avatarUrl: "https://avatars.githubusercontent.com/u/71751652?v=4"
),
Contributor(
id: 8116188,
login: "undeaDD",
avatarUrl: "https://avatars.githubusercontent.com/u/8116188?v=4"
)
]
}
@ -288,8 +283,8 @@ struct TranslatorsView: View {
),
Translator(
id: 3,
login: "cranci",
avatarUrl: "https://github.com/50n50/assets/blob/main/pfps/28ac8bfaa250788579af747d8fb7f827_webp.png?raw=true",
login: "simplymox",
avatarUrl: "https://github.com/50n50/assets/blob/main/pfps/9131174855bd67fc445206e888505a6a_webp.png?raw=true",
language: "Italian"
),
Translator(
@ -327,6 +322,12 @@ struct TranslatorsView: View {
login: "Cufiy",
avatarUrl: "https://github.com/50n50/assets/blob/main/pfps/y1wwm0ed_png.png?raw=true",
language: "German"
),
Translator(
id: 10,
login: "yoshi1780",
avatarUrl: "https://github.com/50n50/assets/blob/main/pfps/262d7c1a61ff49355ddb74c76c7c5c7f_webp.png?raw=true",
language: "Mongolian"
)
]

View file

@ -0,0 +1,261 @@
//
// SettingsViewBackup.swift
// Sora
//
// Created by paul on 29/06/25.
//
import SwiftUI
import Foundation
import UniformTypeIdentifiers
fileprivate struct SettingsSection<Content: View>: View {
let title: String
let footer: String?
let content: Content
init(title: String, footer: String? = nil, @ViewBuilder content: () -> Content) {
self.title = title
self.footer = footer
self.content = content()
}
var body: some View {
VStack(alignment: .leading, spacing: 4) {
Text(title.uppercased())
.font(.footnote)
.foregroundStyle(.gray)
.padding(.horizontal, 20)
VStack(spacing: 0) {
content
}
.background(.ultraThinMaterial)
.clipShape(RoundedRectangle(cornerRadius: 12))
.overlay(
RoundedRectangle(cornerRadius: 12)
.strokeBorder(
LinearGradient(
gradient: Gradient(stops: [
.init(color: Color.accentColor.opacity(0.3), location: 0),
.init(color: Color.accentColor.opacity(0), location: 1)
]),
startPoint: .top,
endPoint: .bottom
),
lineWidth: 0.5
)
)
.padding(.horizontal, 20)
if let footer = footer {
Text(footer)
.font(.footnote)
.foregroundStyle(.gray)
.padding(.horizontal, 20)
.padding(.top, 4)
}
}
}
}
fileprivate struct SettingsActionRow: View {
let icon: String
let title: String
let action: () -> Void
var showDivider: Bool = true
var color: Color = .accentColor
var body: some View {
Button(action: action) {
HStack {
Image(systemName: icon)
.frame(width: 24, height: 24)
.foregroundStyle(color)
Text(title)
.foregroundStyle(color)
Spacer()
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
}
.buttonStyle(PlainButtonStyle())
.background(Color.clear)
.contentShape(Rectangle())
.overlay(
VStack {
if showDivider {
Divider().padding(.leading, 56)
}
}, alignment: .bottom
)
}
}
struct SettingsViewBackup: View {
@State private var showExporter = false
@State private var showImporter = false
@State private var exportURL: URL?
@State private var showAlert = false
@State private var alertMessage = ""
@State private var exportData: Data? = nil
var body: some View {
ScrollView(showsIndicators: false) {
VStack(spacing: 24) {
SettingsSection(
title: NSLocalizedString("Backup & Restore", comment: "Settings section title for backup and restore"),
footer: NSLocalizedString("Notice: This feature is still experimental. Please double-check your data after import/export. \nAlso note that when importing a backup your current data will be overwritten, it is not possible to merge yet.", comment: "Footer notice for experimental backup/restore feature")
) {
SettingsActionRow(
icon: "arrow.up.doc",
title: NSLocalizedString("Export Backup", comment: "Export backup button title"),
action: {
exportData = generateBackupData()
showExporter = true
},
showDivider: true
)
SettingsActionRow(
icon: "arrow.down.doc",
title: NSLocalizedString("Import Backup", comment: "Import backup button title"),
action: {
showImporter = true
},
showDivider: false
)
}
}
.padding(.vertical, 20)
}
.navigationTitle(NSLocalizedString("Backup & Restore", comment: "Navigation title for backup and restore view"))
.fileExporter(
isPresented: $showExporter,
document: BackupDocument(data: exportData ?? Data()),
contentType: .json,
defaultFilename: exportFilename()
) { result in
switch result {
case .success(let url):
alertMessage = "Exported to \(url.lastPathComponent)"
showAlert = true
case .failure(let error):
alertMessage = "Export failed: \(error.localizedDescription)"
showAlert = true
}
}
.fileImporter(
isPresented: $showImporter,
allowedContentTypes: [.json]
) { result in
switch result {
case .success(let url):
var success = false
if url.startAccessingSecurityScopedResource() {
defer { url.stopAccessingSecurityScopedResource() }
do {
let data = try Data(contentsOf: url)
try restoreBackupData(data)
alertMessage = "Import successful!"
success = true
} catch {
alertMessage = "Import failed: \(error.localizedDescription)"
}
}
if !success {
alertMessage = "Import failed: Could not access file."
}
showAlert = true
case .failure(let error):
alertMessage = "Import failed: \(error.localizedDescription)"
showAlert = true
}
}
.alert(isPresented: $showAlert) {
Alert(title: Text(NSLocalizedString("Backup", comment: "Alert title for backup actions")), message: Text(alertMessage), dismissButton: .default(Text("OK")))
}
}
@MainActor
private func generateBackupData() -> Data? {
let continueWatching = ContinueWatchingManager.shared.fetchItems()
let continueReading = ContinueReadingManager.shared.fetchItems()
let collections = (try? JSONDecoder().decode([BookmarkCollection].self, from: UserDefaults.standard.data(forKey: "bookmarkCollections") ?? Data())) ?? []
let searchHistory = UserDefaults.standard.stringArray(forKey: "searchHistory") ?? []
let modules = ModuleManager().modules
let backup: [String: Any] = [
"continueWatching": continueWatching.map { try? $0.toDictionary() },
"continueReading": continueReading.map { try? $0.toDictionary() },
"collections": collections.map { try? $0.toDictionary() },
"searchHistory": searchHistory,
"modules": modules.map { try? $0.toDictionary() }
]
return try? JSONSerialization.data(withJSONObject: backup, options: .prettyPrinted)
}
private func restoreBackupData(_ data: Data) throws {
guard let json = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] else {
throw NSError(domain: "restoreBackupData", code: 0, userInfo: [NSLocalizedDescriptionKey: "Invalid backup format"])
}
if let cwArr = json["continueWatching"] as? NSArray {
let cwData = try JSONSerialization.data(withJSONObject: cwArr, options: [])
UserDefaults.standard.set(cwData, forKey: "continueWatchingItems")
}
if let crArr = json["continueReading"] as? NSArray {
let crData = try JSONSerialization.data(withJSONObject: crArr, options: [])
UserDefaults.standard.set(crData, forKey: "continueReadingItems")
}
if let colArr = json["collections"] as? NSArray {
let colData = try JSONSerialization.data(withJSONObject: colArr, options: [])
UserDefaults.standard.set(colData, forKey: "bookmarkCollections")
}
if let shArr = json["searchHistory"] as? [String] {
UserDefaults.standard.set(shArr, forKey: "searchHistory")
}
if let modArr = json["modules"] as? NSArray {
let modData = try JSONSerialization.data(withJSONObject: modArr, options: [])
let fileManager = FileManager.default
let docs = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0]
let modulesURL = docs.appendingPathComponent("modules.json")
try modData.write(to: modulesURL)
}
UserDefaults.standard.synchronize()
}
private func exportFilename() -> String {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd_HH-mm-ss"
let dateString = formatter.string(from: Date())
return "SoraBackup_\(dateString).json"
}
}
extension Encodable {
func toDictionary() throws -> [String: Any] {
let data = try JSONEncoder().encode(self)
let json = try JSONSerialization.jsonObject(with: data, options: [])
guard let dict = json as? [String: Any] else {
throw NSError(domain: "toDictionary", code: 0, userInfo: nil)
}
return dict
}
}
struct BackupDocument: FileDocument {
static var readableContentTypes: [UTType] { [.json] }
var data: Data
init(data: Data) {
self.data = data
}
init(configuration: ReadConfiguration) throws {
self.data = configuration.file.regularFileContents ?? Data()
}
func fileWrapper(configuration: WriteConfiguration) throws -> FileWrapper {
return .init(regularFileWithContents: data)
}
}

View file

@ -150,28 +150,49 @@ fileprivate struct SettingsPickerRow<T: Hashable>: View {
struct SettingsViewGeneral: View {
@AppStorage("episodeChunkSize") private var episodeChunkSize: Int = 100
@AppStorage("refreshModulesOnLaunch") private var refreshModulesOnLaunch: Bool = true
@AppStorage("fetchEpisodeMetadata") private var fetchEpisodeMetadata: Bool = true
@AppStorage("analyticsEnabled") private var analyticsEnabled: Bool = false
@AppStorage("hideSplashScreen") private var hideSplashScreenEnable: Bool = false
@AppStorage("metadataProvidersOrder") private var metadataProvidersOrderData: Data = {
@AppStorage("useNativeTabBar") private var useNativeTabBar: Bool = false
@AppStorage("metadataProvidersOrderData") private var metadataProvidersOrderData: Data = {
try! JSONEncoder().encode(["TMDB","AniList"])
}()
@AppStorage("tmdbImageWidth") private var TMDBimageWidht: String = "original"
@AppStorage("mediaColumnsPortrait") private var mediaColumnsPortrait: Int = 2
@AppStorage("mediaColumnsLandscape") private var mediaColumnsLandscape: Int = 4
@AppStorage("metadataProviders") private var metadataProviders: String = "TMDB"
@AppStorage("librarySectionsOrderData") private var librarySectionsOrderData: Data = {
try! JSONEncoder().encode(["continueWatching", "continueReading", "collections"])
}()
@AppStorage("disabledLibrarySectionsData") private var disabledLibrarySectionsData: Data = {
try! JSONEncoder().encode([String]())
}()
private var metadataProvidersOrder: [String] {
get { (try? JSONDecoder().decode([String].self, from: metadataProvidersOrderData)) ?? ["AniList","TMDB"] }
set { metadataProvidersOrderData = try! JSONEncoder().encode(newValue) }
}
private var librarySectionsOrder: [String] {
get { (try? JSONDecoder().decode([String].self, from: librarySectionsOrderData)) ?? ["continueWatching", "continueReading", "collections"] }
set { librarySectionsOrderData = try! JSONEncoder().encode(newValue) }
}
private var disabledLibrarySections: [String] {
get { (try? JSONDecoder().decode([String].self, from: disabledLibrarySectionsData)) ?? [] }
set { disabledLibrarySectionsData = try! JSONEncoder().encode(newValue) }
}
private let TMDBimageWidhtList = ["300", "500", "780", "1280", "original"]
private let sortOrderOptions = ["Ascending", "Descending"]
private let metadataProvidersList = ["TMDB", "AniList"]
@EnvironmentObject var settings: Settings
@State private var showRestartAlert = false
private let isiOS26OrLater: Bool = {
if #available(iOS 26, *) { return true } else { return false }
}()
var body: some View {
ScrollView(showsIndicators: false) {
VStack(spacing: 24) {
@ -194,8 +215,17 @@ struct SettingsViewGeneral: View {
icon: "wand.and.rays.inverse",
title: NSLocalizedString("Hide Splash Screen", comment: ""),
isOn: $hideSplashScreenEnable,
showDivider: false
showDivider: isiOS26OrLater
)
if isiOS26OrLater {
SettingsToggleRow(
icon: "inset.filled.bottomthird.rectangle",
title: NSLocalizedString("Use Native Tab Bar", comment: ""),
isOn: $useNativeTabBar,
showDivider: false
)
}
}
SettingsSection(title: NSLocalizedString("Language", comment: "")) {
@ -210,7 +240,9 @@ struct SettingsViewGeneral: View {
"Dutch",
"French",
"German",
"Italian",
"Kazakh",
"Mongolian",
"Norsk",
"Russian",
"Slovak",
@ -231,7 +263,9 @@ struct SettingsViewGeneral: View {
case "Russian": return "Русский"
case "Norsk": return "Norsk"
case "Kazakh": return "Қазақша"
case "Mongolian": return "Монгол"
case "Swedish": return "Svenska"
case "Italian": return "Italiano"
default: return lang
}
},
@ -301,9 +335,15 @@ struct SettingsViewGeneral: View {
}
}
.listStyle(.plain)
.frame(height: CGFloat(metadataProvidersOrder.count * 48))
.frame(height: CGFloat(metadataProvidersOrder.count * 65))
.background(Color.clear)
.padding(.bottom, 8)
Text(NSLocalizedString("Drag to reorder", comment: ""))
.font(.caption)
.foregroundStyle(.gray)
.frame(maxWidth: .infinity, alignment: .center)
.padding(.top, -6)
.padding(.bottom, 8)
}
.environment(\.editMode, .constant(.active))
}
@ -330,17 +370,7 @@ struct SettingsViewGeneral: View {
)
}
SettingsSection(
title: NSLocalizedString("Modules", comment: ""),
footer: NSLocalizedString("Note that the modules will be replaced only if there is a different version string inside the JSON file.", comment: "")
) {
SettingsToggleRow(
icon: "arrow.clockwise",
title: NSLocalizedString("Refresh Modules on Launch", comment: ""),
isOn: $refreshModulesOnLaunch,
showDivider: false
)
}
SettingsSection(
title: NSLocalizedString("Advanced", comment: ""),
@ -353,6 +383,70 @@ struct SettingsViewGeneral: View {
showDivider: false
)
}
SettingsSection(
title: NSLocalizedString("Library View", comment: ""),
footer: NSLocalizedString("Customize the sections shown in your library. You can reorder sections or disable them completely.", comment: "")
) {
VStack(spacing: 0) {
HStack {
Image(systemName: "arrow.up.arrow.down")
.frame(width: 24, height: 24)
.foregroundStyle(.primary)
Text(NSLocalizedString("Library Sections Order", comment: ""))
.foregroundStyle(.primary)
Spacer()
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
List {
ForEach(Array(librarySectionsOrder.enumerated()), id: \.element) { index, section in
HStack {
Text("\(index + 1)")
.frame(width: 24, height: 24)
.foregroundStyle(.gray)
Image(systemName: sectionIcon(for: section))
.frame(width: 24, height: 24)
Text(sectionName(for: section))
.foregroundStyle(.primary)
Spacer()
Toggle("", isOn: toggleBinding(for: section))
.labelsHidden()
.tint(.accentColor.opacity(0.7))
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
.listRowBackground(Color.clear)
.listRowSeparator(.visible)
.listRowSeparatorTint(.gray.opacity(0.3))
.listRowInsets(EdgeInsets())
}
.onMove { from, to in
var arr = librarySectionsOrder
arr.move(fromOffsets: from, toOffset: to)
librarySectionsOrderData = try! JSONEncoder().encode(arr)
}
}
.listStyle(.plain)
.frame(height: CGFloat(librarySectionsOrder.count * 70))
.background(Color.clear)
Text(NSLocalizedString("Drag to reorder sections", comment: ""))
.font(.caption)
.foregroundStyle(.gray)
.frame(maxWidth: .infinity, alignment: .center)
.padding(.top, -6)
.padding(.bottom, 8)
}
.environment(\.editMode, .constant(.active))
}
}
.padding(.vertical, 20)
}
@ -366,4 +460,47 @@ struct SettingsViewGeneral: View {
)
}
}
private func sectionName(for section: String) -> String {
switch section {
case "continueWatching":
return NSLocalizedString("Continue Watching", comment: "")
case "continueReading":
return NSLocalizedString("Continue Reading", comment: "")
case "collections":
return NSLocalizedString("Collections", comment: "")
default:
return section
}
}
private func sectionIcon(for section: String) -> String {
switch section {
case "continueWatching":
return "play.fill"
case "continueReading":
return "book.fill"
case "collections":
return "folder.fill"
default:
return "questionmark"
}
}
private func toggleBinding(for section: String) -> Binding<Bool> {
return Binding(
get: { !self.disabledLibrarySections.contains(section) },
set: { isEnabled in
var sections = self.disabledLibrarySections
if isEnabled {
sections.removeAll { $0 == section }
} else {
if !sections.contains(section) {
sections.append(section)
}
}
self.disabledLibrarySectionsData = try! JSONEncoder().encode(sections)
}
)
}
}

Some files were not shown because too many files have changed in this diff Show more