- fix(videcore): custom ass font
This commit is contained in:
5rahim
2025-12-23 16:07:48 +01:00
parent 187b5c636c
commit b66200f7d8
7 changed files with 51 additions and 24 deletions

View File

@@ -40,17 +40,18 @@ body:
options:
- Other
- Authentication
- Configuration
- Built-in Player
- Denshi (Desktop app)
- Anime Library
- Transcoding / Media Streaming
- Torrent Streaming
- Online Streaming
- Transcoding
- Manga
- Settings
- Offline mode
- AniList
- UI / Web Interface
- Denshi (Desktop app)
- User Interface
- Configuration (config.toml)
validations:
required: true
- type: textarea

View File

@@ -13,8 +13,12 @@ const (
MalClientId = "51cb4294feb400f3ddc66a30f9b9a00f"
DiscordApplicationId = "1224777421941899285"
AnilistApiUrl = "https://graphql.anilist.co"
)
const (
SeanimeRoomsApiUrl = "https://seanime.app/api/rooms"
SeanimeRoomsApiWsUrl = "wss://seanime.app/api/rooms"
SeanimeRoomsVersion = "1.0.0"
)
var DefaultExtensionMarketplaceURL = util.Decode("aHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzVyYWhpbS9zZWFuaW1lLWV4dGVuc2lvbnMvcmVmcy9oZWFkcy9tYWluL21hcmtldHBsYWNlLmpzb24=")

View File

@@ -55,13 +55,14 @@ func (m *Manager) RoomsAvailable() bool {
}
var createResp struct {
Status string `json:"status"`
Status string `json:"status"`
Version string `json:"version"`
}
if err := json.Unmarshal(resp.Bytes(), &createResp); err != nil {
return false
}
if createResp.Status != "healthy" {
if createResp.Status != "healthy" && createResp.Version != constants.SeanimeRoomsVersion {
return false
}
@@ -78,6 +79,11 @@ func (m *Manager) CreateAndJoinRoom() error {
return errors.New("host password not set")
}
// Check if Rooms API is available
if !m.RoomsAvailable() {
return errors.New("rooms API not available")
}
// Create room
room, err := m.createRoom(m.settings.HostPassword)
if err != nil {

View File

@@ -20,6 +20,7 @@ import { useServerStatus } from "@/app/(main)/_hooks/use-server-status"
import { useNakamaOnlineStreamWatchParty } from "@/app/(main)/onlinestream/_lib/handle-onlinestream"
import { clientIdAtom, websocketConnectedAtom } from "@/app/websocket-provider"
import { BetaBadge, ExperimentalBadge } from "@/components/shared/beta-badge"
import { ConfirmationDialog, useConfirmationDialog } from "@/components/shared/confirmation-dialog"
import { GlowingEffect } from "@/components/shared/glowing-effect"
import { SeaLink } from "@/components/shared/sea-link"
import { Badge } from "@/components/ui/badge"
@@ -293,6 +294,15 @@ export function NakamaManager() {
},
})
const confirmRoom = useConfirmationDialog({
title: "Create a Cloud Room",
description: "By continuing, you agree to broadcast your playback state through Seanime's servers to sync with peers only the room is active. You are limited to 10 rooms per day and 4 peers per room (subject to change).",
onConfirm: () => {
handleCreateRoom()
},
actionIntent: "white-glass",
})
return <>
<Modal
open={isModalOpen}
@@ -406,16 +416,16 @@ export function NakamaManager() {
<div className="flex items-center justify-between">
<div className="space-y-1">
<p className="font-bold">
Cloud Rooms <ExperimentalBadge />
Cloud Rooms <ExperimentalBadge title="Public Beta" />
</p>
<p className="text-sm text-[--muted] pr-4">
Cloud Rooms use Seanime's API to enable hosting a watch party without exposing your server to the
Cloud Rooms use Seanime's API to enable hosting watch parties without exposing your server to the
internet.
</p>
</div>
<Tooltip
trigger={<Button
onClick={handleCreateRoom}
onClick={confirmRoom.open}
disabled={isCreatingRoom}
size="sm"
intent="white-glass"
@@ -520,6 +530,8 @@ export function NakamaManager() {
</div>
)}
</Modal>
<ConfirmationDialog {...confirmRoom} />
</>
}

View File

@@ -653,7 +653,7 @@ Style: Default, Roboto Medium,24,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0
// devnote: jassub scales down to 30% of the og scale
// /jassub/blob/main/src/JASSUB.cpp#L709
const customStyle = {
let customStyle = {
Name: "CustomDefault",
FontName: DEFAULT_FONT_NAME, // opts.fontName || DEFAULT_FONT_NAME,
FontSize: vc_getSubtitleStyle(opts, "fontSize"),
@@ -682,10 +682,6 @@ Style: Default, Roboto Medium,24,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0
treat_fontname_as_pattern: 0,
}
// Apply the style override
this.libassRenderer.styleOverride(customStyle)
subtitleLog.info("Applied subtitle customization override", customStyle)
// Apply font change
// fontName can be something like "Noto Sans SC" or "Noto Sans SC.ttf"
if (opts.fontName) {
@@ -697,19 +693,27 @@ Style: Default, Roboto Medium,24,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0
// if the font is not already loaded, load it
const fontName = _fontName.split(".")[0]
if (this.fonts.includes(url)) {
subtitleLog.info("Setting default font to", fontName)
this.libassRenderer.setDefaultFont(fontName)
return
}
subtitleLog.info("Applying font change", url, ", setting default font to", fontName)
this.fonts.push(url)
this.libassRenderer.addFont(url)
if (!this.fonts.includes(url)) {
subtitleLog.info("Adding font", fontName)
// this.libassRenderer.setDefaultFont(fontName)
this.fonts.push(url)
this.libassRenderer.addFont(url)
}
this.libassRenderer!.setDefaultFont(fontName)
customStyle.FontName = fontName
// Apply the style override
this.libassRenderer.styleOverride(customStyle)
this.libassRenderer.resize()
} else {
this.libassRenderer.setDefaultFont(DEFAULT_FONT_NAME)
// Apply the style override
this.libassRenderer.styleOverride(customStyle)
}
subtitleLog.info("Applied subtitle customization override", customStyle)
}
private __eventMapKey(event: MKVParser_SubtitleEvent): string {

View File

@@ -16,8 +16,8 @@ export function AlphaBadge({ className, ...props }: Props) {
}
export function ExperimentalBadge({ className, ...props }: Props) {
export function ExperimentalBadge({ className, title = "Experimental", ...props }: Props) {
return (
<Badge intent="warning" size="sm" className={cn("align-middle ml-2 border-transparent", className)} {...props}>Experimental</Badge>
<Badge intent="warning" size="sm" className={cn("align-middle ml-2 border-transparent", className)} {...props}>{title}</Badge>
)
}

View File

@@ -325,7 +325,7 @@ function flattenColorPalette(colors: Colors) {
result[`${root}${parent === "DEFAULT" ? "" : `-${parent}`}`] = value
}
} else {
result[root] = children
result[root] = children as any
}
}