Skip to content

Commit

Permalink
🎨 Mirakurunの接続チェックURLをapi/statusに変更
Browse files Browse the repository at this point in the history
api/versionは外部疎通を必要とするため
  • Loading branch information
ci7lus committed Apr 21, 2022
1 parent 79c1b2b commit f2139cf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/components/contentPlayer/MirakurunManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ export const MirakurunManager: React.VFC<{}> = () => {
playingContent.contentType !== "Mirakurun") ||
isPlaying
try {
const version = await mirakurun.version.checkVersion()
const status = await mirakurun.status.getStatus()
let message: string
if (typeof version.data === "string") {
if (typeof status.data === "string") {
setCompatibility("Mirakc")
setVersion(version.data)
message = `Mirakc (${version.data})`
} else if (typeof version.data.current === "string") {
setVersion(status.data)
message = `Mirakc (${status.data})`
} else if (typeof status.data.version === "string") {
setCompatibility("Mirakurun")
setVersion(version.data.current || null)
message = `Mirakurun (${version.data.current})`
setVersion(status.data.version || null)
message = `Mirakurun (${status.data.version})`
} else {
throw new Error()
}
Expand Down

1 comment on commit f2139cf

@humiaozuzu
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ci7lus
Currently Mirakc do not implement /api/status API (will return an empty object) and this change will break Mirakc support
For Mirakc api docs:
https://github.com/mirakc/mirakc/blob/main/docs/web-api.md#apistatus

Please sign in to comment.