Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb89093c0d | ||
|
|
b0a32c67cc | ||
|
|
39e4a1e5be | ||
|
|
22ef458b35 | ||
|
|
4cdc2c8018 | ||
|
|
5ae76818ef | ||
|
|
ff5fc5a149 | ||
|
|
9251a3518e | ||
|
|
737df84488 | ||
|
|
2ee2de5fe1 | ||
|
|
16146e5e46 | ||
|
|
16c6885bcb | ||
|
|
eeb9a5f9a8 | ||
|
|
9cd22577a4 | ||
|
|
063c3e98e8 | ||
|
|
68c88068f6 | ||
|
|
ac95c1711c | ||
|
|
d5e8229ad5 | ||
|
|
8786288906 | ||
|
|
a80353bcf2 | ||
|
|
39be8b5037 | ||
|
|
eaca1d64fe | ||
|
|
599bdabf29 | ||
|
|
455a499670 | ||
|
|
eb482c180e | ||
|
|
0493598d48 | ||
|
|
754d679ea5 | ||
|
|
ea2e0a6b1c | ||
|
|
81a2135254 | ||
|
|
1447e0033a | ||
|
|
f13533dfc6 | ||
|
|
9d28aaae96 | ||
|
|
778c8f8039 | ||
|
|
7519b04cf0 | ||
|
|
0e7e280a8d | ||
|
|
f25c170023 | ||
|
|
3f8d920aac | ||
|
|
4c8812d0fe | ||
|
|
faf3dc2a48 | ||
|
|
b155daa83b | ||
|
|
bf89f35ddd | ||
|
|
e13940b015 | ||
|
|
f44a3dc5b1 |
No files matched your search
@@ -2,119 +2,119 @@
|
||||
|
||||
name: Continuous Integration
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
|
||||
jobs:
|
||||
build_web:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
build_web:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
name: Install pnpm
|
||||
with:
|
||||
version: 7
|
||||
run_install: false
|
||||
- uses: pnpm/action-setup@v3
|
||||
name: Install pnpm
|
||||
with:
|
||||
version: 7
|
||||
run_install: false
|
||||
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/cache@v4
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
- uses: actions/cache@v4
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Sync node version and setup cache
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
cache: "pnpm"
|
||||
- name: Sync node version and setup cache
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --no-frozen-lockfile
|
||||
- name: Install dependencies
|
||||
run: pnpm install --no-frozen-lockfile
|
||||
|
||||
# - name: Lint
|
||||
# run: pnpm run lint
|
||||
# - name: Lint
|
||||
# run: pnpm run lint
|
||||
|
||||
- name: Build
|
||||
run: pnpm run build
|
||||
- name: Build
|
||||
run: pnpm run build
|
||||
|
||||
build:
|
||||
needs: build_web
|
||||
# Prevent forked PRs from running the build job which is expensive
|
||||
if: github.repository == 'prayag17/JellyPlayer'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [macos-latest, ubuntu-22.04, windows-latest]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
environment: TAURI
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
build:
|
||||
needs: build_web
|
||||
# Prevent forked PRs from running the build job which is expensive
|
||||
if: github.repository == 'prayag17/JellyPlayer'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [macos-latest, ubuntu-22.04, windows-latest]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
environment: TAURI
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies (ubuntu only)
|
||||
if: matrix.platform == 'ubuntu-22.04'
|
||||
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev librsvg2-dev
|
||||
- name: Install dependencies (ubuntu only)
|
||||
if: matrix.platform == 'ubuntu-22.04'
|
||||
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev librsvg2-dev
|
||||
|
||||
- name: Rust setup
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: Rust setup
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Rust cache
|
||||
uses: swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: "./src-tauri -> target"
|
||||
- name: Rust cache
|
||||
uses: swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: "./src-tauri -> target"
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
name: Install pnpm
|
||||
with:
|
||||
version: 7
|
||||
run_install: false
|
||||
- uses: pnpm/action-setup@v3
|
||||
name: Install pnpm
|
||||
with:
|
||||
version: 7
|
||||
run_install: false
|
||||
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/cache@v4
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
- uses: actions/cache@v4
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Sync node version and setup cache
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
cache: "pnpm"
|
||||
- name: Sync node version and setup cache
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --no-frozen-lockfile
|
||||
- name: Install dependencies
|
||||
run: pnpm install --no-frozen-lockfile
|
||||
|
||||
- name: Build app
|
||||
run: pnpm run tauri build --bundles "deb" "appimage" "nsis" "app" "dmg"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
|
||||
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
||||
- name: Build app
|
||||
run: pnpm run tauri build --bundles "deb" "appimage" "nsis" "app" "dmg"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
|
||||
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
||||
|
||||
- name: Upload build Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: JellyPlayer-${{ matrix.platform }}-dev${{ github.sha }}
|
||||
path: src-tauri/target/release/bundle/*
|
||||
- name: Upload build Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: JellyPlayer-${{ matrix.platform }}-dev${{ github.sha }}
|
||||
path: src-tauri/target/release/bundle/*
|
||||
@@ -2,77 +2,77 @@
|
||||
|
||||
name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [macos-latest, ubuntu-22.04, windows-latest]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
environment: TAURI
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
release:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [macos-latest, ubuntu-22.04, windows-latest]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
environment: TAURI
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies (ubuntu only)
|
||||
if: matrix.platform == 'ubuntu-22.04'
|
||||
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev librsvg2-dev
|
||||
- name: Install dependencies (ubuntu only)
|
||||
if: matrix.platform == 'ubuntu-22.04'
|
||||
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev librsvg2-dev
|
||||
|
||||
- name: Rust setup
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: Rust setup
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Rust cache
|
||||
uses: swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: "./src-tauri -> target"
|
||||
- name: Rust cache
|
||||
uses: swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: "./src-tauri -> target"
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
name: Install pnpm
|
||||
with:
|
||||
version: 7
|
||||
run_install: false
|
||||
- uses: pnpm/action-setup@v3
|
||||
name: Install pnpm
|
||||
with:
|
||||
version: 7
|
||||
run_install: false
|
||||
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/cache@v4
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
- uses: actions/cache@v4
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Sync node version and setup cache
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
cache: "pnpm" # Set this to npm, yarn or pnpm.
|
||||
- name: Sync node version and setup cache
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
cache: "pnpm" # Set this to npm, yarn or pnpm.
|
||||
|
||||
- name: Install app dependencies and build web
|
||||
# Remove `&& yarn build` if you build your frontend in `beforeBuildCommand`
|
||||
run: pnpm install --no-frozen-lockfile && pnpm run build # Change this to npm, yarn or pnpm.
|
||||
- name: Install app dependencies and build web
|
||||
# Remove `&& yarn build` if you build your frontend in `beforeBuildCommand`
|
||||
run: pnpm install --no-frozen-lockfile && pnpm run build # Change this to npm, yarn or pnpm.
|
||||
|
||||
- name: Build the app
|
||||
uses: tauri-apps/tauri-action@dev
|
||||
- name: Build the app
|
||||
uses: tauri-apps/tauri-action@dev
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
|
||||
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
||||
with:
|
||||
tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
|
||||
releaseName: "App Name v__VERSION__" # tauri-action replaces \_\_VERSION\_\_ with the app version.
|
||||
releaseBody: "See the assets to download and install this version."
|
||||
releaseDraft: true
|
||||
prerelease: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
|
||||
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
||||
with:
|
||||
tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
|
||||
releaseName: "App Name v__VERSION__" # tauri-action replaces \_\_VERSION\_\_ with the app version.
|
||||
releaseBody: "See the assets to download and install this version."
|
||||
releaseDraft: true
|
||||
prerelease: false
|
||||
@@ -0,0 +1,12 @@
|
||||
- # v0.0.5-dev
|
||||
> **Note** : This is an unstable release
|
||||
- feat(web): Add new About page (#258) by @prayag17
|
||||
- feat(web): Allow managing servers from settings dialog by @prayag17
|
||||
- feat(search): Add Episode to search by @prayag17
|
||||
- feat(settings-server): Add a refretch button by @prayag17
|
||||
- feat(web): Add a global query fetch/mutation status by @prayag17
|
||||
- fix(server): Use redirect instead of relaunch when changing or deleting a server by @prayag17
|
||||
- refactor(player): Rewrite and improve video playback by @prayag17
|
||||
- feat(web): Use season backdrop in series page if available by @prayag17
|
||||
- feat(player): Allow selecting subtitles during playback by @prayag17
|
||||
- feat(ui): Add new episode layout by @prayag17
|
||||
@@ -3,7 +3,7 @@
|
||||
# 📝 Prerequisites
|
||||
|
||||
- Nodejs (≥19.1.0)
|
||||
- Rust (≥1.66.1)
|
||||
- Rust (≥1.76.0)
|
||||
- Visual Studio C++ Build tools
|
||||
- [pnpm](https://pnpm.io/)
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
{
|
||||
"version": "0.0.3-dev",
|
||||
"notes": "- Updated home carousel.\n- Removed sidemenu\n- Updated appBar\n- Update Notices",
|
||||
"pub_date": "2023-12-31T11:58:58.485Z",
|
||||
"platforms": {
|
||||
"darwin-x86_64": {
|
||||
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVROHVTNk5NMHU2bVhtQVFqQmJIbldTQ3F1YktNNWd4MkltMkF1b2pGQmc2Q3RmWlFnZGE0K2FSNmpkczUzNEEzZ1p3dDBBWldSZk15SDYrcE9ub0tUZG1uOVlvMnlwMWdFPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzA0MDIzNTA1CWZpbGU6SmVsbHlQbGF5ZXIuYXBwLnRhci5nego2M0NPUElEZzdjaUdaeDVMYm8rSTVRYTdncFA1YnNOMHpBd0wyS2JOaHhVeWhKM0lUaEN3TWw1RU1vQm5VYlgyQkZma2x1alpKY1pPSHhuSUx5Q1RCUT09Cg==",
|
||||
"url": "https://github.com/prayag17/JellyPlayer/releases/download/v0.0.3-dev/JellyPlayer_x64.app.tar.gz"
|
||||
},
|
||||
"linux-x86_64": {
|
||||
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVROHVTNk5NMHU2bVY2aHRVL0Y2d09SL2sxZGhsUzNxQmF1NVR1c2h2cUpJYVFrRkU2N3JqWGU3aEhBYnJuK0NpdDlpRlBadW9HT1B5MDhjMTE1TURyTnRBQ2FmVUJvd2dBPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzA0MDIzNjQ4CWZpbGU6amVsbHktcGxheWVyXzAuMC4zLWRldl9hbWQ2NC5BcHBJbWFnZS50YXIuZ3oKRXd4dHhGUmd6Rm1ZeGEwcUdHd2NDNTdRS1d0ZWo0aWpwYS85SlFxa3ZyMW9VNm9McCtlRjlmN1N4dWcxck5oMWhoM0Y4L2xHZ2hQOXNockFyL3FYQUE9PQo=",
|
||||
"url": "https://github.com/prayag17/JellyPlayer/releases/download/v0.0.3-dev/jelly-player_0.0.3-dev_amd64.AppImage.tar.gz"
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVROHVTNk5NMHU2bWE3TlYzV1NOK2NMK25lamlCY21RQkFMem9nK0E0bTlITWUyQm1xZzg0aEhwS0dvUURtN2pRcG1iczMwUHhIbU0vOUFaQkFSL1lHT3VLRnh5Q3VZVFFZPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzA0MDIzOTMxCWZpbGU6SmVsbHlQbGF5ZXJfMC4wLjMtZGV2X3g2NC1zZXR1cC5uc2lzLnppcApLN1V6aDN4Qndtb0NaQVlGOENIQ0pyTDJRd0NianRYZGxKanR3TU9IUWxTRE5TVW9mNWVPdkdyQkxudkRJY3ZzOU4wSnlmaWVmSWJYNFBKYUdpUG1CZz09Cg==",
|
||||
"url": "https://github.com/prayag17/JellyPlayer/releases/download/v0.0.3-dev/JellyPlayer_0.0.3-dev_x64-setup.nsis.zip"
|
||||
}
|
||||
}
|
||||
"version": "0.0.4-dev",
|
||||
"notes": "\n## What's Changed\n* refactor(web): update to typescript, cleanup small bugs + workspace by @dan-online in [#244](https://github.com/prayag17/JellyPlayer/pull/244)\n* feat(user): store `accessToken` over password by @dan-online in [#247](https://github.com/prayag17/JellyPlayer/pull/247)\n* fix(queries): staleTime and invalidating cache by @dan-online in [#248](https://github.com/prayag17/JellyPlayer/pull/248)\n* refactor: use `crypto.randomUUID` vs `uuid.v4` by @dan-online in [#249](https://github.com/prayag17/JellyPlayer/pull/249)\n* style(icons): only use the rounded css by @dan-online in [#250](https://github.com/prayag17/JellyPlayer/pull/250)\n* feat: quick connect by @dan-online in [#251](https://github.com/prayag17/JellyPlayer/pull/251)\n* feat: add new itemDetail Pages by @prayag17 in [#243](https://github.com/prayag17/issue/243)\n* feat: Auto focus search input in search route when opened initially by @prayag17\n* feat: Improved Login page ui by @prayag17\n* refactor: improve error boundary component\n## New Contributors\n* @dan-online made their first contribution in [#244](https://github.com/prayag17/JellyPlayer/pull/244)\n**Full Changelog**: [v0.0.3-dev...v0.0.4-dev](https://github.com/prayag17/JellyPlayer/compare/v0.0.3-dev...v0.0.4-dev)",
|
||||
"pub_date": "2024-01-23T17:12:09.705Z",
|
||||
"platforms": {
|
||||
"linux-x86_64": {
|
||||
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVROHVTNk5NMHU2bVordkFWa21Fa2ZJTUFRcElHbmxFWlJFY29IdHg2WTZaeTRxbXNuUy9lMmI1MWEwSEtIa0FUN09WTjlKZDZiMHVWUEFPV0lneE9TWG53dis0K0hpdUFVPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzA2MDI5NjgxCWZpbGU6amVsbHktcGxheWVyXzAuMC40LWRldl9hbWQ2NC5BcHBJbWFnZS50YXIuZ3oKeDFiSzBtalVnYjlweUV5RElYeHlrZDRxS2tMQXFLZ3RmUkkveUVEQjhoSkp5ZmJCdEJlKzMza3lBdFRvMzVJZUhkUmdMejVBZGFvSEgwL2h2VnRZRHc9PQo=",
|
||||
"url": "https://github.com/prayag17/JellyPlayer/releases/download/v0.0.4-dev/jelly-player_0.0.4-dev_amd64.AppImage.tar.gz"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVROHVTNk5NMHU2bVRxQlpMUGxUcjhZYWVmSWllK2JQYXFTVnVaZGxCQnNaL1J5ekVnSitUOVhWdjVBeEFQUHJXOER4bTI2Q0ZsWFYvSWNVK0FOSFE4M0U1VjNTRzFVOEF3PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzA2MDI5Nzg0CWZpbGU6SmVsbHlQbGF5ZXIuYXBwLnRhci5negpkT2VmTmNjRG1hWjBYNUV3UUh4OG1KM1BRdHVvUTBrZWZ5NlhMOWx5U0YvZURZcUUzeVVFbFNDV2JzaDAyVThtZk9NV1lwSXozQjYyekNKY2hXVjdCdz09Cg==",
|
||||
"url": "https://github.com/prayag17/JellyPlayer/releases/download/v0.0.4-dev/JellyPlayer_x64.app.tar.gz"
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVROHVTNk5NMHU2bWVHdGR2NTB1SDF5Vk5rN3ZyTXpybW5rMktsZmlwbVAxK2ZEMHltWndCdG9qUmpQNlNnaGcwdUdRVW1NeUJ3VmRPK1hFTFdLcWpINWZrdzBBYlBFUkFNPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzA2MDI5OTIyCWZpbGU6SmVsbHlQbGF5ZXJfMC4wLjQtZGV2X3g2NC1zZXR1cC5uc2lzLnppcApDWlpoYVd2enE5dDRhblV4R1g3djJtSzBTTlR1MXRIMHFVbTRYb3dIalZ0U0ozRlg1eXdjcHMrU1gwWGtuL24vNnI5UWRZdVNKSnF5Z0JycDNwcy9DQT09Cg==",
|
||||
"url": "https://github.com/prayag17/JellyPlayer/releases/download/v0.0.4-dev/JellyPlayer_0.0.4-dev_x64-setup.nsis.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jellyplayer",
|
||||
"private": true,
|
||||
"version": "0.0.4-dev",
|
||||
"version": "0.0.5-dev",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -12,53 +12,58 @@
|
||||
"lint:fix": "biome check --apply src/**/*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.11.3",
|
||||
"@emotion/react": "^11.11.4",
|
||||
"@emotion/styled": "^11.11.0",
|
||||
"@fontsource-variable/jetbrains-mono": "^5.0.19",
|
||||
"@fontsource/noto-sans": "^5.0.18",
|
||||
"@fontsource-variable/jetbrains-mono": "^5.0.20",
|
||||
"@fontsource/noto-sans": "^5.0.21",
|
||||
"@jellyfin/sdk": "0.8.2",
|
||||
"@mui/lab": "5.0.0-alpha.162",
|
||||
"@mui/material": "^5.15.6",
|
||||
"@tanstack/react-query": "^5.17.19",
|
||||
"@tanstack/react-query-devtools": "^5.17.21",
|
||||
"@mui/lab": "5.0.0-alpha.168",
|
||||
"@mui/material": "^5.15.13",
|
||||
"@tanem/react-nprogress": "^5.0.51",
|
||||
"@tanstack/react-query": "^5.28.4",
|
||||
"@tanstack/react-query-devtools": "^5.28.4",
|
||||
"@tauri-apps/api": "^1.5.3",
|
||||
"@types/node": "^20.11.5",
|
||||
"@types/react": "^18.2.48",
|
||||
"@types/react-dom": "^18.2.18",
|
||||
"axios": "^1.6.5",
|
||||
"@types/node": "^20.11.28",
|
||||
"@types/react": "^18.2.66",
|
||||
"@types/react-dom": "^18.2.22",
|
||||
"axios": "^1.6.8",
|
||||
"axios-tauri-api-adapter": "^0.2.1",
|
||||
"blurhash": "^2.0.5",
|
||||
"events": "^3.3.0",
|
||||
"framer-motion": "^11.0.2",
|
||||
"material-symbols": "^0.14.5",
|
||||
"framer-motion": "^11.0.14",
|
||||
"jassub": "^1.7.15",
|
||||
"material-symbols": "^0.17.0",
|
||||
"million": "^3.0.6",
|
||||
"notistack": "^3.0.1",
|
||||
"react": "^18.2.0",
|
||||
"react-blurhash": "^0.3.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-error-boundary": "^4.0.12",
|
||||
"react-error-boundary": "^4.0.13",
|
||||
"react-markdown": "^9.0.1",
|
||||
"react-multi-carousel": "^2.8.4",
|
||||
"react-player": "^2.14.1",
|
||||
"react-router-dom": "^6.21.3",
|
||||
"react-player": "^2.15.1",
|
||||
"react-router-dom": "^6.22.3",
|
||||
"react-use-konami": "^1.1.0",
|
||||
"remark-gfm": "^4.0.0",
|
||||
"rx-player": "^4.0.0",
|
||||
"shaka-player": "^4.7.11",
|
||||
"tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log#v1",
|
||||
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
|
||||
"typescript": "^5.3.3",
|
||||
"typescript": "^5.4.2",
|
||||
"vite-plugin-svgr": "^4.2.0",
|
||||
"wavesurfer.js": "^7.6.5",
|
||||
"zustand": "^4.5.0"
|
||||
"wavesurfer.js": "^7.7.5",
|
||||
"zustand": "^4.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.5.3",
|
||||
"@tauri-apps/cli": "^1.5.9",
|
||||
"@biomejs/biome": "^1.6.1",
|
||||
"@tauri-apps/cli": "^1.5.11",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-plugin-react": "^7.33.2",
|
||||
"eslint-plugin-react-refresh": "^0.4.5",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-react": "^7.34.1",
|
||||
"eslint-plugin-react-refresh": "^0.4.6",
|
||||
"prop-types": "^15.8.1",
|
||||
"sass": "^1.70.0",
|
||||
"vite": "^5.0.12",
|
||||
"sass": "^1.72.0",
|
||||
"vite": "^5.1.6",
|
||||
"vite-plugin-compression": "^0.5.1"
|
||||
},
|
||||
"license": "GPL-3.0-only"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "jellyplayer"
|
||||
version = "0.0.4-dev"
|
||||
version = "0.0.5-dev"
|
||||
description = "A Modern Jellyfin Client"
|
||||
authors = ["prayag17", "JellyPlayer contributors (https://github.com/prayag17/JellyPlayer/graphs/contributors)"]
|
||||
license = "GPL-3.0-only"
|
||||
@@ -18,7 +18,7 @@ tauri-build = { version = "1.5.1", features = [] }
|
||||
log = "^0.4.20"
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "1.5.4", features = [ "updater", "http-all", "devtools", "process-exit", "process-relaunch", "shell-all", "window-set-fullscreen", "http-all"] }
|
||||
tauri = { version = "1.6.1", features = [ "window-all", "updater", "http-all", "process-exit", "process-relaunch", "shell-all", "http-all"] }
|
||||
tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
|
||||
tauri-plugin-localhost = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
|
||||
tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1", features = ["colored"] }
|
||||
|
||||
@@ -39,7 +39,7 @@ fn main() {
|
||||
.build(),
|
||||
)
|
||||
.plugin(tauri_plugin_store::Builder::default().build())
|
||||
.plugin(tauri_plugin_window_state::Builder::default().build())
|
||||
// .plugin(tauri_plugin_window_state::Builder::default().build())
|
||||
.run(context)
|
||||
.expect("error while running JellyPlayer");
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "JellyPlayer",
|
||||
"version": "0.0.4-dev"
|
||||
"version": "../package.json"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
@@ -19,6 +19,7 @@
|
||||
"relaunchDangerousAllowSymlinkMacos": false
|
||||
},
|
||||
"window": {
|
||||
"all": true,
|
||||
"setFullscreen": true
|
||||
},
|
||||
"shell": {
|
||||
@@ -46,7 +47,7 @@
|
||||
"icons/icon.ico"
|
||||
],
|
||||
"identifier": "com.jellyplayer.prayag17",
|
||||
"longDescription": "A Modern Jellyfin Client for Jellyfin",
|
||||
"longDescription": "A modern desktop client for Jellyfin",
|
||||
"macOS": {
|
||||
"entitlements": null,
|
||||
"exceptionDomain": "",
|
||||
@@ -55,7 +56,7 @@
|
||||
"signingIdentity": null
|
||||
},
|
||||
"resources": [],
|
||||
"shortDescription": "A Modern Jellyfin Client for Jellyfin",
|
||||
"shortDescription": "JellyPlayer",
|
||||
"targets": ["deb", "appimage", "nsis", "app", "dmg", "updater"],
|
||||
"windows": {
|
||||
"certificateThumbprint": null,
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
|
||||
import { relaunch } from "@tauri-apps/api/process";
|
||||
import {
|
||||
UpdateManifest,
|
||||
type UpdateManifest,
|
||||
checkUpdate,
|
||||
installUpdate,
|
||||
} from "@tauri-apps/api/updater";
|
||||
@@ -56,11 +56,10 @@ import {
|
||||
UserLoginManual,
|
||||
} from "./routes/login";
|
||||
import PersonTitlePage from "./routes/person/index.jsx";
|
||||
import { VideoPlayer } from "./routes/player/videoPlayer.jsx";
|
||||
import VideoPlayer from "./routes/player/videoPlayer";
|
||||
import PlaylistTitlePage from "./routes/playlist/index.jsx";
|
||||
import SearchPage from "./routes/search";
|
||||
import SeriesTitlePage from "./routes/series/index.jsx";
|
||||
import Settings from "./routes/settings";
|
||||
import { ServerSetup } from "./routes/setup/server";
|
||||
import ServerList from "./routes/setup/serverList/index.jsx";
|
||||
|
||||
@@ -108,6 +107,14 @@ import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { ErrorBoundary } from "react-error-boundary";
|
||||
|
||||
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
|
||||
import {
|
||||
useIsFetching,
|
||||
useIsMutating,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import NProgress from "./components/nProgress";
|
||||
import Settings from "./components/settings";
|
||||
import { EasterEgg } from "./components/utils/easterEgg.jsx";
|
||||
import { handleRelaunch } from "./utils/misc/relaunch";
|
||||
import {
|
||||
@@ -117,8 +124,8 @@ import {
|
||||
getServer,
|
||||
setDefaultServer,
|
||||
} from "./utils/storage/servers";
|
||||
import { UserStore, delUser, getUser } from "./utils/storage/user";
|
||||
import { createApi, useApi } from "./utils/store/api";
|
||||
import { type UserStore, delUser, getUser } from "./utils/storage/user";
|
||||
import { axiosClient, createApi, useApi } from "./utils/store/api";
|
||||
|
||||
const handleAuthError = async () => {
|
||||
await delUser();
|
||||
@@ -158,6 +165,15 @@ const init = async () => {
|
||||
|
||||
const userOnDisk = await getUser();
|
||||
createApi(defaultServerInfo.address, "");
|
||||
try {
|
||||
const api = useApi.getState();
|
||||
const ping = await getSystemApi(api.api).getPingSystem();
|
||||
// const ping = await fetch("http://192.168.29.60:8096/System/Ping");
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
setInitialRoute("/error");
|
||||
return;
|
||||
}
|
||||
|
||||
if (userOnDisk) {
|
||||
try {
|
||||
@@ -216,7 +232,6 @@ function App() {
|
||||
|
||||
return <AppReady />;
|
||||
}
|
||||
|
||||
function AppReady() {
|
||||
const [audioPlayerVisible] = useAudioPlayback((state) => [state.display]);
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
@@ -240,9 +255,10 @@ function AppReady() {
|
||||
undefined,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
window.scrollTo(0, 0);
|
||||
}, [location.key]);
|
||||
const isQueryFetching = useIsFetching();
|
||||
const isMutating = useIsMutating();
|
||||
|
||||
useEffect(() => window.scrollTo(0, 0), [location.key]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
async function checkForUpdates() {
|
||||
@@ -280,18 +296,8 @@ function AppReady() {
|
||||
return (
|
||||
<SnackbarProvider maxSnack={5}>
|
||||
<ThemeProvider theme={theme}>
|
||||
{playbackDataLoading && (
|
||||
<LinearProgress
|
||||
sx={{
|
||||
position: "fixed",
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
width: "100vw",
|
||||
zIndex: 100000,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<CssBaseline />
|
||||
<NProgress isAnimating={isQueryFetching || isMutating} />
|
||||
<Dialog
|
||||
open={updateDialog}
|
||||
fullWidth
|
||||
@@ -303,6 +309,11 @@ function AppReady() {
|
||||
border: "1px solid rgb(255 255 255 / 0.2)",
|
||||
},
|
||||
}}
|
||||
sx={{
|
||||
"& img": {
|
||||
width: "100%",
|
||||
},
|
||||
}}
|
||||
>
|
||||
{updateInfo !== undefined && (
|
||||
<>
|
||||
@@ -387,6 +398,8 @@ function AppReady() {
|
||||
</>
|
||||
)}
|
||||
</Dialog>
|
||||
|
||||
<Settings />
|
||||
<EasterEgg />
|
||||
|
||||
{/* Show Dialog if server not reachable */}
|
||||
@@ -432,80 +445,83 @@ function AppReady() {
|
||||
transition: "padding 250ms",
|
||||
}}
|
||||
>
|
||||
<CssBaseline />
|
||||
{/* <SideMenu /> */}
|
||||
<AppBar />
|
||||
<AudioPlayer key={audioPlayerVisible} />
|
||||
{audioPlayerVisible && <AudioPlayer />}
|
||||
<ErrorBoundary FallbackComponent={ErrorNotice} key={location.key}>
|
||||
<Routes location={location}>
|
||||
{/* <Route
|
||||
// key={location.key}
|
||||
element={<AnimationWrapper />}
|
||||
> */}
|
||||
<Route path="/" element={<Navigate to={initialRoute} />} />
|
||||
<Route
|
||||
path="/error"
|
||||
element={
|
||||
<Dialog
|
||||
open
|
||||
onClose={handleRelaunch}
|
||||
aria-labelledby="alert-dialog-text"
|
||||
aria-describedby="alert-dialog-desc"
|
||||
maxWidth="md"
|
||||
>
|
||||
<DialogTitle id="alert-dialog-text">
|
||||
Unable to reach server
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<DialogContentText id="alert-dialog-desc">
|
||||
Unable to connect to the jellyfin server.
|
||||
</DialogContentText>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => navigate("/servers/list")}>
|
||||
Change Server
|
||||
</Button>
|
||||
<Button variant="outlined" onClick={handleRelaunch}>
|
||||
Restart JellyPlayer
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
}
|
||||
/>
|
||||
<Route path="/login/index" element={<LoginRoute />} />
|
||||
<Route key={location.key}>
|
||||
<Route path="/" element={<Navigate to={initialRoute} />} />
|
||||
<Route
|
||||
path="/error"
|
||||
element={
|
||||
<Dialog
|
||||
open
|
||||
onClose={handleRelaunch}
|
||||
aria-labelledby="alert-dialog-text"
|
||||
aria-describedby="alert-dialog-desc"
|
||||
maxWidth="md"
|
||||
>
|
||||
<DialogTitle id="alert-dialog-text">
|
||||
Unable to reach server
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<DialogContentText id="alert-dialog-desc">
|
||||
Unable to connect to the jellyfin server.
|
||||
</DialogContentText>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button
|
||||
color="secondary"
|
||||
variant="contained"
|
||||
onClick={() => navigate("/servers/list")}
|
||||
>
|
||||
Change Server
|
||||
</Button>
|
||||
<Button
|
||||
variant="contained"
|
||||
color="primary"
|
||||
onClick={handleRelaunch}
|
||||
>
|
||||
Restart JellyPlayer
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
}
|
||||
/>
|
||||
<Route path="/login/index" element={<LoginRoute />} />
|
||||
|
||||
<Route path="/home" element={<Home />} />
|
||||
<Route path="/setup/server" element={<ServerSetup />} />
|
||||
<Route path="/servers/list" element={<ServerList />} />
|
||||
<Route
|
||||
path="/login/withImg/:userName/:userId/"
|
||||
element={<LoginWithImage />}
|
||||
/>
|
||||
<Route path="/login/users" element={<UserLogin />} />
|
||||
<Route path="/login/manual" element={<UserLoginManual />} />
|
||||
<Route path="/library/:id" element={<LibraryView />} />
|
||||
<Route path="/item/:id" element={<ItemDetail />} />
|
||||
<Route
|
||||
path="/musicalbum/:id"
|
||||
element={<MusicAlbumTitlePage />}
|
||||
errorElement={<div>Error</div>}
|
||||
/>
|
||||
<Route path="/artist/:id" element={<ArtistTitlePage />} />
|
||||
<Route path="/boxset/:id" element={<BoxSetTitlePage />} />
|
||||
<Route path="/episode/:id" element={<EpisodeTitlePage />} />
|
||||
<Route path="/person/:id" element={<PersonTitlePage />} />
|
||||
<Route path="/playlist/:id" element={<PlaylistTitlePage />} />
|
||||
<Route path="/series/:id" element={<SeriesTitlePage />} />
|
||||
<Route path="/search" element={<SearchPage />} />
|
||||
<Route path="/favorite" element={<FavoritePage />} />
|
||||
<Route path="/settings" element={<Settings />} />
|
||||
<Route path="/about" element={<About />} />
|
||||
<Route path="/player" element={<VideoPlayer />} />
|
||||
{/* </Route> */}
|
||||
<Route path="/home" element={<Home />} />
|
||||
<Route path="/setup/server" element={<ServerSetup />} />
|
||||
<Route path="/servers/list" element={<ServerList />} />
|
||||
<Route
|
||||
path="/login/withImg/:userName/:userId/"
|
||||
element={<LoginWithImage />}
|
||||
/>
|
||||
<Route path="/login/users" element={<UserLogin />} />
|
||||
<Route path="/login/manual" element={<UserLoginManual />} />
|
||||
<Route path="/library/:id" element={<LibraryView />} />
|
||||
<Route path="/item/:id" element={<ItemDetail />} />
|
||||
<Route
|
||||
path="/musicalbum/:id"
|
||||
element={<MusicAlbumTitlePage />}
|
||||
errorElement={<div>Error</div>}
|
||||
/>
|
||||
<Route path="/artist/:id" element={<ArtistTitlePage />} />
|
||||
<Route path="/boxset/:id" element={<BoxSetTitlePage />} />
|
||||
<Route path="/episode/:id" element={<EpisodeTitlePage />} />
|
||||
<Route path="/person/:id" element={<PersonTitlePage />} />
|
||||
<Route path="/playlist/:id" element={<PlaylistTitlePage />} />
|
||||
<Route path="/series/:id" element={<SeriesTitlePage />} />
|
||||
<Route path="/search" element={<SearchPage />} />
|
||||
<Route path="/favorite" element={<FavoritePage />} />
|
||||
<Route path="/about" element={<About />} />
|
||||
<Route path="/player" element={<VideoPlayer />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
</ErrorBoundary>
|
||||
</div>
|
||||
<ReactQueryDevtools buttonPosition="bottom-left" />
|
||||
|
||||
<ReactQueryDevtools buttonPosition="bottom-right" position="left" />
|
||||
</ThemeProvider>
|
||||
</SnackbarProvider>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.35913 16.4525H9.06241V14.59H8.38159V14.3291H10.0399V14.59H9.35913V16.4525ZM6.24451 16.4525H5.91463L6.83534 14.3291H7.10524L8.01752 16.4525H7.68135L7.46509 15.9306H6.45758L6.24451 16.4525ZM11.9524 15.9606H11.9582L12.5853 14.3291H13.0472V16.4525H12.75V14.6769H12.7442L12.0392 16.4525H11.8503L11.1479 14.6769H11.1427V16.4525H10.8544V14.3291H11.3163L11.9524 15.9606ZM16.0182 15.3877C16.0182 15.5439 15.9909 15.687 15.9367 15.817C15.8825 15.9475 15.8078 16.0595 15.7131 16.1537C15.6178 16.2479 15.5047 16.321 15.3737 16.3731C15.2427 16.4252 15.0996 16.4515 14.946 16.4515C14.7918 16.4515 14.6498 16.4252 14.5199 16.3731C14.3894 16.321 14.2768 16.2479 14.1815 16.1537C14.0868 16.0595 14.0121 15.9475 13.9595 15.817C13.9058 15.687 13.8795 15.5439 13.8795 15.3877C13.8795 15.2298 13.9058 15.0862 13.9595 14.9557C14.0121 14.8258 14.0868 14.7142 14.1815 14.6222C14.2768 14.5301 14.3894 14.458 14.5199 14.407C14.6498 14.3554 14.7918 14.3301 14.946 14.3301C15.0996 14.3301 15.2427 14.3554 15.3737 14.407C15.5047 14.458 15.6178 14.5301 15.7131 14.6222C15.8078 14.7142 15.8825 14.8258 15.9367 14.9557C15.9909 15.0862 16.0182 15.2298 16.0182 15.3877ZM17.8302 14.7547C17.7902 14.7 17.736 14.6548 17.6676 14.6195C17.5992 14.5843 17.5224 14.5669 17.4372 14.5669C17.3914 14.5669 17.3451 14.5732 17.2988 14.5853C17.252 14.5974 17.2099 14.6174 17.172 14.6453C17.1336 14.6727 17.1026 14.7068 17.0789 14.7479C17.0552 14.7884 17.0436 14.8373 17.0436 14.8947C17.0436 14.9499 17.0542 14.9957 17.0763 15.033C17.0984 15.0699 17.1273 15.1014 17.1647 15.1267C17.2015 15.1525 17.2457 15.1746 17.2956 15.1925C17.3462 15.2109 17.3998 15.2293 17.4566 15.2482C17.525 15.2693 17.5945 15.293 17.665 15.3193C17.735 15.3461 17.7991 15.3813 17.856 15.425C17.9128 15.4687 17.9596 15.5234 17.9954 15.5886C18.0317 15.6544 18.0501 15.7375 18.0501 15.8385C18.0501 15.9427 18.0301 16.0337 17.9912 16.1105C17.9523 16.1873 17.9007 16.251 17.836 16.3015C17.7713 16.352 17.6966 16.3894 17.6119 16.4141C17.5277 16.4388 17.4409 16.4515 17.3514 16.4515C17.2241 16.4515 17.101 16.4262 16.9821 16.3773C16.8632 16.3278 16.7648 16.2547 16.6869 16.1579L16.9063 15.9722C16.9542 16.0427 17.0179 16.0995 17.0978 16.1432C17.1773 16.1868 17.2641 16.2089 17.3572 16.2089C17.4045 16.2089 17.4519 16.2021 17.4998 16.1889C17.5471 16.1758 17.5903 16.1547 17.6292 16.1263C17.6681 16.0979 17.7002 16.0621 17.725 16.0195C17.7492 15.9764 17.7618 15.9248 17.7618 15.8638C17.7618 15.8033 17.7492 15.7522 17.7234 15.7112C17.6976 15.6707 17.6629 15.636 17.6192 15.607C17.5755 15.5792 17.5245 15.5544 17.4666 15.5344C17.4088 15.5144 17.3472 15.4944 17.283 15.4734C17.2183 15.4545 17.1546 15.4308 17.092 15.4034C17.0294 15.3761 16.9731 15.3408 16.9237 15.2982C16.8742 15.2551 16.8342 15.2025 16.8037 15.1399C16.7732 15.0772 16.7585 14.9989 16.7585 14.9063C16.7585 14.8052 16.7785 14.719 16.8195 14.6464C16.8606 14.5743 16.9137 14.5143 16.9795 14.4669C17.0447 14.4196 17.1194 14.3849 17.2015 14.3628C17.2846 14.3412 17.3677 14.3301 17.4514 14.3301C17.5692 14.3301 17.6792 14.3512 17.7818 14.3928C17.8844 14.4348 17.967 14.4906 18.0296 14.5611L17.8302 14.7547ZM15.7131 15.3877C15.7131 15.2777 15.6947 15.1735 15.6589 15.0757C15.6226 14.9778 15.5716 14.8915 15.5047 14.8173C15.4379 14.7432 15.3579 14.6848 15.2638 14.6421C15.1696 14.5995 15.0638 14.5779 14.946 14.5779C14.8297 14.5779 14.7245 14.5995 14.6309 14.6421C14.5367 14.6848 14.4567 14.7432 14.3915 14.8173C14.3257 14.8915 14.2747 14.9778 14.2384 15.0757C14.2026 15.1735 14.1847 15.2777 14.1847 15.3877C14.1847 15.5002 14.2026 15.6055 14.2384 15.7044C14.2747 15.8033 14.3262 15.8896 14.3925 15.9622C14.4593 16.0358 14.5393 16.0932 14.6324 16.1348C14.725 16.1768 14.8297 16.1979 14.946 16.1979C15.0617 16.1979 15.167 16.1768 15.2622 16.1348C15.3574 16.0932 15.4379 16.0358 15.5047 15.9622C15.5716 15.8896 15.6226 15.8033 15.6589 15.7044C15.6947 15.6055 15.7131 15.5002 15.7131 15.3877ZM6.5628 15.6696H7.35725L6.96107 14.6737L6.5628 15.6696ZM23.2282 8.9832L22.3075 11.0524L21.3868 8.9832H20.6155L21.9218 11.9195L21.8861 11.9968L21.603 12.6355C21.6024 12.6371 21.602 12.6387 21.6014 12.6408C21.5167 12.8302 21.2931 12.9165 21.1037 12.8318L21.0027 12.7865L20.8048 13.23L20.7176 13.4268L20.7186 13.4273L20.9633 13.5368C21.4226 13.7414 21.9644 13.5331 22.1696 13.0722C22.1717 13.0685 23.8427 9.33412 24 8.9832H23.2282ZM16.799 7.54741H16.0924V12.2131H16.799V7.54741ZM19.0245 8.98214C18.6809 8.98214 18.3626 9.08999 18.1011 9.27308V7.54741H17.393V12.2131H18.1011V11.921C18.3626 12.1041 18.6809 12.212 19.0245 12.212C19.9147 12.212 20.6392 11.4881 20.6392 10.5973C20.6392 9.70662 19.9147 8.98214 19.0245 8.98214ZM14.0206 8.98214C13.1304 8.98214 12.4054 9.70608 12.4054 10.5968C12.4054 11.4875 13.1304 12.212 14.0206 12.212C14.9113 12.212 15.6357 11.4875 15.6357 10.5968C15.6357 9.70608 14.9113 8.98214 14.0206 8.98214ZM9.7169 7.54688H8.03332V12.2078H9.7169C11.0017 12.2078 12.0471 11.1618 12.0471 9.87706C12.0471 8.59175 11.0017 7.54688 9.7169 7.54688ZM6.62174 12.2072H5.93513C4.Line truncated
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.8 KiB |
@@ -0,0 +1,10 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_1029_358)">
|
||||
<path d="M7.62939e-06 3.57031H2.51845C7.12551 3.57031 10.9286 7.35238 10.9286 12.0023C10.9286 16.6415 7.12551 20.4289 2.51845 20.4289H7.62939e-06V3.57031ZM24 20.4289H21.4816C16.8745 20.4289 13.0714 16.6469 13.0714 12.0023C13.0714 7.35774 16.8745 3.57031 21.4816 3.57031H24V20.4289Z" fill="white"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_1029_358">
|
||||
<rect width="24" height="24" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 545 B |
@@ -0,0 +1,16 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_1029_240)">
|
||||
<path d="M13.7635 9.78027C13.9704 9.78027 14.1127 9.79963 14.1871 9.83982C14.2631 9.88002 14.31 9.94254 14.331 10.0289C14.352 10.1152 14.3633 10.3103 14.3633 10.6155V13.2327C14.3633 13.6823 14.331 13.9562 14.2679 14.0575C14.2049 14.1602 14.0367 14.2093 13.7635 14.2093V9.78027Z" fill="#F5C518"/>
|
||||
<path d="M19.2771 13.6066V12.0072C19.2771 11.7429 19.2601 11.5694 19.2248 11.4896C19.1894 11.4098 19.0483 11.3585 18.9494 11.3585C18.8504 11.3585 18.6978 11.4002 18.6681 11.4704V14.1778C18.702 14.2549 18.8476 14.2978 18.9494 14.2978C19.0512 14.2978 19.1993 14.2563 19.2304 14.1778C19.2615 14.0993 19.2771 13.908 19.2771 13.6066Z" fill="#F5C518"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 0H22.5C23.3284 0 24 0.671573 24 1.5V22.5C24 23.3284 23.3284 24 22.5 24H1.5C0.671573 24 0 23.3284 0 22.5V1.5C0 0.671573 0.671573 0 1.5 0ZM3 8.625V15.375H4.875V8.625H3ZM8.87719 8.625L8.45756 11.7782L8.19683 10.0631C8.12123 9.51378 8.04872 9.03441 7.97929 8.625H5.625V15.375H7.21561L7.22178 10.9177L7.89135 15.375H9.02376L9.65939 10.8194L9.66402 15.375H11.25V8.625H8.87719ZM12 8.625V15.375H14.9267C15.5894 15.375 16.125 14.8417 16.125 14.1838V9.81623C16.125 9.15748 15.5885 8.625 14.9267 8.625H12ZM19.6612 10.3151H19.7811C20.4543 10.3151 21 10.8423 21 11.4918V14.1982C21 14.8481 20.4544 15.375 19.7811 15.375H19.6612C19.2493 15.375 18.8851 15.1776 18.6645 14.8756L18.5565 15.2883H16.875V8.625H18.6691V10.7927C18.9009 10.5038 19.2582 10.3151 19.6612 10.3151Z" fill="#F5C518"/>
|
||||
<path d="M3 8.625V15.375H4.875V8.625H3Z" fill="black"/>
|
||||
<path d="M8.87719 8.625L8.45756 11.7782L8.19683 10.0631C8.12123 9.51378 8.04872 9.03441 7.97929 8.625H5.625V15.375H7.21561L7.22178 10.9177L7.89135 15.375H9.02376L9.65939 10.8194L9.66402 15.375H11.25V8.625H8.87719Z" fill="black"/>
|
||||
<path d="M12 15.375V8.625H14.9267C15.5885 8.625 16.125 9.15748 16.125 9.81623V14.1838C16.125 14.8417 15.5894 15.375 14.9267 15.375H12ZM14.1871 9.83982C14.1127 9.79963 13.9704 9.78027 13.7635 9.78027V14.2093C14.0367 14.2093 14.2049 14.1602 14.2679 14.0575C14.331 13.9562 14.3633 13.6823 14.3633 13.2327V10.6155C14.3633 10.3103 14.352 10.1152 14.331 10.0289C14.31 9.94255 14.2631 9.88002 14.1871 9.83982Z" fill="black"/>
|
||||
<path d="M19.6612 10.3151H19.7811C20.4543 10.3151 21 10.8423 21 11.4918V14.1982C21 14.8481 20.4544 15.375 19.7811 15.375H19.6612C19.2493 15.375 18.8851 15.1776 18.6645 14.8756L18.5565 15.2883H16.875V8.625H18.6691V10.7927C18.9009 10.5038 19.2582 10.3151 19.6612 10.3151ZM19.2771 13.6066V12.0072C19.2771 11.7429 19.2601 11.5694 19.2248 11.4896C19.1894 11.4098 19.0483 11.3585 18.9494 11.3585C18.8504 11.3585 18.6978 11.4002 18.6681 11.4704V14.1778C18.702 14.2549 18.8476 14.2978 18.9494 14.2978C19.0512 14.2978 19.1993 14.2563 19.2304 14.1778C19.2615 14.0993 19.2771 13.908 19.2771 13.6066Z" fill="black"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_1029_240">
|
||||
<rect width="24" height="24" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
@@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.582 0L1.418 5.832V18.168L11.582 24V10.01L7.1 12.668V16.332C7.11 16.443 7.11 16.557 7.1 16.668C6.997 17.103 6.56 17.472 6.1 17.779C5.298 18.316 4.348 18.288 3.934 17.668C3.521 17.048 3.793 16.037 4.6 15.5C4.984 15.22 5.463 15.101 5.934 15.168V6.619C5.934 6.465 6.068 6.367 6.16 6.311L11.582 3V0ZM12.418 0V6.162C12.992 6.192 13.558 6.322 14.086 6.549C14.3968 6.55178 14.7047 6.48941 14.99 6.36592C15.2752 6.24243 15.5314 6.06055 15.742 5.832C15.6554 5.70835 15.5974 5.56704 15.572 5.41824C15.5467 5.26944 15.5547 5.11688 15.5955 4.97155C15.6362 4.82622 15.7087 4.69175 15.8078 4.57783C15.9068 4.46391 16.0298 4.37339 16.1681 4.3128C16.3063 4.25221 16.4563 4.22305 16.6072 4.22743C16.758 4.23181 16.9061 4.26962 17.0406 4.33813C17.1751 4.40665 17.2927 4.50416 17.3849 4.62363C17.4772 4.7431 17.5417 4.88155 17.574 5.029L17.578 5.035C17.6162 5.20913 17.6082 5.39022 17.5548 5.5603C17.5014 5.73038 17.4044 5.88353 17.2735 6.00453C17.1425 6.12554 16.9823 6.2102 16.8085 6.2501C16.6348 6.29 16.4536 6.28376 16.283 6.232C15.943 6.635 15.491 6.93 14.986 7.082C15.326 7.345 15.627 7.658 15.877 8.01C16.1424 7.94828 16.4214 7.99316 16.654 8.135C17.422 8.621 17.222 9.792 16.336 9.992C15.45 10.192 14.762 9.222 15.246 8.453C15.266 8.423 15.288 8.393 15.311 8.363C14.9421 7.85583 14.4471 7.45388 13.875 7.197C13.4159 6.98618 12.9221 6.86112 12.418 6.828V10.838C13.273 10.898 13.674 11.331 13.973 11.672C14.2 11.928 14.329 12.062 14.551 12.074C14.874 12.092 15.119 12.082 15.357 12.074C15.6554 12.0567 15.9548 12.0641 16.252 12.096C17.192 12.079 17.524 11.87 17.857 11.65C18.1906 11.4057 18.5789 11.2467 18.988 11.187C19.0154 11.0941 19.0558 11.0056 19.108 10.924C19.1391 10.8755 19.1743 10.8297 19.213 10.787C19.236 10.762 19.26 10.743 19.283 10.721C19.0778 9.93246 19.0778 9.10454 19.283 8.316L19.271 8.306C19.0967 8.14439 18.9843 7.92698 18.9532 7.69132C18.9221 7.45566 18.9744 7.21655 19.1008 7.01528C19.2273 6.81402 19.4201 6.66325 19.6459 6.58902C19.8717 6.51478 20.1164 6.52175 20.3376 6.6087C20.5588 6.69566 20.7427 6.85715 20.8576 7.06527C20.9724 7.2734 21.0109 7.5151 20.9665 7.74861C20.9221 7.98212 20.7975 8.19279 20.6143 8.34422C20.4311 8.49566 20.2007 8.57834 19.963 8.578H19.906C19.7674 9.19599 19.7674 9.83701 19.906 10.455H19.969C20.1271 10.4552 20.2829 10.4921 20.4243 10.5629C20.5656 10.6336 20.6886 10.7363 20.7835 10.8627C20.8784 10.9891 20.9426 11.1358 20.971 11.2913C20.9995 11.4468 20.9914 11.6067 20.9475 11.7586C20.9036 11.9104 20.8249 12.05 20.7178 12.1662C20.6107 12.2824 20.478 12.3722 20.3303 12.4284C20.1826 12.4846 20.0238 12.5056 19.8665 12.49C19.7092 12.4743 19.5577 12.4223 19.424 12.338L19.377 12.305C19.2196 12.1946 19.0974 12.0411 19.025 11.863C18.7294 11.9145 18.4503 12.0359 18.211 12.217C17.9936 12.3689 17.7573 12.4916 17.508 12.582C18.265 13.137 19.28 14.182 19.707 14.881C19.7906 14.8593 19.8766 14.8482 19.963 14.848C20.1215 14.8475 20.2779 14.8839 20.4199 14.9543C20.5619 15.0248 20.6855 15.1274 20.7809 15.254C20.8763 15.3805 20.9409 15.5276 20.9696 15.6835C20.9983 15.8393 20.9902 15.9998 20.9461 16.152C20.902 16.3042 20.823 16.4441 20.7154 16.5605C20.6078 16.6768 20.4745 16.7665 20.3262 16.8224C20.1779 16.8783 20.0186 16.8989 19.8609 16.8825C19.7033 16.8661 19.5516 16.8132 19.418 16.728L19.371 16.698C19.158 16.5471 19.0112 16.3201 18.9609 16.064C18.9107 15.8078 18.9608 15.5422 19.101 15.322C19.1165 15.297 19.1335 15.2729 19.152 15.25C18.707 14.475 17.126 12.97 16.692 12.863C16.2647 12.7527 15.8221 12.7131 15.382 12.746C15.142 12.754 14.869 12.764 14.516 12.746C14.001 12.719 13.733 12.413 13.473 12.117C13.213 11.821 12.963 11.557 12.418 11.506V18.5C12.5649 18.4721 12.7079 18.4268 12.844 18.365C12.8624 18.3542 12.8818 18.3451 12.902 18.338C13.462 18.071 14.323 17.428 14.998 15.891C14.7941 15.7405 14.6535 15.5196 14.6036 15.2711C14.5536 15.0227 14.598 14.7645 14.728 14.547C14.8183 14.3949 14.9466 14.2689 15.1004 14.1813C15.2541 14.0938 15.428 14.0477 15.6049 14.0477C15.7818 14.0477 15.9557 14.0937 16.1095 14.1811C16.2632 14.2686 16.3916 14.3946 16.482 14.5467C16.5723 14.6988 16.6216 14.8718 16.6249 15.0487C16.6282 15.2255 16.5854 15.4002 16.5008 15.5556C16.4162 15.711 16.2926 15.8416 16.1422 15.9348C15.9918 16.028 15.8198 16.0804 15.643 16.087C15.3183 16.8903 14.8307 17.6175 14.211 18.223C14.4605 18.2745 14.6961 18.3789 14.902 18.529C15.0049 18.6221 15.1342 18.6808 15.272 18.697C15.5769 18.6645 15.8757 18.5898 16.16 18.475C16.1327 18.2574 16.1764 18.0368 16.2844 17.8459C16.3924 17.655 16.5591 17.504 16.7597 17.4154C16.9603 17.3267 17.1841 17.305 17.398 17.3536C17.6119 17.4022 17.8044 17.5184 17.947 17.685V17.68C18.0736 17.828 18.1552 18.0092 18.1821 18.2022C18.209 18.3951 18.1801 18.5917 18.0988 18.7687C18.0175 18.9458 17.8872 19.0958 17.7233 19.2011C17.5594 19.3064 17.3688 19.3626 17.174 19.363C16.906 19.3653 16.6478 19.2623 16.455 19.076C16.0827 19.231 15.6887 19.3278 15.287 19.363H15.237C14.9784 19.3435 14.7313 19.2478 14.527 19.088C14.265 18.911 14.017 18.743 13.125 18.968C12.9029 19.0757 12.6636 19.1434 12.418 Line truncated
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.5 KiB |
@@ -0,0 +1,6 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 6.72048C0 5.92852 0.71433 5.38577 1.55763 5.50986L12.5582 6.94676C13.0526 7.01951 13.4467 7.55223 13.4467 8.13239L13.4465 9.63401C12.5196 10.2552 11.912 11.2948 11.912 12.4725C11.912 13.6614 12.5048 14.692 13.4467 15.311V15.9713C13.4467 16.5515 13.0526 17.0842 12.5582 17.1569L2.79676 18.4904C1.95345 18.6145 1.23912 18.0717 1.23912 17.2798L0 6.72048ZM4.74367 8.10062H3.29281V10.0011H2.37237V11.0992H3.29281V13.2108C3.25026 14.5376 3.77141 15.1317 4.96891 15.1429L6.08645 15.1429V14.0448H5.51262C4.86284 14.0132 4.72219 13.8231 4.74374 12.9679V11.0991H6.52725L8.17933 15.1428H9.73851L12.0124 10.001H10.4747L9.00215 13.5381L7.65934 10.0011H4.74367V8.10062Z" fill="#6CD591"/>
|
||||
<path d="M4.74367 8.10062H3.29281V10.0011H2.37237V11.0992H3.29281V13.2108C3.25026 14.5376 3.77141 15.1317 4.96891 15.1429L6.08645 15.1429V14.0448H5.51262C4.86284 14.0132 4.72219 13.8231 4.74374 12.9679V11.0991H6.52725L8.17933 15.1428H9.73851L12.0124 10.001H10.4747L9.00215 13.5381L7.65934 10.0011H4.74367V8.10062Z" fill="white"/>
|
||||
<path d="M21.358 9.89753C22.3 9.89753 22.928 10.1298 23.4045 10.6577C23.7943 11.08 24 11.703 24 12.3998C24 13.4133 23.5886 14.2052 22.8415 14.6592C22.3541 14.9549 21.9319 15.0394 20.979 15.0394H18.6185V7.99707H20.0695V9.89753H21.358ZM20.0695 13.9413H21.1414C21.9968 13.9413 22.5166 13.3712 22.5166 12.442C22.5166 11.4706 22.0618 10.9955 21.1414 10.9955H20.0695V13.9413Z" fill="white"/>
|
||||
<path d="M16.3936 7.99707H17.8446V15.0394H15.3433C14.3255 15.0394 13.8382 14.8916 13.3184 14.4375C12.7878 13.9625 12.5172 13.2868 12.5172 12.4315C12.5172 11.5445 12.8096 10.8689 13.4268 10.3726C13.8166 10.0559 14.3473 9.89753 15.0294 9.89753H16.3937L16.3936 7.99707ZM16.3936 10.9956H15.3433C14.4988 10.9956 13.9898 11.5341 13.9898 12.4315C13.9898 13.3712 14.5095 13.9413 15.3433 13.9413H16.3936V10.9956Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M6.62 11.9996C6.61947 11.6983 6.67838 11.3999 6.79334 11.1214C6.9083 10.8429 7.07706 10.5898 7.28996 10.3767C7.50285 10.1635 7.75571 9.9944 8.03404 9.87907C8.31237 9.76375 8.61072 9.70445 8.912 9.70459H8.899C9.20011 9.70472 9.49824 9.7642 9.77635 9.87965C10.0544 9.99509 10.3071 10.1642 10.5198 10.3774C10.7324 10.5905 10.901 10.8435 11.0159 11.1219C11.1307 11.4002 11.1895 11.6985 11.189 11.9996C11.189 12.607 10.9478 13.1896 10.5183 13.6192C10.0889 14.0488 9.50644 14.2903 8.899 14.2906H8.912C8.61106 14.2907 8.31304 14.2316 8.03497 14.1165C7.75689 14.0014 7.50422 13.8327 7.29137 13.6199C7.07853 13.4072 6.90968 13.1546 6.79449 12.8765C6.67929 12.5985 6.62 12.3005 6.62 11.9996ZM17.34 7.93759H21.606C22.2134 7.93732 22.7959 7.69583 23.2253 7.26621C23.6548 6.8366 23.896 6.25402 23.896 5.64659C23.8967 5.34539 23.8379 5.04702 23.7231 4.76855C23.6084 4.49008 23.4398 4.23698 23.2271 4.02372C23.0144 3.81047 22.7617 3.64125 22.4836 3.52574C22.2054 3.41024 21.9072 3.35072 21.606 3.35059H17.34C17.0387 3.35059 16.7404 3.41001 16.4621 3.52545C16.1838 3.6409 15.9311 3.8101 15.7182 4.02337C15.5054 4.23664 15.3368 4.48979 15.222 4.76832C15.1071 5.04686 15.0483 5.34531 15.049 5.64659C15.0493 6.25385 15.2906 6.83617 15.72 7.26557C16.1494 7.69497 16.7317 7.93632 17.339 7.93659L17.34 7.93759ZM2.688 20.6446H10.973C11.2739 20.6446 11.5719 20.5853 11.85 20.4701C12.128 20.3549 12.3806 20.1861 12.5933 19.9732C12.8061 19.7604 12.9748 19.5077 13.0899 19.2296C13.205 18.9515 13.2641 18.6535 13.264 18.3526C13.2645 18.0515 13.2057 17.7532 13.0909 17.4749C12.976 17.1965 12.8074 16.9435 12.5948 16.7304C12.3821 16.5172 12.1294 16.3481 11.8513 16.2326C11.5732 16.1172 11.2751 16.0577 10.974 16.0576H2.687C2.3858 16.0576 2.08757 16.117 1.80935 16.2324C1.53113 16.3477 1.27839 16.5169 1.0656 16.73C0.852811 16.9432 0.684141 17.1962 0.569243 17.4746C0.454345 17.753 0.395474 18.0514 0.396 18.3526C0.395869 18.6534 0.454997 18.9514 0.570009 19.2294C0.685021 19.5074 0.853665 19.76 1.06631 19.9729C1.27896 20.1857 1.53144 20.3546 1.80935 20.4698C2.08726 20.5851 2.38514 20.6445 2.686 20.6446H2.688ZM13.569 14.2906H14.379L16.273 9.70459H15.19L14.036 12.7126H14.023L12.888 9.70459H11.734L13.569 14.2906ZM17.777 14.2906H18.788V9.70459H17.777V14.2906ZM20.655 14.2906H23.89V13.3606H21.667V12.4276H23.657V11.4936H21.667V10.6386H23.774V9.70459H20.662L20.655 14.2906ZM1.31 7.94059H2.32V4.24659H3.63V3.35159H0V4.24659H1.31V7.94059ZM5.057 7.94059H6.068V5.95859H8.026V7.94259H9.037V3.35259H8.027V5.06359H6.061V3.35059H5.057V7.94059ZM10.405 7.94059H13.647V7.00759H11.41V6.07359H13.4V5.14059H11.41V4.28459H13.517V3.35059H10.405V7.94059ZM0.162 14.2956H1.167V10.7756H1.18L2.347 14.2956H3.112L4.318 10.7756H4.331V14.2956H5.342V9.70559H3.82L2.755 12.6996H2.742L1.686 9.70459H0.156L0.162 14.2956ZM14.696 20.6486H16.337C16.6694 20.6503 17.0001 20.6 17.317 20.4996C17.6164 20.4062 17.8958 20.258 18.141 20.0626C18.3794 19.8687 18.5728 19.6255 18.708 19.3496C18.8577 19.0437 18.934 18.7071 18.931 18.3666C18.9416 17.9979 18.867 17.6318 18.713 17.2966C18.5777 17.0145 18.3767 16.769 18.127 16.5806C17.8652 16.3928 17.5683 16.2595 17.254 16.1886C16.9119 16.103 16.5606 16.0594 16.208 16.0586H14.689L14.696 20.6486ZM15.709 16.9926H16.305C16.5097 16.9917 16.7136 17.0186 16.911 17.0726C17.0924 17.122 17.2629 17.2047 17.414 17.3166C17.5577 17.4258 17.674 17.5668 17.754 17.7286C17.8433 17.9112 17.8879 18.1124 17.884 18.3156C17.8893 18.5418 17.845 18.7664 17.754 18.9736C17.6762 19.1446 17.5569 19.2934 17.407 19.4066C17.2523 19.5204 17.0761 19.6013 16.889 19.6446C16.6761 19.6932 16.4583 19.7167 16.24 19.7146H15.702L15.709 16.9926ZM20.395 20.6486H22.275C22.481 20.6484 22.6864 20.6269 22.888 20.5846C23.0836 20.5456 23.271 20.4732 23.442 20.3706C23.6044 20.2735 23.742 20.14 23.844 19.9806C23.953 19.7977 24.0068 19.5873 23.999 19.3746C24.0002 19.2331 23.9762 19.0926 23.928 18.9596C23.8831 18.8339 23.8138 18.7183 23.724 18.6196C23.634 18.5208 23.5265 18.4394 23.407 18.3796C23.2776 18.3134 23.138 18.2695 22.994 18.2496V18.2376C23.2169 18.1736 23.4166 18.0465 23.569 17.8716C23.7178 17.6893 23.7947 17.4587 23.785 17.2236C23.7954 17.0123 23.7436 16.8027 23.636 16.6206C23.5394 16.4707 23.4053 16.3486 23.247 16.2666C23.0779 16.18 22.8953 16.1229 22.707 16.0976C22.5082 16.0704 22.3077 16.0567 22.107 16.0566H20.395V20.6486ZM21.406 16.9146H22.093C22.1735 16.915 22.2538 16.9224 22.333 16.9366C22.4098 16.95 22.484 16.9753 22.553 17.0116C22.618 17.0462 22.6731 17.0968 22.713 17.1586C22.7563 17.2294 22.7776 17.3116 22.774 17.3946C22.7761 17.4757 22.7571 17.556 22.719 17.6276C22.6841 17.691 22.6339 17.7446 22.573 17.7836C22.5106 17.8236 22.4415 17.852 22.369 17.8676C22.2935 17.8846 22.2164 17.8934 22.139 17.8936H21.394L21.406 16.9146ZM21.406 18.7496H22.171C22.26 18.7502 22.3489 18.7569 22.437 18.7696C22.5264 18.7813 22.6138 18.8048 22.697 18.8396C22.7766 18.8725 22.8467 18.9248 22.901 18.9916C22.9568 19.0665 22.985 19.1583 22.981 19.2516C22.9846 19.3398 22.9638 19.4274 22.921 19.5046C22.881 19.5719 22.8263 19.6294 22.761Line truncated
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.1 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.3256 20.447C17.9817 20.9692 17.3136 21.51 16.6142 21.8705L17.8097 9.74531C18.5703 9.50094 19.3125 9.17716 19.8592 8.71287L18.3256 20.447ZM15.4246 22.3763C14.267 22.7594 13.5939 22.8781 12.6303 22.9727L12.7805 10.5127C13.845 10.4822 15.2225 10.3379 16.3963 10.0874L15.4246 22.3763ZM8.52295 22.3763L7.55135 10.0874C8.72503 10.3379 10.1026 10.4822 11.1671 10.5127L11.3172 22.9727C10.3536 22.8781 9.68066 22.7594 8.52295 22.3763ZM5.62207 20.447L4.0883 8.71287C4.63504 9.17716 5.37725 9.50094 6.13785 9.74531L7.3333 21.8705C6.634 21.51 5.96583 20.9692 5.62207 20.447ZM18.2398 4.08301C18.255 4.15706 18.2635 4.23361 18.2639 4.31221C18.2644 4.39171 18.2567 4.46942 18.242 4.54454C18.7973 4.63367 19.2234 5.11206 19.2267 5.69306C19.2269 5.72946 19.2249 5.76551 19.2219 5.8011C19.5049 5.83867 19.7561 5.97731 19.938 6.17948C19.1398 7.3918 15.8806 8.3145 11.9738 8.3369C7.50032 8.3625 3.86204 7.19828 3.79281 5.72928C3.80262 5.71867 3.81163 5.70725 3.82189 5.69699C3.75284 5.57922 3.70519 5.44797 3.68057 5.3087C3.25223 5.71528 2.99304 6.04307 3.03864 6.52039C3.04301 6.58418 4.93365 20.121 4.93365 20.121C5.1518 22.2649 8.2651 23.9785 11.9738 23.9997C15.6824 23.9785 18.7958 22.2649 19.0139 20.121C19.0139 20.121 20.9045 6.58418 20.9089 6.52039C20.9995 5.56565 19.8824 4.69898 18.2398 4.08301Z" fill="#BCBDBE"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.79281 5.72934C3.86196 7.19825 7.50023 8.36256 11.9737 8.33704C15.8806 8.31474 19.1397 7.39203 19.938 6.17981C19.7561 5.97764 19.5049 5.83899 19.2219 5.80143C19.2249 5.76574 19.2269 5.72979 19.2267 5.6933C19.2234 5.11239 18.7973 4.63399 18.2421 4.54478C18.2567 4.46965 18.2644 4.39194 18.2639 4.31245C18.2603 3.66552 17.7328 3.14412 17.0859 3.14778C17.0712 3.14787 17.057 3.14965 17.0424 3.15028C17.0838 3.0293 17.107 2.90002 17.1063 2.76503C17.1025 2.1181 16.5752 1.5967 15.9282 1.60036C15.7798 1.60125 15.6385 1.63078 15.5081 1.68191C15.3231 1.33359 14.9678 1.09083 14.5536 1.06281C14.4814 0.481906 13.9851 0.033757 13.3853 0.0371283C13.0078 0.0392886 12.674 0.220582 12.4614 0.499036C12.2457 0.264389 11.9367 0.117177 11.5929 0.11914C10.946 0.122798 10.4246 0.650263 10.4282 1.2971C10.4289 1.42067 10.449 1.53942 10.4851 1.65104C10.2211 1.70002 9.98891 1.83724 9.81922 2.03111C9.6845 1.52934 9.22636 1.1606 8.68239 1.16363C8.17419 1.16657 7.74469 1.4933 7.58517 1.94662C7.15343 2.12122 6.84955 2.54475 6.85241 3.03875C6.85303 3.14849 6.86981 3.25413 6.89862 3.35477C6.75302 3.29107 6.59251 3.25538 6.42335 3.25636C5.91329 3.2593 5.48245 3.58834 5.32426 4.04434C5.17259 3.97386 5.00396 3.9338 4.82561 3.93487C4.17868 3.93853 3.6572 4.46591 3.66092 5.11284C3.6621 5.32616 3.72126 5.5253 3.8219 5.69695C3.81164 5.7073 3.80262 5.71863 3.79281 5.72934Z" fill="#DEDEDF"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,8 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.3256 20.447C17.9817 20.9692 17.3136 21.51 16.6143 21.8705L17.8097 9.74531C18.5703 9.50094 19.3125 9.17716 19.8593 8.71287L18.3256 20.447ZM15.4246 22.3763C14.267 22.7594 13.5939 22.8781 12.6304 22.9727L12.7805 10.5127C13.845 10.4822 15.2225 10.3379 16.3963 10.0874L15.4246 22.3763ZM8.52296 22.3763L7.55136 10.0874C8.72504 10.3379 10.1026 10.4822 11.1671 10.5127L11.3172 22.9727C10.3537 22.8781 9.68067 22.7594 8.52296 22.3763ZM5.62209 20.447L4.08832 8.71287C4.63505 9.17716 5.37727 9.50094 6.13786 9.74531L7.33331 21.8705C6.63401 21.51 5.96585 20.9692 5.62209 20.447ZM18.2398 4.08301C18.255 4.15706 18.2635 4.23361 18.2639 4.31221C18.2644 4.39171 18.2567 4.46942 18.242 4.54454C18.7973 4.63367 19.2234 5.11206 19.2267 5.69306C19.2269 5.72946 19.2249 5.76551 19.2219 5.8011C19.5049 5.83867 19.7561 5.97731 19.938 6.17948C19.1398 7.3918 15.8806 8.3145 11.9738 8.3369C7.50033 8.3625 3.86206 7.19828 3.79282 5.72928C3.80264 5.71867 3.81165 5.70725 3.82191 5.69699C3.75285 5.57922 3.70521 5.44797 3.68058 5.3087C3.25224 5.71528 2.99306 6.04307 3.03865 6.52039C3.04302 6.58418 4.93367 20.121 4.93367 20.121C5.15181 22.2649 8.26512 23.9785 11.9738 23.9997C15.6825 23.9785 18.7959 22.2649 19.0139 20.121C19.0139 20.121 20.9046 6.58418 20.9089 6.52039C20.9995 5.56565 19.8824 4.69898 18.2398 4.08301Z" fill="#DB382A"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.0883 8.71289L5.62198 20.447C5.96583 20.9692 6.634 21.51 7.3333 21.8705L6.13785 9.74534C5.37725 9.50096 4.63504 9.17719 4.0883 8.71289Z" fill="#FFFFFE"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.55135 10.0879L8.52294 22.3768C9.68065 22.7599 10.3536 22.8786 11.3172 22.9732L11.167 10.5132C10.1026 10.4827 8.72503 10.3384 7.55135 10.0879Z" fill="#FFFFFE"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.6303 22.9732C13.5939 22.8786 14.2669 22.7599 15.4246 22.3768L16.3962 10.0879C15.2225 10.3384 13.845 10.4827 12.7805 10.5132L12.6303 22.9732Z" fill="#FFFFFE"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.6142 21.8705C17.3135 21.51 17.9817 20.9692 18.3255 20.447L19.8592 8.71289C19.3125 9.17719 18.5703 9.50096 17.8097 9.74534L16.6142 21.8705Z" fill="#FFFFFE"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.79281 5.72934C3.86196 7.19825 7.50023 8.36256 11.9737 8.33704C15.8806 8.31474 19.1397 7.39203 19.938 6.17981C19.7561 5.97764 19.5049 5.83899 19.2219 5.80143C19.2249 5.76574 19.2269 5.72979 19.2267 5.6933C19.2234 5.11239 18.7973 4.63399 18.2421 4.54478C18.2567 4.46965 18.2644 4.39194 18.2639 4.31245C18.2603 3.66552 17.7328 3.14412 17.0859 3.14778C17.0712 3.14787 17.057 3.14965 17.0424 3.15028C17.0838 3.0293 17.107 2.90002 17.1063 2.76503C17.1025 2.1181 16.5752 1.5967 15.9282 1.60036C15.7798 1.60125 15.6385 1.63078 15.5081 1.68191C15.3231 1.33359 14.9678 1.09083 14.5536 1.06281C14.4814 0.481906 13.9851 0.033757 13.3853 0.0371283C13.0078 0.0392886 12.674 0.220582 12.4614 0.499036C12.2457 0.264389 11.9367 0.117177 11.5929 0.11914C10.946 0.122798 10.4246 0.650263 10.4282 1.2971C10.4289 1.42067 10.449 1.53942 10.4851 1.65104C10.2211 1.70002 9.98891 1.83724 9.81922 2.03111C9.6845 1.52934 9.22636 1.1606 8.68239 1.16363C8.17419 1.16657 7.74469 1.4933 7.58517 1.94662C7.15343 2.12122 6.84955 2.54475 6.85241 3.03875C6.85303 3.14849 6.86981 3.25413 6.89862 3.35477C6.75302 3.29107 6.59251 3.25538 6.42335 3.25636C5.91329 3.2593 5.48245 3.58834 5.32426 4.04434C5.17259 3.97386 5.00396 3.9338 4.82561 3.93487C4.17868 3.93853 3.6572 4.46591 3.66092 5.11284C3.6621 5.32616 3.72126 5.5253 3.8219 5.69695C3.81164 5.7073 3.80262 5.71863 3.79281 5.72934Z" fill="#F9D320"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
@@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 24C5.385 24 0 18.615 0 12C0 5.385 5.385 0 12 0C18.615 0 24 5.385 24 12C24 18.615 18.615 24 12 24ZM12 1.211C6.05 1.211 1.211 6.05 1.211 12C1.211 17.95 6.05 22.79 12 22.79C17.95 22.79 22.79 17.95 22.79 12C22.79 6.05 17.95 1.211 12 1.211ZM4.89 18.531C5.79317 19.5162 6.89208 20.302 8.1164 20.838C9.34072 21.3741 10.6635 21.6486 12 21.644C13.3899 21.6464 14.7637 21.3475 16.027 20.768L9.33 14.088L4.89 18.531ZM19.178 18.464C20.7773 16.6901 21.6624 14.3864 21.662 11.998C21.662 8.113 19.375 4.783 16.094 3.238L10.005 9.314L19.169 18.464H19.178ZM9.301 10.035L4.227 15.09L3.548 14.41L8.885 9.074L15.115 2.849C14.1112 2.51138 13.0591 2.33946 12 2.34C6.663 2.337 2.337 6.663 2.337 12C2.337 14.172 3.05 16.178 4.276 17.801L9.332 12.746L9.691 13.075L16.936 20.32C17.0825 20.242 17.2229 20.1531 17.356 20.054L9.33 12.05L4.476 16.905L3.797 16.226L9.332 10.691L9.691 11.022L18.151 19.459C18.286 19.359 18.406 19.244 18.526 19.143L9.39 10.027L9.307 10.042L9.301 10.035ZM12.348 11.063L11.67 10.387L16.458 5.597L17.137 6.286L12.348 11.071V11.063ZM16.89 4.485L11.37 10.005L10.69 9.326L16.211 3.806L16.89 4.49V4.485Z" fill="#ED1C24"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -8,9 +8,9 @@
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
&-avatar {
|
||||
background: $clr-gradient-dark;
|
||||
background: rgb(255 255 255 / 0.1) !important;
|
||||
&-icon {
|
||||
fill: url(#clr-gradient-default) !important;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
&-text {
|
||||
|
||||
@@ -18,7 +18,7 @@ import useScrollTrigger from "@mui/material/useScrollTrigger";
|
||||
|
||||
import { red } from "@mui/material/colors";
|
||||
|
||||
import { NavLink, useLocation, useNavigate } from "react-router-dom";
|
||||
import { Link, NavLink, useLocation, useNavigate } from "react-router-dom";
|
||||
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||
@@ -33,9 +33,14 @@ import "./appBar.module.scss";
|
||||
import { EventEmitter as event } from "../../eventEmitter";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
|
||||
import { getTypeIcon } from "../../components/utils/iconsCollection";
|
||||
import { getTypeIcon } from "../utils/iconsCollection";
|
||||
|
||||
import { Divider } from "@mui/material";
|
||||
import logo from "../../assets/icon.svg";
|
||||
import {
|
||||
setSettingsDialogOpen,
|
||||
setSettingsTabValue,
|
||||
} from "../../utils/store/settings";
|
||||
|
||||
const forwardRefNavLink = React.forwardRef({
|
||||
displayName: "NavLink",
|
||||
@@ -78,7 +83,7 @@ export const AppBar = () => {
|
||||
});
|
||||
return libs.data;
|
||||
},
|
||||
enabled: !!user.data,
|
||||
enabled: !!user.data && !!api.accessToken,
|
||||
networkMode: "always",
|
||||
});
|
||||
useEffect(() => {
|
||||
@@ -380,35 +385,41 @@ export const AppBar = () => {
|
||||
sx={{ mt: 2 }}
|
||||
disableScrollLock
|
||||
>
|
||||
<MenuItem onClick={() => navigate("/settings")} disabled>
|
||||
<ListItemIcon>
|
||||
<div className="material-symbols-rounded">settings</div>
|
||||
</ListItemIcon>
|
||||
Settings
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => navigate("/about")}>
|
||||
<ListItemIcon>
|
||||
<div className="material-symbols-rounded">info</div>
|
||||
</ListItemIcon>
|
||||
About
|
||||
</MenuItem>
|
||||
<MenuItem onClick={handleLogout}>
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
handleLogout();
|
||||
handleMenuClose();
|
||||
}}
|
||||
>
|
||||
<ListItemIcon>
|
||||
<div className="material-symbols-rounded">logout</div>
|
||||
</ListItemIcon>
|
||||
Logout
|
||||
</MenuItem>
|
||||
<Divider />
|
||||
<MenuItem
|
||||
onClick={async () => {
|
||||
navigate("/servers/list");
|
||||
onClick={() => {
|
||||
setSettingsDialogOpen(true);
|
||||
setSettingsTabValue(1);
|
||||
handleMenuClose();
|
||||
}}
|
||||
>
|
||||
<ListItemIcon>
|
||||
<div className="material-symbols-rounded appBar-icon">
|
||||
dns
|
||||
</div>
|
||||
<div className="material-symbols-rounded">settings</div>
|
||||
</ListItemIcon>
|
||||
Select Server
|
||||
Settings
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
setSettingsDialogOpen(true);
|
||||
setSettingsTabValue(10);
|
||||
handleMenuClose();
|
||||
}}
|
||||
>
|
||||
<ListItemIcon>
|
||||
<div className="material-symbols-rounded">info</div>
|
||||
</ListItemIcon>
|
||||
About
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</div>
|
||||
@@ -17,8 +17,8 @@
|
||||
&-icon {
|
||||
height: 100%;
|
||||
padding: 0.2em;
|
||||
background: $clr-gradient-dark;
|
||||
fill: url(#clr-gradient-default) !important;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
color: white;
|
||||
font-size: 7em !important;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import React from "react";
|
||||
import React, { useEffect } from "react";
|
||||
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
|
||||
@@ -18,19 +18,28 @@ const LikeButton = ({ itemId, isFavorite, queryKey, userId, itemName }) => {
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const handleLiking = async () => {
|
||||
let result = null;
|
||||
if (isFavorite) {
|
||||
await getUserLibraryApi(api).unmarkFavoriteItem({
|
||||
result = await getUserLibraryApi(api).unmarkFavoriteItem({
|
||||
userId: userId,
|
||||
itemId: itemId,
|
||||
});
|
||||
} else if (!isFavorite) {
|
||||
await getUserLibraryApi(api).markFavoriteItem({
|
||||
result = await getUserLibraryApi(api).markFavoriteItem({
|
||||
userId: userId,
|
||||
itemId: itemId,
|
||||
});
|
||||
}
|
||||
return result.data;
|
||||
};
|
||||
const mutation = useMutation({
|
||||
// mutationFn: async () => {
|
||||
// new Promise((resolve, reject) => {
|
||||
// setTimeout(() => {
|
||||
// resolve("foo");
|
||||
// }, 4000);
|
||||
// });
|
||||
// },
|
||||
mutationFn: handleLiking,
|
||||
onError: (error) => {
|
||||
enqueueSnackbar(`${error}`, {
|
||||
@@ -43,66 +52,42 @@ const LikeButton = ({ itemId, isFavorite, queryKey, userId, itemName }) => {
|
||||
},
|
||||
onSettled: async () => {
|
||||
return await queryClient.invalidateQueries({
|
||||
queryKey: queryKey,
|
||||
queryKey,
|
||||
});
|
||||
},
|
||||
mutationKey: ["likeButton", itemId],
|
||||
});
|
||||
|
||||
return (
|
||||
<div
|
||||
<IconButton
|
||||
onClick={(e) => {
|
||||
if (!mutation.isPending) {
|
||||
mutation.mutate();
|
||||
e.stopPropagation();
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
opacity: mutation.isPending ? 0.5 : 1,
|
||||
transition: "opacity 250ms",
|
||||
position: "relative",
|
||||
display: "inline-flex",
|
||||
}}
|
||||
>
|
||||
<CircularProgress
|
||||
style={{
|
||||
opacity: mutation.isPending ? 1 : 0,
|
||||
transition: "opacity 200ms",
|
||||
}}
|
||||
thickness={2}
|
||||
/>
|
||||
<IconButton
|
||||
onClick={(e) => {
|
||||
if (!mutation.isPending) {
|
||||
e.stopPropagation();
|
||||
mutation.mutate();
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
opacity: mutation.isPending ? 0.5 : 1,
|
||||
}}
|
||||
<div
|
||||
className="material-symbols-rounded"
|
||||
style={
|
||||
isFavorite
|
||||
? {
|
||||
"--fill": mutation.isPending ? 0 : 1,
|
||||
color: mutation.isPending ? "white" : pink.A700,
|
||||
}
|
||||
: {
|
||||
"--fill": mutation.isPending ? 1 : 0,
|
||||
color: mutation.isPending ? pink.A700 : "white",
|
||||
}
|
||||
}
|
||||
>
|
||||
<div
|
||||
className="material-symbols-rounded"
|
||||
style={
|
||||
isFavorite
|
||||
? {
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
color: pink[700],
|
||||
}
|
||||
: {
|
||||
fontVariationSettings:
|
||||
'"FILL" 0, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
color: "white",
|
||||
}
|
||||
}
|
||||
>
|
||||
favorite
|
||||
</div>
|
||||
</IconButton>
|
||||
</div>
|
||||
favorite
|
||||
</div>
|
||||
</IconButton>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -19,17 +19,19 @@ const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const handleMarking = async () => {
|
||||
let result = null;
|
||||
if (!isPlayed) {
|
||||
await getPlaystateApi(api).markPlayedItem({
|
||||
result = await getPlaystateApi(api).markPlayedItem({
|
||||
userId: userId,
|
||||
itemId: itemId,
|
||||
});
|
||||
} else if (isPlayed) {
|
||||
await getPlaystateApi(api).markUnplayedItem({
|
||||
result = await getPlaystateApi(api).markUnplayedItem({
|
||||
userId: userId,
|
||||
itemId: itemId,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
const mutation = useMutation({
|
||||
mutationFn: handleMarking,
|
||||
@@ -50,49 +52,33 @@ const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
|
||||
mutationKey: ["markPlayedButton", itemId],
|
||||
});
|
||||
return (
|
||||
<div
|
||||
<IconButton
|
||||
onClick={(e) => {
|
||||
if (!mutation.isPending) {
|
||||
mutation.mutate();
|
||||
e.stopPropagation();
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
opacity: mutation.isPending ? 0.5 : 1,
|
||||
transition: "opacity 250ms",
|
||||
position: "relative",
|
||||
display: "inline-flex",
|
||||
}}
|
||||
>
|
||||
<CircularProgress
|
||||
<div
|
||||
className="material-symbols-rounded"
|
||||
style={{
|
||||
opacity: mutation.isPending ? 1 : 0,
|
||||
transition: "opacity 200ms",
|
||||
}}
|
||||
thickness={2}
|
||||
/>
|
||||
<IconButton
|
||||
onClick={(e) => {
|
||||
if (!mutation.isPending) {
|
||||
e.stopPropagation();
|
||||
mutation.mutate();
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
opacity: mutation.isPending ? 0.5 : 1,
|
||||
color: isPlayed
|
||||
? mutation.isPending
|
||||
? "white"
|
||||
: green.A700
|
||||
: mutation.isPending
|
||||
? green.A700
|
||||
: "white",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="material-symbols-rounded"
|
||||
style={{
|
||||
color: isPlayed ? green[400] : "white",
|
||||
}}
|
||||
>
|
||||
done
|
||||
</div>
|
||||
</IconButton>
|
||||
</div>
|
||||
done
|
||||
</div>
|
||||
</IconButton>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,19 +2,20 @@ import PropTypes from "prop-types";
|
||||
import React from "react";
|
||||
|
||||
import Button, {
|
||||
ButtonProps,
|
||||
ButtonPropsSizeOverrides,
|
||||
type ButtonProps,
|
||||
type ButtonPropsSizeOverrides,
|
||||
} from "@mui/material/Button";
|
||||
import Fab from "@mui/material/Fab";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import {
|
||||
BaseItemDto,
|
||||
type BaseItemDto,
|
||||
type BaseItemDtoQueryResult,
|
||||
BaseItemKind,
|
||||
ItemFields,
|
||||
SortOrder,
|
||||
UserItemDataDto,
|
||||
type UserItemDataDto,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getPlaylistsApi } from "@jellyfin/sdk/lib/utils/api/playlists-api";
|
||||
@@ -24,13 +25,17 @@ import { useSnackbar } from "notistack";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
||||
|
||||
import useQueue, { setQueue } from "../../utils/store/queue";
|
||||
|
||||
import {
|
||||
playItem,
|
||||
setItem,
|
||||
usePlaybackDataLoadStore,
|
||||
usePlaybackStore,
|
||||
} from "../../utils/store/playback";
|
||||
|
||||
import { SxProps } from "@mui/material";
|
||||
import type { SxProps } from "@mui/material";
|
||||
|
||||
const PlayButton = ({
|
||||
item,
|
||||
@@ -72,35 +77,35 @@ const PlayButton = ({
|
||||
const [api] = useApi((state) => [state.api]);
|
||||
|
||||
const navigate = useNavigate();
|
||||
const [
|
||||
setUrl,
|
||||
setPosition,
|
||||
setDuration,
|
||||
setItemId,
|
||||
setItemName,
|
||||
setAudioStreamIndex,
|
||||
setVideoStreamIndex,
|
||||
setSubtitleStreamIndex,
|
||||
setMediaSourceId,
|
||||
setUserId,
|
||||
setMediaContainer,
|
||||
setSeriesId,
|
||||
setEpisodeIndex,
|
||||
] = usePlaybackStore((state) => [
|
||||
state.setUrl,
|
||||
state.setPosition,
|
||||
state.setDuration,
|
||||
state.setItemId,
|
||||
state.setItemName,
|
||||
state.setAudioStreamIndex,
|
||||
state.setVideoStreamIndex,
|
||||
state.setSubtitleStreamIndex,
|
||||
state.setMediaSourceId,
|
||||
state.setUserId,
|
||||
state.setMediaContainer,
|
||||
state.setSeriesId,
|
||||
state.setEpisodeIndex,
|
||||
]);
|
||||
// const [
|
||||
// setUrl,
|
||||
// setPosition,
|
||||
// setDuration,
|
||||
// setItemId,
|
||||
// setItemName,
|
||||
// setAudioStreamIndex,
|
||||
// setVideoStreamIndex,
|
||||
// setSubtitleStreamIndex,
|
||||
// setMediaSourceId,
|
||||
// setUserId,
|
||||
// setMediaContainer,
|
||||
// setSeriesId,
|
||||
// setEpisodeIndex,
|
||||
// ] = usePlaybackStore((state) => [
|
||||
// state.setUrl,
|
||||
// state.setPosition,
|
||||
// state.setDuration,
|
||||
// state.setItemId,
|
||||
// state.setItemName,
|
||||
// state.setAudioStreamIndex,
|
||||
// state.setVideoStreamIndex,
|
||||
// state.setSubtitleStreamIndex,
|
||||
// state.setMediaSourceId,
|
||||
// state.setUserId,
|
||||
// state.setMediaContainer,
|
||||
// state.setSeriesId,
|
||||
// state.setEpisodeIndex,
|
||||
// ]);
|
||||
const [
|
||||
setAudioUrl,
|
||||
setAudioDisplay,
|
||||
@@ -191,17 +196,18 @@ const PlayButton = ({
|
||||
}
|
||||
return result.data;
|
||||
},
|
||||
onSuccess: (result) => {
|
||||
console.log(result.Items[0].MediaSources);
|
||||
onSuccess: (result: BaseItemDtoQueryResult | null) => {
|
||||
if (trackIndex) {
|
||||
setPlaylistItemId(playlistItemId);
|
||||
setCurrentTrack(trackIndex);
|
||||
setAudioTracks(result.Items);
|
||||
// setCurrentTrack(trackIndex);
|
||||
// setAudioTracks(result.Items);
|
||||
setAudioUrl(
|
||||
`${api.basePath}/Audio/${result.Items[trackIndex].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${userId}&api_key=${api.accessToken}`,
|
||||
);
|
||||
setAudioItem(result.Items[trackIndex]);
|
||||
setAudioDisplay(true);
|
||||
|
||||
setQueue(result.Items, trackIndex);
|
||||
} else if (audio) {
|
||||
setAudioItem(result.Items[0]);
|
||||
setAudioTracks(result.Items);
|
||||
@@ -209,99 +215,46 @@ const PlayButton = ({
|
||||
`${api.basePath}/Audio/${result.Items[0].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${userId}&api_key=${api.accessToken}`,
|
||||
);
|
||||
setAudioDisplay(true);
|
||||
setQueue(result.Items, 0);
|
||||
} else {
|
||||
setUserId(userId);
|
||||
setItemId(result.Items[0].Id);
|
||||
setDuration(result.Items[0].RunTimeTicks);
|
||||
// Movie / Series Playback
|
||||
const queue = result.Items;
|
||||
|
||||
if (result.Items[0].Type === BaseItemKind.Episode) {
|
||||
setSeriesId(result.Items[0].SeriesId);
|
||||
// setEpisodeIndex(result.Ite)
|
||||
let itemName = result.Items[0].Name;
|
||||
let episodeTitle = "";
|
||||
if (result.Items[0].SeriesId) {
|
||||
itemName = result.Items[0].SeriesName;
|
||||
episodeTitle = `S${result?.Items[0].ParentIndexNumber ?? 0}:E${
|
||||
result?.Items[0].IndexNumber ?? 0
|
||||
} ${result?.Items[0].Name}`;
|
||||
}
|
||||
|
||||
setMediaContainer(result.Items[0].MediaSources[0].Container);
|
||||
// Set all required stream index
|
||||
setAudioStreamIndex(currentAudioTrack);
|
||||
setVideoStreamIndex(currentVideoTrack);
|
||||
setSubtitleStreamIndex(currentSubTrack);
|
||||
|
||||
setMediaSourceId(result.Items[0].Id);
|
||||
setItem(result.Items[0]);
|
||||
|
||||
switch (result.Items[0].Type) {
|
||||
case BaseItemKind.Movie:
|
||||
if (result.Items[0].ImageBlurHashes.Logo) {
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<img
|
||||
alt={result.Items[0].Name}
|
||||
src={`${api.basePath}/Items/${result.Items[0].Id}/Images/Logo`}
|
||||
className="video-osd-name-logo"
|
||||
onLoad={(e) => {
|
||||
e.target.style.opacity = 1;
|
||||
}}
|
||||
/>
|
||||
</div>,
|
||||
);
|
||||
} else {
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<Typography variant="h6">{result.Items[0].Name}</Typography>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
break;
|
||||
case BaseItemKind.Episode:
|
||||
if (result.Items[0].ImageBlurHashes.Logo) {
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<img
|
||||
alt={result.Items[0].SeriesName}
|
||||
src={`${api.basePath}/Items/${result.Items[0].SeriesId}/Images/Logo`}
|
||||
className="video-osd-name-logo"
|
||||
onLoad={(e) => {
|
||||
e.target.style.opacity = 1;
|
||||
}}
|
||||
/>
|
||||
<Typography variant="subtitle1">
|
||||
S{result.Items[0].ParentIndexNumber}
|
||||
:E
|
||||
{result.Items[0].IndexNumber} {result.Items[0].Name}
|
||||
</Typography>
|
||||
</div>,
|
||||
);
|
||||
} else {
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<Typography variant="h6">
|
||||
{result.Items[0].SeriesName}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1">
|
||||
S{result.Items[0].ParentIndexNumber}
|
||||
:E
|
||||
{result.Items[0].IndexNumber} {result.Items[0].Name}
|
||||
</Typography>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<Typography variant="h6">{result.Items[0].Name}</Typography>
|
||||
</div>,
|
||||
);
|
||||
break;
|
||||
}
|
||||
setPosition(result.Items[0].UserData?.PlaybackPositionTicks);
|
||||
|
||||
setUrl(
|
||||
`${api.basePath}/Videos/${result.Items[0].Id}/stream.
|
||||
${result.Items[0].MediaSources[0].Container}
|
||||
?Static=true&mediaSourceId=${result.Items[0].Id}&deviceId=${api.deviceInfo.id}&api_key=${api.accessToken}&Tag=${result.Items[0].MediaSources[0].ETag}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`,
|
||||
let selectedSubtitleTrack: number | undefined = currentSubTrack;
|
||||
const subtitles = result?.Items[0].MediaSources[0].MediaStreams?.filter(
|
||||
(value) => value.Type === "Subtitle",
|
||||
);
|
||||
if (!currentSubTrack) {
|
||||
selectedSubtitleTrack = subtitles[0].Index;
|
||||
}
|
||||
|
||||
playItem(
|
||||
itemName,
|
||||
episodeTitle,
|
||||
currentVideoTrack,
|
||||
currentAudioTrack,
|
||||
selectedSubtitleTrack,
|
||||
result.Items[0].Container,
|
||||
true,
|
||||
`${api.basePath}/Videos/${result.Items[0].Id}/stream.${result.Items[0].Container}?Static=true&mediaSourceId=${result.Items[0].Id}&deviceId=${api.deviceInfo.id}&api_key=${api.accessToken}&Tag=${result.Items[0].MediaSources[0].ETag}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`,
|
||||
userId,
|
||||
result?.Items[0].UserData?.PlaybackPositionTicks,
|
||||
result.Items[0].RunTimeTicks,
|
||||
result.Items[0],
|
||||
queue,
|
||||
0,
|
||||
subtitles,
|
||||
result?.Items[0].MediaSources[0].Id
|
||||
);
|
||||
navigate("/player");
|
||||
}
|
||||
},
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import { MediaUrl } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { Dialog, IconButton } from "@mui/material";
|
||||
import React, { useState } from "react";
|
||||
import ReactPlayer from "react-player";
|
||||
|
||||
type TrailerButtonType = {
|
||||
trailerItem: MediaUrl[];
|
||||
disabled: boolean;
|
||||
};
|
||||
|
||||
const TrailerButton = (props: TrailerButtonType) => {
|
||||
const [dialog, setDialog] = useState(false);
|
||||
return (
|
||||
<>
|
||||
<IconButton
|
||||
disabled={props.disabled ?? false}
|
||||
onClick={() => setDialog(true)}
|
||||
>
|
||||
<span className="material-symbols-rounded">theaters</span>
|
||||
</IconButton>
|
||||
<Dialog
|
||||
maxWidth="md"
|
||||
fullWidth
|
||||
open={dialog}
|
||||
PaperProps={{
|
||||
style: {
|
||||
overflow: "hidden",
|
||||
},
|
||||
}}
|
||||
onClose={() => setDialog(false)}
|
||||
>
|
||||
<ReactPlayer
|
||||
playing={false}
|
||||
url={props.trailerItem[0]?.Url}
|
||||
width="100%"
|
||||
height="auto"
|
||||
style={{
|
||||
aspectRatio: "16/9",
|
||||
}}
|
||||
controls
|
||||
/>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default TrailerButton;
|
||||
@@ -25,17 +25,26 @@
|
||||
&-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 8px rgb(0 0 0 / 0.2);
|
||||
border-radius: $border-radius-default;
|
||||
overflow: hidden;
|
||||
height: auto;
|
||||
z-index: 0;
|
||||
&.thumb{
|
||||
aspect-ratio: 1.777777;
|
||||
}
|
||||
&.portrait{
|
||||
aspect-ratio: 0.666666;
|
||||
}
|
||||
&.square {
|
||||
aspect-ratio: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&-icon {
|
||||
font-size: 5.4em !important;
|
||||
fill: url(#clr-gradient-default) !important;
|
||||
&-container {
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
background: linear-gradient(45deg, rgb(255 255 255 / 0.05), rgb(255 255 255 / 0.15));
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
@@ -131,4 +140,27 @@
|
||||
border-radius: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
&-progress{
|
||||
// width: attr('data-progress');
|
||||
height: 100%;
|
||||
background: white;
|
||||
transition: width $transition-time-default ease-in-out;
|
||||
&-container{
|
||||
$padding: 12px;
|
||||
position: absolute;
|
||||
bottom: $padding;
|
||||
left: $padding;
|
||||
right: $padding;
|
||||
height: 4.5px;
|
||||
background: rgb(255 255 255 / 0.5);
|
||||
backdrop-filter: blur(10px);
|
||||
box-shadow: 0 0 10px rgb(20 20 20 / 0.5);
|
||||
z-index: 1;
|
||||
overflow: hidden;
|
||||
box-sizing: content-box;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,24 @@
|
||||
/** @format */
|
||||
|
||||
import React from "react";
|
||||
import { Component, useState } from "react";
|
||||
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import { getTypeIcon } from "../utils/iconsCollection";
|
||||
import "./card.module.scss";
|
||||
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import {
|
||||
type BaseItemDto,
|
||||
BaseItemKind,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import LikeButton from "../buttons/likeButton";
|
||||
import MarkPlayedButton from "../buttons/markPlayedButton";
|
||||
import PlayButton from "../buttons/playButton";
|
||||
import ErrorBoundary from "../errorBoundary";
|
||||
import { getTypeIcon } from "../utils/iconsCollection";
|
||||
import "./card.module.scss";
|
||||
|
||||
const cardImageAspectRatios = {
|
||||
thumb: 1.777,
|
||||
@@ -29,43 +34,32 @@ const availableSpecialRoutes = [
|
||||
BaseItemKind.Playlist,
|
||||
];
|
||||
|
||||
/**
|
||||
* @typedef {Object} Props
|
||||
* @property {import("@jellyfin/sdk/lib/generated-client/models").BaseItemDto} item
|
||||
* @property {string} cardTitle
|
||||
* @property {string | number} cardCaption
|
||||
* @property {string} imageType
|
||||
* @property {string} imageBlurhash
|
||||
* @property {'thumb' | 'portrait' | 'square'} cardType
|
||||
* @property {Array} queryKey
|
||||
* @property {string} userId
|
||||
* @property {string} seriesId
|
||||
* @property {boolean} hideText
|
||||
* @property {() => {}} onClick
|
||||
* @property {boolean} disableOverlay
|
||||
* @property {boolean} disablePadding
|
||||
* @property {any} overrideIcon
|
||||
*/
|
||||
|
||||
/**
|
||||
* @description Hero section for item pages
|
||||
* @param {Props}
|
||||
* @returns {React.Component}
|
||||
*/
|
||||
|
||||
export const Card = ({
|
||||
item,
|
||||
cardTitle,
|
||||
cardCaption,
|
||||
imageType = "Primary",
|
||||
cardType,
|
||||
cardType = "square",
|
||||
queryKey,
|
||||
userId,
|
||||
seriesId,
|
||||
hideText,
|
||||
hideText = false,
|
||||
onClick,
|
||||
disableOverlay = false,
|
||||
overrideIcon,
|
||||
}: {
|
||||
item: BaseItemDto;
|
||||
cardTitle: string | null;
|
||||
cardCaption: string | null;
|
||||
imageType: string;
|
||||
cardType: string;
|
||||
queryKey: [];
|
||||
userId: string;
|
||||
seriesId: string | null;
|
||||
hideText: boolean;
|
||||
onClick: Function | null;
|
||||
disableOverlay: boolean;
|
||||
overrideIcon: any;
|
||||
}) => {
|
||||
const [api] = useApi((state) => [state.api]);
|
||||
const navigate = useNavigate();
|
||||
@@ -80,18 +74,14 @@ export const Card = ({
|
||||
navigate(`/item/${item.Id}`);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
className="card"
|
||||
elevation={0}
|
||||
onClick={onClick ? onClick : defaultOnClick}
|
||||
>
|
||||
<div
|
||||
className="card-image-container"
|
||||
style={{
|
||||
aspectRatio: cardImageAspectRatios[cardType],
|
||||
}}
|
||||
>
|
||||
<div className={`card-image-container ${cardType}`}>
|
||||
<ErrorBoundary fallback>
|
||||
<div
|
||||
className="card-indicator check"
|
||||
@@ -99,12 +89,16 @@ export const Card = ({
|
||||
opacity: item.UserData?.Played ? 1 : 0,
|
||||
}}
|
||||
>
|
||||
<div className="material-symbols-rounded">done</div>
|
||||
<div className="material-symbols-rounded">
|
||||
done
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className={"card-indicator text"}
|
||||
style={{
|
||||
opacity: item.UserData?.UnplayedItemCount ? 1 : 0,
|
||||
opacity: item.UserData?.UnplayedItemCount
|
||||
? 1
|
||||
: 0,
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
@@ -127,7 +121,9 @@ export const Card = ({
|
||||
/>
|
||||
)} */}
|
||||
<div className="card-image-icon-container">
|
||||
{overrideIcon ? getTypeIcon(overrideIcon) : getTypeIcon(item.Type)}
|
||||
{overrideIcon
|
||||
? getTypeIcon(overrideIcon)
|
||||
: getTypeIcon(item.Type)}
|
||||
</div>
|
||||
<img
|
||||
alt={item.Name}
|
||||
@@ -137,16 +133,11 @@ export const Card = ({
|
||||
: api.getItemImageUrl(
|
||||
seriesId
|
||||
? item.SeriesId
|
||||
: item.AlbumId
|
||||
? item.AlbumId
|
||||
: item.Id,
|
||||
: item.AlbumId ?? item.Id,
|
||||
imageType,
|
||||
{
|
||||
quality: 90,
|
||||
fillHeight: 226,
|
||||
fillWidth: Math.floor(
|
||||
226 / cardImageAspectRatios[cardType],
|
||||
),
|
||||
fillWidth: 400,
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -157,8 +148,9 @@ export const Card = ({
|
||||
}}
|
||||
loading="lazy"
|
||||
onLoad={(e) => {
|
||||
e.target.style.opacity = 1;
|
||||
e.currentTarget.style.setProperty("opacity", "1");
|
||||
}}
|
||||
onLoadStart={(e) => console.log(e)}
|
||||
className="card-image"
|
||||
/>
|
||||
<div className="card-overlay">
|
||||
@@ -177,12 +169,16 @@ export const Card = ({
|
||||
}}
|
||||
iconOnly
|
||||
audio={
|
||||
item.Type === BaseItemKind.MusicAlbum ||
|
||||
item.Type ===
|
||||
BaseItemKind.MusicAlbum ||
|
||||
item.Type === BaseItemKind.Audio ||
|
||||
item.Type === BaseItemKind.AudioBook ||
|
||||
item.Type ===
|
||||
BaseItemKind.AudioBook ||
|
||||
item.Type === BaseItemKind.Playlist
|
||||
}
|
||||
playlistItem={
|
||||
item.Type === BaseItemKind.Playlist
|
||||
}
|
||||
playlistItem={item.Type === BaseItemKind.Playlist}
|
||||
playlistItemId={item.Id}
|
||||
/>
|
||||
<LikeButton
|
||||
@@ -202,6 +198,17 @@ export const Card = ({
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{item.UserData?.PlaybackPositionTicks > 0 && (
|
||||
<div className="card-progress-container">
|
||||
<div
|
||||
className="card-progress"
|
||||
style={{
|
||||
width: `${item.UserData?.PlayedPercentage}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{/*
|
||||
{item.UserData?.PlaybackPositionTicks > 0 && (
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
@@ -218,7 +225,7 @@ export const Card = ({
|
||||
}}
|
||||
color="primary"
|
||||
/>
|
||||
)}
|
||||
)} */}
|
||||
</div>
|
||||
<div
|
||||
className="card-text-container"
|
||||
@@ -24,6 +24,7 @@ import PlayButton from "../buttons/playButton";
|
||||
* @property {string} imageBlurhash
|
||||
* @property {Array} queryKey
|
||||
* @property {string} userId
|
||||
* @property {boolean} disableRunTime
|
||||
* @property {() => {}} onClick
|
||||
*/
|
||||
|
||||
@@ -40,6 +41,7 @@ export const EpisodeCard = ({
|
||||
imageBlurhash,
|
||||
queryKey,
|
||||
userId,
|
||||
disableRunTime = false,
|
||||
onClick,
|
||||
}) => {
|
||||
const [api] = useApi((state) => [state.api]);
|
||||
@@ -126,7 +128,7 @@ export const EpisodeCard = ({
|
||||
<MarkPlayedButton
|
||||
itemId={item.Id}
|
||||
itemName={item.Name}
|
||||
isPlayed={item.UserData.Played}
|
||||
isPlayed={item.UserData?.Played}
|
||||
queryKey={queryKey}
|
||||
userId={userId}
|
||||
/>
|
||||
@@ -172,15 +174,17 @@ export const EpisodeCard = ({
|
||||
>
|
||||
{cardTitle}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
fontWeight={500}
|
||||
noWrap
|
||||
textAlign="start"
|
||||
style={{ opacity: 0.8, flexShrink: 0 }}
|
||||
>
|
||||
{getRuntimeCompact(item.RunTimeTicks)}
|
||||
</Typography>
|
||||
{!disableRunTime && (
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
fontWeight={500}
|
||||
noWrap
|
||||
textAlign="start"
|
||||
style={{ opacity: 0.8, flexShrink: 0 }}
|
||||
>
|
||||
{getRuntimeCompact(item.RunTimeTicks)}
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<Typography
|
||||
|
||||
@@ -57,8 +57,12 @@ const CarouselSlide = ({ item }) => {
|
||||
const handleMoreInfo = () => {
|
||||
if (availableSpecialRoutes.includes(item.Type)) {
|
||||
navigate(`/${item.Type.toLocaleLowerCase()}/${item.Id}`);
|
||||
} else if (item.Role) {
|
||||
} else if (!!item.Role || item.Type === BaseItemKind.Person) {
|
||||
navigate(`/person/${item.Id}`);
|
||||
} else if (item.Type === BaseItemKind.MusicArtist) {
|
||||
navigate(`/artist/${item.Id}`);
|
||||
} else if (item.Type === BaseItemKind.Episode) {
|
||||
navigate(`/episode/${item.Id}`);
|
||||
} else {
|
||||
navigate(`/item/${item.Id}`);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import { Link, Typography } from "@mui/material";
|
||||
import React from "react";
|
||||
|
||||
import imdbIcon from "../../assets/icons/imdb.svg";
|
||||
import musicBrainzIcon from "../../assets/icons/musicbrainz.svg";
|
||||
import tvDbIcon from "../../assets/icons/the-tvdb.svg";
|
||||
import tmdbIcon from "../../assets/icons/themoviedatabase.svg";
|
||||
import traktIcon from "../../assets/icons/trakt.svg";
|
||||
|
||||
const knownIcons = ["imdb", "themoviedb", "trakt", "musicbrainz", "thetvdb"];
|
||||
|
||||
const IconLink = ({ name, url }: { name: string; url: string }) => {
|
||||
return (
|
||||
<Link target="_blank" href={url} className="item-detail-link">
|
||||
{name.toLocaleLowerCase() === "imdb" && <img src={imdbIcon} alt="IMDb" />}
|
||||
{name.toLocaleLowerCase() === "themoviedb" && (
|
||||
<img src={tmdbIcon} alt="TheMovieDb" />
|
||||
)}
|
||||
{name.toLocaleLowerCase() === "trakt" && (
|
||||
<img src={traktIcon} alt="Trakt" />
|
||||
)}
|
||||
{name.toLocaleLowerCase() === "musicbrainz" && (
|
||||
<img src={musicBrainzIcon} alt="MusicBrainz" />
|
||||
)}
|
||||
{name.toLocaleLowerCase() === "thetvdb" && (
|
||||
<img src={tvDbIcon} alt="THeTVDB" />
|
||||
)}
|
||||
{!knownIcons.includes(name.toLocaleLowerCase()) && (
|
||||
<Typography>{name}</Typography>
|
||||
)}
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
|
||||
export default IconLink;
|
||||
@@ -35,7 +35,7 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
||||
queryKey: ["homeSection, latestMedia", latestMediaLib],
|
||||
queryFn: () => fetchLatestMedia(latestMediaLib[0]),
|
||||
enabled: !!user.data,
|
||||
networkMode: "always",
|
||||
refetchOnMount: true
|
||||
});
|
||||
if (data.isPending) {
|
||||
return <CardsSkeleton />;
|
||||
|
||||
@@ -1,177 +0,0 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { NavLink, useLocation } from "react-router-dom";
|
||||
|
||||
import MuiDrawer from "@mui/material/Drawer";
|
||||
import Tooltip from "@mui/material/Tooltip";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { styled } from "@mui/material/styles";
|
||||
|
||||
import { getTypeIcon } from "../../components/utils/iconsCollection.jsx";
|
||||
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import "./sidemenu.module.scss";
|
||||
|
||||
import Icon from "../../assets/icon.svg";
|
||||
|
||||
const DrawerHeader = styled("div")(({ theme }) => ({
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-end",
|
||||
padding: theme.spacing(0, 1),
|
||||
...theme.mixins.toolbar,
|
||||
}));
|
||||
|
||||
const MiniDrawer = styled(MuiDrawer, {
|
||||
shouldForwardProp: (prop) => prop !== "open",
|
||||
})(({ theme }) => ({
|
||||
flexShrink: 0,
|
||||
whiteSpace: "nowrap",
|
||||
boxSizing: "border-box",
|
||||
backgroundColor: theme.palette.primary.background.dark,
|
||||
overflowX: "hidden",
|
||||
}));
|
||||
|
||||
export const SideMenu = () => {
|
||||
const [api] = useApi((state) => [state.api]);
|
||||
const location = useLocation();
|
||||
|
||||
const [display, setDisplay] = useState(false);
|
||||
|
||||
const user = useQuery({
|
||||
queryKey: ["user"],
|
||||
queryFn: async () => {
|
||||
const usr = await getUserApi(api).getCurrentUser();
|
||||
return usr.data;
|
||||
},
|
||||
enabled: display,
|
||||
networkMode: "always",
|
||||
});
|
||||
const libraries = useQuery({
|
||||
queryKey: ["libraries"],
|
||||
queryFn: async () => {
|
||||
const libs = await getUserViewsApi(api).getUserViews({
|
||||
userId: user.data.Id,
|
||||
});
|
||||
return libs.data;
|
||||
},
|
||||
enabled: !!user.data,
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
location.pathname.includes("login") ||
|
||||
location.pathname.includes("setup") ||
|
||||
location.pathname.includes("server") ||
|
||||
location.pathname.includes("player") ||
|
||||
location.pathname.includes("error") ||
|
||||
location.pathname === "/"
|
||||
) {
|
||||
setDisplay(false);
|
||||
} else {
|
||||
setDisplay(true);
|
||||
}
|
||||
}, [location]);
|
||||
|
||||
if (!display) {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
if (display) {
|
||||
return (
|
||||
<>
|
||||
<MiniDrawer
|
||||
variant="permanent"
|
||||
open={false}
|
||||
PaperProps={{
|
||||
sx: {
|
||||
backgroundColor: "inherit",
|
||||
border: "none",
|
||||
width: "5em",
|
||||
height: "100vh",
|
||||
zIndex: "1",
|
||||
},
|
||||
}}
|
||||
sx={{
|
||||
zIndex: 1,
|
||||
width: "5em",
|
||||
background: "transparent !important ",
|
||||
}}
|
||||
>
|
||||
<DrawerHeader
|
||||
className="Mui-DrawerHeader"
|
||||
sx={{
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<img alt="JellyPlayer" src={Icon} className="sidemenu-icon" />
|
||||
</DrawerHeader>
|
||||
<div className="sidemenu-item-container">
|
||||
{libraries.isPending ? (
|
||||
<></>
|
||||
) : (
|
||||
<>
|
||||
<NavLink to="/home" className="sidemenu-item small">
|
||||
<div className="sidemenu-item-icon">
|
||||
{getTypeIcon("Home")}
|
||||
</div>
|
||||
<Typography
|
||||
className="sidemenu-item-text"
|
||||
variant="caption"
|
||||
fontWeight={500}
|
||||
style={{
|
||||
width: "80%",
|
||||
}}
|
||||
overflow="hidden"
|
||||
textOverflow="ellipsis"
|
||||
textAlign="center"
|
||||
>
|
||||
Home
|
||||
</Typography>
|
||||
</NavLink>
|
||||
{libraries.data.Items.map((lib) => {
|
||||
return (
|
||||
<Tooltip
|
||||
title={lib.Name}
|
||||
placement="right"
|
||||
arrow
|
||||
followCursor
|
||||
key={lib.Id}
|
||||
>
|
||||
<NavLink
|
||||
to={`/library/${lib.Id}`}
|
||||
className="sidemenu-item"
|
||||
>
|
||||
<div className="sidemenu-item-icon">
|
||||
{getTypeIcon(lib.CollectionType)}
|
||||
</div>
|
||||
<Typography
|
||||
className="sidemenu-item-text"
|
||||
variant="caption"
|
||||
fontWeight={500}
|
||||
style={{
|
||||
width: "80%",
|
||||
}}
|
||||
overflow="hidden"
|
||||
textOverflow="ellipsis"
|
||||
textAlign="center"
|
||||
>
|
||||
{lib.Name}
|
||||
</Typography>
|
||||
</NavLink>
|
||||
</Tooltip>
|
||||
);
|
||||
})}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</MiniDrawer>
|
||||
</>
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -1,79 +0,0 @@
|
||||
|
||||
.sidemenu {
|
||||
&-icon {
|
||||
width: 60%;
|
||||
object-fit: cover;
|
||||
}
|
||||
&-item {
|
||||
&-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 1em;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
position: relative;
|
||||
width: 100%;
|
||||
color: rgb(255 255 255 / 0.7);
|
||||
transition: color $transition-time-fast;
|
||||
text-decoration: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
gap: 0.2em;
|
||||
margin-bottom: 0.8em;
|
||||
|
||||
&:hover {
|
||||
color: white;
|
||||
.material-symbols-rounded {
|
||||
font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 25,
|
||||
"opsz" 40;
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
color: white;
|
||||
.sidemenu-item-icon::before {
|
||||
opacity: 1;
|
||||
transform: scaleX(1);
|
||||
}
|
||||
.sidemenu-item-text {
|
||||
opacity: 1;
|
||||
}
|
||||
.material-symbols-rounded {
|
||||
font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 25,
|
||||
"opsz" 40;
|
||||
}
|
||||
}
|
||||
|
||||
&-text {
|
||||
transition: max-height 0.5s;
|
||||
transition-delay: 0.05s;
|
||||
|
||||
font-size: 0.7em !important;
|
||||
}
|
||||
|
||||
&-icon {
|
||||
padding: 0.15em 0.75em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
&::before {
|
||||
content: "";
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
background: $clr-gradient-default;
|
||||
z-index: -1;
|
||||
transform: scaleX(0.25);
|
||||
opacity: 0;
|
||||
border-radius: 100px;
|
||||
transition: opacity $transition-time-fast,
|
||||
transform $transition-time-fast;
|
||||
transition-delay: 0.1s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import { LinearProgress } from "@mui/material";
|
||||
import { useNProgress } from "@tanem/react-nprogress";
|
||||
import React from "react";
|
||||
|
||||
const NProgress: React.FC<{ isAnimating: boolean | number }> = ({
|
||||
isAnimating,
|
||||
}) => {
|
||||
const { animationDuration, isFinished, progress } = useNProgress({
|
||||
isAnimating,
|
||||
});
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
opacity: isFinished ? 0 : 1,
|
||||
pointerEvents: "none",
|
||||
transition: `opacity ${animationDuration}ms linear`,
|
||||
position: "fixed",
|
||||
top: "0",
|
||||
left: "0",
|
||||
right: "0",
|
||||
zIndex: "10000",
|
||||
}}
|
||||
>
|
||||
<LinearProgress
|
||||
sx={{
|
||||
height: 3,
|
||||
transitionDuration: animationDuration,
|
||||
}}
|
||||
value={progress * 100}
|
||||
variant="determinate"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default NProgress;
|
||||
@@ -1,3 +1,4 @@
|
||||
$image-size: 4em;
|
||||
|
||||
.audio-player {
|
||||
position: fixed;
|
||||
@@ -6,14 +7,14 @@
|
||||
background: rgb(0 0 0 / 0.6);
|
||||
z-index: 10;
|
||||
display: grid;
|
||||
padding: 1em;
|
||||
padding: 0.5em 1em;
|
||||
// margin: 1em;
|
||||
backdrop-filter: blur(10px);
|
||||
// border-radius: 10px;
|
||||
overflow: hidden;
|
||||
// overflow: hidden;
|
||||
gap: 1em;
|
||||
box-shadow: 0 0 20px rgb(0 0 0 / 0.25);
|
||||
|
||||
border-top: 1.2px solid rgb(255 255 255 / 0.2);
|
||||
grid-template-columns: 25% 1fr 25%;
|
||||
|
||||
#waveform {
|
||||
@@ -28,13 +29,14 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 1em;
|
||||
gap: 0.5em;
|
||||
padding: 0.5em 0;
|
||||
flex-flow: column;
|
||||
}
|
||||
&-info {
|
||||
display: grid;
|
||||
gap: 0.5em;
|
||||
grid-template-columns: minmax(0, 4.5em) minmax(0, 1fr);
|
||||
grid-template-columns: minmax(0, $image-size) minmax(0, 1fr);
|
||||
width: fit-content;
|
||||
align-items: center;
|
||||
flex-grow: 1;
|
||||
@@ -42,7 +44,7 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
&-image {
|
||||
width: 4.5em;
|
||||
width: $image-size;
|
||||
aspect-ratio: 1;
|
||||
object-fit: cover;
|
||||
z-index: 1;
|
||||
@@ -51,12 +53,14 @@
|
||||
|
||||
position: relative;
|
||||
&-container {
|
||||
border-radius: $border-radius-default;
|
||||
border-radius: 5px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: $clr-gradient-dark;
|
||||
height: fit-content;
|
||||
aspect-ratio: 1;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
|
||||
border: 1.2px solid rgb(255 255 255 / 0.1);
|
||||
}
|
||||
&-icon {
|
||||
position: absolute;
|
||||
@@ -64,11 +68,49 @@
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 2em !important;
|
||||
fill: url(#clr-gradient-default) !important;
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
||||
&-track {
|
||||
grid-template-columns: 4.5em 60% 0.5fr 0.5fr !important;
|
||||
grid-template-columns: $image-size 60% 0.5fr 0.5fr !important;
|
||||
}
|
||||
&-playlist{
|
||||
background: $clr-background-dark !important;
|
||||
border: 1.2px solid rgb(255 255 255 / 0.2);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
// Magic scrollbar
|
||||
&::-webkit-scrollbar {
|
||||
&-thumb {
|
||||
height: 150px;
|
||||
max-height: 33%;
|
||||
}
|
||||
&-track {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
background: transparent !important;
|
||||
}
|
||||
}
|
||||
|
||||
&-track{
|
||||
display: grid;
|
||||
gap: 1em;
|
||||
grid-template-columns: 4em 1fr 4em;
|
||||
cursor: pointer;
|
||||
&.active{
|
||||
color: $clr-accent-default;
|
||||
}
|
||||
&-image{
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
border: 1.2px solid rgb(255 255 255 / 0.1);
|
||||
overflow: hidden;
|
||||
border-radius:5px;
|
||||
width: 100%;
|
||||
aspect-ratio: 1;
|
||||
height: 4em;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,16 @@
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import React, {
|
||||
useEffect,
|
||||
useLayoutEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import Fab from "@mui/material/Fab";
|
||||
import Grow from "@mui/material/Grow";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import Popper from "@mui/material/Popper";
|
||||
@@ -13,6 +20,7 @@ import Typography from "@mui/material/Typography";
|
||||
import WaveSurfer from "wavesurfer.js";
|
||||
|
||||
import { useAudioPlayback } from "../../../utils/store/audioPlayback";
|
||||
import useQueue, { setTrackIndex } from "../../../utils/store/queue";
|
||||
|
||||
import { AnimatePresence } from "framer-motion";
|
||||
import "./audioPlayer.module.scss";
|
||||
@@ -32,11 +40,10 @@ const AudioPlayer = () => {
|
||||
url,
|
||||
display,
|
||||
item,
|
||||
tracks,
|
||||
currentTrack,
|
||||
// tracks,
|
||||
// currentTrack,
|
||||
setCurrentTrack,
|
||||
setAudioUrl,
|
||||
setAudioDisplay,
|
||||
setAudioItem,
|
||||
setAudioTracks,
|
||||
resetPlayer,
|
||||
@@ -45,17 +52,21 @@ const AudioPlayer = () => {
|
||||
state.url,
|
||||
state.display,
|
||||
state.item,
|
||||
state.tracks,
|
||||
state.currentTrack,
|
||||
// state.tracks,
|
||||
// state.currentTrack,
|
||||
state.setCurrentTrack,
|
||||
state.setUrl,
|
||||
state.setDisplay,
|
||||
state.setItem,
|
||||
state.setTracks,
|
||||
state.reset,
|
||||
state.playlistItemId,
|
||||
]);
|
||||
|
||||
const [tracks, currentTrack] = useQueue((state) => [
|
||||
state.tracks,
|
||||
state.currentItemIndex,
|
||||
]);
|
||||
|
||||
const user = useQuery({
|
||||
queryKey: ["user"],
|
||||
queryFn: async () => {
|
||||
@@ -90,7 +101,7 @@ const AudioPlayer = () => {
|
||||
const waveSurfer = WaveSurfer.create({
|
||||
container: waveSurferContainerRef.current,
|
||||
dragToSeek: true,
|
||||
height: 35,
|
||||
height: 25,
|
||||
cursorColor: "#fb2376",
|
||||
progressColor: "#fb2376",
|
||||
waveColor: "#ffffff2f",
|
||||
@@ -110,8 +121,8 @@ const AudioPlayer = () => {
|
||||
setPlayerReady(true);
|
||||
setLoading(false);
|
||||
});
|
||||
waveSurfer.on("timeupdate", async (time) => {
|
||||
setCurrentTime(time);
|
||||
waveSurfer.on("timeupdate", async (atime) => {
|
||||
setCurrentTime(atime);
|
||||
});
|
||||
waveSurfer.on("redraw", () => {
|
||||
setShowWaveform(true);
|
||||
@@ -146,9 +157,9 @@ const AudioPlayer = () => {
|
||||
waveSurfer.destroy();
|
||||
};
|
||||
}
|
||||
}, [url, display, currentTrack]);
|
||||
}, [url, currentTrack]);
|
||||
|
||||
useEffect(() => {
|
||||
useLayoutEffect(() => {
|
||||
if (playerReady) {
|
||||
waveSurferRef.current.setVolume(volume);
|
||||
waveSurferRef.current.setMuted(isMuted);
|
||||
@@ -161,7 +172,7 @@ const AudioPlayer = () => {
|
||||
|
||||
const handleNext = () => {
|
||||
setPlaying(false);
|
||||
setCurrentTrack(currentTrack + 1);
|
||||
// setCurrentTrack(currentTrack + 1);
|
||||
setAudioUrl(
|
||||
`${api.basePath}/Audio/${
|
||||
tracks[currentTrack + 1].Id
|
||||
@@ -169,13 +180,19 @@ const AudioPlayer = () => {
|
||||
user.data.Id
|
||||
}&api_key=${api.accessToken}`,
|
||||
);
|
||||
setAudioItem(tracks[currentTrack + 1]);
|
||||
|
||||
setTrackIndex(currentTrack + 1);
|
||||
|
||||
// console.info(tracks[currentTrack + 1]);
|
||||
|
||||
console.log(currentTrack);
|
||||
// setAudioItem(tracks[currentTrack + 1]);
|
||||
setShowWaveform(false);
|
||||
};
|
||||
|
||||
const handlePrevious = () => {
|
||||
setPlaying(false);
|
||||
setCurrentTrack(currentTrack - 1);
|
||||
// setCurrentTrack(currentTrack - 1);
|
||||
setAudioUrl(
|
||||
`${api.basePath}/Audio/${
|
||||
tracks[currentTrack - 1].Id
|
||||
@@ -183,33 +200,322 @@ const AudioPlayer = () => {
|
||||
user.data.Id
|
||||
}&api_key=${api.accessToken}`,
|
||||
);
|
||||
setAudioItem(tracks[currentTrack - 1]);
|
||||
setTrackIndex(currentTrack - 1);
|
||||
// setAudioItem(tracks[currentTrack - 1]);
|
||||
setShowWaveform(false);
|
||||
};
|
||||
|
||||
const info = useMemo(
|
||||
() => (
|
||||
<div
|
||||
// initial={{
|
||||
// filter: "opacity(0)",
|
||||
// }}
|
||||
// animate={{
|
||||
// filter: "opacity(1)",
|
||||
// }}
|
||||
// exit={{
|
||||
// filter: "opacity(0)",
|
||||
// }}
|
||||
className="audio-player-info"
|
||||
>
|
||||
<div className="audio-player-image-container">
|
||||
<img
|
||||
alt={tracks[currentTrack].Name}
|
||||
className="audio-player-image"
|
||||
src={api.getItemImageUrl(
|
||||
Object.keys(tracks[currentTrack].ImageTags).length === 0
|
||||
? item.AlbumId
|
||||
: item.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 85,
|
||||
fillHeight: 462,
|
||||
fillWidth: 462,
|
||||
},
|
||||
)}
|
||||
/>
|
||||
<span className="material-symbols-rounded audio-player-image-icon">
|
||||
music_note
|
||||
</span>
|
||||
</div>
|
||||
<div className="audio-player-info-text">
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
fontWeight={500}
|
||||
>
|
||||
{tracks[currentTrack].IndexNumber
|
||||
? `${tracks[currentTrack].IndexNumber}. ${tracks[currentTrack].Name}`
|
||||
: tracks[currentTrack].Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
noWrap
|
||||
fontWeight={400}
|
||||
>
|
||||
by {tracks[currentTrack].Artists.map((artist) => artist).join(",")}
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
[currentTrack],
|
||||
);
|
||||
|
||||
const controls = useMemo(
|
||||
() => (
|
||||
<div style={{ display: "flex", gap: "1em" }}>
|
||||
<IconButton onClick={handlePrevious} disabled={currentTrack === 0}>
|
||||
<div className="material-symbols-rounded">skip_previous</div>
|
||||
</IconButton>
|
||||
<div
|
||||
style={{
|
||||
display: "inline-flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
position: "relative",
|
||||
}}
|
||||
>
|
||||
<CircularProgress
|
||||
size={48}
|
||||
style={{
|
||||
position: "absolute",
|
||||
zIndex: 1,
|
||||
opacity: loading ? 1 : 0,
|
||||
transition: "opacity 500ms",
|
||||
}}
|
||||
/>
|
||||
<Fab size="small" onClick={handlePlayPause}>
|
||||
<div
|
||||
className="material-symbols-rounded"
|
||||
style={{
|
||||
fontSize: "2em",
|
||||
}}
|
||||
>
|
||||
{playing ? "pause" : "play_arrow"}
|
||||
</div>
|
||||
</Fab>
|
||||
</div>
|
||||
<IconButton
|
||||
onClick={handleNext}
|
||||
disabled={tracks.length - 1 === currentTrack}
|
||||
>
|
||||
<div className="material-symbols-rounded">skip_next</div>
|
||||
</IconButton>
|
||||
</div>
|
||||
),
|
||||
[currentTrack, loading, playing, tracks.length],
|
||||
);
|
||||
|
||||
const buttons = useMemo(
|
||||
() => (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-end",
|
||||
}}
|
||||
>
|
||||
<Popper
|
||||
open={Boolean(queueButton)}
|
||||
anchorEl={queueButton}
|
||||
placement="top"
|
||||
style={{
|
||||
zIndex: 100,
|
||||
}}
|
||||
disablePortal
|
||||
modifiers={[
|
||||
{
|
||||
name: "flip",
|
||||
enabled: true,
|
||||
options: {
|
||||
altBoundary: true,
|
||||
rootBoundary: "document",
|
||||
padding: 8,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "preventOverflow",
|
||||
enabled: true,
|
||||
options: {
|
||||
altAxis: true,
|
||||
altBoundary: true,
|
||||
tether: true,
|
||||
rootBoundary: "document",
|
||||
padding: 8,
|
||||
},
|
||||
},
|
||||
]}
|
||||
transition
|
||||
>
|
||||
{({ TransitionProps }) => (
|
||||
<Grow
|
||||
{...TransitionProps}
|
||||
style={{
|
||||
transformOrigin: "50% 100% 0",
|
||||
}}
|
||||
timeout={250}
|
||||
>
|
||||
<Paper
|
||||
className="audio-player-playlist"
|
||||
style={{
|
||||
padding: "1em",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
width: "34em",
|
||||
maxHeight: "24em",
|
||||
overflowY: "auto",
|
||||
borderRadius: "20px",
|
||||
marginBottom: "2.4em",
|
||||
}}
|
||||
>
|
||||
{tracks.map((track, index) => {
|
||||
return (
|
||||
<div
|
||||
className={
|
||||
track.Id === tracks[currentTrack].Id
|
||||
? "audio-player-playlist-track active"
|
||||
: "audio-player-playlist-track"
|
||||
}
|
||||
onClick={() => setTrackIndex(index)}
|
||||
>
|
||||
<div className="audio-player-playlist-track-image">
|
||||
{Object.keys(track.ImageTags).includes("Primary") ? (
|
||||
<img
|
||||
alt={track.Name}
|
||||
src={api.getItemImageUrl(track.Id, "Primary", {
|
||||
quality: 80,
|
||||
tag: track.ImageTags["Primary"],
|
||||
fillWidth: 92,
|
||||
fillHeight: 92,
|
||||
})}
|
||||
style={{
|
||||
width: "inherit",
|
||||
height: "inherit",
|
||||
objectFit: "cover",
|
||||
}}
|
||||
/>
|
||||
) : track.AlbumPrimaryImageTag ? (
|
||||
<img
|
||||
alt={track.Name}
|
||||
src={api.getItemImageUrl(track.AlbumId, "Primary", {
|
||||
quality: 80,
|
||||
tag: track.AlbumPrimaryImageTag,
|
||||
fillWidth: 102,
|
||||
fillHeight: 102,
|
||||
})}
|
||||
style={{
|
||||
width: "inherit",
|
||||
height: "inherit",
|
||||
objectFit: "cover",
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
<Typography variant="subtitle1">
|
||||
{track.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="caption"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{track.Artists.join(", ")}
|
||||
</Typography>
|
||||
</div>
|
||||
<Typography variant="subtitle2">
|
||||
{getRuntimeMusic(track.RunTimeTicks)}
|
||||
</Typography>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</Paper>
|
||||
</Grow>
|
||||
)}
|
||||
</Popper>
|
||||
<IconButton onClick={handleOpenQueue}>
|
||||
<div className="material-symbols-rounded">queue_music</div>
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={(e) => {
|
||||
setIsMuted(!isMuted);
|
||||
}}
|
||||
>
|
||||
<div className="material-symbols-rounded">
|
||||
{isMuted ? "volume_mute" : "volume_up"}
|
||||
</div>
|
||||
</IconButton>
|
||||
<Slider
|
||||
value={isMuted ? 0 : volume * 100}
|
||||
step={1}
|
||||
max={100}
|
||||
onChange={(e, newVal) => setVolume(newVal / 100)}
|
||||
valueLabelDisplay="auto"
|
||||
valueLabelFormat={(value) => Math.floor(value)}
|
||||
size="small"
|
||||
sx={{
|
||||
mr: 1,
|
||||
ml: 1,
|
||||
width: "10em",
|
||||
"& .MuiSlider-valueLabel": {
|
||||
lineHeight: 1.2,
|
||||
fontSize: 24,
|
||||
background: "rgb(0 0 0 / 0.5)",
|
||||
backdropFilter: "blur(5px)",
|
||||
padding: 1,
|
||||
borderRadius: "10px",
|
||||
border: "1px solid rgb(255 255 255 / 0.15)",
|
||||
boxShadow: "0 0 10px rgb(0 0 0 / 0.4) ",
|
||||
transform: "translatey(-120%) scale(0)",
|
||||
"&:before": {
|
||||
display: "none",
|
||||
},
|
||||
"&.MuiSlider-valueLabelOpen": {
|
||||
transform: "translateY(-120%) scale(1)",
|
||||
},
|
||||
"& > *": {
|
||||
transform: "rotate(0deg)",
|
||||
},
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<IconButton onClick={resetPlayer}>
|
||||
<div className="material-symbols-rounded">close</div>
|
||||
</IconButton>
|
||||
</div>
|
||||
),
|
||||
[queueButton, volume, isMuted, currentTrack],
|
||||
);
|
||||
|
||||
return (
|
||||
<AnimatePresence mode="sync">
|
||||
{display && (
|
||||
<motion.div
|
||||
key={display}
|
||||
initial={{
|
||||
transform: "translateY(100%)",
|
||||
}}
|
||||
animate={{ transform: "translateY(0)" }}
|
||||
exit={{
|
||||
transform: "translateY(100%)",
|
||||
}}
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.2,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="audio-player"
|
||||
>
|
||||
<motion.div
|
||||
key={item.Id}
|
||||
<motion.div
|
||||
initial={{
|
||||
transform: "translateY(100%)",
|
||||
}}
|
||||
animate={{ transform: "translateY(0)" }}
|
||||
exit={{
|
||||
transform: "translateY(100%)",
|
||||
}}
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.2,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="audio-player"
|
||||
>
|
||||
{/* <motion.div
|
||||
initial={{
|
||||
filter: "opacity(0)",
|
||||
}}
|
||||
@@ -223,9 +529,10 @@ const AudioPlayer = () => {
|
||||
>
|
||||
<div className="audio-player-image-container">
|
||||
<img
|
||||
alt={tracks[currentTrack].Name}
|
||||
className="audio-player-image"
|
||||
src={api.getItemImageUrl(
|
||||
Object.keys(item.ImageTags).length === 0
|
||||
Object.keys(tracks[currentTrack].ImageTags).length === 0
|
||||
? item.AlbumId
|
||||
: item.Id,
|
||||
"Primary",
|
||||
@@ -248,9 +555,9 @@ const AudioPlayer = () => {
|
||||
}}
|
||||
fontWeight={500}
|
||||
>
|
||||
{item.IndexNumber
|
||||
? `${item.IndexNumber}. ${item.Name}`
|
||||
: item.Name}
|
||||
{tracks[currentTrack].IndexNumber
|
||||
? `${tracks[currentTrack].IndexNumber}. ${tracks[currentTrack].Name}`
|
||||
: tracks[currentTrack].Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
@@ -260,175 +567,51 @@ const AudioPlayer = () => {
|
||||
noWrap
|
||||
fontWeight={400}
|
||||
>
|
||||
by {item.Artists.map((artist) => artist).join(",")}
|
||||
by{" "}
|
||||
{tracks[currentTrack].Artists.map((artist) => artist).join(",")}
|
||||
</Typography>
|
||||
</div>
|
||||
</motion.div>
|
||||
<div className="audio-player-controls">
|
||||
<div style={{ display: "flex", gap: "1em" }}>
|
||||
<IconButton
|
||||
onClick={handlePrevious}
|
||||
disabled={currentTrack === 0}
|
||||
>
|
||||
<div className="material-symbols-rounded">skip_previous</div>
|
||||
</IconButton>
|
||||
<div
|
||||
style={{
|
||||
display: "inline-flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
position: "relative",
|
||||
}}
|
||||
>
|
||||
<CircularProgress
|
||||
size={48}
|
||||
style={{
|
||||
position: "absolute",
|
||||
zIndex: 1,
|
||||
opacity: loading ? 1 : 0,
|
||||
transition: "opacity 500ms",
|
||||
}}
|
||||
/>
|
||||
<Fab size="small" onClick={handlePlayPause}>
|
||||
<div
|
||||
className="material-symbols-rounded"
|
||||
style={{
|
||||
fontSize: "2em",
|
||||
}}
|
||||
>
|
||||
{playing ? "pause" : "play_arrow"}
|
||||
</div>
|
||||
</Fab>
|
||||
</div>
|
||||
<IconButton
|
||||
onClick={handleNext}
|
||||
disabled={tracks.length - 1 === currentTrack}
|
||||
>
|
||||
<div className="material-symbols-rounded">skip_next</div>
|
||||
</IconButton>
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
display: "flex",
|
||||
gap: "1em",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
fontWeight={300}
|
||||
style={{
|
||||
opacity: 0.8,
|
||||
}}
|
||||
>
|
||||
{getRuntimeMusic(secToTicks(currentTime))}
|
||||
</Typography>
|
||||
<div
|
||||
id="waveform"
|
||||
ref={waveSurferContainerRef}
|
||||
data-show={Boolean(showWaveform)}
|
||||
/>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
fontWeight={300}
|
||||
style={{
|
||||
opacity: 0.8,
|
||||
}}
|
||||
>
|
||||
{getRuntimeMusic(item.RunTimeTicks)}
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
</motion.div> */}
|
||||
{info}
|
||||
|
||||
<div className="audio-player-controls">
|
||||
{controls}
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
display: "flex",
|
||||
gap: "1em",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-end",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<Popper
|
||||
open={Boolean(queueButton)}
|
||||
anchorEl={queueButton}
|
||||
placement="top"
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
fontWeight={300}
|
||||
style={{
|
||||
zIndex: 100,
|
||||
opacity: 0.8,
|
||||
}}
|
||||
>
|
||||
<Paper
|
||||
style={{
|
||||
padding: "1em",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
width: "36em",
|
||||
}}
|
||||
>
|
||||
{tracks.map((track, index) => {
|
||||
return (
|
||||
<MusicTrack
|
||||
item={track}
|
||||
key={track.Id}
|
||||
queryKey={[]}
|
||||
userId={user.data.Id}
|
||||
className="audio-player-track"
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</Paper>
|
||||
</Popper>
|
||||
<IconButton onClick={handleOpenQueue} disabled>
|
||||
<div className="material-symbols-rounded">queue_music</div>
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={(e) => {
|
||||
setIsMuted(!isMuted);
|
||||
}}
|
||||
>
|
||||
<div className="material-symbols-rounded">
|
||||
{isMuted ? "volume_mute" : "volume_up"}
|
||||
</div>
|
||||
</IconButton>
|
||||
<Slider
|
||||
value={isMuted ? 0 : volume * 100}
|
||||
step={1}
|
||||
max={100}
|
||||
onChange={(e, newVal) => setVolume(newVal / 100)}
|
||||
valueLabelDisplay="auto"
|
||||
valueLabelFormat={(value) => Math.floor(value)}
|
||||
size="small"
|
||||
sx={{
|
||||
mr: 1,
|
||||
ml: 1,
|
||||
width: "10em",
|
||||
"& .MuiSlider-valueLabel": {
|
||||
lineHeight: 1.2,
|
||||
fontSize: 24,
|
||||
background: "rgb(0 0 0 / 0.5)",
|
||||
backdropFilter: "blur(5px)",
|
||||
padding: 1,
|
||||
borderRadius: "10px",
|
||||
border: "1px solid rgb(255 255 255 / 0.15)",
|
||||
boxShadow: "0 0 10px rgb(0 0 0 / 0.4) ",
|
||||
transform: "translatey(-120%) scale(0)",
|
||||
"&:before": {
|
||||
display: "none",
|
||||
},
|
||||
"&.MuiSlider-valueLabelOpen": {
|
||||
transform: "translateY(-120%) scale(1)",
|
||||
},
|
||||
"& > *": {
|
||||
transform: "rotate(0deg)",
|
||||
},
|
||||
},
|
||||
}}
|
||||
{getRuntimeMusic(secToTicks(currentTime))}
|
||||
</Typography>
|
||||
<div
|
||||
id="waveform"
|
||||
ref={waveSurferContainerRef}
|
||||
data-show={Boolean(showWaveform)}
|
||||
/>
|
||||
<IconButton onClick={resetPlayer}>
|
||||
<div className="material-symbols-rounded">close</div>
|
||||
</IconButton>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
fontWeight={300}
|
||||
style={{
|
||||
opacity: 0.8,
|
||||
}}
|
||||
>
|
||||
{getRuntimeMusic(tracks[currentTrack].RunTimeTicks)}
|
||||
</Typography>
|
||||
</div>
|
||||
</motion.div>
|
||||
)}
|
||||
</div>
|
||||
{buttons}
|
||||
</motion.div>
|
||||
</AnimatePresence>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,887 @@
|
||||
import {
|
||||
Button,
|
||||
Chip,
|
||||
Dialog,
|
||||
DialogActions,
|
||||
DialogContent,
|
||||
DialogTitle,
|
||||
Fab,
|
||||
FormControlLabel,
|
||||
IconButton,
|
||||
LinearProgress,
|
||||
Link,
|
||||
Skeleton,
|
||||
Switch,
|
||||
Tab,
|
||||
Tabs,
|
||||
TextField,
|
||||
Typography,
|
||||
styled,
|
||||
withStyles,
|
||||
} from "@mui/material";
|
||||
import { AnimatePresence, motion, transform } from "framer-motion";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import useSettingsStore, {
|
||||
setSettingsDialogOpen,
|
||||
setSettingsTabValue,
|
||||
} from "../../utils/store/settings";
|
||||
|
||||
import logo from "../../assets/logoBlack.png";
|
||||
|
||||
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { createApi, useApi } from "../../utils/store/api";
|
||||
import { useCentralStore } from "../../utils/store/central";
|
||||
import "./settings.module.scss";
|
||||
|
||||
import { RecommendedServerInfo } from "@jellyfin/sdk";
|
||||
import { LoadingButton } from "@mui/lab";
|
||||
import { red, yellow } from "@mui/material/colors";
|
||||
import { relaunch } from "@tauri-apps/api/process";
|
||||
import { checkUpdate, installUpdate } from "@tauri-apps/api/updater";
|
||||
import { enqueueSnackbar, useSnackbar } from "notistack";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import {
|
||||
delServer,
|
||||
getAllServers,
|
||||
getDefaultServer,
|
||||
setDefaultServer,
|
||||
setServer,
|
||||
} from "../../utils/storage/servers";
|
||||
import { delUser } from "../../utils/storage/user";
|
||||
|
||||
const motionConfig = {
|
||||
initial: {
|
||||
opacity: 0,
|
||||
},
|
||||
visible: {
|
||||
opacity: 1,
|
||||
},
|
||||
};
|
||||
|
||||
const Settings = () => {
|
||||
const [open, tabValue] = useSettingsStore((state) => [
|
||||
state.dialogOpen,
|
||||
state.tabValue,
|
||||
]);
|
||||
const [api, jellyfin] = useApi((state) => [state.api, state.jellyfin]);
|
||||
const systemInfo = useQuery({
|
||||
queryKey: ["about", "systemInfo"],
|
||||
queryFn: async () => {
|
||||
const result = await getSystemApi(api).getSystemInfo();
|
||||
return result.data;
|
||||
},
|
||||
enabled: Boolean(api) && open,
|
||||
});
|
||||
|
||||
const navigate = useNavigate();
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const [applicationVersion, serversOnDiskFn] = useCentralStore((state) => [
|
||||
state.clientVersion,
|
||||
state.allServersOnDisk,
|
||||
]);
|
||||
|
||||
const serversOnDisk = useQuery({
|
||||
queryKey: ["settings", "serversOnDisk"],
|
||||
queryFn: async () => await getAllServers(),
|
||||
enabled: open,
|
||||
});
|
||||
|
||||
const updateInfo = useQuery({
|
||||
queryKey: ["about", "updater"],
|
||||
queryFn: async () => await checkUpdate(),
|
||||
enabled: open,
|
||||
});
|
||||
|
||||
const defaultServer = useQuery({
|
||||
queryKey: ["settings", "default-server"],
|
||||
queryFn: async () => await getDefaultServer(),
|
||||
enabled: open,
|
||||
});
|
||||
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const [updating, setUpdating] = useState(false);
|
||||
const [serverState, setServerState] = useState();
|
||||
const [ask, setAsk] = useState(false);
|
||||
const [action, setAction] = useState(null);
|
||||
const [addServerDialog, setAddServerDialog] = useState(false);
|
||||
const [serverIp, setServerIp] = useState("");
|
||||
|
||||
const handleServerChange = useMutation({
|
||||
mutationFn: async () => {
|
||||
await delUser();
|
||||
await setDefaultServer(serverState.id);
|
||||
await defaultServer.refetch();
|
||||
createApi(serverState.address, null);
|
||||
queryClient.removeQueries();
|
||||
},
|
||||
onSuccess: async () => {
|
||||
setAsk(false);
|
||||
setSettingsDialogOpen(false);
|
||||
navigate("/login/index");
|
||||
},
|
||||
onError: (error) => {
|
||||
console.error(error);
|
||||
enqueueSnackbar("Error changing the server", {
|
||||
variant: "error",
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const handleDelete = async (server: RecommendedServerInfo) => {
|
||||
await delServer(server.id);
|
||||
|
||||
if (server.id === defaultServer.data) {
|
||||
await delUser();
|
||||
await serversOnDisk.refetch();
|
||||
|
||||
if (serversOnDisk.data.length > 0) {
|
||||
setDefaultServer(serversOnDisk.data[0].id);
|
||||
createApi(serversOnDisk.data[0].address, null);
|
||||
} else {
|
||||
// Reset Api as no server is present on disk
|
||||
useApi.setState(useApi.getInitialState());
|
||||
}
|
||||
setSettingsDialogOpen(false);
|
||||
queryClient.removeQueries();
|
||||
navigate("/");
|
||||
}
|
||||
enqueueSnackbar("Server deleted successfully!", { variant: "success" });
|
||||
setAsk(false);
|
||||
await serversOnDisk.refetch();
|
||||
await defaultServer.refetch();
|
||||
};
|
||||
|
||||
const addServer = useMutation({
|
||||
mutationFn: async () => {
|
||||
const servers =
|
||||
await jellyfin.discovery.getRecommendedServerCandidates(serverIp);
|
||||
const bestServer = jellyfin.discovery.findBestServer(servers);
|
||||
return bestServer;
|
||||
},
|
||||
onSuccess: async (bestServer) => {
|
||||
if (bestServer) {
|
||||
await setServer(bestServer.systemInfo.Id, bestServer);
|
||||
setAddServerDialog(false);
|
||||
enqueueSnackbar(
|
||||
"Client added successfully. You might need to refresh client list.",
|
||||
{
|
||||
variant: "success",
|
||||
},
|
||||
);
|
||||
await serversOnDisk.refetch();
|
||||
}
|
||||
},
|
||||
onError: (err) => {
|
||||
console.error(err);
|
||||
enqueueSnackbar(`${err}`, { variant: "error" });
|
||||
enqueueSnackbar("Something went wrong", { variant: "error" });
|
||||
},
|
||||
onSettled: async (bestServer) => {
|
||||
if (!bestServer) {
|
||||
enqueueSnackbar("Provided server address is not a Jellyfin server.", {
|
||||
variant: "error",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
open={open}
|
||||
fullWidth
|
||||
maxWidth="md"
|
||||
PaperProps={{
|
||||
className: "settings",
|
||||
}}
|
||||
onClose={() => setSettingsDialogOpen(false)}
|
||||
>
|
||||
<Tabs
|
||||
orientation="vertical"
|
||||
value={tabValue}
|
||||
onChange={(e, newValue) => {
|
||||
setSettingsTabValue(newValue);
|
||||
}}
|
||||
style={{
|
||||
borderRight: "1.2px solid rgb(255 255 255 / 0.1)",
|
||||
}}
|
||||
>
|
||||
<Tab
|
||||
icon={<span className="material-symbols-rounded">settings</span>}
|
||||
iconPosition="start"
|
||||
value={1}
|
||||
label="General"
|
||||
className="settings-tab"
|
||||
sx={{
|
||||
minHeight: "48px",
|
||||
height: "48px",
|
||||
}}
|
||||
/>
|
||||
<Tab
|
||||
icon={<span className="material-symbols-rounded">dns</span>}
|
||||
iconPosition="start"
|
||||
value={2}
|
||||
label="Servers"
|
||||
className="settings-tab"
|
||||
sx={{
|
||||
minHeight: "48px",
|
||||
height: "48px",
|
||||
}}
|
||||
/>
|
||||
<Tab
|
||||
icon={<span className="material-symbols-rounded">info</span>}
|
||||
iconPosition="start"
|
||||
value={10}
|
||||
label="About"
|
||||
className="settings-tab"
|
||||
sx={{
|
||||
minHeight: "48px",
|
||||
height: "48px",
|
||||
marginTop: "auto",
|
||||
}}
|
||||
/>
|
||||
</Tabs>
|
||||
<AnimatePresence mode="wait">
|
||||
<motion.div
|
||||
variants={motionConfig}
|
||||
initial="initial"
|
||||
animate="visible"
|
||||
exit="initial"
|
||||
key={tabValue}
|
||||
transition={{
|
||||
duration: 0.25,
|
||||
}}
|
||||
className="settings-scroll "
|
||||
>
|
||||
{/* General */}
|
||||
{tabValue === 1 && (
|
||||
<div className="settings-container">
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
<FormControlLabel
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="h6" fontWeight={400}>
|
||||
Enable DiscordRPC
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" fontWeight={200}>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Server */}
|
||||
{tabValue === 2 && (
|
||||
<motion.div
|
||||
layoutScroll
|
||||
className="settings-container settings-server-container"
|
||||
>
|
||||
{serversOnDisk.isSuccess &&
|
||||
serversOnDisk.data.map((server, index) => {
|
||||
return (
|
||||
<motion.div
|
||||
key={server.id}
|
||||
className="settings-server"
|
||||
initial={{
|
||||
transform: "translateY(10px)",
|
||||
opacity: 0,
|
||||
}}
|
||||
animate={{ transform: "translateY(0px)", opacity: 1 }}
|
||||
exit={{ transform: "translateY(-10px)", opacity: 1 }}
|
||||
transition={{
|
||||
delay: 0.1 * index,
|
||||
duration: 0.15,
|
||||
}}
|
||||
>
|
||||
<span className="material-symbols-rounded settings-server-icon">
|
||||
hard_drive
|
||||
</span>
|
||||
<div className="settings-server-info">
|
||||
<Typography
|
||||
variant="h5"
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
{server.systemInfo?.ServerName}
|
||||
{systemInfo.data?.Id === server.id && (
|
||||
<Chip
|
||||
label={
|
||||
<Typography
|
||||
variant="caption"
|
||||
fontWeight={600}
|
||||
fontFamily="JetBrains Mono Variable"
|
||||
>
|
||||
Current
|
||||
</Typography>
|
||||
}
|
||||
color="info"
|
||||
sx={{
|
||||
ml: 2,
|
||||
width: "5.4em",
|
||||
}}
|
||||
size="medium"
|
||||
/>
|
||||
)}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1">
|
||||
{server.address}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
className="settings-server-info-version"
|
||||
>
|
||||
Version:{" "}
|
||||
<Typography
|
||||
className="gradient-text"
|
||||
variant="subtitle2"
|
||||
fontWeight={700}
|
||||
>
|
||||
{server.systemInfo?.Version}
|
||||
</Typography>
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="settings-buttons">
|
||||
<IconButton
|
||||
style={{
|
||||
fontSize: "1.64em",
|
||||
}}
|
||||
onClick={() => {
|
||||
setAsk(true);
|
||||
setAction("change-server");
|
||||
setServerState(server);
|
||||
}}
|
||||
disabled={handleServerChange.isPending}
|
||||
>
|
||||
<div className="material-symbols-rounded">start</div>
|
||||
</IconButton>
|
||||
<IconButton
|
||||
style={{
|
||||
fontSize: "1.64em",
|
||||
|
||||
color: red[400],
|
||||
}}
|
||||
disabled={handleServerChange.isPending}
|
||||
onClick={() => {
|
||||
setAsk(true);
|
||||
setAction("delete-server");
|
||||
setServerState(server);
|
||||
}}
|
||||
>
|
||||
<div className="material-symbols-rounded">
|
||||
delete_forever
|
||||
</div>
|
||||
</IconButton>
|
||||
</div>
|
||||
</motion.div>
|
||||
);
|
||||
})}
|
||||
<div className="settings-server-fab-container">
|
||||
<Fab
|
||||
onClick={() => serversOnDisk.refetch()}
|
||||
size="medium"
|
||||
color="info"
|
||||
disabled={serversOnDisk.isFetching}
|
||||
>
|
||||
<span
|
||||
className={
|
||||
serversOnDisk.isFetching
|
||||
? "material-symbols-rounded animate-rotate"
|
||||
: "material-symbols-rounded"
|
||||
}
|
||||
>
|
||||
autorenew
|
||||
</span>
|
||||
</Fab>
|
||||
<Fab
|
||||
variant="extended"
|
||||
onClick={() => setAddServerDialog(true)}
|
||||
>
|
||||
<span
|
||||
className="material-symbols-rounded fill"
|
||||
style={{
|
||||
marginRight: "0.25em",
|
||||
}}
|
||||
>
|
||||
add_circle
|
||||
</span>
|
||||
Add server
|
||||
</Fab>
|
||||
</div>
|
||||
</motion.div>
|
||||
)}
|
||||
|
||||
{/* About */}
|
||||
{tabValue === 10 && (
|
||||
<div className="settings-container settings-about">
|
||||
<img src={logo} className="settings-logo" alt="JellyPlayer" />
|
||||
<div className="settings-grid">
|
||||
<div className="settings-info-container">
|
||||
<div className="settings-info">
|
||||
<Typography>Client Version:</Typography>
|
||||
<Chip
|
||||
icon={
|
||||
<span className="material-symbols-rounded">
|
||||
{updateInfo.data?.shouldUpdate
|
||||
? "update"
|
||||
: "update_disabled"}
|
||||
</span>
|
||||
}
|
||||
label={
|
||||
<Typography variant="subtitle1">
|
||||
{applicationVersion}
|
||||
</Typography>
|
||||
}
|
||||
color={
|
||||
updateInfo.data?.shouldUpdate ? "error" : "success"
|
||||
}
|
||||
size="medium"
|
||||
style={{
|
||||
width: "fit-content !important",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="settings-info">
|
||||
<Typography>Update Available:</Typography>
|
||||
<Typography>
|
||||
{updateInfo.isFetching
|
||||
? "Checking for new updates..."
|
||||
: updateInfo.data?.shouldUpdate
|
||||
? updateInfo.data.manifest?.version
|
||||
: "No update found."}
|
||||
</Typography>
|
||||
</div>
|
||||
<LoadingButton
|
||||
style={{
|
||||
marginTop: "auto",
|
||||
}}
|
||||
loading={updateInfo.isFetching || updating}
|
||||
variant="contained"
|
||||
disabled={!updateInfo.data?.shouldUpdate}
|
||||
loadingPosition="start"
|
||||
onClick={async () => {
|
||||
if (updateInfo.data?.shouldUpdate) {
|
||||
setUpdating(true);
|
||||
await installUpdate();
|
||||
enqueueSnackbar(
|
||||
"Update has been installed! You need to relaunch JellyPlayer.",
|
||||
{
|
||||
variant: "success",
|
||||
},
|
||||
);
|
||||
await relaunch();
|
||||
}
|
||||
}}
|
||||
>
|
||||
{updateInfo.isFetching
|
||||
? "Checking for Update..."
|
||||
: updateInfo.data?.shouldUpdate
|
||||
? "Update"
|
||||
: "No Update Found"}
|
||||
</LoadingButton>
|
||||
</div>
|
||||
{systemInfo.isSuccess ? (
|
||||
<div className="settings-info-container">
|
||||
<div className="settings-info">
|
||||
<Typography>Server:</Typography>
|
||||
<Typography>{systemInfo.data?.ServerName}</Typography>
|
||||
</div>
|
||||
<div className="settings-info">
|
||||
<Typography>Jellyfin Version:</Typography>
|
||||
<Typography>{systemInfo.data?.Version}</Typography>
|
||||
</div>
|
||||
<div className="settings-info">
|
||||
<Typography>Operating System:</Typography>
|
||||
<Typography>
|
||||
{systemInfo.data?.OperatingSystemDisplayName}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="settings-info">
|
||||
<Typography>Server Architecture:</Typography>
|
||||
<Typography>
|
||||
{systemInfo.data?.SystemArchitecture}
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<Skeleton
|
||||
variant="rectangular"
|
||||
sx={{
|
||||
height: "100%",
|
||||
borderRadius: "10px",
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
marginTop: "1em",
|
||||
background: "rgb(0 0 0 / 0.3)",
|
||||
padding: "1em",
|
||||
borderRadius: "10px",
|
||||
border: "1px solid rgb(255 255 255 / 0.1)",
|
||||
}}
|
||||
>
|
||||
<Typography variant="h6" fontWeight={300} mb={1}>
|
||||
Links:
|
||||
</Typography>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "flex-start",
|
||||
gap: "0.1em",
|
||||
}}
|
||||
>
|
||||
<Link
|
||||
target="_blank"
|
||||
href="https://github.com/prayag17/JellyPlayer"
|
||||
>
|
||||
https://github.com/prayag17/JellyPlayer
|
||||
</Link>
|
||||
<Link target="_blank" href="https://jellyfin.org">
|
||||
https://jellyfin.org
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</motion.div>
|
||||
</AnimatePresence>
|
||||
{/* Show dialog before deleting or changing server */}
|
||||
<Dialog open={ask} fullWidth maxWidth="xs">
|
||||
<DialogTitle>Are you sure?</DialogTitle>
|
||||
<DialogActions
|
||||
style={{
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
padding: "1em",
|
||||
gap: "1em",
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
variant="contained"
|
||||
color="error"
|
||||
fullWidth
|
||||
onClick={() => setAsk(false)}
|
||||
>
|
||||
No
|
||||
</Button>
|
||||
<Button
|
||||
variant="contained"
|
||||
color="success"
|
||||
fullWidth
|
||||
style={{
|
||||
margin: 0,
|
||||
}}
|
||||
onClick={() => {
|
||||
if (action === "change-server") {
|
||||
handleServerChange.mutate();
|
||||
} else if (action === "delete-server") {
|
||||
handleDelete(serverState);
|
||||
}
|
||||
}}
|
||||
>
|
||||
yes
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
{/* Add Server */}
|
||||
<Dialog open={addServerDialog} fullWidth>
|
||||
<DialogTitle>Add Server</DialogTitle>
|
||||
<DialogContent className="settings-server-add">
|
||||
<TextField
|
||||
variant="filled"
|
||||
label="Address"
|
||||
fullWidth
|
||||
onChange={(e) => setServerIp(e.target.value)}
|
||||
/>
|
||||
</DialogContent>
|
||||
<DialogActions
|
||||
style={{
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
padding: "1em",
|
||||
gap: "1em",
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
variant="contained"
|
||||
startIcon={
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{
|
||||
marginRight: "0.25em",
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
}}
|
||||
>
|
||||
cancel
|
||||
</span>
|
||||
}
|
||||
color="error"
|
||||
onClick={() => setAddServerDialog(false)}
|
||||
>
|
||||
Close
|
||||
</Button>
|
||||
<LoadingButton
|
||||
startIcon={
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{
|
||||
marginRight: "0.25em",
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
}}
|
||||
>
|
||||
add_circle
|
||||
</span>
|
||||
}
|
||||
variant="contained"
|
||||
loading={addServer.isPending}
|
||||
loadingPosition="start"
|
||||
onClick={addServer.mutate}
|
||||
color="success"
|
||||
>
|
||||
Add
|
||||
</LoadingButton>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
|
||||
export default Settings;
|
||||
@@ -0,0 +1,148 @@
|
||||
.settings{
|
||||
display: grid !important;
|
||||
grid-template-columns: 20% 1fr;
|
||||
height: 60vh;
|
||||
overflow: hidden !important;
|
||||
|
||||
.MuiTabs-flexContainerVertical{
|
||||
height: 100%;
|
||||
}
|
||||
&-container{
|
||||
margin: 14px 0 14px 14px;
|
||||
}
|
||||
&-tab{
|
||||
display: grid !important;
|
||||
grid-template-columns: 2em 1fr;
|
||||
align-items: center;
|
||||
justify-items: start !important;
|
||||
gap:1em;
|
||||
& .material-symbols-rounded{
|
||||
justify-self: center !important;
|
||||
}
|
||||
|
||||
}
|
||||
&-scroll{
|
||||
overflow-y: auto;
|
||||
mask-image: linear-gradient(to top, transparent, black 15px calc(100% - 15px), transparent);
|
||||
scrollbar-gutter:stable ;
|
||||
// Magic scrollbar
|
||||
&::-webkit-scrollbar {
|
||||
&-thumb {
|
||||
height: 150px;
|
||||
max-height: 33%;
|
||||
}
|
||||
&-track {
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
background: transparent !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// About page
|
||||
&-grid{
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||
gap:1em;
|
||||
}
|
||||
&-logo{
|
||||
width: 100%;
|
||||
background: rgb(255 255 255 / 1);
|
||||
padding: 2em;
|
||||
margin-bottom: 1em;
|
||||
border-radius: $border-radius-default;
|
||||
}
|
||||
&-info{
|
||||
display: grid;
|
||||
grid-template-columns: 40% 1fr;
|
||||
gap: 1em;
|
||||
justify-items: start;
|
||||
align-items: center;
|
||||
|
||||
&-container{
|
||||
background: rgb(0 0 0 / 0.3);
|
||||
border: 1px solid rgb(255 255 255 / 0.1);
|
||||
padding: 1em;
|
||||
border-radius: $border-radius-default;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap:0.4em;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
//settings
|
||||
&-option{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding: 0 !important;
|
||||
margin: 0 0 0.4em 0!important;
|
||||
}
|
||||
|
||||
//serverList
|
||||
&-server{
|
||||
&-container{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
align-items: center;
|
||||
padding-bottom: 4.6em;
|
||||
}
|
||||
|
||||
display: grid;
|
||||
grid-template-columns: 3.4em 1fr auto;
|
||||
justify-items: start;
|
||||
align-items: center;
|
||||
gap: 0.8em;
|
||||
background: rgb(0 0 0 / 0.3);
|
||||
padding: 1em;
|
||||
width: 100%;
|
||||
border-radius: $border-radius-default;
|
||||
|
||||
&-icon {
|
||||
font-size: 3.4em !important;
|
||||
font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 10, "opsz" 40;
|
||||
}
|
||||
&-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// width: 100%;
|
||||
&-version {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap:0.4em;
|
||||
}
|
||||
}
|
||||
&-buttons {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 0.5em;
|
||||
// width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&-fab-container {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
bottom: 14px;
|
||||
right: 14px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.8em;
|
||||
}
|
||||
|
||||
// Dialog
|
||||
&-add {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 1em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.Mui-selected .material-symbols-rounded{
|
||||
font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40;
|
||||
}
|
||||
@@ -11,9 +11,10 @@ export const CarouselSkeleton = () => {
|
||||
elevation={0}
|
||||
sx={{
|
||||
height: "70vh",
|
||||
margin: "4.4em 1.6em 1.6em 1.6em",
|
||||
margin: "0.6em 1.6em 1.6em 1.6em",
|
||||
position: "relative",
|
||||
background: theme.palette.primary.background.main,
|
||||
background: "black",
|
||||
border: "1px solid rgb(255 255 255 / 0.2)",
|
||||
borderRadius: "10px",
|
||||
overflow: "hidden",
|
||||
}}
|
||||
@@ -24,23 +25,31 @@ export const CarouselSkeleton = () => {
|
||||
variant="text"
|
||||
sx={{ fontSize: "8rem" }}
|
||||
width={300}
|
||||
animation="wave"
|
||||
// animation="wave"
|
||||
/>
|
||||
</Typography>
|
||||
<Typography variant="p" className="hero-carousel-text">
|
||||
<Typography
|
||||
variant="p"
|
||||
className="hero-carousel-text"
|
||||
style={{ display: "flex", flexDirection: "column" }}
|
||||
>
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{ fontSize: "3rem" }}
|
||||
sx={{ fontSize: "2rem" }}
|
||||
width={400}
|
||||
animation="wave"
|
||||
// animation="wave"
|
||||
/>
|
||||
</Typography>
|
||||
<Typography variant="p" className="hero-carousel-text">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{ fontSize: "3rem" }}
|
||||
sx={{ fontSize: "2rem" }}
|
||||
width={400}
|
||||
animation="wave"
|
||||
// animation="wave"
|
||||
/>
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{ fontSize: "2rem" }}
|
||||
width={400}
|
||||
// animation="wave"
|
||||
/>
|
||||
</Typography>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
import { Divider, Skeleton, Typography } from "@mui/material";
|
||||
import React from "react";
|
||||
|
||||
const EpisodeSkeleton = () => {
|
||||
return Array.from(new Array(8)).map((a, index) => {
|
||||
return <>
|
||||
<div
|
||||
key={index}
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
className="item-detail-episode"
|
||||
>
|
||||
<Typography variant="h6"><Skeleton variant="circular" sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}} /></Typography>
|
||||
<div className="item-detail-episode-image-container">
|
||||
<Skeleton className="item-detail-episode-image" variant="rectangular" sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}} />
|
||||
</div>
|
||||
<div className="item-detail-episode-info">
|
||||
<Typography variant="h4">
|
||||
<Skeleton variant="text" width="10em" sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}} />
|
||||
</Typography>
|
||||
<Skeleton variant="rounded" width="5em" style={{ borderRadius: "100px" }} sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}} />
|
||||
<Typography style={{
|
||||
width: "100%"
|
||||
}}>
|
||||
<Skeleton width="100%" sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}} />
|
||||
<Skeleton width="100%" sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}} />
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
{index !== 7 && <Divider orientation="horizontal" flexItem />}
|
||||
|
||||
</>
|
||||
})
|
||||
}
|
||||
|
||||
export default EpisodeSkeleton
|
||||
@@ -0,0 +1,124 @@
|
||||
import React from "react";
|
||||
|
||||
import { Divider, LinearProgress, Skeleton } from "@mui/material";
|
||||
|
||||
const ItemSkeleton = () => {
|
||||
return (
|
||||
<div
|
||||
className="item item-default scrollY padded-top flex flex-column"
|
||||
style={{
|
||||
width: "100vw",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="item-hero flex flex-row"
|
||||
style={{
|
||||
height: "50vh",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="item-hero-image-container"
|
||||
style={{
|
||||
aspectRatio: 0.6666,
|
||||
boxShadow: "0 0 black",
|
||||
}}
|
||||
>
|
||||
<Skeleton
|
||||
variant="rounded"
|
||||
style={{
|
||||
height: "50vh",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className="item-hero-detail flex flex-column"
|
||||
style={
|
||||
{
|
||||
// width: "50vw",
|
||||
}
|
||||
}
|
||||
>
|
||||
<Skeleton variant="text" sx={{ fontSize: "4rem" }} width="50%" />
|
||||
{/* </Typography> */}
|
||||
|
||||
<div
|
||||
className="item-hero-buttons-container flex flex-row"
|
||||
style={{
|
||||
width: "70%",
|
||||
gap: "1em",
|
||||
justifyContent: "flex-start",
|
||||
}}
|
||||
>
|
||||
<Skeleton
|
||||
width="10rem"
|
||||
height="3rem"
|
||||
sx={{
|
||||
fontSize: "3rem",
|
||||
borderRadius: "3em",
|
||||
transform: "scale(1)",
|
||||
}}
|
||||
/>
|
||||
<div className="flex flex-row" style={{ gap: "1em" }}>
|
||||
<Skeleton
|
||||
width="3rem"
|
||||
height="3rem"
|
||||
sx={{
|
||||
fontSize: "3rem",
|
||||
borderRadius: "3em",
|
||||
transform: "scale(1)",
|
||||
aspectRatio: "1",
|
||||
}}
|
||||
/>
|
||||
<Skeleton
|
||||
width="3rem"
|
||||
height="3rem"
|
||||
sx={{
|
||||
fontSize: "3rem",
|
||||
borderRadius: "3em",
|
||||
transform: "scale(1)",
|
||||
aspectRatio: "1",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="item-detail">
|
||||
<div style={{ width: "100%" }}>
|
||||
<Skeleton variant="text" />
|
||||
<Skeleton variant="text" />
|
||||
<Skeleton variant="text" />
|
||||
</div>
|
||||
<Divider flexItem orientation="vertical" />
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<Skeleton
|
||||
variant="rounded"
|
||||
sx={{
|
||||
fontSize: "2.4rem",
|
||||
mb: 1,
|
||||
}}
|
||||
/>
|
||||
<Skeleton
|
||||
variant="rounded"
|
||||
sx={{
|
||||
fontSize: "2.4rem",
|
||||
mb: 1,
|
||||
}}
|
||||
/>
|
||||
<Skeleton
|
||||
variant="rounded"
|
||||
sx={{
|
||||
fontSize: "2.4rem",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ItemSkeleton;
|
||||
@@ -1,10 +1,8 @@
|
||||
import Card from "@mui/material/Card";
|
||||
import CardContent from "@mui/material/CardContent";
|
||||
import CardMedia from "@mui/material/CardMedia";
|
||||
import Divider from "@mui/material/Divider";
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Grid from "@mui/material/Unstable_Grid2";
|
||||
import EpisodeSkeleton from "./episode";
|
||||
|
||||
import { borderRadiusDefault } from "../../palette.module.scss";
|
||||
|
||||
@@ -47,75 +45,9 @@ export const SeasonSelectorSkeleton = () => {
|
||||
paddingBottom: " 0.5em",
|
||||
}}
|
||||
/>
|
||||
{Array.from(new Array(4)).map((a, index) => {
|
||||
return (
|
||||
<Grid xs={1} sm={1} md={1} key={a}>
|
||||
<Card sx={{ background: "transparent" }} elevation={0}>
|
||||
<CardMedia>
|
||||
<Skeleton
|
||||
// animation="wave"
|
||||
variant="rectangular"
|
||||
sx={{
|
||||
aspectRatio: "1.777",
|
||||
height: "auto",
|
||||
m: 1,
|
||||
borderRadius: "10px",
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
}}
|
||||
/>
|
||||
</CardMedia>
|
||||
<CardContent
|
||||
sx={{
|
||||
padding: "0 0.5em",
|
||||
alignItems: "flex-start",
|
||||
backgroundColor: "transparent",
|
||||
}}
|
||||
>
|
||||
<Typography variant="h6">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
}}
|
||||
/>
|
||||
</Typography>
|
||||
|
||||
<Typography variant="body2">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
}}
|
||||
/>
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
}}
|
||||
/>
|
||||
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
}}
|
||||
/>
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
);
|
||||
})}
|
||||
<div className="item-detail-episode-container">
|
||||
<EpisodeSkeleton/>
|
||||
</div>
|
||||
</Grid>
|
||||
);
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import { BrowserRouter as Router } from "react-router-dom";
|
||||
import { MemoryRouter as Router } from "react-router-dom";
|
||||
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
|
||||
@@ -10,7 +10,8 @@ const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
networkMode: "always",
|
||||
staleTime: 2 * 60 * 1000, // 2 minutes
|
||||
staleTime: 1 * 60 * 1000, // 1 minute,
|
||||
refetchInterval: 10 * 60 * 1000, // 10 minutes,
|
||||
},
|
||||
mutations: {
|
||||
networkMode: "always",
|
||||
|
||||
@@ -157,8 +157,8 @@ $border-radius: 20px;
|
||||
}
|
||||
}
|
||||
&-backdrop {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
object-fit: cover;
|
||||
object-position: top;
|
||||
opacity: 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import PropTypes from "prop-types";
|
||||
import React, { useEffect, useLayoutEffect } from "react";
|
||||
import React, { useEffect, useLayoutEffect, useRef } from "react";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import Chip from "@mui/material/Chip";
|
||||
@@ -11,7 +11,8 @@ import Typography from "@mui/material/Typography";
|
||||
|
||||
import { Link, NavLink, useParams } from "react-router-dom";
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
import { motion, useScroll } from "framer-motion";
|
||||
import useParallax from "../../utils/hooks/useParallax";
|
||||
|
||||
import {
|
||||
BaseItemKind,
|
||||
@@ -45,6 +46,8 @@ import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||
import "./album.module.scss";
|
||||
|
||||
import IconLink from "../../components/iconLink";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
|
||||
@@ -170,6 +173,13 @@ const MusicAlbumTitlePage = () => {
|
||||
}
|
||||
}, [item.isSuccess]);
|
||||
|
||||
const pageRef = useRef(null);
|
||||
const { scrollYProgress } = useScroll({
|
||||
target: pageRef,
|
||||
offset: ["start start", "60vh start"],
|
||||
});
|
||||
const parallax = useParallax(scrollYProgress, 50);
|
||||
|
||||
if (item.isPending || similarItems.isPending) {
|
||||
return (
|
||||
<Box
|
||||
@@ -200,11 +210,12 @@ const MusicAlbumTitlePage = () => {
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY padded-top item item-album"
|
||||
ref={pageRef}
|
||||
>
|
||||
<div className="item-hero flex flex-row">
|
||||
<div className="item-hero-backdrop-container">
|
||||
{item.data.BackdropImageTags ? (
|
||||
<img
|
||||
<motion.img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(
|
||||
item.data.ParentBackdropItemId,
|
||||
@@ -217,6 +228,9 @@ const MusicAlbumTitlePage = () => {
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
style={{
|
||||
y: parallax,
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
@@ -346,14 +360,7 @@ const MusicAlbumTitlePage = () => {
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls.map((url) => (
|
||||
<Link
|
||||
key={url.Url}
|
||||
target="_blank"
|
||||
to={url.Url}
|
||||
className="item-detail-link"
|
||||
>
|
||||
<Typography>{url.Name}</Typography>
|
||||
</Link>
|
||||
<IconLink url={url.Url} name={url.Name} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
}
|
||||
}
|
||||
&-backdrop {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
object-fit: cover;
|
||||
object-position: top;
|
||||
opacity: 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import PropTypes from "prop-types";
|
||||
import React, { useState, useEffect, useLayoutEffect } from "react";
|
||||
import React, { useState, useEffect, useLayoutEffect, useRef } from "react";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
@@ -8,7 +8,8 @@ import Tab from "@mui/material/Tab";
|
||||
import Tabs from "@mui/material/Tabs";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
import { AnimatePresence, motion, useScroll } from "framer-motion";
|
||||
import useParallax from "../../utils/hooks/useParallax";
|
||||
|
||||
import { Link, useParams } from "react-router-dom";
|
||||
|
||||
@@ -36,6 +37,8 @@ import { useApi } from "../../utils/store/api";
|
||||
import { setBackdrop, useBackdropStore } from "../../utils/store/backdrop";
|
||||
import "./artist.module.scss";
|
||||
|
||||
import IconLink from "../../components/iconLink";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
|
||||
@@ -176,6 +179,13 @@ const ArtistTitlePage = () => {
|
||||
}
|
||||
}, [item.isSuccess]);
|
||||
|
||||
const pageRef = useRef(null);
|
||||
const { scrollYProgress } = useScroll({
|
||||
target: pageRef,
|
||||
offset: ["start start", "60vh start"],
|
||||
});
|
||||
const parallax = useParallax(scrollYProgress, 50);
|
||||
|
||||
if (item.isPending) {
|
||||
return (
|
||||
<Box
|
||||
@@ -206,10 +216,11 @@ const ArtistTitlePage = () => {
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY item item-artist"
|
||||
ref={pageRef}
|
||||
>
|
||||
<div className="item-hero flex flex-row">
|
||||
<div className="item-hero-backdrop-container">
|
||||
<img
|
||||
<motion.img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
@@ -218,6 +229,9 @@ const ArtistTitlePage = () => {
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
style={{
|
||||
y: parallax,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
@@ -294,14 +308,7 @@ const ArtistTitlePage = () => {
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls.map((url) => (
|
||||
<Link
|
||||
key={url.Url}
|
||||
target="_blank"
|
||||
to={url.Url}
|
||||
className="item-detail-link"
|
||||
>
|
||||
<Typography>{url.Name}</Typography>
|
||||
</Link>
|
||||
<IconLink url={url.Url} name={url.Name} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
}
|
||||
}
|
||||
&-backdrop {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
object-fit: cover;
|
||||
object-position: top;
|
||||
opacity: 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import PropTypes from "prop-types";
|
||||
import React, { useState, useEffect, useLayoutEffect } from "react";
|
||||
import React, { useState, useEffect, useLayoutEffect, useRef } from "react";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import Chip from "@mui/material/Chip";
|
||||
@@ -9,7 +9,8 @@ import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { Link, useNavigate, useParams } from "react-router-dom";
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
import { motion, useScroll } from "framer-motion";
|
||||
import useParallax from "../../utils/hooks/useParallax";
|
||||
|
||||
import {
|
||||
BaseItemKind,
|
||||
@@ -39,6 +40,9 @@ import PlayButton from "../../components/buttons/playButton";
|
||||
|
||||
import meshBg from "../../assets/herobg.png";
|
||||
import "./boxset.module.scss";
|
||||
|
||||
import IconLink from "../../components/iconLink";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
|
||||
@@ -128,6 +132,13 @@ const BoxSetTitlePage = () => {
|
||||
}
|
||||
}, [item.isSuccess]);
|
||||
|
||||
const pageRef = useRef(null);
|
||||
const { scrollYProgress } = useScroll({
|
||||
target: pageRef,
|
||||
offset: ["start start", "60vh start"],
|
||||
});
|
||||
const parallax = useParallax(scrollYProgress, 50);
|
||||
|
||||
if (item.isPending || similarItems.isPending) {
|
||||
return (
|
||||
<Box
|
||||
@@ -158,17 +169,21 @@ const BoxSetTitlePage = () => {
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY item item-boxset padded-top"
|
||||
ref={pageRef}
|
||||
>
|
||||
<div className="item-hero flex flex-row">
|
||||
<div className="item-hero-backdrop-container">
|
||||
{item.data.BackdropImageTags ? (
|
||||
<img
|
||||
<motion.img
|
||||
alt={item.data.Name}
|
||||
src={meshBg}
|
||||
className="item-hero-backdrop"
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
style={{
|
||||
y: parallax,
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
@@ -399,14 +414,7 @@ const BoxSetTitlePage = () => {
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls.map((url) => (
|
||||
<Link
|
||||
key={url.Url}
|
||||
target="_blank"
|
||||
to={url.Url}
|
||||
className="item-detail-link"
|
||||
>
|
||||
<Typography>{url.Name}</Typography>
|
||||
</Link>
|
||||
<IconLink url={url.Url} name={url.Name} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -52,8 +52,8 @@
|
||||
}
|
||||
}
|
||||
&-backdrop {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
object-fit: cover;
|
||||
object-position: top;
|
||||
opacity: 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import PropTypes from "prop-types";
|
||||
import React, { useState, useLayoutEffect } from "react";
|
||||
import React, { useState, useLayoutEffect, useRef } from "react";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import Chip from "@mui/material/Chip";
|
||||
@@ -16,7 +16,8 @@ import { Blurhash } from "react-blurhash";
|
||||
|
||||
import { Link, NavLink, useParams } from "react-router-dom";
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
import { motion, useScroll } from "framer-motion";
|
||||
import useParallax from "../../utils/hooks/useParallax";
|
||||
|
||||
import {
|
||||
BaseItemKind,
|
||||
@@ -36,6 +37,7 @@ import Hero from "../../components/layouts/item/hero";
|
||||
import LikeButton from "../../components/buttons/likeButton";
|
||||
import MarkPlayedButton from "../../components/buttons/markPlayedButton";
|
||||
import PlayButton from "../../components/buttons/playButton";
|
||||
import TrailerButton from "../../components/buttons/trailerButton";
|
||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||
import ShowMoreText from "../../components/showMoreText";
|
||||
import TextLink from "../../components/textLink";
|
||||
@@ -45,6 +47,9 @@ import { useApi } from "../../utils/store/api";
|
||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||
import "./episode.module.scss";
|
||||
|
||||
import dolbyIcon from "../../assets/icons/dolby.svg";
|
||||
import IconLink from "../../components/iconLink";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
|
||||
@@ -213,6 +218,15 @@ const EpisodeTitlePage = () => {
|
||||
if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("truehd")) {
|
||||
return "TrueHD";
|
||||
}
|
||||
if (
|
||||
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("ddp") ||
|
||||
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("digital+")
|
||||
) {
|
||||
return "Digital+";
|
||||
}
|
||||
if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("dd")) {
|
||||
return "Digital";
|
||||
}
|
||||
return "";
|
||||
};
|
||||
|
||||
@@ -227,6 +241,13 @@ const EpisodeTitlePage = () => {
|
||||
return "2.0";
|
||||
};
|
||||
|
||||
const pageRef = useRef(null);
|
||||
const { scrollYProgress } = useScroll({
|
||||
target: pageRef,
|
||||
offset: ["start start", "60vh start"],
|
||||
});
|
||||
const parallax = useParallax(scrollYProgress, 50);
|
||||
|
||||
if (item.isPending) {
|
||||
return (
|
||||
<Box
|
||||
@@ -257,11 +278,12 @@ const EpisodeTitlePage = () => {
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY padded-top flex flex-column item item-episode"
|
||||
ref={pageRef}
|
||||
>
|
||||
<div className="item-hero flex flex-row">
|
||||
<div className="item-hero-backdrop-container">
|
||||
{item.data.BackdropImageTags ? (
|
||||
<img
|
||||
<motion.img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(
|
||||
item.data.ParentBackdropItemId,
|
||||
@@ -274,6 +296,9 @@ const EpisodeTitlePage = () => {
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
style={{
|
||||
y: parallax,
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
@@ -384,7 +409,23 @@ const EpisodeTitlePage = () => {
|
||||
<Chip
|
||||
variant="filled"
|
||||
label={
|
||||
<Typography variant="caption" fontWeight={600}>
|
||||
<Typography
|
||||
variant="caption"
|
||||
fontWeight={600}
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: "0.5em",
|
||||
}}
|
||||
>
|
||||
<img
|
||||
alt="Dolby"
|
||||
src={dolbyIcon}
|
||||
style={{
|
||||
height: "1.6em",
|
||||
}}
|
||||
/>
|
||||
{atmosLabel()}
|
||||
</Typography>
|
||||
}
|
||||
@@ -525,6 +566,10 @@ const EpisodeTitlePage = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-row" style={{ gap: "1em" }}>
|
||||
<TrailerButton
|
||||
trailerItem={item.data.RemoteTrailers}
|
||||
disabled={item.data.RemoteTrailers?.length === 0}
|
||||
/>
|
||||
<LikeButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
@@ -721,14 +766,7 @@ const EpisodeTitlePage = () => {
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls.map((url) => (
|
||||
<Link
|
||||
key={url.Url}
|
||||
target="_blank"
|
||||
to={url.Url}
|
||||
className="item-detail-link"
|
||||
>
|
||||
<Typography>{url.Name}</Typography>
|
||||
</Link>
|
||||
<IconLink url={url.Url} name={url.Name} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
-webkit-line-clamp: 2;
|
||||
margin-bottom: 0.5em;
|
||||
&-logo {
|
||||
max-width: 9em;
|
||||
max-width: 50vw;
|
||||
max-height: 3em;
|
||||
object-fit: contain;
|
||||
object-position: bottom;
|
||||
|
||||
@@ -52,7 +52,7 @@ const Home = () => {
|
||||
});
|
||||
return libs.data;
|
||||
},
|
||||
enabled: !!user.data,
|
||||
enabled: !!user.data && !!api.accessToken,
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
@@ -91,6 +91,7 @@ const Home = () => {
|
||||
return resumeItems.data;
|
||||
},
|
||||
enabled: !!user.data,
|
||||
refetchOnMount: true
|
||||
});
|
||||
|
||||
const resumeItemsAudio = useQuery({
|
||||
@@ -126,6 +127,7 @@ const Home = () => {
|
||||
return upNext.data;
|
||||
},
|
||||
enabled: !!user.data,
|
||||
refetchOnMount: true
|
||||
});
|
||||
|
||||
const [latestMediaLibs, setLatestMediaLibs] = useState([]);
|
||||
@@ -421,4 +423,4 @@ const Home = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default Home;
|
||||
export default React.memo(Home);
|
||||
@@ -1,5 +1,5 @@
|
||||
import PropTypes from "prop-types";
|
||||
import React, { useState, useLayoutEffect } from "react";
|
||||
import React, { useState, useLayoutEffect, useRef } from "react";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import Chip from "@mui/material/Chip";
|
||||
@@ -16,7 +16,8 @@ import { Blurhash } from "react-blurhash";
|
||||
|
||||
import { Link, NavLink, useParams } from "react-router-dom";
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
import { motion, useScroll } from "framer-motion";
|
||||
import useParallax from "../../utils/hooks/useParallax";
|
||||
|
||||
import {
|
||||
BaseItemKind,
|
||||
@@ -40,6 +41,7 @@ import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||
import LikeButton from "../../components/buttons/likeButton";
|
||||
import MarkPlayedButton from "../../components/buttons/markPlayedButton";
|
||||
import PlayButton from "../../components/buttons/playButton";
|
||||
import TrailerButton from "../../components/buttons/trailerButton";
|
||||
import ShowMoreText from "../../components/showMoreText";
|
||||
import TextLink from "../../components/textLink";
|
||||
import { getTypeIcon } from "../../components/utils/iconsCollection";
|
||||
@@ -47,6 +49,13 @@ import { endsAt, getRuntime } from "../../utils/date/time";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||
|
||||
import ItemSkeleton from "../../components/skeleton/item";
|
||||
|
||||
import dolbyAtmosIcon from "../../assets/icons/dolby-atmos.svg";
|
||||
import dolbyIcon from "../../assets/icons/dolby.svg";
|
||||
|
||||
import IconLink from "../../components/iconLink";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
|
||||
@@ -215,15 +224,15 @@ const ItemDetail = () => {
|
||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("2160p") ||
|
||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("4k")
|
||||
) {
|
||||
return <span className="material-symbols-rounded">4k</span>;
|
||||
return <span className="material-symbols-rounded fill">4k</span>;
|
||||
}
|
||||
if (
|
||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("1080p") ||
|
||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("hd")
|
||||
) {
|
||||
return <span className="material-symbols-rounded">full_hd</span>;
|
||||
return <span className="material-symbols-rounded fill">full_hd</span>;
|
||||
}
|
||||
return <span className="material-symbols-rounded">hd</span>;
|
||||
return <span className="material-symbols-rounded fill">hd</span>;
|
||||
};
|
||||
|
||||
const atmosLabel = () => {
|
||||
@@ -239,6 +248,15 @@ const ItemDetail = () => {
|
||||
if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("truehd")) {
|
||||
return "TrueHD";
|
||||
}
|
||||
if (
|
||||
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("ddp") ||
|
||||
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("digital+")
|
||||
) {
|
||||
return "Digital+";
|
||||
}
|
||||
if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("dd")) {
|
||||
return "Digital";
|
||||
}
|
||||
return "";
|
||||
};
|
||||
|
||||
@@ -252,19 +270,28 @@ const ItemDetail = () => {
|
||||
return "2.0";
|
||||
};
|
||||
|
||||
const pageRef = useRef(null);
|
||||
const { scrollYProgress } = useScroll({
|
||||
layoutEffect: false,
|
||||
target: pageRef,
|
||||
offset: ["start start", "60vh start"],
|
||||
});
|
||||
const parallax = useParallax(scrollYProgress, 50);
|
||||
|
||||
if (item.isPending || similarItems.isPending) {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
width: "100%",
|
||||
height: "100vh",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
// <Box
|
||||
// sx={{
|
||||
// width: "100%",
|
||||
// height: "100vh",
|
||||
// display: "flex",
|
||||
// alignItems: "center",
|
||||
// justifyContent: "center",
|
||||
// }}
|
||||
// >
|
||||
// <CircularProgress />
|
||||
// </Box>
|
||||
<ItemSkeleton />
|
||||
);
|
||||
}
|
||||
|
||||
@@ -283,11 +310,12 @@ const ItemDetail = () => {
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY padded-top flex flex-column item item-default"
|
||||
ref={pageRef}
|
||||
>
|
||||
<div className="item-hero flex flex-row">
|
||||
<div className="item-hero-backdrop-container">
|
||||
{item.data.BackdropImageTags ? (
|
||||
<img
|
||||
<motion.img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
@@ -296,6 +324,9 @@ const ItemDetail = () => {
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
style={{
|
||||
y: parallax,
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
@@ -334,13 +365,14 @@ const ItemDetail = () => {
|
||||
)}
|
||||
</div>
|
||||
<div className="item-hero-detail flex flex-column">
|
||||
{Object.keys(item.data.ImageTags).includes("Logo") ? (
|
||||
{item.data.ImageTags?.Logo ? (
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Logo", {
|
||||
quality: 90,
|
||||
fillWidth: 592,
|
||||
fillHeight: 592,
|
||||
tag: item.data.ImageTags.Logo,
|
||||
})}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
@@ -399,7 +431,23 @@ const ItemDetail = () => {
|
||||
<Chip
|
||||
variant="filled"
|
||||
label={
|
||||
<Typography variant="caption" fontWeight={600}>
|
||||
<Typography
|
||||
variant="caption"
|
||||
fontWeight={600}
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: "0.5em",
|
||||
}}
|
||||
>
|
||||
<img
|
||||
alt="Dolby"
|
||||
src={dolbyIcon}
|
||||
style={{
|
||||
height: "1.6em",
|
||||
}}
|
||||
/>
|
||||
{atmosLabel()}
|
||||
</Typography>
|
||||
}
|
||||
@@ -422,8 +470,8 @@ const ItemDetail = () => {
|
||||
// >
|
||||
// CC
|
||||
// </Typography>
|
||||
<span className="material-symbols-rounded">
|
||||
closed_caption
|
||||
<span className="material-symbols-rounded fill">
|
||||
subtitles
|
||||
</span>
|
||||
}
|
||||
sx={{
|
||||
@@ -458,12 +506,10 @@ const ItemDetail = () => {
|
||||
className="hero-carousel-info-rating"
|
||||
>
|
||||
<div
|
||||
className="material-symbols-rounded "
|
||||
className="material-symbols-rounded fill"
|
||||
style={{
|
||||
// fontSize: "2.2em",
|
||||
color: yellow[400],
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
}}
|
||||
>
|
||||
star
|
||||
@@ -488,12 +534,10 @@ const ItemDetail = () => {
|
||||
className="hero-carousel-info-rating"
|
||||
>
|
||||
<div
|
||||
className="material-symbols-rounded "
|
||||
className="material-symbols-rounded fill"
|
||||
style={{
|
||||
color:
|
||||
item.data.CriticRating > 50 ? green[400] : red[400],
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
}}
|
||||
>
|
||||
{item.data.CriticRating > 50 ? "thumb_up" : "thumb_down"}
|
||||
@@ -543,6 +587,10 @@ const ItemDetail = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-row" style={{ gap: "1em" }}>
|
||||
<TrailerButton
|
||||
trailerItem={item.data.RemoteTrailers}
|
||||
disabled={item.data.RemoteTrailers?.length === 0}
|
||||
/>
|
||||
<LikeButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
@@ -744,14 +792,7 @@ const ItemDetail = () => {
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls.map((url) => (
|
||||
<Link
|
||||
key={url.Url}
|
||||
target="_blank"
|
||||
to={url.Url}
|
||||
className="item-detail-link"
|
||||
>
|
||||
<Typography>{url.Name}</Typography>
|
||||
</Link>
|
||||
<IconLink url={url.Url} name={url.Name} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
}
|
||||
}
|
||||
&-backdrop {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
object-fit: cover;
|
||||
object-position: top;
|
||||
opacity: 0;
|
||||
@@ -65,9 +65,9 @@
|
||||
z-index: -1;
|
||||
mask-image: linear-gradient(to top, transparent, black);
|
||||
-webkit-mask-image: linear-gradient(
|
||||
to top,
|
||||
transparent,
|
||||
black
|
||||
to top,
|
||||
transparent,
|
||||
black
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -135,3 +135,26 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Global item-detail
|
||||
.item-detail-link{
|
||||
&:hover > img{
|
||||
filter: grayscale(0);
|
||||
}
|
||||
& > img {
|
||||
width: 2.5em;
|
||||
aspect-ratio: 1;
|
||||
filter: grayscale(1);
|
||||
transition: filter $transition-time-default;
|
||||
}
|
||||
}
|
||||
|
||||
.item {
|
||||
&-hero-image{
|
||||
box-sizing: border-box;
|
||||
&-container{
|
||||
box-sizing: content-box;
|
||||
border: 1.2px solid rgb(255 255 255 / 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,8 +42,9 @@
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
&-grid {
|
||||
--number-of-cols:8;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(8, minmax(0, 1fr));
|
||||
grid-template-columns: repeat(var(--number-of-cols), minmax(0, 1fr));
|
||||
justify-items: center;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
@@ -33,14 +33,14 @@ import { useSnackbar } from "notistack";
|
||||
|
||||
import { AppBarBackOnly } from "../../components/appBar/backOnly.jsx";
|
||||
import { AvatarImage } from "../../components/avatar/avatar.jsx";
|
||||
import { Card } from "../../components/card/card.jsx";
|
||||
import { Card } from "../../components/card/card";
|
||||
|
||||
import { getBrandingApi } from "@jellyfin/sdk/lib/utils/api/branding-api";
|
||||
import { getQuickConnectApi } from "@jellyfin/sdk/lib/utils/api/quick-connect-api";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
|
||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice.jsx";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import { createApi, useApi } from "../../utils/store/api";
|
||||
import "./login.module.scss";
|
||||
|
||||
import { setBackdrop } from "../../utils/store/backdrop.js";
|
||||
@@ -117,7 +117,14 @@ export const LoginWithImage = () => {
|
||||
);
|
||||
return auth;
|
||||
} catch (error) {
|
||||
enqueueSnackbar("Incorrect Password!", { variant: "error" });
|
||||
if (error.response?.status === 500) {
|
||||
enqueueSnackbar(
|
||||
"Unable to connect to server. Please try again after some time.",
|
||||
{ variant: "error" },
|
||||
);
|
||||
} else {
|
||||
enqueueSnackbar("Incorrect Password.", { variant: "error" });
|
||||
}
|
||||
setLoading(false);
|
||||
console.error(error);
|
||||
}
|
||||
@@ -127,10 +134,10 @@ export const LoginWithImage = () => {
|
||||
setLoading(true);
|
||||
const user = await authUser();
|
||||
sessionStorage.setItem("accessToken", user.data.AccessToken);
|
||||
createApi(api.basePath, user.data.AccessToken);
|
||||
if (rememberMe === true) {
|
||||
await saveUser(userName, user.data.AccessToken);
|
||||
}
|
||||
event.emit("set-api-accessToken", api.basePath);
|
||||
setLoading(false);
|
||||
navigate("/home");
|
||||
};
|
||||
@@ -175,12 +182,22 @@ export const LoginWithImage = () => {
|
||||
elevation={2}
|
||||
>
|
||||
<Typography
|
||||
textAlign="left"
|
||||
textAlign="center"
|
||||
variant="h5"
|
||||
sx={{ opacity: 0.8 }}
|
||||
mb={2}
|
||||
>
|
||||
Login as {userName}:
|
||||
Login as{" "}
|
||||
<Typography
|
||||
variant="h5"
|
||||
style={{
|
||||
display: "inline",
|
||||
}}
|
||||
fontWeight={700}
|
||||
className="gradient-text"
|
||||
>
|
||||
{userName}
|
||||
</Typography>
|
||||
</Typography>
|
||||
<FormGroup
|
||||
sx={{
|
||||
@@ -208,11 +225,11 @@ export const LoginWithImage = () => {
|
||||
>
|
||||
{password.showpass ? (
|
||||
<span className="material-symbols-rounded">
|
||||
visibility_off
|
||||
visibility
|
||||
</span>
|
||||
) : (
|
||||
<span className="material-symbols-rounded">
|
||||
visibility
|
||||
visibility_off
|
||||
</span>
|
||||
)}
|
||||
</IconButton>
|
||||
@@ -352,12 +369,12 @@ export const UserLogin = () => {
|
||||
}
|
||||
|
||||
sessionStorage.setItem("accessToken", auth.data.AccessToken);
|
||||
createApi(api.basePath, auth.data.AccessToken);
|
||||
|
||||
if (rememberMe === true) {
|
||||
await saveUser(auth.data.User.Name, auth.data.AccessToken);
|
||||
}
|
||||
|
||||
event.emit("set-api-accessToken", api.basePath);
|
||||
setQuickConnectLoading(-1);
|
||||
enqueueSnackbar(`Logged in as ${auth.data.User.Name}!`, {
|
||||
variant: "success",
|
||||
@@ -612,10 +629,10 @@ export const UserLoginManual = () => {
|
||||
setLoading(true);
|
||||
const user = await authUser();
|
||||
sessionStorage.setItem("accessToken", user.data.AccessToken);
|
||||
createApi(api.basePath, user.data.AccessToken);
|
||||
if (rememberMe === true) {
|
||||
await saveUser(userName, user.data.AccessToken);
|
||||
}
|
||||
event.emit("set-api-accessToken", api.basePath);
|
||||
setLoading(false);
|
||||
navigate("/home");
|
||||
};
|
||||
@@ -696,12 +713,12 @@ export const UserLoginManual = () => {
|
||||
}
|
||||
|
||||
sessionStorage.setItem("accessToken", auth.data.AccessToken);
|
||||
createApi(api.basePath, auth.data.AccessToken);
|
||||
|
||||
if (rememberMe === true) {
|
||||
await saveUser(userName, auth.data.AccessToken);
|
||||
}
|
||||
|
||||
event.emit("set-api-accessToken", api.basePath);
|
||||
setQuickConnectLoading(-1);
|
||||
enqueueSnackbar(`Logged in as ${auth.data.User.Name}!`, {
|
||||
variant: "success",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import PropTypes from "prop-types";
|
||||
import React, { useState, useEffect, useLayoutEffect } from "react";
|
||||
import React, { useState, useEffect, useLayoutEffect, useRef } from "react";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
@@ -8,7 +8,8 @@ import Tab from "@mui/material/Tab";
|
||||
import Tabs from "@mui/material/Tabs";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
import { AnimatePresence, motion, useScroll } from "framer-motion";
|
||||
import useParallax from "../../utils/hooks/useParallax";
|
||||
|
||||
import { Link, useParams } from "react-router-dom";
|
||||
|
||||
@@ -35,6 +36,8 @@ import meshBg from "../../assets/herobg.png";
|
||||
import ShowMoreText from "../../components/showMoreText";
|
||||
import "./person.module.scss";
|
||||
|
||||
import IconLink from "../../components/iconLink";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
|
||||
@@ -242,6 +245,13 @@ const PersonTitlePage = () => {
|
||||
|
||||
const [animationDirection, setAnimationDirection] = useState("forward");
|
||||
|
||||
const pageRef = useRef(null);
|
||||
const { scrollYProgress } = useScroll({
|
||||
target: pageRef,
|
||||
offset: ["start start", "60vh start"],
|
||||
});
|
||||
const parallax = useParallax(scrollYProgress, 50);
|
||||
|
||||
if (item.isPending) {
|
||||
return (
|
||||
<Box
|
||||
@@ -273,16 +283,20 @@ const PersonTitlePage = () => {
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY padded-top item item-person flex flex-column"
|
||||
ref={pageRef}
|
||||
>
|
||||
<div className="item-hero flex flex-row">
|
||||
<div className="item-hero-backdrop-container">
|
||||
<img
|
||||
<motion.img
|
||||
alt={item.data.Name}
|
||||
src={meshBg}
|
||||
className="item-hero-backdrop"
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
style={{
|
||||
y: parallax,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
@@ -344,14 +358,7 @@ const PersonTitlePage = () => {
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls.map((url) => (
|
||||
<Link
|
||||
key={url.Url}
|
||||
target="_blank"
|
||||
to={url.Url}
|
||||
className="item-detail-link"
|
||||
>
|
||||
<Typography>{url.Name}</Typography>
|
||||
</Link>
|
||||
<IconLink url={url.Url} name={url.Name} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -71,8 +71,8 @@
|
||||
}
|
||||
}
|
||||
&-backdrop {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
object-fit: cover;
|
||||
object-position: top;
|
||||
opacity: 0;
|
||||
|
||||
@@ -1,880 +0,0 @@
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
import React from "react";
|
||||
|
||||
import Backdrop from "@mui/material/Backdrop";
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Menu from "@mui/material/Menu";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import Slider from "@mui/material/Slider";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import ReactPlayer from "react-player";
|
||||
|
||||
import { usePlaybackStore } from "../../utils/store/playback";
|
||||
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { Navigate, useNavigate } from "react-router-dom";
|
||||
import { secToTicks, ticksToSec } from "../../utils/date/time";
|
||||
|
||||
import { getMediaInfoApi } from "@jellyfin/sdk/lib/utils/api/media-info-api";
|
||||
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||
|
||||
import "./videoPlayer.module.scss";
|
||||
|
||||
import { endsAt } from "../../utils/date/time";
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { ItemFields, LocationType } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
|
||||
import { useApi } from "../../utils/store/api";
|
||||
|
||||
export const VideoPlayer = () => {
|
||||
const navigate = useNavigate();
|
||||
const [api] = useApi((state) => [state.api]);
|
||||
|
||||
const [settingsMenuEl, setSettingsMenuEl] = useState(null);
|
||||
const settingsMenuState = Boolean(settingsMenuEl);
|
||||
|
||||
const [speedMenuEl, setSpeedMenuEl] = useState(null);
|
||||
const [speed, setSpeed] = useState(3);
|
||||
const speedMenuState = Boolean(speedMenuEl);
|
||||
const availableSpeeds = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
|
||||
|
||||
const [
|
||||
url,
|
||||
startPosition,
|
||||
itemDuration,
|
||||
itemId,
|
||||
itemName,
|
||||
audioStreamIndex,
|
||||
subtitleStreamIndex,
|
||||
userId,
|
||||
seriesId,
|
||||
setUrl,
|
||||
setPosition,
|
||||
setDurationStore,
|
||||
setItemId,
|
||||
setItemName,
|
||||
setAudioStreamIndex,
|
||||
setVideoStreamIndex,
|
||||
setSubtitleStreamIndex,
|
||||
setMediaSourceId,
|
||||
setUserId,
|
||||
setSeriesId,
|
||||
item,
|
||||
] = usePlaybackStore((state) => [
|
||||
state.url,
|
||||
state.startPosition,
|
||||
state.duration,
|
||||
state.itemId,
|
||||
state.itemName,
|
||||
state.audioStreamIndex,
|
||||
state.subtitleStreamIndex,
|
||||
state.userId,
|
||||
state.seriesId,
|
||||
state.setUrl,
|
||||
state.setPosition,
|
||||
state.setDuration,
|
||||
state.setItemId,
|
||||
state.setItemName,
|
||||
state.setAudioStreamIndex,
|
||||
state.setVideoStreamIndex,
|
||||
state.setSubtitleStreamIndex,
|
||||
state.setMediaSourceId,
|
||||
state.setUserId,
|
||||
state.setSeriesId,
|
||||
state.item,
|
||||
]);
|
||||
|
||||
const mediaInfo = useQuery({
|
||||
queryKey: ["videoPlayer", itemId, "mediaInfo"],
|
||||
queryFn: async () => {
|
||||
const result = await getMediaInfoApi(api).getPlaybackInfo({
|
||||
itemId: itemId,
|
||||
userId: userId,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
});
|
||||
|
||||
const episodes = useQuery({
|
||||
queryKey: ["videoPlayer", itemId, "episodes"],
|
||||
queryFn: async () => {
|
||||
const result = await getTvShowsApi(api).getEpisodes({
|
||||
userId: userId,
|
||||
seriesId: seriesId,
|
||||
fields: [ItemFields.MediaSources],
|
||||
excludeLocationTypes: [LocationType.Virtual],
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
});
|
||||
|
||||
const currentEpisodeIndex = episodes.data?.Items?.findIndex(
|
||||
(item) => item.Id === itemId,
|
||||
);
|
||||
|
||||
const [currentSubtrack] = useState(subtitleStreamIndex);
|
||||
|
||||
const [showControls, setShowControls] = useState(false);
|
||||
|
||||
const playerRef = useRef();
|
||||
const [isSeeking, setIsSeeking] = useState(false);
|
||||
const [isBuffering, setIsBuffering] = useState(true);
|
||||
const [isPlaying, setIsPlaying] = useState(true);
|
||||
const [isMuted, setIsMuted] = useState(false);
|
||||
const [isReady, setIsReady] = useState(false);
|
||||
const [isPIP, setIsPIP] = useState(false);
|
||||
const [volume, setVolume] = useState(0.8);
|
||||
|
||||
const [progress, setProgress] = useState(0);
|
||||
const [currentTime, setCurrentTime] = useState(startPosition);
|
||||
|
||||
const onReady = useCallback(async () => {
|
||||
if (!isReady) {
|
||||
const timeToStart = ticksToSec(startPosition);
|
||||
await getPlaystateApi(api).reportPlaybackStart({
|
||||
playbackStartInfo: {
|
||||
PlayMethod: mediaInfo.data?.MediaSources[0].SupportsDirectPlay
|
||||
? "DirectPlay"
|
||||
: mediaInfo.data?.MediaSources[0].SupportsDirectStream
|
||||
? "DirectStream"
|
||||
: "Transcode",
|
||||
AudioStreamIndex: audioStreamIndex,
|
||||
SubtitleStreamIndex: subtitleStreamIndex,
|
||||
userId: userId,
|
||||
CanSeek: true,
|
||||
ItemId: itemId,
|
||||
MediaSourceId: mediaInfo.data?.MediaSources[0].Id,
|
||||
PlaySessionId: mediaInfo.data?.PlaySessionId,
|
||||
},
|
||||
});
|
||||
|
||||
playerRef.current.seekTo(timeToStart, "seconds");
|
||||
setIsReady(true);
|
||||
}
|
||||
});
|
||||
|
||||
const handleDisplayCurrentTime = () => {
|
||||
let time = ticksToSec(progress * itemDuration);
|
||||
const hr = Math.floor(time / 3600);
|
||||
time -= hr * 3600;
|
||||
const min = Math.floor(time / 60);
|
||||
time -= min * 60;
|
||||
return `${hr.toLocaleString([], {
|
||||
minimumIntegerDigits: 2,
|
||||
maximumFractionDigits: 0,
|
||||
})}:${min.toLocaleString([], {
|
||||
minimumIntegerDigits: 2,
|
||||
maximumFractionDigits: 0,
|
||||
})}:${time.toLocaleString([], {
|
||||
minimumIntegerDigits: 2,
|
||||
maximumFractionDigits: 0,
|
||||
})}`;
|
||||
};
|
||||
|
||||
const handleDisplayTime = (ticks) => {
|
||||
let time = ticksToSec(ticks);
|
||||
const hr = Math.floor(time / 3600);
|
||||
time -= hr * 3600;
|
||||
const min = Math.floor(time / 60);
|
||||
time -= min * 60;
|
||||
return `${hr.toLocaleString([], {
|
||||
minimumIntegerDigits: 2,
|
||||
maximumFractionDigits: 0,
|
||||
})}:${min.toLocaleString([], {
|
||||
minimumIntegerDigits: 2,
|
||||
maximumFractionDigits: 0,
|
||||
})}:${time.toLocaleString([], {
|
||||
minimumIntegerDigits: 2,
|
||||
maximumFractionDigits: 0,
|
||||
})}`;
|
||||
};
|
||||
|
||||
const handlePlayNextEpisode = () => {
|
||||
// Reset Player time state
|
||||
setProgress(0);
|
||||
setCurrentTime(0);
|
||||
setIsPlaying(true);
|
||||
|
||||
setUserId(userId);
|
||||
|
||||
// Set all required stream index
|
||||
setAudioStreamIndex(0);
|
||||
setVideoStreamIndex(0);
|
||||
setSubtitleStreamIndex(0);
|
||||
|
||||
setMediaSourceId(episodes.data.Items[currentEpisodeIndex + 1].Id);
|
||||
|
||||
setUrl(
|
||||
`${api.basePath}/Videos/${episodes.data.Items[currentEpisodeIndex + 1].Id}/stream.
|
||||
${
|
||||
episodes.data.Items[currentEpisodeIndex + 1].MediaSources[0]
|
||||
.Container
|
||||
}
|
||||
?Static=true&mediaSourceId=${
|
||||
episodes.data.Items[currentEpisodeIndex + 1].Id
|
||||
}&deviceId=${api.deviceInfo.id}&api_key=${api.accessToken}&Tag=${
|
||||
episodes.data.Items[currentEpisodeIndex + 1].MediaSources[0].ETag
|
||||
}&videoStreamIndex=${0}&audioStreamIndex=${0}`,
|
||||
);
|
||||
setPosition(
|
||||
episodes.data.Items[currentEpisodeIndex + 1].UserData
|
||||
?.PlaybackPositionTicks,
|
||||
);
|
||||
|
||||
setSeriesId(episodes.data.Items[currentEpisodeIndex + 1].SeriesId);
|
||||
if (episodes.data.Items[currentEpisodeIndex + 1].ImageBlurHashes.Logo) {
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<img
|
||||
alt="Series Logo"
|
||||
src={`${api.basePath}/Items/${
|
||||
episodes.data.Items[currentEpisodeIndex + 1].SeriesId
|
||||
}/Images/Logo`}
|
||||
className="video-osd-name-logo"
|
||||
onLoad={(e) => {
|
||||
e.target.style.opacity = 1;
|
||||
}}
|
||||
/>
|
||||
<Typography variant="subtitle1">
|
||||
S{episodes.data.Items[currentEpisodeIndex + 1].ParentIndexNumber}
|
||||
:E
|
||||
{episodes.data.Items[currentEpisodeIndex + 1].IndexNumber}{" "}
|
||||
{episodes.data.Items[currentEpisodeIndex + 1].Name}
|
||||
</Typography>
|
||||
</div>,
|
||||
);
|
||||
} else {
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<Typography variant="h6">
|
||||
{episodes.data.Items[currentEpisodeIndex + 1].SeriesName}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1">
|
||||
S{episodes.data.Items[currentEpisodeIndex + 1].ParentIndexNumber}
|
||||
:E
|
||||
{episodes.data.Items[currentEpisodeIndex + 1].IndexNumber}{" "}
|
||||
{episodes.data.Items[currentEpisodeIndex + 1].Name}
|
||||
</Typography>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
|
||||
setItemId(episodes.data.Items[currentEpisodeIndex + 1].Id);
|
||||
setDurationStore(episodes.data.Items[currentEpisodeIndex + 1].RunTimeTicks);
|
||||
};
|
||||
const handlePlayPrevEpisode = () => {
|
||||
// Reset video player state
|
||||
setProgress(0);
|
||||
setCurrentTime(0);
|
||||
setIsPlaying(true);
|
||||
|
||||
setUserId(userId);
|
||||
|
||||
// Set all required stream index
|
||||
setAudioStreamIndex(0);
|
||||
setVideoStreamIndex(0);
|
||||
setSubtitleStreamIndex(0);
|
||||
|
||||
setMediaSourceId(episodes.data.Items[currentEpisodeIndex - 1].Id);
|
||||
|
||||
setUrl(
|
||||
`${api.basePath}/Videos/${episodes.data.Items[currentEpisodeIndex - 1].Id}/stream.
|
||||
${
|
||||
episodes.data.Items[currentEpisodeIndex - 1].MediaSources[0]
|
||||
.Container
|
||||
}
|
||||
?Static=true&mediaSourceId=${
|
||||
episodes.data.Items[currentEpisodeIndex - 1].Id
|
||||
}&deviceId=${api.deviceInfo.id}&api_key=${api.accessToken}&Tag=${
|
||||
episodes.data.Items[currentEpisodeIndex - 1].MediaSources[0].ETag
|
||||
}&videoStreamIndex=${0}&audioStreamIndex=${0}`,
|
||||
);
|
||||
setPosition(
|
||||
episodes.data.Items[currentEpisodeIndex - 1].UserData
|
||||
?.PlaybackPositionTicks,
|
||||
);
|
||||
|
||||
setSeriesId(episodes.data.Items[currentEpisodeIndex - 1].SeriesId);
|
||||
if (episodes.data.Items[currentEpisodeIndex - 1].ImageBlurHashes.Logo) {
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<img
|
||||
alt="Series Logo"
|
||||
src={`${api.basePath}/Items/${
|
||||
episodes.data.Items[currentEpisodeIndex - 1].SeriesId
|
||||
}/Images/Logo`}
|
||||
className="video-osd-name-logo"
|
||||
onLoad={(e) => {
|
||||
e.target.style.opacity = 1;
|
||||
}}
|
||||
/>
|
||||
<Typography variant="subtitle1">
|
||||
S{episodes.data.Items[currentEpisodeIndex - 1].ParentIndexNumber}
|
||||
:E
|
||||
{episodes.data.Items[currentEpisodeIndex - 1].IndexNumber}{" "}
|
||||
{episodes.data.Items[currentEpisodeIndex - 1].Name}
|
||||
</Typography>
|
||||
</div>,
|
||||
);
|
||||
} else {
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<Typography variant="h6">
|
||||
{episodes.data.Items[currentEpisodeIndex - 1].SeriesName}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1">
|
||||
S{episodes.data.Items[currentEpisodeIndex - 1].ParentIndexNumber}
|
||||
:E
|
||||
{episodes.data.Items[currentEpisodeIndex - 1].IndexNumber}{" "}
|
||||
{episodes.data.Items[currentEpisodeIndex - 1].Name}
|
||||
</Typography>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
|
||||
setItemId(episodes.data.Items[currentEpisodeIndex - 1].Id);
|
||||
setDurationStore(episodes.data.Items[currentEpisodeIndex - 1].RunTimeTicks);
|
||||
};
|
||||
|
||||
const [appFullscreen, setAppFullScreen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (showControls) {
|
||||
const timeout = setTimeout(() => {
|
||||
setShowControls(false);
|
||||
}, 5000);
|
||||
return () => {
|
||||
clearTimeout(timeout);
|
||||
};
|
||||
}
|
||||
}, [showControls]);
|
||||
|
||||
const handleKeyPress = useCallback((event) => {
|
||||
switch (event.key) {
|
||||
case "ArrowRight":
|
||||
playerRef.current.seekTo(playerRef.current.getCurrentTime() + 15);
|
||||
break;
|
||||
case "ArrowLeft":
|
||||
playerRef.current.seekTo(playerRef.current.getCurrentTime() - 15);
|
||||
break;
|
||||
case " ":
|
||||
setIsPlaying((state) => !state);
|
||||
break;
|
||||
case "ArrowUp":
|
||||
setVolume((state) => (state <= 0.9 ? state + 0.1 : state));
|
||||
break;
|
||||
case "ArrowDown":
|
||||
setVolume((state) => (state >= 0.1 ? state - 0.1 : state));
|
||||
break;
|
||||
case "F":
|
||||
case "f":
|
||||
setAppFullScreen((state) => !state);
|
||||
break;
|
||||
case "P":
|
||||
case "p":
|
||||
setIsPIP((state) => !state);
|
||||
break;
|
||||
case "M":
|
||||
case "m":
|
||||
setIsMuted((state) => !state);
|
||||
break;
|
||||
default:
|
||||
console.log(event.key);
|
||||
break;
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
appWindow.setFullscreen(appFullscreen);
|
||||
}, [appFullscreen]);
|
||||
|
||||
useEffect(() => {
|
||||
// attach the event listener
|
||||
document.addEventListener("keydown", handleKeyPress);
|
||||
|
||||
// remove the event listener
|
||||
return () => {
|
||||
document.removeEventListener("keydown", handleKeyPress);
|
||||
};
|
||||
}, [handleKeyPress]);
|
||||
|
||||
const [showVolume, setShowVolume] = useState(false);
|
||||
|
||||
// Show/Hide volume Indicator
|
||||
useEffect(() => {
|
||||
setShowVolume(true);
|
||||
const timeout = setTimeout(() => {
|
||||
setShowVolume(false);
|
||||
}, 5000);
|
||||
return () => {
|
||||
clearTimeout(timeout);
|
||||
};
|
||||
}, []);
|
||||
|
||||
const handleExit = async () => {
|
||||
// Remove app from fullscreen
|
||||
await appWindow.setFullscreen(false);
|
||||
// Send playback end report
|
||||
await getPlaystateApi(api).reportPlaybackStopped({
|
||||
playbackStopInfo: {
|
||||
Failed: false,
|
||||
Item: item,
|
||||
ItemId: itemId,
|
||||
MediaSourceId: mediaInfo.data?.MediaSources[0].Id,
|
||||
PlaySessionId: mediaInfo.data?.PlaySessionId,
|
||||
PositionTicks: currentTime,
|
||||
},
|
||||
});
|
||||
|
||||
navigate(-1);
|
||||
|
||||
// Reset playback store
|
||||
setUrl("");
|
||||
setPosition(0);
|
||||
setDurationStore(0);
|
||||
setItemId("");
|
||||
setItemName("");
|
||||
setAudioStreamIndex(0);
|
||||
setVideoStreamIndex(0);
|
||||
setSubtitleStreamIndex(0);
|
||||
setMediaSourceId("");
|
||||
setUserId("");
|
||||
setSeriesId("");
|
||||
};
|
||||
|
||||
const handleOnEnd = () => {
|
||||
if (seriesId) {
|
||||
if (episodes.isSuccess && episodes.data.TotalRecordCount > 0) {
|
||||
handlePlayNextEpisode();
|
||||
}
|
||||
} else {
|
||||
handleExit();
|
||||
}
|
||||
};
|
||||
|
||||
const onProgress = async (e) => {
|
||||
if (!isSeeking) {
|
||||
setProgress(e.played);
|
||||
setCurrentTime(secToTicks(e.playedSeconds));
|
||||
}
|
||||
await getPlaystateApi(api).reportPlaybackProgress({
|
||||
playbackProgressInfo: {
|
||||
PlayMethod: mediaInfo.data?.MediaSources[0].SupportsDirectPlay
|
||||
? "DirectPlay"
|
||||
: mediaInfo.data?.MediaSources[0].SupportsDirectStream
|
||||
? "DirectStream"
|
||||
: "Transcode",
|
||||
ItemId: itemId,
|
||||
IsMuted: isMuted,
|
||||
PositionTicks: secToTicks(e.playedSeconds),
|
||||
PlaybackStartTimeTicks: startPosition,
|
||||
VolumeLevel: volume * 100,
|
||||
IsPaused: !isPlaying,
|
||||
AudioStreamIndex: audioStreamIndex,
|
||||
Brightness: 100,
|
||||
CanSeek: true,
|
||||
MediaSourceId: mediaInfo.data?.MediaSources[0].Id,
|
||||
SubtitleStreamIndex: subtitleStreamIndex,
|
||||
PlaySessionId: mediaInfo.data?.PlaySessionId,
|
||||
},
|
||||
});
|
||||
if (Math.round(e.playedSeconds) === ticksToSec(itemDuration)) {
|
||||
handleOnEnd();
|
||||
}
|
||||
};
|
||||
|
||||
if (!itemId) {
|
||||
return (
|
||||
<>
|
||||
<Navigate to="/library/index" />;
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="video-player-container"
|
||||
style={{ background: "black" }}
|
||||
onMouseMove={() => {
|
||||
setShowControls(true);
|
||||
}}
|
||||
key={itemId}
|
||||
>
|
||||
<AnimatePresence>
|
||||
{showVolume && (
|
||||
<motion.div
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
exit={{ opacity: 0 }}
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: "4em",
|
||||
right: "4em",
|
||||
background: "rgb(0 0 0/ 0.5)",
|
||||
backdropFilter: "blur(10px)",
|
||||
width: "10em",
|
||||
height: "10em",
|
||||
padding: "1em",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
flexDirection: "column",
|
||||
borderRadius: "10px",
|
||||
border: "2px solid rgb(255 255 255 / 0.2)",
|
||||
gap: "2em",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="material-symbols-rounded"
|
||||
style={{ fontSize: "2.8em" }}
|
||||
>
|
||||
{isMuted ? "volume_mute" : "volume_up"}
|
||||
</div>
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
value={volume * 100}
|
||||
style={{
|
||||
width: "8em",
|
||||
margin: "0 1em",
|
||||
}}
|
||||
/>
|
||||
</motion.div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
<div
|
||||
style={{
|
||||
position: "absolute",
|
||||
inset: 0,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
opacity: isBuffering ? 1 : 0,
|
||||
transition: "opacity 250ms",
|
||||
}}
|
||||
>
|
||||
<CircularProgress />
|
||||
</div>
|
||||
<Backdrop
|
||||
className={showControls ? "video-osd video-osd-visible" : "video-osd"}
|
||||
sx={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
zIndex: 1000,
|
||||
justifyContent: "space-between",
|
||||
background: "transparent",
|
||||
}}
|
||||
open={showControls}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
background:
|
||||
"linear-gradient(to bottom, rgb(0 0 0 / 0.75), transparent)",
|
||||
width: "100vw",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
padding: "0.85em 1.2em",
|
||||
}}
|
||||
>
|
||||
<IconButton onClick={handleExit}>
|
||||
<span className="material-symbols-rounded">arrow_back</span>
|
||||
</IconButton>
|
||||
|
||||
{itemName}
|
||||
</div>
|
||||
<Stack
|
||||
direction="column"
|
||||
padding={2}
|
||||
width="100%"
|
||||
sx={{
|
||||
background:
|
||||
"linear-gradient(to top, rgb(0 0 0 / 0.75), transparent)",
|
||||
}}
|
||||
>
|
||||
<Stack
|
||||
width="100%"
|
||||
direction="row"
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
gap={2}
|
||||
>
|
||||
<Typography variant="h6">{handleDisplayCurrentTime()}</Typography>
|
||||
<Slider
|
||||
value={currentTime ? currentTime : 0}
|
||||
step={0.01}
|
||||
max={itemDuration}
|
||||
onChange={(e, newVal) => {
|
||||
setIsSeeking(true);
|
||||
setCurrentTime(newVal);
|
||||
}}
|
||||
onChangeCommitted={(e, newVal) => {
|
||||
playerRef.current.seekTo(ticksToSec(newVal));
|
||||
setCurrentTime(newVal);
|
||||
setIsSeeking(false);
|
||||
}}
|
||||
valueLabelDisplay="auto"
|
||||
valueLabelFormat={(value) => handleDisplayTime(value)}
|
||||
// size="medium"
|
||||
sx={{
|
||||
"& .MuiSlider-valueLabel": {
|
||||
lineHeight: 1.2,
|
||||
fontSize: 24,
|
||||
background: "rgb(0 0 0 / 0.5)",
|
||||
backdropFilter: "blur(5px)",
|
||||
padding: 1,
|
||||
borderRadius: "10px",
|
||||
border: "1px solid rgb(255 255 255 / 0.15)",
|
||||
boxShadow: "0 0 10px rgb(0 0 0 / 0.4) ",
|
||||
transform: "translatey(-120%) scale(0)",
|
||||
"&:before": { display: "none" },
|
||||
"&.MuiSlider-valueLabelOpen": {
|
||||
transform: "translateY(-120%) scale(1)",
|
||||
},
|
||||
"& > *": {
|
||||
transform: "rotate(0deg)",
|
||||
},
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<Typography variant="h6">
|
||||
{handleDisplayTime(itemDuration)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
<Stack
|
||||
direction="row"
|
||||
justifyContent="space-between"
|
||||
alignItems="center"
|
||||
>
|
||||
<Stack
|
||||
direction="row"
|
||||
gap={1}
|
||||
justifyContent="center"
|
||||
alignItems="center"
|
||||
>
|
||||
<IconButton
|
||||
onClick={handlePlayPrevEpisode}
|
||||
disabled={
|
||||
seriesId
|
||||
? episodes.isPending || currentEpisodeIndex === 0
|
||||
: true
|
||||
}
|
||||
>
|
||||
<div className="material-symbols-rounded">skip_previous</div>
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={() =>
|
||||
playerRef.current.seekTo(
|
||||
playerRef.current.getCurrentTime() - 15,
|
||||
)
|
||||
}
|
||||
>
|
||||
<div className="material-symbols-rounded">fast_rewind</div>
|
||||
</IconButton>
|
||||
<IconButton onClick={() => setIsPlaying((state) => !state)}>
|
||||
<div className="material-symbols-rounded">
|
||||
{isPlaying ? "pause" : "play_arrow"}
|
||||
</div>
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={() =>
|
||||
playerRef.current.seekTo(
|
||||
playerRef.current.getCurrentTime() + 15,
|
||||
)
|
||||
}
|
||||
>
|
||||
<div className="material-symbols-rounded">fast_forward</div>
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={handlePlayNextEpisode}
|
||||
disabled={
|
||||
seriesId
|
||||
? episodes.isPending ||
|
||||
episodes.data?.TotalRecordCount ===
|
||||
currentEpisodeIndex + 1
|
||||
: true
|
||||
}
|
||||
>
|
||||
<div className="material-symbols-rounded">skip_next</div>
|
||||
</IconButton>
|
||||
<Typography variant="subtitle1">
|
||||
{endsAt(itemDuration - currentTime)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
<Stack
|
||||
direction="row"
|
||||
gap={1}
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
>
|
||||
<Box>
|
||||
<Menu
|
||||
anchorEl={speedMenuEl}
|
||||
open={speedMenuState}
|
||||
onClose={() => setSpeedMenuEl(null)}
|
||||
MenuListProps={{
|
||||
"aria-labelledby": "lock-button",
|
||||
role: "listbox",
|
||||
}}
|
||||
anchorOrigin={{
|
||||
vertical: "top",
|
||||
horizontal: "center",
|
||||
}}
|
||||
transformOrigin={{
|
||||
vertical: "bottom",
|
||||
horizontal: "center",
|
||||
}}
|
||||
sx={{
|
||||
mb: 20,
|
||||
}}
|
||||
>
|
||||
{availableSpeeds.map((sspeed, index) => {
|
||||
return (
|
||||
<MenuItem
|
||||
key={sspeed}
|
||||
selected={index === speed}
|
||||
onClick={() => {
|
||||
setSpeed(index);
|
||||
setSpeedMenuEl(null);
|
||||
}}
|
||||
sx={{
|
||||
width: 160,
|
||||
}}
|
||||
>
|
||||
{sspeed}x
|
||||
</MenuItem>
|
||||
);
|
||||
})}
|
||||
</Menu>
|
||||
<IconButton onClick={(e) => setSpeedMenuEl(e.currentTarget)}>
|
||||
<div className="material-symbols-rounded">pace</div>
|
||||
</IconButton>
|
||||
</Box>
|
||||
<IconButton
|
||||
sx={{
|
||||
ml: 0.1,
|
||||
}}
|
||||
onClick={() => setIsMuted((state) => !state)}
|
||||
>
|
||||
<div className="material-symbols-rounded">
|
||||
{isMuted ? "volume_mute" : "volume_up"}
|
||||
</div>
|
||||
</IconButton>
|
||||
<Slider
|
||||
value={isMuted ? 0 : volume * 100}
|
||||
step={1}
|
||||
max={100}
|
||||
onChange={(e, newVal) => setVolume(newVal / 100)}
|
||||
valueLabelDisplay="auto"
|
||||
valueLabelFormat={(value) => Math.floor(value)}
|
||||
size="small"
|
||||
sx={{
|
||||
mr: 1,
|
||||
ml: 1,
|
||||
width: "8em",
|
||||
"& .MuiSlider-valueLabel": {
|
||||
lineHeight: 1.2,
|
||||
fontSize: 24,
|
||||
background: "rgb(0 0 0 / 0.5)",
|
||||
backdropFilter: "blur(5px)",
|
||||
padding: 1,
|
||||
borderRadius: "10px",
|
||||
border: "1px solid rgb(255 255 255 / 0.15)",
|
||||
boxShadow: "0 0 10px rgb(0 0 0 / 0.4) ",
|
||||
transform: "translatey(-120%) scale(0)",
|
||||
"&:before": {
|
||||
display: "none",
|
||||
},
|
||||
"&.MuiSlider-valueLabelOpen": {
|
||||
transform: "translateY(-120%) scale(1)",
|
||||
},
|
||||
"& > *": {
|
||||
transform: "rotate(0deg)",
|
||||
},
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<Box>
|
||||
<Menu
|
||||
anchorEl={settingsMenuEl}
|
||||
onClose={() => {
|
||||
setSettingsMenuEl(null);
|
||||
}}
|
||||
open={settingsMenuState}
|
||||
sx={{ padding: 2 }}
|
||||
>
|
||||
<Stack direction="row">
|
||||
<Typography variant="h6">Subtitle</Typography>
|
||||
</Stack>
|
||||
</Menu>
|
||||
<IconButton
|
||||
onClick={(e) => setSettingsMenuEl(e.currentTarget)}
|
||||
disabled
|
||||
>
|
||||
<div className="material-symbols-rounded">settings</div>
|
||||
</IconButton>
|
||||
</Box>
|
||||
<IconButton
|
||||
onClick={() => {
|
||||
setIsPIP(!isPIP);
|
||||
}}
|
||||
>
|
||||
<div className="material-symbols-rounded">
|
||||
picture_in_picture_alt
|
||||
</div>
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={async () => {
|
||||
const fstate = await appWindow.isFullscreen();
|
||||
setAppFullScreen(!fstate);
|
||||
}}
|
||||
>
|
||||
<div className="material-symbols-rounded">
|
||||
{appFullscreen ? "fullscreen_exit" : "fullscreen"}
|
||||
</div>
|
||||
</IconButton>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Backdrop>
|
||||
<ReactPlayer
|
||||
ref={playerRef}
|
||||
width="100vw"
|
||||
height="100vh"
|
||||
playing={isPlaying}
|
||||
url={url}
|
||||
onProgress={onProgress}
|
||||
onReady={onReady}
|
||||
muted={isMuted}
|
||||
pip={isPIP}
|
||||
volume={volume}
|
||||
onBuffer={() => setIsBuffering(true)}
|
||||
onBufferEnd={() => setIsBuffering(false)}
|
||||
config={{
|
||||
file: {
|
||||
attributes: {
|
||||
crossOrigin: "true",
|
||||
},
|
||||
tracks: [
|
||||
{
|
||||
kind: "subtitles",
|
||||
src: `${api.basePath}/Videos/${itemId}/${itemId}/Subtitles/${currentSubtrack}/Stream.vtt?api_key=${api.accessToken}`,
|
||||
srcLang: "",
|
||||
default: true,
|
||||
mode: "showing",
|
||||
},
|
||||
],
|
||||
},
|
||||
}}
|
||||
playbackRate={availableSpeeds[speed]}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -46,3 +46,45 @@ video {
|
||||
text-shadow: 0 2px 10px rgb(0 0 0 / 0.8);
|
||||
}
|
||||
}
|
||||
|
||||
.video-player {
|
||||
background: black;
|
||||
position: absolute;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
top: 0;
|
||||
left: 0;
|
||||
&-osd{
|
||||
position: absolute;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-self: stretch;
|
||||
justify-content: space-between;
|
||||
padding: 1em 2em;
|
||||
background: linear-gradient(to top, rgb(0 0 0 / 0.7) 5vh, transparent 26vh 90vh, rgb(0 0 0 / 0.7));
|
||||
&-controls{
|
||||
&-progress{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.2em;
|
||||
align-items: stretch;
|
||||
justify-content: center;
|
||||
&-text{
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
justify-content: space-between;
|
||||
}
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
&-buttons {
|
||||
display: flex;
|
||||
gap: 0.4em;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,9 @@ import useDebounce from "../../utils/hooks/useDebounce";
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getPersonsApi } from "@jellyfin/sdk/lib/utils/api/persons-api";
|
||||
import { getSearchApi } from "@jellyfin/sdk/lib/utils/api/search-api";
|
||||
import { Card } from "../../components/card/card";
|
||||
import { EpisodeCard } from "../../components/card/episodeCard";
|
||||
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import "./search.module.scss";
|
||||
@@ -142,6 +144,20 @@ const SearchPage = () => {
|
||||
enabled: user.isSuccess,
|
||||
cacheTime: 0,
|
||||
});
|
||||
const episodes = useQuery({
|
||||
queryKey: ["search", "items", "Episodes", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getSearchApi(api).get({
|
||||
userId: user.data.Id,
|
||||
searchTerm,
|
||||
limit: itemLimit,
|
||||
includeItemTypes: ["Episode"],
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess,
|
||||
cacheTime: 0,
|
||||
});
|
||||
|
||||
const [setBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||
|
||||
@@ -269,6 +285,23 @@ const SearchPage = () => {
|
||||
))}
|
||||
</CardScroller>
|
||||
)}
|
||||
{episodes.isSuccess && episodes.data.TotalRecordCount > 0 && (
|
||||
<CardScroller title="Episodes" displayCards={4} disableDecoration>
|
||||
{episodes.data.SearchHints.map((episode) => {
|
||||
return (
|
||||
<EpisodeCard
|
||||
key={episode.Id}
|
||||
item={episode}
|
||||
cardTitle={episode.Series}
|
||||
cardCaption={`S${episode.ParentIndexNumber}:E${episode.IndexNumber} - ${episode.Name}`}
|
||||
queryKey={["search", "items", "Episodes", searchParam]}
|
||||
userId={user.data.Id}
|
||||
disableRunTime
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
)}
|
||||
{audio.isSuccess && audio.data.Items.length > 0 && (
|
||||
<CardScroller title="Audio" displayCards={8} disableDecoration>
|
||||
{audio.data.Items.map((item, index) => (
|
||||
@@ -396,7 +429,8 @@ const SearchPage = () => {
|
||||
musicAlbum.data.Items.length === 0 &&
|
||||
book.data.Items.length === 0 &&
|
||||
musicArtists.data.Items.length === 0 &&
|
||||
person.data.Items.length === 0 && (
|
||||
person.data.Items.length === 0 &&
|
||||
episodes.data.SearchHints.length === 0 && (
|
||||
<div
|
||||
style={{
|
||||
height: "calc(100vh - 12em)",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import PropTypes from "prop-types";
|
||||
import React, { useState, useEffect, useLayoutEffect } from "react";
|
||||
import React, { useState, useEffect, useLayoutEffect, useRef } from "react";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import MuiCard from "@mui/material/Card";
|
||||
@@ -16,9 +16,10 @@ import TextField from "@mui/material/TextField";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { green, red, yellow } from "@mui/material/colors";
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
import { AnimatePresence, motion, useScroll } from "framer-motion";
|
||||
import useParallax from "../../utils/hooks/useParallax";
|
||||
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
|
||||
import { Blurhash } from "react-blurhash";
|
||||
|
||||
@@ -34,7 +35,7 @@ import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api"
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { endsAt, getRuntime, getRuntimeMusic } from "../../utils/date/time";
|
||||
import { endsAt, getRuntime, getRuntimeCompact, getRuntimeMusic } from "../../utils/date/time";
|
||||
|
||||
import { Card } from "../../components/card/card";
|
||||
import { EpisodeCard } from "../../components/card/episodeCard";
|
||||
@@ -45,15 +46,21 @@ import "./series.module.scss";
|
||||
|
||||
import { Link } from "react-router-dom";
|
||||
import { NavLink } from "react-router-dom";
|
||||
|
||||
import LikeButton from "../../components/buttons/likeButton";
|
||||
import MarkPlayedButton from "../../components/buttons/markPlayedButton";
|
||||
import PlayButton from "../../components/buttons/playButton";
|
||||
import TrailerButton from "../../components/buttons/trailerButton";
|
||||
import ShowMoreText from "../../components/showMoreText";
|
||||
import { SeasonSelectorSkeleton } from "../../components/skeleton/seasonSelector";
|
||||
import TextLink from "../../components/textLink";
|
||||
import { getTypeIcon } from "../../components/utils/iconsCollection";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||
|
||||
import IconLink from "../../components/iconLink";
|
||||
import EpisodeSkeleton from "../../components/skeleton/episode";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
|
||||
@@ -77,6 +84,13 @@ TabPanel.propTypes = {
|
||||
value: PropTypes.number.isRequired,
|
||||
};
|
||||
|
||||
const getEpisodeDateString = (date: Date) => {
|
||||
const formatter = new Intl.DateTimeFormat(navigator.language ?? "en-US", {
|
||||
dateStyle: "full",
|
||||
})
|
||||
return formatter.format(date).toString();
|
||||
}
|
||||
|
||||
const SeriesTitlePage = () => {
|
||||
const { id } = useParams();
|
||||
|
||||
@@ -154,7 +168,16 @@ const SeriesTitlePage = () => {
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const [currentSeason, setCurrentSeason] = useState(0);
|
||||
const [backdropImage, setBackdropImage] = useState(() => {
|
||||
const result = sessionStorage.getItem(`backdrop-${item.data?.Id}`);
|
||||
return result ?? "0";
|
||||
});
|
||||
const [backdropImageLoaded, setBackdropImageLoaded] = useState(false);
|
||||
|
||||
const [currentSeason, setCurrentSeason] = useState(() => {
|
||||
const result = sessionStorage.getItem(`season-${item.data?.Id}`);
|
||||
return result ?? 0;
|
||||
});
|
||||
|
||||
const currentSeasonItem = useQuery({
|
||||
queryKey: ["item", id, "season", currentSeason],
|
||||
@@ -207,11 +230,15 @@ const SeriesTitlePage = () => {
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (item.isSuccess) {
|
||||
setBackdropImage(
|
||||
api.getItemImageUrl(item.data?.Id, "Backdrop", {
|
||||
tag: item.data?.BackdropImageTags[0],
|
||||
}),
|
||||
);
|
||||
setAppBackdrop(
|
||||
item.data.Type === BaseItemKind.MusicAlbum ||
|
||||
item.data.Type === BaseItemKind.Episode
|
||||
? `${api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
||||
: `${api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||
api.getItemImageUrl(item.data?.Id, "Backdrop", {
|
||||
tag: item.data?.BackdropImageTags[0],
|
||||
}),
|
||||
item.data.Id,
|
||||
);
|
||||
const direTp = item.data.People.filter((itm) => itm.Type === "Director");
|
||||
@@ -228,7 +255,10 @@ const SeriesTitlePage = () => {
|
||||
}, [item.isSuccess]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (seasons.isSuccess) {
|
||||
if (
|
||||
seasons.isSuccess &&
|
||||
!sessionStorage.getItem(`season-${item.data?.Id}`)
|
||||
) {
|
||||
if (
|
||||
seasons.data.TotalRecordCount > 1 &&
|
||||
seasons.data.Items[0].Name.toLowerCase().includes("special")
|
||||
@@ -240,6 +270,62 @@ const SeriesTitlePage = () => {
|
||||
}
|
||||
}, [seasons.isSuccess]);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
currentSeasonItem.isSuccess &&
|
||||
currentSeasonItem.data?.BackdropImageTags?.length > 0
|
||||
) {
|
||||
sessionStorage.setItem(
|
||||
`backdrop-${item.data?.Id}`,
|
||||
api.getItemImageUrl(currentSeasonItem.data.Id, "Backdrop", {
|
||||
tag: currentSeasonItem.data.BackdropImageTags[0],
|
||||
}),
|
||||
);
|
||||
setBackdropImage(
|
||||
api.getItemImageUrl(currentSeasonItem.data.Id, "Backdrop", {
|
||||
tag: currentSeasonItem.data.BackdropImageTags[0],
|
||||
}),
|
||||
currentSeasonItem.data.Id,
|
||||
);
|
||||
setAppBackdrop(
|
||||
api.getItemImageUrl(currentSeasonItem.data.Id, "Backdrop", {
|
||||
tag: currentSeasonItem.data.BackdropImageTags[0],
|
||||
}),
|
||||
currentSeasonItem.data.Id,
|
||||
);
|
||||
setBackdropImageLoaded(false)
|
||||
} else if (item.isSuccess && item.data?.BackdropImageTags?.length > 0) {
|
||||
sessionStorage.setItem(
|
||||
`backdrop-${item.data?.Id}`,
|
||||
api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
}),
|
||||
);
|
||||
setBackdropImage(
|
||||
api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
}),
|
||||
item.data.Id,
|
||||
);
|
||||
setAppBackdrop(
|
||||
api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
}),
|
||||
item.data.Id,
|
||||
);
|
||||
setBackdropImageLoaded(false)
|
||||
}
|
||||
}, [currentSeasonItem.dataUpdatedAt]);
|
||||
|
||||
const pageRef = useRef(null);
|
||||
const { scrollYProgress } = useScroll({
|
||||
target: pageRef,
|
||||
offset: ["start start", "60vh start"],
|
||||
});
|
||||
const parallax = useParallax(scrollYProgress, 50);
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
if (item.isPending || similarItems.isPending) {
|
||||
return (
|
||||
<Box
|
||||
@@ -271,23 +357,41 @@ const SeriesTitlePage = () => {
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY padded-top flex flex-column item item-series"
|
||||
ref={pageRef}
|
||||
>
|
||||
<div className="item-hero flex flex-row">
|
||||
<div className="item-hero-backdrop-container">
|
||||
{item.data.BackdropImageTags ? (
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
})}
|
||||
className="item-hero-backdrop"
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
<AnimatePresence mode="wait">
|
||||
|
||||
{item.data.BackdropImageTags ? (
|
||||
<motion.img
|
||||
key={currentSeasonItem.dataUpdatedAt}
|
||||
alt={item.data.Name}
|
||||
src={backdropImage}
|
||||
className="item-hero-backdrop"
|
||||
initial={{
|
||||
opacity: 0
|
||||
}}
|
||||
onLoad={() => {
|
||||
setBackdropImageLoaded(true)
|
||||
}}
|
||||
animate={{
|
||||
opacity: backdropImageLoaded ? 1 : 0
|
||||
}}
|
||||
exit={{
|
||||
opacity: 0
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.2
|
||||
}}
|
||||
style={{
|
||||
y: parallax,
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
<div
|
||||
className="item-hero-image-container"
|
||||
@@ -300,7 +404,7 @@ const SeriesTitlePage = () => {
|
||||
<Blurhash
|
||||
hash={
|
||||
item.data.ImageBlurHashes.Primary[
|
||||
item.data.ImageTags.Primary
|
||||
item.data.ImageTags.Primary
|
||||
]
|
||||
}
|
||||
className="item-hero-image-blurhash"
|
||||
@@ -349,7 +453,7 @@ const SeriesTitlePage = () => {
|
||||
{item.data.Status === "Continuing"
|
||||
? " - Present"
|
||||
: item.data.EndDate &&
|
||||
` - ${new Date(item.data.EndDate).getFullYear()}`}
|
||||
` - ${new Date(item.data.EndDate).getFullYear()}`}
|
||||
</Typography>
|
||||
{item.data.OfficialRating && (
|
||||
<Chip variant="filled" label={item.data.OfficialRating} />
|
||||
@@ -433,7 +537,7 @@ const SeriesTitlePage = () => {
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
|
||||
{endsAt(
|
||||
item.data.RunTimeTicks -
|
||||
item.data.UserData.PlaybackPositionTicks,
|
||||
item.data.UserData.PlaybackPositionTicks,
|
||||
)}
|
||||
</Typography>
|
||||
)}
|
||||
@@ -456,6 +560,10 @@ const SeriesTitlePage = () => {
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-row" style={{ gap: "1em" }}>
|
||||
<TrailerButton
|
||||
trailerItem={item.data.RemoteTrailers}
|
||||
disabled={item.data.RemoteTrailers?.length === 0}
|
||||
/>
|
||||
<LikeButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
@@ -486,7 +594,7 @@ const SeriesTitlePage = () => {
|
||||
<Typography>
|
||||
{getRuntime(
|
||||
item.data.RunTimeTicks -
|
||||
item.data.UserData.PlaybackPositionTicks,
|
||||
item.data.UserData.PlaybackPositionTicks,
|
||||
)}{" "}
|
||||
left
|
||||
</Typography>
|
||||
@@ -586,14 +694,7 @@ const SeriesTitlePage = () => {
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls.map((url) => (
|
||||
<Link
|
||||
key={url.Url}
|
||||
target="_blank"
|
||||
to={url.Url}
|
||||
className="item-detail-link"
|
||||
>
|
||||
<Typography>{url.Name}</Typography>
|
||||
</Link>
|
||||
<IconLink url={url.Url} name={url.Name} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
@@ -799,7 +900,7 @@ const SeriesTitlePage = () => {
|
||||
cardCaption={episode.Overview}
|
||||
imageBlurhash={
|
||||
episode.ImageBlurHashes?.Primary[
|
||||
Object.keys(episode.ImageBlurHashes.Primary)[0]
|
||||
Object.keys(episode.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
}
|
||||
queryKey={[
|
||||
@@ -882,7 +983,13 @@ const SeriesTitlePage = () => {
|
||||
)}
|
||||
<TextField
|
||||
value={currentSeason}
|
||||
onChange={(e) => setCurrentSeason(e.target.value)}
|
||||
onChange={(e) => {
|
||||
setCurrentSeason(e.target.value);
|
||||
sessionStorage.setItem(
|
||||
`season-${item.data?.Id}`,
|
||||
e.target.value,
|
||||
);
|
||||
}}
|
||||
select
|
||||
SelectProps={{
|
||||
MenuProps: {
|
||||
@@ -902,86 +1009,15 @@ const SeriesTitlePage = () => {
|
||||
</div>
|
||||
</div>
|
||||
<Divider />
|
||||
<div className="item-detail-episodes-container">
|
||||
<div className="item-detail-episode-container">
|
||||
{episodes.isPending
|
||||
? Array.from(new Array(4)).map((a, index) => {
|
||||
return (
|
||||
<MuiCard
|
||||
key={a}
|
||||
sx={{
|
||||
background: "transparent",
|
||||
width: "100%",
|
||||
}}
|
||||
elevation={0}
|
||||
>
|
||||
<CardMedia>
|
||||
<Skeleton
|
||||
// animation="wave"
|
||||
variant="rectangular"
|
||||
sx={{
|
||||
aspectRatio: "1.777",
|
||||
height: "auto",
|
||||
m: 1,
|
||||
borderRadius: "10px",
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
}}
|
||||
/>
|
||||
</CardMedia>
|
||||
<CardContent
|
||||
sx={{
|
||||
padding: "0 0.5em",
|
||||
alignItems: "flex-start",
|
||||
backgroundColor: "transparent",
|
||||
}}
|
||||
>
|
||||
<Typography variant="h6">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
}}
|
||||
/>
|
||||
</Typography>
|
||||
|
||||
<Typography variant="body2">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
}}
|
||||
/>
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
}}
|
||||
/>
|
||||
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
}}
|
||||
/>
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</MuiCard>
|
||||
);
|
||||
})
|
||||
: episodes.data.Items.map((episode) => {
|
||||
return (
|
||||
? <EpisodeSkeleton />
|
||||
: episodes.data.Items.map((episode, index) => {
|
||||
return (
|
||||
<>
|
||||
<motion.div
|
||||
key={episode.Id}
|
||||
onClick={() => navigate(`/episode/${episode.Id}`)}
|
||||
initial={{
|
||||
transform: "translateY(10px)",
|
||||
opacity: 0,
|
||||
@@ -1000,34 +1036,77 @@ const SeriesTitlePage = () => {
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
className="item-detail-episode"
|
||||
>
|
||||
<EpisodeCard
|
||||
item={episode}
|
||||
cardTitle={
|
||||
episode.ParentIndexNumber === 0
|
||||
? `${episode.SeasonName} - ${episode.Name}`
|
||||
: episode.IndexNumberEnd
|
||||
? `${episode.IndexNumber}-${episode.IndexNumberEnd}. ${episode.Name}`
|
||||
: `${episode.IndexNumber}. ${episode.Name}`
|
||||
<Typography variant="h6">{episode.IndexNumber ?? 0}</Typography>
|
||||
<div className="item-detail-episode-image-container">
|
||||
<div className="item-detail-episode-image-overlay">
|
||||
<PlayButton item={episode} itemId={episode.Id} itemType="Episode" itemUserData={episode.UserData} userId={user.data.Id} currentAudioTrack={0} currentVideoTrack={0} currentSubTrack={0} size="medium" buttonProps={{
|
||||
color: "white",
|
||||
style: {
|
||||
color: "black ",
|
||||
},
|
||||
}} iconOnly />
|
||||
</div>
|
||||
<div className="item-detail-episode-image-icon-container">
|
||||
<span className="material-symbols-rounded item-detail-episode-image-icon">tv_gen</span>
|
||||
</div>
|
||||
<img alt={episode.Name} src={api.getItemImageUrl(episode.Id, "Primary", {
|
||||
tag: episode.ImageTags.Primary,
|
||||
fillHeight: 300,
|
||||
})} className="item-detail-episode-image" onLoad={(e) => {
|
||||
e.target.style.opacity = 1;
|
||||
}} />
|
||||
{episode.UserData?.PlaybackPositionTicks > 0 &&
|
||||
<div className="card-progress-container">
|
||||
<div
|
||||
className="card-progress"
|
||||
style={{
|
||||
width: `${episode.UserData?.PlayedPercentage}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
cardCaption={episode.Overview}
|
||||
imageBlurhash={
|
||||
!!episode.ImageBlurHashes?.Primary &&
|
||||
episode.ImageBlurHashes?.Primary[
|
||||
Object.keys(episode.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
}
|
||||
queryKey={[
|
||||
"item",
|
||||
id,
|
||||
`season ${currentSeason + 1}`,
|
||||
"episodes",
|
||||
]}
|
||||
userId={user.data.Id}
|
||||
/>
|
||||
</div>
|
||||
<div className="item-detail-episode-info">
|
||||
<Typography variant="h6">{episode.Name}</Typography>
|
||||
<div className="flex flex-row flex-align-center" style={{
|
||||
gap: "0.5em",
|
||||
}}>
|
||||
{episode.PremiereDate && <Chip variant="filled" label={getEpisodeDateString(new Date(episode.PremiereDate))} size="small" />}
|
||||
<Typography variant="subtitle1" >{getRuntimeCompact(episode.RunTimeTicks)}</Typography>
|
||||
</div>
|
||||
<Typography style={{
|
||||
display: "-webkit-box",
|
||||
textOverflow: "ellipsis",
|
||||
overflow: "hidden",
|
||||
WebkitLineClamp: 2,
|
||||
WebkitBoxOrient: "vertical",
|
||||
width: "100%",
|
||||
opacity: 0.7
|
||||
}}>{episode.Overview}</Typography>
|
||||
<div className="item-detail-episode-info-buttons">
|
||||
<LikeButton
|
||||
itemId={episode.Id}
|
||||
itemName={episode.Name}
|
||||
isFavorite={episode.UserData?.IsFavorite}
|
||||
queryKey={["item", id, `season ${currentSeason + 1}`, "episodes"]}
|
||||
userId={user.data.Id}
|
||||
/>
|
||||
<MarkPlayedButton
|
||||
itemId={episode.Id}
|
||||
itemName={episode.Name}
|
||||
isPlayed={episode.UserData?.Played}
|
||||
queryKey={["item", id, `season ${currentSeason + 1}`, "episodes"]}
|
||||
userId={user.data.Id}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
);
|
||||
})}
|
||||
{index + 1 !== episodes.data?.Items?.length && <Divider orientation="horizontal" flexItem />}
|
||||
</>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
@@ -1051,42 +1130,16 @@ const SeriesTitlePage = () => {
|
||||
imageBlurhash={
|
||||
!!special.ImageBlurHashes?.Primary &&
|
||||
special.ImageBlurHashes.Primary[
|
||||
Object.keys(special.ImageBlurHashes.Primary)[0]
|
||||
Object.keys(special.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
}
|
||||
userId={user.data.Id}
|
||||
onClick={() => {}}
|
||||
onClick={() => { }}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
)}
|
||||
{/* {item.data.People.length > 0 && (
|
||||
<CardScroller
|
||||
title="Cast & Crew"
|
||||
displayCards={8}
|
||||
disableDecoration
|
||||
>
|
||||
{item.data.People.map((person) => {
|
||||
return (
|
||||
<ActorCard
|
||||
key={person.Id}
|
||||
item={person}
|
||||
cardTitle={person.Name}
|
||||
cardCaption={person.Role}
|
||||
cardType="square"
|
||||
userId={user.data.Id}
|
||||
imageBlurhash={
|
||||
person.ImageBlurHashes
|
||||
?.Primary[0]
|
||||
}
|
||||
overrideIcon="Person"
|
||||
disableOverlay
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
)} */}
|
||||
{similarItems.data.TotalRecordCount > 0 && (
|
||||
<CardScroller
|
||||
title="You might also like"
|
||||
@@ -1109,18 +1162,17 @@ const SeriesTitlePage = () => {
|
||||
similar.Type === BaseItemKind.Episode
|
||||
? `S${similar.ParentIndexNumber}:E${similar.IndexNumber} - ${similar.Name}`
|
||||
: similar.Type === BaseItemKind.Series
|
||||
? `${similar.ProductionYear} - ${
|
||||
similar.EndDate
|
||||
? new Date(similar.EndDate).toLocaleString([], {
|
||||
year: "numeric",
|
||||
})
|
||||
: "Present"
|
||||
}`
|
||||
: similar.ProductionYear
|
||||
? `${similar.ProductionYear} - ${similar.EndDate
|
||||
? new Date(similar.EndDate).toLocaleString([], {
|
||||
year: "numeric",
|
||||
})
|
||||
: "Present"
|
||||
}`
|
||||
: similar.ProductionYear
|
||||
}
|
||||
cardType={
|
||||
similar.Type === BaseItemKind.MusicAlbum ||
|
||||
similar.Type === BaseItemKind.Audio
|
||||
similar.Type === BaseItemKind.Audio
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
@@ -1129,7 +1181,7 @@ const SeriesTitlePage = () => {
|
||||
imageBlurhash={
|
||||
!!similar.ImageBlurHashes?.Primary &&
|
||||
similar.ImageBlurHashes?.Primary[
|
||||
Object.keys(similar.ImageBlurHashes.Primary)[0]
|
||||
Object.keys(similar.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
}
|
||||
/>
|
||||
@@ -50,8 +50,8 @@
|
||||
}
|
||||
}
|
||||
&-backdrop {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
object-fit: cover;
|
||||
object-position: top;
|
||||
opacity: 0;
|
||||
@@ -151,13 +151,82 @@
|
||||
text-decoration-color: white;
|
||||
}
|
||||
}
|
||||
&-episodes-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 0.25em;
|
||||
margin-top: 0.5em;
|
||||
align-items: start;
|
||||
justify-items: center;
|
||||
&-episode{
|
||||
display:grid;
|
||||
grid-template-columns: 1.4em 16em 1fr;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
gap:1em;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
|
||||
&-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: nowrap;
|
||||
gap: 0.5em;
|
||||
margin-top: 0.5em;
|
||||
width: 100%;
|
||||
}
|
||||
&-image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
opacity: 0;
|
||||
transition: opacity $transition-time-default;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 0;
|
||||
&-container{
|
||||
width: 16em;
|
||||
aspect-ratio: 1.66666;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-radius: $border-radius-default;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
&-overlay{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
opacity: 0;
|
||||
transition: opacity $transition-time-default;
|
||||
z-index: 2;
|
||||
}
|
||||
&-icon {
|
||||
font-size: 3em;
|
||||
&-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
&-info{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
gap: 0.4em;
|
||||
width: 100%;
|
||||
padding-right: 2em;
|
||||
}
|
||||
|
||||
&:hover .item-detail-episode-image-overlay, &:focus-within .item-detail-episode-image-overlay{
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
const Settings = () => {
|
||||
return <h1>WIP Settings</h1>;
|
||||
};
|
||||
|
||||
export default Settings;
|
||||
@@ -8,7 +8,7 @@ import Paper from "@mui/material/Paper";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { red } from "@mui/material/colors";
|
||||
|
||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { AppBarBackOnly } from "../../../components/appBar/backOnly";
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
setDefaultServer,
|
||||
} from "../../../utils/storage/servers";
|
||||
import { delUser } from "../../../utils/storage/user";
|
||||
import { createApi, useApi } from "../../../utils/store/api";
|
||||
import { setBackdrop } from "../../../utils/store/backdrop";
|
||||
import "./serverList.module.scss";
|
||||
|
||||
@@ -26,6 +27,9 @@ const ServerList = () => {
|
||||
const navigate = useNavigate();
|
||||
const [serverState, setServerState] = useState(null);
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const servers = useQuery({
|
||||
queryKey: ["servers-list"],
|
||||
queryFn: async () => await getAllServers(),
|
||||
@@ -39,8 +43,11 @@ const ServerList = () => {
|
||||
const handleServerChange = useMutation({
|
||||
mutationFn: async () => {
|
||||
await delUser();
|
||||
console.log(serverState);
|
||||
await setDefaultServer(serverState);
|
||||
await setDefaultServer(serverState.id);
|
||||
queryClient.clear();
|
||||
await defaultServer.refetch();
|
||||
createApi(serverState.address);
|
||||
queryClient.removeQueries();
|
||||
},
|
||||
onSuccess: async () => {
|
||||
navigate("/login/index");
|
||||
@@ -53,22 +60,26 @@ const ServerList = () => {
|
||||
},
|
||||
});
|
||||
|
||||
const handleDelete = async (serverId) => {
|
||||
await delServer(serverId);
|
||||
const handleDelete = async (server) => {
|
||||
await delServer(server.id);
|
||||
|
||||
if (serverId === defaultServer.data) {
|
||||
if (server.id === defaultServer.data) {
|
||||
await delUser();
|
||||
await servers.refetch();
|
||||
|
||||
if (servers.length > 0) {
|
||||
setDefaultServer(servers[0].id);
|
||||
createApi(servers[0].address);
|
||||
} else {
|
||||
navigate("/login/index");
|
||||
useApi.setState(useApi.getInitialState());
|
||||
}
|
||||
queryClient.removeQueries();
|
||||
navigate("/");
|
||||
}
|
||||
enqueueSnackbar("Server deleted successfully!", { variant: "success" });
|
||||
|
||||
servers.refetch();
|
||||
defaultServer.refetch();
|
||||
await servers.refetch();
|
||||
await defaultServer.refetch();
|
||||
};
|
||||
|
||||
useLayoutEffect(() => {
|
||||
@@ -161,7 +172,7 @@ const ServerList = () => {
|
||||
fontSize: "1.64em",
|
||||
}}
|
||||
onClick={() => {
|
||||
setServerState(server.id);
|
||||
setServerState(server);
|
||||
handleServerChange.mutate();
|
||||
}}
|
||||
disabled={handleServerChange.isPending}
|
||||
@@ -176,7 +187,7 @@ const ServerList = () => {
|
||||
}}
|
||||
disabled={handleServerChange.isPending}
|
||||
onClick={() => {
|
||||
handleDelete(server.id);
|
||||
handleDelete(server);
|
||||
}}
|
||||
>
|
||||
<div className="material-symbols-rounded">delete_forever</div>
|
||||
|
||||
@@ -148,9 +148,17 @@ h1 {
|
||||
}
|
||||
|
||||
.material-symbols-rounded {
|
||||
font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 25, "opsz" 40;
|
||||
--fill: 0;
|
||||
--wght: 300;
|
||||
--grad: 25;
|
||||
--opsz: 40;
|
||||
|
||||
font-variation-settings: "FILL" var(--fill, 0), "wght" var(--wght, 300), "GRAD" var(--grad, 25), "opsz" var(--opsz, 40);
|
||||
font-size: 1.1em;
|
||||
transition: all $transition-time-default;
|
||||
&.fill{
|
||||
--fill: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.audio-playing .scrollY {
|
||||
@@ -195,6 +203,19 @@ h1 {
|
||||
}
|
||||
}
|
||||
|
||||
.animate-rotate{
|
||||
animation: rotation linear 1s infinite;
|
||||
}
|
||||
|
||||
@keyframes rotation {
|
||||
0%{
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100%{
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes iconAnimation {
|
||||
0% {
|
||||
opacity: 1;
|
||||
@@ -218,6 +239,12 @@ h1 {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
&-align-center {
|
||||
align-items: center;
|
||||
}
|
||||
&-justify-spaced-between {
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
@@ -231,3 +258,18 @@ h1 {
|
||||
opacity: 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
.gradient-text{
|
||||
background: $clr-gradient-default;
|
||||
color: transparent;
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.divider-circle{
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
aspect-ratio: 1;
|
||||
border-radius: 10px;
|
||||
background: white;
|
||||
}
|
||||
@@ -56,16 +56,26 @@ export const theme = createTheme({
|
||||
styleOverrides: {
|
||||
paper: {
|
||||
borderRadius: "10px",
|
||||
// boxShadow: "0 0 5px hsl(273, 100%, 36%)",
|
||||
background: "hsl(256, 100%, 2%, 40%)",
|
||||
backdropFilter: "blur(20px)",
|
||||
// border: "1.8px solid hsl(273, 100%, 36%)",
|
||||
border: "1px solid rgb(255 255 255 / 0.1)",
|
||||
},
|
||||
list: {
|
||||
padding: "8px",
|
||||
},
|
||||
},
|
||||
defaultProps: {
|
||||
disableScrollLock: true,
|
||||
},
|
||||
},
|
||||
MuiMenuItem: {
|
||||
styleOverrides: {
|
||||
root: {
|
||||
borderRadius: "4px",
|
||||
transition: "250ms",
|
||||
},
|
||||
},
|
||||
},
|
||||
MuiDialog: {
|
||||
styleOverrides: {
|
||||
paper: {
|
||||
|
||||
@@ -101,7 +101,7 @@ export const getRuntimeFull = (ticks) => {
|
||||
/**
|
||||
* @format
|
||||
* @param {number} ticks - C# ticks of a particular item
|
||||
* @return {number} Converted ticks to Hhr Mmin formate
|
||||
* @return {number} Converted ticks to Hh Mm formate
|
||||
*/
|
||||
export const getRuntimeCompact = (ticks) => {
|
||||
const time = ticksToMs(ticks);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { MotionValue, useTransform } from "framer-motion";
|
||||
|
||||
export default function useParallax(
|
||||
value: MotionValue<number>,
|
||||
distance: number,
|
||||
) {
|
||||
return useTransform(value, [0, 1], [-distance, distance]);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { matchPath, useLocation } from "react-router-dom";
|
||||
|
||||
function useRouteMatch(patterns: readonly string[]) {
|
||||
const { pathname } = useLocation();
|
||||
|
||||
for (let i = 0; i < patterns.length; i += 1) {
|
||||
const pattern = patterns[i];
|
||||
const possibleMatch = matchPath(pattern, pathname);
|
||||
if (possibleMatch !== null) {
|
||||
return possibleMatch;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
export default useRouteMatch;
|
||||
@@ -33,6 +33,7 @@ const getUser = async () => {
|
||||
* Delete user from storage
|
||||
*/
|
||||
const delUser = async () => {
|
||||
sessionStorage.removeItem("accessToken");
|
||||
await user.clear();
|
||||
await user.save();
|
||||
};
|
||||
|
||||
@@ -11,8 +11,8 @@ export const useCentralStore = create(() => ({
|
||||
const a = await getDefaultServer();
|
||||
return await getServer(a);
|
||||
},
|
||||
allServersOnDisk: async () => getAllServers(),
|
||||
userOnDisk: async () => getUser(),
|
||||
allServersOnDisk: async () => await getAllServers(),
|
||||
userOnDisk: async () => await getUser(),
|
||||
/** This is the initial route that app goes to just after app startups */
|
||||
initialRoute: null,
|
||||
clientVersion: version,
|
||||
|
||||
@@ -1,106 +1,184 @@
|
||||
import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import type { BaseItemDto, MediaStream } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { create } from "zustand";
|
||||
import { setQueue, setTrackIndex } from "./queue";
|
||||
|
||||
export interface PlaybackState {
|
||||
url: string;
|
||||
startPosition: number;
|
||||
duration: number;
|
||||
itemId: string;
|
||||
itemName: string | Element;
|
||||
subtitleTracks: unknown[];
|
||||
selectedSubtitleTrack: number;
|
||||
mediaSourceId: string;
|
||||
audioStreamIndex: number;
|
||||
videoStreamIndex: number;
|
||||
subtitleStreamIndex: number;
|
||||
// export interface PlaybackState {
|
||||
// url: string;
|
||||
// startPosition: number;
|
||||
// duration: number;
|
||||
// itemId: string;
|
||||
// itemName: string | Element;
|
||||
// subtitleTracks: unknown[];
|
||||
// selectedSubtitleTrack: number;
|
||||
// mediaSourceId: string;
|
||||
// audioStreamIndex: number;
|
||||
// videoStreamIndex: number;
|
||||
// subtitleStreamIndex: number;
|
||||
// userId: string;
|
||||
// mediaContainer: string;
|
||||
// seriesId: string;
|
||||
// queue: unknown[];
|
||||
// episodeIndex: number;
|
||||
// item: BaseItemDto;
|
||||
// setUrl: (aurl: string) => void;
|
||||
// setPosition: (apos: number) => void;
|
||||
// setDuration: (adur: number) => void;
|
||||
// setItemId: (aid: string) => void;
|
||||
// setItemName: (anm: string | Element) => void;
|
||||
// setUserId: (anm: string) => void;
|
||||
// setSeriesId: (anm: string) => void;
|
||||
// setMediaContainer: (anm: string) => void;
|
||||
// setMediaSourceId: (anm: string) => void;
|
||||
// setAudioStreamIndex: (anm: number) => void;
|
||||
// setVideoStreamIndex: (anm: number) => void;
|
||||
// setSubtitleStreamIndex: (anm: number) => void;
|
||||
// setSubtitleTracks: (asub: unknown[]) => void;
|
||||
// setSelectedSubtitleTrack: (asub: number) => void;
|
||||
// setQueue: (qitem: unknown[]) => void;
|
||||
// setEpisodeIndex: (aitem: number) => void;
|
||||
// }
|
||||
|
||||
// export const usePlaybackStore = create<PlaybackState>((set) => ({
|
||||
// url: "",
|
||||
// startPosition: 0,
|
||||
// duration: 0,
|
||||
// itemId: "",
|
||||
// itemName: "",
|
||||
// subtitleTracks: [],
|
||||
// selectedSubtitleTrack: 0,
|
||||
// mediaSourceId: "",
|
||||
// audioStreamIndex: 0,
|
||||
// videoStreamIndex: 0,
|
||||
// subtitleStreamIndex: 0,
|
||||
// userId: "",
|
||||
// mediaContainer: "",
|
||||
// seriesId: "",
|
||||
// queue: [],
|
||||
// episodeIndex: 0,
|
||||
|
||||
// item: {} as BaseItemDto,
|
||||
// setUrl: (aurl: string) =>
|
||||
// set((state: PlaybackState) => ({ ...state, url: aurl })),
|
||||
// setPosition: (apos: number) =>
|
||||
// set((state: PlaybackState) => ({ ...state, startPosition: apos })),
|
||||
// setDuration: (adur: number) =>
|
||||
// set((state: PlaybackState) => ({ ...state, duration: adur })),
|
||||
// setItemId: (aid: string) =>
|
||||
// set((state: PlaybackState) => ({ ...state, itemId: aid })),
|
||||
// setItemName: (anm: string | Element) =>
|
||||
// set((state: PlaybackState) => ({ ...state, itemName: anm })),
|
||||
// setUserId: (anm: string) =>
|
||||
// set((state: PlaybackState) => ({ ...state, userId: anm })),
|
||||
// setSeriesId: (anm: string) =>
|
||||
// set((state: PlaybackState) => ({ ...state, seriesId: anm })),
|
||||
// setMediaContainer: (anm: string) =>
|
||||
// set((state: PlaybackState) => ({ ...state, mediaContainer: anm })),
|
||||
// setMediaSourceId: (anm: string) =>
|
||||
// set((state: PlaybackState) => ({ ...state, mediaSourceId: anm })),
|
||||
// setAudioStreamIndex: (anm: number) =>
|
||||
// set((state: PlaybackState) => ({ ...state, audioStreamIndex: anm })),
|
||||
// setVideoStreamIndex: (anm: number) =>
|
||||
// set((state: PlaybackState) => ({ ...state, videoStreamIndex: anm })),
|
||||
// setSubtitleStreamIndex: (anm: number) =>
|
||||
// set((state: PlaybackState) => ({ ...state, subtitleStreamIndex: anm })),
|
||||
// setSubtitleTracks: (asub: unknown[]) =>
|
||||
// set((state: PlaybackState) => ({
|
||||
// ...state,
|
||||
// subtitleTracks: asub,
|
||||
// })),
|
||||
// setSelectedSubtitleTrack: (asub: number) =>
|
||||
// set((state: PlaybackState) => ({
|
||||
// ...state,
|
||||
// selectedSubtitleTrack: asub,
|
||||
// })),
|
||||
// setQueue: (qitem: unknown[]) =>
|
||||
// set((state: PlaybackState) => ({ ...state, queue: qitem })),
|
||||
// setEpisodeIndex: (aitem: number) =>
|
||||
// set((state: PlaybackState) => ({ ...state, episodeIndex: aitem })),
|
||||
// }));
|
||||
|
||||
// export const setItem = (item: BaseItemDto) =>
|
||||
// usePlaybackStore.setState((state: PlaybackState) => ({
|
||||
// ...state,
|
||||
// item: item,
|
||||
// }));
|
||||
|
||||
type PlaybackStore = {
|
||||
itemName: string | React.Component;
|
||||
episodeTitle: string | React.Component;
|
||||
mediaSource: {
|
||||
videoTrack: number;
|
||||
audioTrack: number;
|
||||
subtitleTrack: number;
|
||||
container: string;
|
||||
availableSubtitleTracks: MediaStream[];
|
||||
id: string | undefined;
|
||||
};
|
||||
enableSubtitle: boolean;
|
||||
hlsStream: string;
|
||||
userId: string;
|
||||
mediaContainer: string;
|
||||
seriesId: string;
|
||||
queue: unknown[];
|
||||
episodeIndex: number;
|
||||
item: BaseItemDto;
|
||||
setUrl: (aurl: string) => void;
|
||||
setPosition: (apos: number) => void;
|
||||
setDuration: (adur: number) => void;
|
||||
setItemId: (aid: string) => void;
|
||||
setItemName: (anm: string | Element) => void;
|
||||
setUserId: (anm: string) => void;
|
||||
setSeriesId: (anm: string) => void;
|
||||
setMediaContainer: (anm: string) => void;
|
||||
setMediaSourceId: (anm: string) => void;
|
||||
setAudioStreamIndex: (anm: number) => void;
|
||||
setVideoStreamIndex: (anm: number) => void;
|
||||
setSubtitleStreamIndex: (anm: number) => void;
|
||||
setSubtitleTracks: (asub: unknown[]) => void;
|
||||
setSelectedSubtitleTrack: (asub: number) => void;
|
||||
setQueue: (qitem: unknown[]) => void;
|
||||
setEpisodeIndex: (aitem: number) => void;
|
||||
}
|
||||
startPosition: number;
|
||||
itemDuration: number;
|
||||
item: BaseItemDto | null;
|
||||
};
|
||||
|
||||
export const usePlaybackStore = create<PlaybackState>((set) => ({
|
||||
url: "",
|
||||
startPosition: 0,
|
||||
duration: 0,
|
||||
itemId: "",
|
||||
export const usePlaybackStore = create<PlaybackStore>(() => ({
|
||||
itemName: "",
|
||||
subtitleTracks: [],
|
||||
selectedSubtitleTrack: 0,
|
||||
mediaSourceId: "",
|
||||
audioStreamIndex: 0,
|
||||
videoStreamIndex: 0,
|
||||
subtitleStreamIndex: 0,
|
||||
episodeTitle: "",
|
||||
mediaSource: {
|
||||
videoTrack: 0,
|
||||
audioTrack: 0,
|
||||
subtitleTrack: 0,
|
||||
container: "",
|
||||
availableSubtitleTracks: [],
|
||||
id: undefined
|
||||
},
|
||||
enableSubtitle: true,
|
||||
hlsStream: "",
|
||||
userId: "",
|
||||
mediaContainer: "",
|
||||
seriesId: "",
|
||||
queue: [],
|
||||
episodeIndex: 0,
|
||||
|
||||
item: {} as BaseItemDto,
|
||||
setUrl: (aurl: string) =>
|
||||
set((state: PlaybackState) => ({ ...state, url: aurl })),
|
||||
setPosition: (apos: number) =>
|
||||
set((state: PlaybackState) => ({ ...state, startPosition: apos })),
|
||||
setDuration: (adur: number) =>
|
||||
set((state: PlaybackState) => ({ ...state, duration: adur })),
|
||||
setItemId: (aid: string) =>
|
||||
set((state: PlaybackState) => ({ ...state, itemId: aid })),
|
||||
setItemName: (anm: string | Element) =>
|
||||
set((state: PlaybackState) => ({ ...state, itemName: anm })),
|
||||
setUserId: (anm: string) =>
|
||||
set((state: PlaybackState) => ({ ...state, userId: anm })),
|
||||
setSeriesId: (anm: string) =>
|
||||
set((state: PlaybackState) => ({ ...state, seriesId: anm })),
|
||||
setMediaContainer: (anm: string) =>
|
||||
set((state: PlaybackState) => ({ ...state, mediaContainer: anm })),
|
||||
setMediaSourceId: (anm: string) =>
|
||||
set((state: PlaybackState) => ({ ...state, mediaSourceId: anm })),
|
||||
setAudioStreamIndex: (anm: number) =>
|
||||
set((state: PlaybackState) => ({ ...state, audioStreamIndex: anm })),
|
||||
setVideoStreamIndex: (anm: number) =>
|
||||
set((state: PlaybackState) => ({ ...state, videoStreamIndex: anm })),
|
||||
setSubtitleStreamIndex: (anm: number) =>
|
||||
set((state: PlaybackState) => ({ ...state, subtitleStreamIndex: anm })),
|
||||
setSubtitleTracks: (asub: unknown[]) =>
|
||||
set((state: PlaybackState) => ({
|
||||
...state,
|
||||
subtitleTracks: asub,
|
||||
})),
|
||||
setSelectedSubtitleTrack: (asub: number) =>
|
||||
set((state: PlaybackState) => ({
|
||||
...state,
|
||||
selectedSubtitleTrack: asub,
|
||||
})),
|
||||
setQueue: (qitem: unknown[]) =>
|
||||
set((state: PlaybackState) => ({ ...state, queue: qitem })),
|
||||
setEpisodeIndex: (aitem: number) =>
|
||||
set((state: PlaybackState) => ({ ...state, episodeIndex: aitem })),
|
||||
startPosition: 0,
|
||||
itemDuration: 0,
|
||||
item: null,
|
||||
}));
|
||||
|
||||
export const setItem = (item: BaseItemDto) =>
|
||||
usePlaybackStore.setState((state: PlaybackState) => ({
|
||||
...state,
|
||||
item: item,
|
||||
}));
|
||||
export const playItem = (
|
||||
itemName,
|
||||
episodeTitle,
|
||||
videoTrack,
|
||||
audioTrack,
|
||||
subtitleTrack,
|
||||
container,
|
||||
enableSubtitle,
|
||||
hlsStream,
|
||||
userId,
|
||||
startPosition,
|
||||
itemDuration,
|
||||
item,
|
||||
queue,
|
||||
queueItemIndex,
|
||||
availableSubtitleTracks,
|
||||
mediaSourceId
|
||||
) => {
|
||||
usePlaybackStore.setState({
|
||||
itemName,
|
||||
episodeTitle,
|
||||
mediaSource: {
|
||||
videoTrack,
|
||||
audioTrack,
|
||||
subtitleTrack,
|
||||
container,
|
||||
availableSubtitleTracks,
|
||||
id: mediaSourceId,
|
||||
},
|
||||
enableSubtitle,
|
||||
hlsStream,
|
||||
userId,
|
||||
startPosition,
|
||||
itemDuration,
|
||||
item,
|
||||
});
|
||||
setQueue(queue, queueItemIndex);
|
||||
};
|
||||
|
||||
interface PlaybackDataLoadState {
|
||||
isPending: boolean;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { create } from "zustand";
|
||||
import { getRuntimeMusic, secToTicks } from "../date/time";
|
||||
|
||||
const usePlayer = create(() => ({
|
||||
timeString: 0,
|
||||
}));
|
||||
|
||||
export const setTime = (sec: number) => {
|
||||
const a = getRuntimeMusic(secToTicks(sec));
|
||||
console.log(a);
|
||||
usePlayer.setState(() => ({ timeString: a }));
|
||||
};
|
||||
|
||||
export default usePlayer;
|
||||
@@ -0,0 +1,23 @@
|
||||
import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { create } from "zustand";
|
||||
|
||||
interface QueueStore {
|
||||
tracks: BaseItemDto[];
|
||||
currentItemIndex: number;
|
||||
}
|
||||
|
||||
const useQueue = create<QueueStore>(() => ({
|
||||
tracks: [],
|
||||
currentItemIndex: 0,
|
||||
}));
|
||||
|
||||
export const setQueue = (tracks: BaseItemDto[], currentItemIndex: number) => {
|
||||
useQueue.setState(() => ({ tracks, currentItemIndex }));
|
||||
};
|
||||
|
||||
export const setTrackIndex = (index: number) => {
|
||||
console.info(`Setting index ${index}`);
|
||||
useQueue.setState((state) => ({ ...state, currentItemIndex: index }));
|
||||
};
|
||||
|
||||
export default useQueue;
|
||||
@@ -0,0 +1,19 @@
|
||||
import { create } from "zustand";
|
||||
|
||||
const useSettingsStore = create(() => ({
|
||||
dialogOpen: false,
|
||||
tabValue: 0,
|
||||
}));
|
||||
|
||||
const setDialogOpen = (dialog: boolean) =>
|
||||
useSettingsStore.setState((state) => ({ ...state, dialogOpen: dialog }));
|
||||
|
||||
const setTabValue = (value: number) => {
|
||||
useSettingsStore.setState((state) => ({ ...state, tabValue: value }));
|
||||
};
|
||||
|
||||
export default useSettingsStore;
|
||||
export {
|
||||
setDialogOpen as setSettingsDialogOpen,
|
||||
setTabValue as setSettingsTabValue,
|
||||
};
|
||||
@@ -6,6 +6,7 @@
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"checkJs": true,
|
||||
"allowJs": true, // Allow JavaScript files to be compiled
|
||||
"skipLibCheck": true, // Skip type checking of all declaration files
|
||||
"esModuleInterop": true, // Disables namespace imports (import * as fs from "fs") and enables CJS/AMD/UMD style imports (import fs from "fs")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import svgr from "vite-plugin-svgr";
|
||||
import million from "million/compiler";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
@@ -28,14 +28,11 @@ export default defineConfig({
|
||||
envPrefix: ["VITE_", "TAURI_"],
|
||||
build: {
|
||||
// Tauri uses Chromium on Windows and WebKit on macOS and Linux
|
||||
target:
|
||||
process.env.TAURI_PLATFORM == "windows"
|
||||
? "chrome105"
|
||||
: "safari13",
|
||||
target: process.env.TAURI_PLATFORM == "windows" ? "chrome105" : "safari13",
|
||||
// don't minify for debug builds
|
||||
minify: !process.env.TAURI_DEBUG ? "esbuild" : false,
|
||||
// produce sourcemaps for debug builds
|
||||
sourcemap: !!process.env.TAURI_DEBUG,
|
||||
cssCodeSplit: true
|
||||
cssCodeSplit: true,
|
||||
},
|
||||
});
|
||||