mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
utils cleanup, initial static generation
This commit is contained in:
@@ -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"],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user