Compare commits

...
Author SHA1 Message Date
Prayag Prajapati 3db6249f71 Add Updater UI #231 2023-12-10 14:21:56 +05:30
renovate[bot] 2926e845d2 fix(deps): update material-ui monorepo (#230)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-10 10:58:52 +05:30
Prayag Prajapati ec6d5850d0 Update version to 0.0.2 in latest.json for testing 2023-12-08 16:57:25 +05:30
Prayag Prajapati 72a9f2cd39 update latest.json 2023-12-08 16:40:10 +05:30
Prayag Prajapati 874646a6dc Update package.json 2023-12-08 15:33:57 +05:30
Prayag Prajapati d84073ee03 Update updater key and versioning 2023-12-08 15:32:56 +05:30
Prayag Prajapati abca22763c Add env to workflow 2023-12-08 15:04:31 +05:30
7 changed files with 162 additions and 7 deletions

No files matched your search

+1
View File
@@ -14,6 +14,7 @@ jobs:
matrix: matrix:
platform: [macos-latest, ubuntu-22.04, windows-latest] platform: [macos-latest, ubuntu-22.04, windows-latest]
runs-on: ${{ matrix.platform }} runs-on: ${{ matrix.platform }}
environment: TAURI
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
+19
View File
@@ -0,0 +1,19 @@
{
"version": "0.0.1",
"notes": "See the assets to download and install this version.",
"pub_date": "2023-12-08T10:15:47.030Z",
"platforms": {
"darwin-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVROHVTNk5NMHU2bWVlb2tUSWF6NlRYL0dDYWVHK2hhWVpHVjkyeTFLMU9uM01QS0RhQ0huTnpsNDY5eUpiaHIzRlJxS0tGT3VPTWNkWlJWNCtPaXRlWlljZ1VFeEpSNUE4PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzAyMDMwNDI0CWZpbGU6SmVsbHlQbGF5ZXIuYXBwLnRhci5negpzMEx6WDlybVJkTmM4cE1oQThYKzhKT1BsNUlGUjB1MnNGUk4rYXVkNVJMMmoySks4VGp4bTd3a2Jtbm1kTnh2TDFKTXFRZXMzbTQyeXh6L2h3WjBEQT09Cg==",
"url": "https://github.com/prayag17/JellyPlayer/releases/download/v0.0.1-dev%40874646a/JellyPlayer_x64.app.tar.gz"
},
"linux-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVROHVTNk5NMHU2bWNQRlIzaTlNa2l4dHRGQk1hcVNIRUI5Z0Z4L0lEMktIWmhRT0RlS2RHMjBib240NHNlTWltbGZFY242cTNLM2xlTFpMdVh3WWw5a240QnVYNjF0Z2dzPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzAyMDMwMzE0CWZpbGU6amVsbHktcGxheWVyXzAuMC4xX2FtZDY0LkFwcEltYWdlLnRhci5negpBQWhWcDhjZGJTdHYxSG95WUpYZE81WmFrWS8zeDYvNFJpYVRzV1ZKNnVNVXUvL3A0a21YOHV0aHFQR3cwU3Fka2ZNb2dYQkR6OHlIWTRtdnc3T2RCdz09Cg==",
"url": "https://github.com/prayag17/JellyPlayer/releases/download/v0.0.1-dev%40874646a/jelly-player_0.0.1_amd64.AppImage.tar.gz"
},
"windows-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVROHVTNk5NMHU2bVJSTzNJTklhOGFjZUlwTnlPa1d3Zk5WazRzcWUrV0RqSWlvM2ZIWjYweVQ0TWtJK3ZtWEVPdmorbFpMN2M4TDhLdmR4QlJjdDAzWjV2T2NqcTQ3MkFvPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzAyMDMwNTIzCWZpbGU6SmVsbHlQbGF5ZXJfMC4wLjFfeDY0X2VuLVVTLm1zaS56aXAKU054eGZNSDlKeHJsOEVyT0VoczU3TjdIWU9jWGNiVUxvTWRac0ZUdmtRZ1Q1QStqS0NUOVVSRHVaUGJkNDNpc3NUNTFDaWRMOS9VRit2WnFCbVRyRGc9PQo=",
"url": "https://github.com/prayag17/JellyPlayer/releases/download/v0.0.1-dev%40874646a/JellyPlayer_0.0.1_x64_en-US.msi.zip"
}
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "jellyplayer", "name": "jellyplayer",
"private": true, "private": true,
"version": "1.0.0", "version": "0.0.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "jellyplayer" name = "jellyplayer"
version = "1.0.0" version = "0.0.1"
description = "A Modern Jellyfin Client" description = "A Modern Jellyfin Client"
authors = ["prayag17", "JellyPlayer contributors (https://github.com/prayag17/JellyPlayer/graphs/contributors)"] authors = ["prayag17", "JellyPlayer contributors (https://github.com/prayag17/JellyPlayer/graphs/contributors)"]
license = "GPL-3.0-only" license = "GPL-3.0-only"
+4 -4
View File
@@ -8,7 +8,7 @@
}, },
"package": { "package": {
"productName": "JellyPlayer", "productName": "JellyPlayer",
"version": "1.0.0" "version": "0.0.1"
}, },
"tauri": { "tauri": {
"allowlist": { "allowlist": {
@@ -102,10 +102,10 @@
"updater": { "updater": {
"active": true, "active": true,
"endpoints": [ "endpoints": [
"https://cdn.jsdelivr.net/gh/prayag17/jellyplayer@latest/updater.json" "https://raw.githack.com/prayag17/JellyPlayer/main/latest.json"
], ],
"dialog": true, "dialog": false,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDE1MTczRTNFNjFGQ0JBOEMKUldTTXV2eGhQajRYRmNFSG5EYVF1VE1YaVA5Qjl2WGt6alFWOGo5UCs2SGprTGtNOC9WMC8wTjMK" "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDk5QkE0QjMzOEQyRUI5M0MKUldROHVTNk5NMHU2bVMvS3VNRWZHRzhuWE1TRlg3WHI1VHBtZjFvVy80alZ2UHc4T3BqcHVGOWwK"
}, },
"windows": [ "windows": [
{ {
+136
View File
@@ -16,6 +16,11 @@ import {
} from "react-router-dom"; } from "react-router-dom";
import { AnimatePresence, motion } from "framer-motion"; import { AnimatePresence, motion } from "framer-motion";
import {
checkUpdate,
installUpdate,
onUpdaterEvent,
} from "@tauri-apps/api/updater";
import { relaunch } from "@tauri-apps/api/process"; import { relaunch } from "@tauri-apps/api/process";
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api"; import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
@@ -34,6 +39,10 @@ import DialogTitle from "@mui/material/DialogTitle";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import Slide from "@mui/material/Slide"; import Slide from "@mui/material/Slide";
import LinearProgress from "@mui/material/LinearProgress"; import LinearProgress from "@mui/material/LinearProgress";
import IconButton from "@mui/material/IconButton";
import SvgIcon from "@mui/material/SvgIcon";
import Typography from "@mui/material/Typography";
import LoadingButton from "@mui/lab/LoadingButton";
// Routes // Routes
import { ServerSetup } from "./routes/setup/server"; import { ServerSetup } from "./routes/setup/server";
@@ -91,6 +100,7 @@ import { useQuery } from "@tanstack/react-query";
import { CircularProgress } from "@mui/material"; import { CircularProgress } from "@mui/material";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { useCentralStore } from "./utils/store/central.js"; import { useCentralStore } from "./utils/store/central.js";
import { useSnackbar } from "notistack";
const anim = { const anim = {
initial: { initial: {
@@ -158,6 +168,14 @@ const AnimationWrapper = () => {
); );
}; };
// const unlisten = await onUpdaterEvent(({ error, status }) => {
// // This will log all updater events, including status updates and errors.
// console.log("Updater event", error, status);
// });
// // you need to call unlisten if your handler goes out of scope, for example if the component is unmounted.
// unlisten();
function App() { function App() {
const [playbackDataLoading] = usePlaybackDataLoadStore((state) => [ const [playbackDataLoading] = usePlaybackDataLoadStore((state) => [
state.isPending, state.isPending,
@@ -204,6 +222,43 @@ function App() {
"a", "a",
], ],
}); });
const { enqueueSnackbar } = useSnackbar();
const [updateDialog, setUpdateDialog] = useState(false);
/**
* @type {[import("@tauri-apps/api/updater.js").UpdateManifest, React.Dispatch<import("@tauri-apps/api/updater.js").UpdateManifest>]}
*/
const [updateInfo, setUpdateInfo] = useState(null);
const [updateDialogButton, setUpdateDialogButton] = useState(false);
useEffect(() => {
async function checkForUpdates() {
try {
const { shouldUpdate, manifest } = await checkUpdate();
if (shouldUpdate) {
setUpdateInfo(manifest);
setUpdateDialog(true);
// You could show a dialog asking the user if they want to install the update here.
console.log(
`Installing update ${manifest?.version}, ${manifest?.date}, ${manifest?.body}`,
);
// Install the update. This will also restart the app on Windows!
// await installUpdate();
// On macOS and Linux you will need to restart the app manually.
// You could use this step to display another confirmation dialog.
// await relaunch();
}
} catch (error) {
console.error(error);
}
}
checkForUpdates();
}, []);
const [initialRoute] = useCentralStore((state) => [state.initialRoute]); const [initialRoute] = useCentralStore((state) => [state.initialRoute]);
@@ -237,6 +292,87 @@ function App() {
}} }}
/> />
)} )}
<Dialog
// open={false}
open={updateDialog}
// onClose={}
// maxWidth="md"
fullWidth
>
{Boolean(updateInfo) && (
<>
<DialogTitle>
Update Available!
<Typography
style={{
opacity: "0.5",
}}
>
v{updateInfo.version}
</Typography>
</DialogTitle>
<DialogContent dividers>
<DialogContentText>
{updateInfo.body}
</DialogContentText>
</DialogContent>
<DialogActions
style={{
padding: "1em",
}}
>
<IconButton
disabled={updateDialogButton}
>
<SvgIcon>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
viewBox="0 0 16 16"
>
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8" />
</svg>
</SvgIcon>
</IconButton>
<Button
size="large"
color="error"
variant="outlined"
disabled={updateDialogButton}
onClick={() =>
setUpdateDialog(false)
}
>
close
</Button>
<LoadingButton
size="large"
color="success"
variant="contained"
loading={updateDialogButton}
loadingIndicator="Updating..."
onClick={async () => {
setUpdateDialogButton(
true,
);
await installUpdate();
enqueueSnackbar(
"Update has been installed! You need to relaunch JellyPlayer.",
{
variant: "success",
},
);
await relaunch();
}}
>
Update
</LoadingButton>
</DialogActions>
</>
)}
</Dialog>
<Dialog <Dialog
open={easterEgg} open={easterEgg}
onClose={() => setEasterEgg(false)} onClose={() => setEasterEgg(false)}
-1
View File
@@ -1 +0,0 @@
{}