Fold MediaEngine (media-backend, media-webui) into this repo
Per owner decision: MediaEngine (the Media product family's Go backend and SvelteKit frontend, previously its own repo referenced by 7 thin service repos via git submodule) is folded directly into shared/ as media-backend/ and media-webui/, rather than staying separate. media-backend/go.mod's replace directive now points at ../backend (a true sibling within this repo) instead of a vendored ../shared/backend copy, since there's no more nested vendoring - it's the real thing. Also moved MediaEngine's own CI (media-backend-lint.yml, media-backend-tests.yml) and dev tooling scripts (scripts/media/*, audit/lint/enforce scripts for the media-backend+media-webui content), fixing their path assumptions for the new layout, and dropped scripts/media/sync-shared.mjs (confirmed dead code, and now doubly obsolete since there's no more vendored shared/ subfolder for it to check). Added media:* script aliases to package.json for the moved tooling, namespaced to avoid colliding with this repo's own scripts. Also fixed sync-consumers.ps1's workspace-root resolution to walk up until it finds a directory containing both Original/ and Forks/, instead of assuming shared/ is always a direct child of the workspace root - it broke when shared/ moved from Web/shared to Web/Central/shared earlier in this same restructuring. Removed the now-obsolete Original/MediaEngine entry from its consumer list. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
79d9461769
commit
acde180086
99 files changed
+20488
-1
No files matched your search
@@ -0,0 +1,87 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state'
|
||||
import { getAppConfig, getPanelForPath, getPathForPanel } from '$lib/app-config'
|
||||
import AnalyzerWorkspace from '$lib/features/AnalyzerWorkspace.svelte'
|
||||
import ConfigWorkspace from '$lib/features/ConfigWorkspace.svelte'
|
||||
import DesktopWorkspace from '$lib/features/DesktopWorkspace.svelte'
|
||||
import FeedWorkspace from '$lib/features/FeedWorkspace.svelte'
|
||||
import KioskWorkspace from '$lib/features/KioskWorkspace.svelte'
|
||||
import MediaTypePipeline from '$lib/features/MediaTypePipeline.svelte'
|
||||
import ModeratorWorkspace from '$lib/features/ModeratorWorkspace.svelte'
|
||||
import ServantWorkspace from '$lib/features/ServantWorkspace.svelte'
|
||||
import TagsWorkspace from '$lib/features/TagsWorkspace.svelte'
|
||||
import VideoPage from '$lib/features/VideoPage.svelte'
|
||||
import ToolsWorkspace from '$lib/features/ToolsWorkspace.svelte'
|
||||
import ViewerWorkspace from '$lib/features/ViewerWorkspace.svelte'
|
||||
|
||||
const analyzerMediaTypePanels: Record<
|
||||
string,
|
||||
{ mediaType: 'image' | 'video' | 'audio' | 'funscript'; label: string }
|
||||
> = {
|
||||
images: { mediaType: 'image', label: 'Images' },
|
||||
videos: { mediaType: 'video', label: 'Videos' },
|
||||
audios: { mediaType: 'audio', label: 'Audios' },
|
||||
funscripts: { mediaType: 'funscript', label: 'Funscripts' },
|
||||
}
|
||||
|
||||
const app = getAppConfig(__MEDIA_APP__)
|
||||
const requestedPanel = $derived(page.url.searchParams.get('panel') || getPanelForPath(app, page.url.pathname))
|
||||
const panel = $derived(app.id === 'viewer' && requestedPanel === 'search' ? 'library' : requestedPanel)
|
||||
const videoId = $derived(app.id === 'viewer' ? getVideoId(page.url.pathname) : '')
|
||||
|
||||
function getVideoId(pathname: string) {
|
||||
const match = pathname.match(/^\/video\/([^/]+)\/?$/i)
|
||||
if (!match?.[1]) return ''
|
||||
try {
|
||||
return decodeURIComponent(match[1])
|
||||
} catch {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
$effect(() => {
|
||||
const legacyPanel = page.url.searchParams.get('panel')
|
||||
if (typeof window === 'undefined' || !legacyPanel || !app.nav.some((item) => item.panel === legacyPanel)) {
|
||||
return
|
||||
}
|
||||
|
||||
const query = Array.from(page.url.searchParams.entries())
|
||||
.filter(([key]) => key !== 'panel')
|
||||
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
|
||||
.join('&')
|
||||
const target = `${getPathForPanel(app, legacyPanel)}${query ? `?${query}` : ''}`
|
||||
const current = `${page.url.pathname}${page.url.search}`
|
||||
if (target !== current) {
|
||||
window.location.replace(target)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
{#if app.id === 'viewer' && videoId}
|
||||
<VideoPage id={videoId} />
|
||||
{:else if app.id === 'viewer' && panel === 'view'}
|
||||
<FeedWorkspace />
|
||||
{:else if app.id === 'viewer' && panel === 'tags'}
|
||||
<TagsWorkspace />
|
||||
{:else if app.id === 'viewer'}
|
||||
<ViewerWorkspace {panel} />
|
||||
{:else if app.id === 'analyzer' && panel in analyzerMediaTypePanels}
|
||||
<MediaTypePipeline
|
||||
mediaType={analyzerMediaTypePanels[panel].mediaType}
|
||||
label={analyzerMediaTypePanels[panel].label}
|
||||
/>
|
||||
{:else if app.id === 'tools'}
|
||||
<ToolsWorkspace {panel} />
|
||||
{:else if app.id === 'analyzer'}
|
||||
<AnalyzerWorkspace {panel} />
|
||||
{:else if app.id === 'config'}
|
||||
<ConfigWorkspace {panel} />
|
||||
{:else if app.id === 'moderator'}
|
||||
<ModeratorWorkspace {panel} />
|
||||
{:else if app.id === 'kiosk'}
|
||||
<KioskWorkspace {panel} />
|
||||
{:else if app.id === 'servant'}
|
||||
<ServantWorkspace {panel} />
|
||||
{:else}
|
||||
<DesktopWorkspace {panel} />
|
||||
{/if}
|
||||
Reference in new issue
Block a user