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[] = [
264 link: '/ext/suwatte', 264 link: '/ext/suwatte',
265 section: 'Extensions' 265 section: 'Extensions'
266 }, 266 },
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 },
267 { 275 {
268 id: 'ext-hayase', 276 id: 'ext-hayase',
269 icon: ':lucide-puzzle:', 277 icon: ':lucide-puzzle:',
@@ -577,7 +585,8 @@ export const sidebar: DefaultTheme.Sidebar = [
577 { text: 'Aidoku', link: '/ext/aidoku' }, 585 { text: 'Aidoku', link: '/ext/aidoku' },
578 { text: 'Mana', link: '/ext/mana' }, 586 { text: 'Mana', link: '/ext/mana' },
579 { text: 'Paperback', link: '/ext/paperback' }, 587 { text: 'Paperback', link: '/ext/paperback' },
580 { text: 'Suwatte', link: '/ext/suwatte' } 588 { text: 'Suwatte', link: '/ext/suwatte' },
589 { text: 'Sora', link: '/ext/sora' }
581 ] 590 ]
582 }, 591 },
583 { 592 {
docs/.vitepress/theme/components/extrepo/ExtensionRepos.vue +3 −1
@@ -114,6 +114,7 @@ const statusTitle = computed(() => {
114}) 114})
115 115
116const repoData = computed(() => store.value?.sites ?? {}) 116const repoData = computed(() => store.value?.sites ?? {})
117const soraAuthors = computed(() => store.value?.soraAuthors ?? {})
117const echoAuthors = computed(() => store.value?.echoAuthors ?? {}) 118const echoAuthors = computed(() => store.value?.echoAuthors ?? {})
118const repoLists = computed(() => store.value?.repoLists ?? {}) 119const repoLists = computed(() => store.value?.repoLists ?? {})
119 120
@@ -143,7 +144,8 @@ const baseRepos = computed<Repo[]>(() => {
143const resolvedRepos = computed<Repo[]>(() => { 144const resolvedRepos = computed<Repo[]>(() => {
144 const result: Repo[] = [] 145 const result: Repo[] = []
145 for (const repo of baseRepos.value) { 146 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]
147 if (!authors?.length) { 149 if (!authors?.length) {
148 result.push(repo) 150 result.push(repo)
149 continue 151 continue
docs/.vitepress/theme/components/extrepo/SiteCell.vue +5 −1
@@ -15,7 +15,11 @@ const props = defineProps<{
15 scheme?: string 15 scheme?: string
16}>() 16}>()
17 17
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})
19 23
20async function copyInstallUrl() { 24async function copyInstallUrl() {
21 const value = copyTarget.value 25 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'])
53const NO_INSTALL_SCHEMES = new Set(['seanime']) 53const NO_INSTALL_SCHEMES = new Set(['seanime'])
54 54
55// Schemes with no install or copy action 55// Schemes with no install or copy action
56const BROWSE_ONLY_SCHEMES = new Set(['kotatsu', 'echo']) 56const BROWSE_ONLY_SCHEMES = new Set(['kotatsu', 'sora', 'echo'])
57 57
58const NO_COPY_SCHEMES = new Set(['suwatte', 'echo']) 58const NO_COPY_SCHEMES = new Set(['suwatte', 'echo'])
59 59
docs/.vitepress/theme/components/extrepo/useRepoStore.ts +2 −1
@@ -33,7 +33,7 @@ const schemeModules = import.meta.glob<{ data: ExtensionRepoData }>(
33) 33)
34 34
35function emptyData(): ExtensionRepoData { 35function emptyData(): ExtensionRepoData {
36 return { sites: {}, echoAuthors: {}, repoLists: {} } 36 return { sites: {}, soraAuthors: {}, echoAuthors: {}, repoLists: {} }
37} 37}
38 38
39// Never let a hung chunk or upstream fetch spin forever. 39// Never let a hung chunk or upstream fetch spin forever.
@@ -119,6 +119,7 @@ export function provideRepoStore(scheme: string): RepoStore {
119 } 119 }
120 store.value = { 120 store.value = {
121 sites: { ...sites, ...fresh.sites }, 121 sites: { ...sites, ...fresh.sites },
122 soraAuthors: { ...prev.soraAuthors, ...fresh.soraAuthors },
122 echoAuthors: { ...prev.echoAuthors, ...fresh.echoAuthors }, 123 echoAuthors: { ...prev.echoAuthors, ...fresh.echoAuthors },
123 repoLists: { ...prev.repoLists, ...fresh.repoLists } 124 repoLists: { ...prev.repoLists, ...fresh.repoLists }
124 } 125 }
docs/ext/extensionRepos/parsers.ts +132 −1
@@ -182,6 +182,36 @@ interface KotatsuIndex {
182 sites: KotatsuSite[] 182 sites: KotatsuSite[]
183} 183}
184 184
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
185interface EchoExtension { 215interface EchoExtension {
186 id: string 216 id: string
187 type: string 217 type: string
@@ -789,6 +819,98 @@ function loadEchoExtensionList(
789 } 819 }
790} 820}
791 821
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
792function toRepoDataLNReader(plugins: LNReaderPlugin[]): RepoSite[] { 914function toRepoDataLNReader(plugins: LNReaderPlugin[]): RepoSite[] {
793 const seen = new Set<string>() 915 const seen = new Set<string>()
794 const sites: RepoSite[] = [] 916 const sites: RepoSite[] = []
@@ -934,6 +1056,7 @@ async function toRepoData(
934 1056
935export interface ExtensionRepoData { 1057export interface ExtensionRepoData {
936 sites: Record<string, RepoData> 1058 sites: Record<string, RepoData>
1059 soraAuthors: Record<string, SoraAuthorRepo[]>
937 echoAuthors: Record<string, EchoAuthorRepo[]> 1060 echoAuthors: Record<string, EchoAuthorRepo[]>
938 repoLists: Record<string, RepoListEntry[]> 1061 repoLists: Record<string, RepoListEntry[]>
939} 1062}
@@ -945,6 +1068,7 @@ export async function assembleSchemeData(
945): Promise<ExtensionRepoData> { 1068): Promise<ExtensionRepoData> {
946 const listUrlSet = new Set(listUrls) 1069 const listUrlSet = new Set(listUrls)
947 const sites: Record<string, RepoData> = {} 1070 const sites: Record<string, RepoData> = {}
1071 const soraAuthors: Record<string, SoraAuthorRepo[]> = {}
948 const echoAuthors: Record<string, EchoAuthorRepo[]> = {} 1072 const echoAuthors: Record<string, EchoAuthorRepo[]> = {}
949 const repoLists: Record<string, RepoListEntry[]> = {} 1073 const repoLists: Record<string, RepoListEntry[]> = {}
950 const pendingByAuthor: Record<string, RepoData> = {} 1074 const pendingByAuthor: Record<string, RepoData> = {}
@@ -1021,6 +1145,13 @@ export async function assembleSchemeData(
1021 const url = remaining[i] 1145 const url = remaining[i]
1022 const json = jsons[i] 1146 const json = jsons[i]
1023 if (json === undefined) continue 1147 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 }
1024 if (isEchoExtensionList(json)) { 1155 if (isEchoExtensionList(json)) {
1025 const result = loadEchoExtensionList(url, json) 1156 const result = loadEchoExtensionList(url, json)
1026 sites[url] = { sites: result.sites } 1157 sites[url] = { sites: result.sites }
@@ -1031,5 +1162,5 @@ export async function assembleSchemeData(
1031 sites[url] = await toRepoData(url, json, fetchJson) 1162 sites[url] = await toRepoData(url, json, fetchJson)
1032 } 1163 }
1033 Object.assign(sites, pendingByAuthor) 1164 Object.assign(sites, pendingByAuthor)
1034 return { sites, echoAuthors, repoLists } 1165 return { sites, soraAuthors, echoAuthors, repoLists }
1035} 1166}
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:
65 <Card title="Suwatte" href="/ext/suwatte"> 65 <Card title="Suwatte" href="/ext/suwatte">
66 Manga & Novels 66 Manga & Novels
67 </Card> 67 </Card>
68 <Card title="Sora" href="/ext/sora">
69 Anime, Manga, Novels & Live Action
70 </Card>
68</Deck> 71</Deck>
69 72
70## Multi 73## 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:::