mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-20 03:29:50 +00:00
utils cleanup, initial static generation
This commit is contained in:
parent
ec8700f3e9
commit
e1a3a82f75
86 changed files with 279 additions and 261 deletions
|
@ -4,7 +4,7 @@ import { BsVolumeMuteFill, BsFillPlayFill, BsPauseFill, BsCpu, BsFillCpuFill } f
|
|||
import { MdOutlineSmartDisplay } from "react-icons/md";
|
||||
|
||||
import Widget from "components/services/widgets/widget";
|
||||
import { formatProxyUrl, formatProxyUrlWithSegments } from "utils/api-helpers";
|
||||
import { formatProxyUrl, formatProxyUrlWithSegments } from "utils/proxy/api-helpers";
|
||||
|
||||
function ticksToTime(ticks) {
|
||||
const milliseconds = ticks / 10000;
|
||||
|
@ -164,7 +164,7 @@ export default function Component({ service }) {
|
|||
async function handlePlayCommand(session, command) {
|
||||
const url = formatProxyUrlWithSegments(config, "PlayControl", {
|
||||
sessionId: session.Id,
|
||||
command
|
||||
command,
|
||||
});
|
||||
await fetch(url).then(() => {
|
||||
sessionMutate();
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
import genericProxyHandler from "utils/proxies/generic";
|
||||
import genericProxyHandler from "utils/proxy/handlers/generic";
|
||||
|
||||
const widget = {
|
||||
api: "{url}/emby/{endpoint}?api_key={key}",
|
||||
proxyHandler: genericProxyHandler,
|
||||
|
||||
mappings: {
|
||||
"Sessions": {
|
||||
Sessions: {
|
||||
endpoint: "Sessions",
|
||||
},
|
||||
"PlayControl": {
|
||||
PlayControl: {
|
||||
method: "POST",
|
||||
enpoint: "Sessions/{sessionId}/Playing/{command}",
|
||||
segments: ["sessionId", "command"]
|
||||
}
|
||||
segments: ["sessionId", "command"],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue