Commit a97f95d1d3

a97f95d1d378dcd5ceda272597ccbe142192a840

parent: f1b4820d94

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-10-24 09:17 UTC

sora

Layout: unified · split

docs/.vitepress/configs/constants.ts +10 −1
@@ -264,6 +264,14 @@ export const homeCards: HomeCard[] = [
264264 link: '/ext/suwatte',
265265 section: 'Extensions'
266266 },
267 {
268 id: 'ext-sora',
269 icon: ':lucide-puzzle:',
270 title: 'Sora',
271 details: 'Anime, Manga, Movies & Novels',
272 link: '/ext/sora',
273 section: 'Extensions'
274 },
267275 {
268276 id: 'ext-hayase',
269277 icon: ':lucide-puzzle:',
@@ -577,7 +585,8 @@ export const sidebar: DefaultTheme.Sidebar = [
577585 { text: 'Aidoku', link: '/ext/aidoku' },
578586 { text: 'Mana', link: '/ext/mana' },
579587 { text: 'Paperback', link: '/ext/paperback' },
580 { text: 'Suwatte', link: '/ext/suwatte' }
588 { text: 'Suwatte', link: '/ext/suwatte' },
589 { text: 'Sora', link: '/ext/sora' }
581590 ]
582591 },
583592 {
docs/.vitepress/theme/components/extrepo/ExtensionRepos.vue +3 −1
@@ -114,6 +114,7 @@ const statusTitle = computed(() => {
114114})
115115
116116const repoData = computed(() => store.value?.sites ?? {})
117const soraAuthors = computed(() => store.value?.soraAuthors ?? {})
117118const echoAuthors = computed(() => store.value?.echoAuthors ?? {})
118119const repoLists = computed(() => store.value?.repoLists ?? {})
119120
@@ -143,7 +144,8 @@ const baseRepos = computed<Repo[]>(() => {
143144const resolvedRepos = computed<Repo[]>(() => {
144145 const result: Repo[] = []
145146 for (const repo of baseRepos.value) {
146 const authors = echoAuthors.value[repo.indexUrl]
147 const authors = soraAuthors.value[repo.indexUrl] ??
148 echoAuthors.value[repo.indexUrl]
147149 if (!authors?.length) {
148150 result.push(repo)
149151 continue
docs/.vitepress/theme/components/extrepo/SiteCell.vue +5 −1
@@ -15,7 +15,11 @@ const props = defineProps<{
1515 scheme?: string
1616}>()
1717
18const copyTarget = computed(() => props.site.copyUrl ?? props.site.installUrl)
18const copyTarget = computed(() => {
19 const value = props.site.copyUrl ?? props.site.installUrl
20 const soraMatch = value?.match(/^sora:\/\/module\?url=(.+)$/)
21 return soraMatch ? soraMatch[1] : value
22})
1923
2024async function copyInstallUrl() {
2125 const value = copyTarget.value
docs/.vitepress/theme/components/extrepo/install.ts +1 −1
@@ -53,7 +53,7 @@ const MANUAL_ONLY_SCHEMES = new Set(['manual', 'shosetsu'])
5353const NO_INSTALL_SCHEMES = new Set(['seanime'])
5454
5555// Schemes with no install or copy action
56const BROWSE_ONLY_SCHEMES = new Set(['kotatsu', 'echo'])
56const BROWSE_ONLY_SCHEMES = new Set(['kotatsu', 'sora', 'echo'])
5757
5858const NO_COPY_SCHEMES = new Set(['suwatte', 'echo'])
5959
docs/.vitepress/theme/components/extrepo/useRepoStore.ts +2 −1
@@ -33,7 +33,7 @@ const schemeModules = import.meta.glob<{ data: ExtensionRepoData }>(
3333)
3434
3535function emptyData(): ExtensionRepoData {
36 return { sites: {}, echoAuthors: {}, repoLists: {} }
36 return { sites: {}, soraAuthors: {}, echoAuthors: {}, repoLists: {} }
3737}
3838
3939// Never let a hung chunk or upstream fetch spin forever.
@@ -119,6 +119,7 @@ export function provideRepoStore(scheme: string): RepoStore {
119119 }
120120 store.value = {
121121 sites: { ...sites, ...fresh.sites },
122 soraAuthors: { ...prev.soraAuthors, ...fresh.soraAuthors },
122123 echoAuthors: { ...prev.echoAuthors, ...fresh.echoAuthors },
123124 repoLists: { ...prev.repoLists, ...fresh.repoLists }
124125 }
docs/ext/extensionRepos/parsers.ts +132 −1
@@ -182,6 +182,36 @@ interface KotatsuIndex {
182182 sites: KotatsuSite[]
183183}
184184
185interface SoraRepoIndexEntry {
186 name: string
187 source: string
188 path?: string
189 error?: string
190}
191
192interface SoraRepoIndex {
193 repos: SoraRepoIndexEntry[]
194}
195
196interface SoraModule {
197 sourceName: string
198 iconUrl?: string
199 iconURL?: string
200 language?: string
201 baseUrl?: string
202 scriptUrl?: string
203 scriptURL?: string
204 wotaku_sourceName?: string
205 wotaku_language?: string[]
206 wotaku_type?: string[]
207}
208
209export interface SoraAuthorRepo {
210 label: string
211 repoUrl?: string
212 indexUrl: string
213}
214
185215interface EchoExtension {
186216 id: string
187217 type: string
@@ -789,6 +819,98 @@ function loadEchoExtensionList(
789819 }
790820}
791821
822function isSoraRepoIndex(json: unknown): json is SoraRepoIndex {
823 return !!json && typeof json === 'object' &&
824 Array.isArray((json as SoraRepoIndex).repos)
825}
826
827function normalizeSoraLang(language: string | undefined): string {
828 const stripped = (language ?? '').replace(/\s*\([^)]*\)\s*$/, '').trim()
829 if (stripped.toLowerCase().startsWith('multi')) return 'all'
830 return normalizeLang(stripped)
831}
832
833function toRepoDataSoraModules(modules: SoraModule[]): RepoSite[] {
834 const seen = new Set<string>()
835 const sites: RepoSite[] = []
836
837 for (const mod of modules) {
838 const name = mod.wotaku_sourceName ?? mod.sourceName
839 const langs = mod.wotaku_language?.length
840 ? mod.wotaku_language
841 : [mod.language]
842 const scriptUrl = mod.scriptUrl ?? mod.scriptURL
843 const installUrl = scriptUrl?.replace(/\.js$/i, '.json')
844 for (const rawLang of langs) {
845 const lang = normalizeSoraLang(rawLang)
846 const key = `${name}::${lang}::${installUrl ?? ''}`
847 if (seen.has(key)) continue
848 seen.add(key)
849 sites.push({
850 name,
851 lang,
852 icon: mod.iconUrl ?? mod.iconURL ?? '',
853 url: mod.baseUrl ?? '',
854 rating: 'safe',
855 contentType: mod.wotaku_type?.[0],
856 installUrl: installUrl ? `sora://module?url=${installUrl}` : undefined
857 })
858 }
859 }
860
861 return sortSites(sites)
862}
863
864async function loadSoraRepoIndex(
865 indexUrl: string,
866 index: SoraRepoIndex,
867 fetchJson: FetchJson
868): Promise<{
869 sites: RepoSite[]
870 authorRepos: SoraAuthorRepo[]
871 sitesByAuthor: Record<string, RepoData>
872}> {
873 const seen = new Set<string>()
874 const sites: RepoSite[] = []
875 const authorRepos: SoraAuthorRepo[] = []
876 const sitesByAuthor: Record<string, RepoData> = {}
877
878 const entries = index.repos.filter(repo => repo.path && !repo.error)
879 const fileUrls = entries.map(repo => new URL(repo.path!, indexUrl).toString())
880 const moduleLists = await mapLimit(
881 fileUrls,
882 FETCH_CONCURRENCY,
883 url => fetchJson(url)
884 )
885
886 entries.forEach((repo, i) => {
887 const modules = moduleLists[i]
888 const authorSites = Array.isArray(modules)
889 ? toRepoDataSoraModules(modules as SoraModule[])
890 : []
891 const fileUrl = fileUrls[i]
892 sitesByAuthor[fileUrl] = { sites: authorSites }
893 authorRepos.push({
894 label: repo.name,
895 repoUrl: repo.source?.replace(/\.git$/, ''),
896 indexUrl: fileUrl
897 })
898 for (const site of authorSites) {
899 const key = `${site.name}::${site.lang}::${site.installUrl ?? ''}`
900 if (seen.has(key)) continue
901 seen.add(key)
902 sites.push(site)
903 }
904 })
905
906 authorRepos.sort((a, b) => a.label.localeCompare(b.label))
907 return {
908 sites: sortSites(sites),
909 authorRepos,
910 sitesByAuthor
911 }
912}
913
792914function toRepoDataLNReader(plugins: LNReaderPlugin[]): RepoSite[] {
793915 const seen = new Set<string>()
794916 const sites: RepoSite[] = []
@@ -934,6 +1056,7 @@ async function toRepoData(
9341056
9351057export interface ExtensionRepoData {
9361058 sites: Record<string, RepoData>
1059 soraAuthors: Record<string, SoraAuthorRepo[]>
9371060 echoAuthors: Record<string, EchoAuthorRepo[]>
9381061 repoLists: Record<string, RepoListEntry[]>
9391062}
@@ -945,6 +1068,7 @@ export async function assembleSchemeData(
9451068): Promise<ExtensionRepoData> {
9461069 const listUrlSet = new Set(listUrls)
9471070 const sites: Record<string, RepoData> = {}
1071 const soraAuthors: Record<string, SoraAuthorRepo[]> = {}
9481072 const echoAuthors: Record<string, EchoAuthorRepo[]> = {}
9491073 const repoLists: Record<string, RepoListEntry[]> = {}
9501074 const pendingByAuthor: Record<string, RepoData> = {}
@@ -1021,6 +1145,13 @@ export async function assembleSchemeData(
10211145 const url = remaining[i]
10221146 const json = jsons[i]
10231147 if (json === undefined) continue
1148 if (isSoraRepoIndex(json)) {
1149 const result = await loadSoraRepoIndex(url, json, fetchJson)
1150 sites[url] = { sites: result.sites }
1151 soraAuthors[url] = result.authorRepos
1152 Object.assign(pendingByAuthor, result.sitesByAuthor)
1153 continue
1154 }
10241155 if (isEchoExtensionList(json)) {
10251156 const result = loadEchoExtensionList(url, json)
10261157 sites[url] = { sites: result.sites }
@@ -1031,5 +1162,5 @@ export async function assembleSchemeData(
10311162 sites[url] = await toRepoData(url, json, fetchJson)
10321163 }
10331164 Object.assign(sites, pendingByAuthor)
1034 return { sites, echoAuthors, repoLists }
1165 return { sites, soraAuthors, echoAuthors, repoLists }
10351166}
docs/ext/extensionRepos/sora.data.ts added +10
@@ -0,0 +1,10 @@
1import { type ExtensionRepoData, loadScheme } from './shared'
2
3export declare const data: ExtensionRepoData
4
5export default {
6 watch: ['../../**/*.md'],
7 async load(): Promise<ExtensionRepoData> {
8 return loadScheme('sora')
9 }
10}
docs/ext/index.md +3
@@ -65,6 +65,9 @@ og:
6565 <Card title="Suwatte" href="/ext/suwatte">
6666 Manga & Novels
6767 </Card>
68 <Card title="Sora" href="/ext/sora">
69 Anime, Manga, Novels & Live Action
70 </Card>
6871</Deck>
6972
7073## Multi
docs/ext/sora.md added +19
@@ -0,0 +1,19 @@
1---
2title: Sora Extension Repos
3customDescription: Extension Repos for Sora
4feedback: no
5og:
6 image: /embed/ios.png
7---
8# Sora
9
10::: warning README
11Sora / Luna repos are mostly abandonware. Kept here because some apps still support them (for some reason). Best to move to better apps (or OS).
12:::
13
14::: extrepo {scheme=sora}
15
16== Sources
17- raw: https://kotatsu-83g.pages.dev/sora/index.json
18
19:::