feat(player): drafting support for player
This commit is contained in:
parent
849b33f921
commit
4e41fdfcf3
1 changed files with 9 additions and 2 deletions
|
|
@ -10,6 +10,7 @@ import type {
|
|||
RawAdoptedSsInsertRule,
|
||||
RawAdoptedSsReplaceURLBased,
|
||||
RawAdoptedSsReplace,
|
||||
RawReplaceVcss,
|
||||
} from './raw'
|
||||
import type { TrackerMessage } from './tracker'
|
||||
import translate from './tracker'
|
||||
|
|
@ -64,6 +65,12 @@ const resolvers = {
|
|||
...msg,
|
||||
text: resolveCSS(msg.baseURL, msg.text),
|
||||
tp: "adopted_ss_replace"
|
||||
}),
|
||||
"replace_vcss_url_based": (msg: RawReplaceVcss): RawReplaceVcss =>
|
||||
({
|
||||
...msg,
|
||||
styles: resolveCSS(msg.baseURL, msg.styles),
|
||||
tp: "replace_vcss",
|
||||
})
|
||||
} as const
|
||||
|
||||
|
|
@ -84,7 +91,7 @@ export default class JSONRawMessageReader {
|
|||
readMessage(): RawMessage | null {
|
||||
let msg = this.messages.shift()
|
||||
if (!msg) { return null }
|
||||
const rawMsg = Array.isArray(msg)
|
||||
const rawMsg = Array.isArray(msg)
|
||||
? translate(msg)
|
||||
: legacyTranslate(msg)
|
||||
if (!rawMsg) {
|
||||
|
|
@ -97,4 +104,4 @@ export default class JSONRawMessageReader {
|
|||
return rawMsg
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue