Repository: prayag17/JellyPlayer Branch: main Commit: 45dbfbb7ecb1 Files: 266 Total size: 1.2 MB Directory structure: gitextract_zji3jkza/ ├── .babelrc ├── .github/ │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ └── feature_request.md │ ├── release.yaml │ └── workflows/ │ ├── continuous-integration.yml │ ├── release.yml │ └── winget-releaser.yml ├── .gitignore ├── .vscode/ │ ├── extensions.json │ ├── launch.json │ ├── settings.json │ └── tasks.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── biome.json ├── index.html ├── latest.json ├── package.json ├── pnpm-workspace.yaml ├── renovate.json ├── src/ │ ├── components/ │ │ ├── Slider/ │ │ │ ├── index.tsx │ │ │ └── style.scss │ │ ├── addServerDialog/ │ │ │ └── index.tsx │ │ ├── albumMusicTrack/ │ │ │ ├── albumMusicTrack.scss │ │ │ └── index.tsx │ │ ├── alphaSelector/ │ │ │ ├── alphaSelector.scss │ │ │ └── index.tsx │ │ ├── appBar/ │ │ │ ├── appBar.scss │ │ │ ├── appBar.tsx │ │ │ ├── backOnly.tsx │ │ │ └── navigationDrawer.tsx │ │ ├── avatar/ │ │ │ ├── avatar.module.scss │ │ │ └── avatar.tsx │ │ ├── backdrop/ │ │ │ └── index.tsx │ │ ├── blurhash-canvas/ │ │ │ └── index.tsx │ │ ├── buttons/ │ │ │ ├── backButton.tsx │ │ │ ├── likeButton.tsx │ │ │ ├── markPlayedButton.tsx │ │ │ ├── playButton.tsx │ │ │ ├── playNextButton.tsx │ │ │ ├── playPreviousButtom.tsx │ │ │ ├── queueButton.scss │ │ │ ├── queueButton.tsx │ │ │ ├── quickConnectButton.tsx │ │ │ └── trailerButton.tsx │ │ ├── card/ │ │ │ ├── card.scss │ │ │ └── card.tsx │ │ ├── cardScroller/ │ │ │ ├── cardScroller.scss │ │ │ └── cardScroller.tsx │ │ ├── carousel/ │ │ │ ├── carousel.scss │ │ │ ├── index.tsx │ │ │ └── tickers.tsx │ │ ├── carouselSlide/ │ │ │ └── index.tsx │ │ ├── circularPageLoadingAnimation/ │ │ │ └── index.tsx │ │ ├── filtersDialog/ │ │ │ └── index.tsx │ │ ├── iconLink/ │ │ │ └── index.tsx │ │ ├── itemBackdrop/ │ │ │ └── index.tsx │ │ ├── itemHeader/ │ │ │ ├── index.tsx │ │ │ └── itemHeader.scss │ │ ├── layouts/ │ │ │ ├── artist/ │ │ │ │ ├── albumArtist.scss │ │ │ │ └── artistAlbum.tsx │ │ │ └── homeSection/ │ │ │ └── latestMediaSection.tsx │ │ ├── libraryHeader/ │ │ │ ├── index.tsx │ │ │ └── libraryHeader.scss │ │ ├── libraryItemsGrid/ │ │ │ ├── index.tsx │ │ │ └── libraryItemsGrid.scss │ │ ├── listItemLink/ │ │ │ └── index.tsx │ │ ├── musicTrack/ │ │ │ ├── index.tsx │ │ │ └── musicTrack.scss │ │ ├── nProgress/ │ │ │ └── index.tsx │ │ ├── notices/ │ │ │ ├── emptyNotice/ │ │ │ │ └── emptyNotice.tsx │ │ │ └── errorNotice/ │ │ │ └── errorNotice.tsx │ │ ├── outroCard/ │ │ │ ├── index.tsx │ │ │ └── outroCard.scss │ │ ├── playback/ │ │ │ ├── audioPlayer/ │ │ │ │ ├── audioPlayer.scss │ │ │ │ ├── components/ │ │ │ │ │ ├── LyricsPanel.tsx │ │ │ │ │ ├── PlayerActions.tsx │ │ │ │ │ ├── PlayerControls.tsx │ │ │ │ │ ├── PlayerInfo.tsx │ │ │ │ │ ├── PlayerProgress.tsx │ │ │ │ │ ├── PlayerVolume.tsx │ │ │ │ │ ├── QueuePanel.tsx │ │ │ │ │ └── StatsPanel.tsx │ │ │ │ └── index.tsx │ │ │ └── videoPlayer/ │ │ │ ├── EndsAtDisplay.tsx │ │ │ ├── ErrorDisplay.tsx │ │ │ ├── LoadingIndicator.tsx │ │ │ ├── ProgressDisplay.tsx │ │ │ ├── StatsForNerds.tsx │ │ │ ├── VolumeChangeOverlay.tsx │ │ │ ├── bubbleSlider/ │ │ │ │ └── index.tsx │ │ │ ├── buttons/ │ │ │ │ ├── CaptionsButton.tsx │ │ │ │ ├── ChaptersListButton.tsx │ │ │ │ ├── ForwardButton.tsx │ │ │ │ ├── FullscreenButton.tsx │ │ │ │ ├── NextChapterButton.tsx │ │ │ │ ├── PlayPauseButton.tsx │ │ │ │ ├── PrevChapterButton.tsx │ │ │ │ ├── RewindButton.tsx │ │ │ │ └── SkipSegmentButton.tsx │ │ │ ├── controls.scss │ │ │ ├── controls.tsx │ │ │ ├── settingsMenu.tsx │ │ │ ├── upNextFlyout.scss │ │ │ └── upNextFlyout.tsx │ │ ├── queueListItem/ │ │ │ └── index.tsx │ │ ├── queueTrack/ │ │ │ └── index.tsx │ │ ├── routerLoading/ │ │ │ └── index.tsx │ │ ├── search/ │ │ │ ├── index.tsx │ │ │ └── item.tsx │ │ ├── settingOption/ │ │ │ └── index.tsx │ │ ├── settingOptionSelect/ │ │ │ └── index.tsx │ │ ├── showMoreText/ │ │ │ └── index.tsx │ │ ├── skeleton/ │ │ │ ├── cards.tsx │ │ │ ├── carousel.tsx │ │ │ ├── episode.tsx │ │ │ ├── item.tsx │ │ │ ├── libraryItems.tsx │ │ │ └── seasonSelector.tsx │ │ ├── tagChip/ │ │ │ ├── index.tsx │ │ │ └── tagChip.scss │ │ ├── updater/ │ │ │ └── index.tsx │ │ ├── userAvatarMenu/ │ │ │ └── index.tsx │ │ └── utils/ │ │ ├── easterEgg.tsx │ │ └── iconsCollection.tsx │ ├── global.d.ts │ ├── main.tsx │ ├── palette.module.scss │ ├── routeTree.gen.ts │ ├── routes/ │ │ ├── __root.tsx │ │ ├── _api/ │ │ │ ├── album/ │ │ │ │ ├── $id.tsx │ │ │ │ └── album.scss │ │ │ ├── artist/ │ │ │ │ ├── $id.tsx │ │ │ │ └── artist.scss │ │ │ ├── boxset/ │ │ │ │ ├── $id.tsx │ │ │ │ └── boxset.scss │ │ │ ├── episode/ │ │ │ │ ├── $id.tsx │ │ │ │ └── episode.scss │ │ │ ├── favorite/ │ │ │ │ ├── favorite.scss │ │ │ │ └── index.tsx │ │ │ ├── home/ │ │ │ │ ├── home.scss │ │ │ │ └── index.tsx │ │ │ ├── item/ │ │ │ │ ├── $id.tsx │ │ │ │ └── item.scss │ │ │ ├── library/ │ │ │ │ ├── $id.tsx │ │ │ │ └── library.scss │ │ │ ├── login/ │ │ │ │ ├── $userId.$userName.tsx │ │ │ │ ├── list.tsx │ │ │ │ ├── login.scss │ │ │ │ └── manual.tsx │ │ │ ├── login.tsx │ │ │ ├── person/ │ │ │ │ ├── $id.tsx │ │ │ │ └── person.scss │ │ │ ├── player/ │ │ │ │ ├── audio.scss │ │ │ │ ├── audio.tsx │ │ │ │ ├── index.tsx │ │ │ │ ├── photos.scss │ │ │ │ ├── photos.tsx │ │ │ │ └── videoPlayer.scss │ │ │ ├── playlist/ │ │ │ │ ├── $id.tsx │ │ │ │ └── playlist.scss │ │ │ ├── search/ │ │ │ │ ├── index.tsx │ │ │ │ └── search.scss │ │ │ ├── series/ │ │ │ │ ├── $id.tsx │ │ │ │ └── series.scss │ │ │ ├── settings/ │ │ │ │ ├── about.scss │ │ │ │ ├── about.tsx │ │ │ │ ├── changeServer/ │ │ │ │ │ └── index.tsx │ │ │ │ └── preferences.tsx │ │ │ ├── settings.scss │ │ │ └── settings.tsx │ │ ├── _api.tsx │ │ ├── error/ │ │ │ └── $code.tsx │ │ ├── index.tsx │ │ └── setup/ │ │ ├── server.add.tsx │ │ ├── server.error.scss │ │ ├── server.error.tsx │ │ ├── server.list.tsx │ │ ├── server.scss │ │ └── serverList.scss │ ├── styles/ │ │ ├── global.scss │ │ └── variables.scss │ ├── theme.ts │ └── utils/ │ ├── browser-detection.ts │ ├── constants/ │ │ └── library.ts │ ├── date/ │ │ ├── formateDate.ts │ │ └── time.ts │ ├── hooks/ │ │ ├── useDebounce.ts │ │ ├── useDefaultSeason.ts │ │ ├── useInterval.tsx │ │ ├── useKeyPress.tsx │ │ └── useParallax.tsx │ ├── methods/ │ │ ├── getImageUrlsApi.ts │ │ ├── getSubtitles.ts │ │ ├── playback.ts │ │ └── ticksDisplay.ts │ ├── misc/ │ │ ├── debug.ts │ │ ├── konami.ts │ │ └── relaunch.ts │ ├── navigation.ts │ ├── playback-profiles/ │ │ ├── README.md │ │ ├── directplay-profile.ts │ │ ├── helpers/ │ │ │ ├── audio-formats.ts │ │ │ ├── codec-profiles.ts │ │ │ ├── fmp4-audio-formats.ts │ │ │ ├── fmp4-video-formats.ts │ │ │ ├── hls-formats.ts │ │ │ ├── mp4-audio-formats.ts │ │ │ ├── mp4-video-formats.ts │ │ │ ├── transcoding-formats.ts │ │ │ ├── ts-audio-formats.ts │ │ │ ├── ts-video-formats.ts │ │ │ ├── webm-audio-formats.ts │ │ │ └── webm-video-formats.ts │ │ ├── index.ts │ │ ├── response-profile.ts │ │ ├── subtitle-profile.ts │ │ └── transcoding-profile.ts │ ├── queries/ │ │ ├── about.ts │ │ ├── items.ts │ │ ├── library.ts │ │ └── libraryItems.ts │ ├── reducers/ │ │ └── videoPlayerReducer.ts │ ├── schema/ │ │ └── librarySearch.ts │ ├── storage/ │ │ ├── player.ts │ │ ├── servers.ts │ │ ├── settings.ts │ │ └── user.ts │ ├── store/ │ │ ├── api.tsx │ │ ├── audioPlayback.ts │ │ ├── backdrop.tsx │ │ ├── carousel.ts │ │ ├── central.tsx │ │ ├── drawer.ts │ │ ├── header.ts │ │ ├── libraryDraft.ts │ │ ├── libraryState.ts │ │ ├── photosPlayback.ts │ │ ├── playback.ts │ │ ├── queue.ts │ │ ├── search.tsx │ │ └── settings.tsx │ ├── types/ │ │ ├── audioPlaybackInfo.ts │ │ ├── introMediaInfo.ts │ │ ├── mediaQualityInfo.ts │ │ ├── playResult.ts │ │ ├── seriesBackdrop.ts │ │ └── subtitlePlaybackInfo.ts │ └── workers/ │ └── backdrop.worker.ts ├── src-tauri/ │ ├── .gitignore │ ├── Cargo.toml │ ├── build.rs │ ├── capabilities/ │ │ ├── desktop.json │ │ ├── main.json │ │ └── migrated.json │ ├── gen/ │ │ └── schemas/ │ │ ├── acl-manifests.json │ │ ├── capabilities.json │ │ ├── desktop-schema.json │ │ └── windows-schema.json │ ├── icons/ │ │ └── icon.icns │ ├── src/ │ │ └── main.rs │ └── tauri.conf.json ├── tsconfig.json └── vite.config.ts ================================================ FILE CONTENTS ================================================ ================================================ FILE: .babelrc ================================================ {} ================================================ FILE: .github/FUNDING.yml ================================================ # These are supported funding model platforms github: [prayag17] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry polar: # Replace with a single Polar username buy_me_a_coffee: # Replace with a single Buy Me a Coffee username thanks_dev: # Replace with a single thanks.dev username custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Bug report about: Create a report to help us improve title: '' labels: '' assignees: '' --- **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - OS: [e.g. Windows] - Version [e.g. v0.0.6-dev] - Jellyfin Version [e.g. 10.9] **Additional context** Add any other context about the problem here. ================================================ FILE: .github/ISSUE_TEMPLATE/feature_request.md ================================================ --- name: Feature request about: Suggest an idea for this project title: '' labels: '' assignees: '' --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here. ================================================ FILE: .github/release.yaml ================================================ changelog: categories: - title: 🏕 Features labels: - '*' exclude: labels: - dependencies - title: 👒 Dependencies labels: - dependencies ================================================ FILE: .github/workflows/continuous-integration.yml ================================================ # @format name: Continuous Integration on: 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@v6 - uses: pnpm/action-setup@v4 name: Install pnpm with: version: 10 run_install: false - name: Get pnpm store directory shell: bash run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - uses: actions/cache@v5 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@v6 with: node-version: "lts/*" cache: "pnpm" - name: Install dependencies run: pnpm install --no-frozen-lockfile # - name: Lint # run: pnpm run lint - 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/Blink' 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@v6 - 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.1-dev librsvg2-dev - name: Rust setup uses: dtolnay/rust-toolchain@stable - name: Rust cache uses: swatinem/rust-cache@v2 with: workspaces: "./src-tauri -> target" - uses: pnpm/action-setup@v4 name: Install pnpm with: version: 10 run_install: false - name: Get pnpm store directory shell: bash run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - uses: actions/cache@v5 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@v6 with: node-version: "lts/*" cache: "pnpm" - name: Install dependencies run: pnpm install --no-frozen-lockfile - name: Build app run: pnpm run tauri build --debug env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} # TODO: Remove the below command after upstream issue is fixed # Related issue: https://github.com/tauri-apps/tauri/issues/10702 WEBKIT_DISABLE_DMABUF_RENDERER: 1 # Disable DMABUF renderer on Wayland - name: Upload build Artifacts uses: actions/upload-artifact@v6 with: name: Blink-${{ matrix.platform }}-dev${{ github.sha }} path: src-tauri/target/debug/bundle/* # Create or update nightly release nightly_release: needs: build if: github.repository == 'prayag17/Blink' && github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest permissions: contents: write # Required for creating/updating releases steps: - name: Checkout repository uses: actions/checkout@v6.0.1 - name: Download all artifacts uses: actions/download-artifact@v7.0.0 with: path: artifacts - name: Prepare assets run: | mkdir -p release_assets find artifacts -type f \( -name "*.exe" -o -name "*.msi" -o -name "*.dmg" -o -name "*.deb" -o -name "*.AppImage" -o -name "*.rpm" -o -name "*.tar.gz" \) | while read -r file; do # Extract platform from artifact name (e.g. Blink-ubuntu-22.04-devSHA) artifact_name=$(echo "$file" | cut -d'/' -f2) platform=$(echo "$artifact_name" | sed -E 's/Blink-(.*)-dev.*/\1/' | sed 's/-/_/g') filename=$(basename "$file") cp "$file" "release_assets/${platform}-${filename}" done - name: Delete old nightly release run: gh release delete nightly --yes --repo ${{ github.repository }} || true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create nightly release uses: softprops/action-gh-release@v2.5.0 with: tag_name: nightly name: Nightly Build (${{ github.sha }}) body: | Nightly build from the latest main branch. **Last commit:** ${{ github.event.head_commit.message }} **SHA:** ${{ github.sha }} prerelease: true files: release_assets/* fail_on_unmatched_files: true ================================================ FILE: .github/workflows/release.yml ================================================ # @format name: Release on: 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@v6 - 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.1-dev librsvg2-dev - name: Rust setup uses: dtolnay/rust-toolchain@stable with: # Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds. targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} - name: Rust cache uses: swatinem/rust-cache@v2 with: workspaces: "./src-tauri -> target" - uses: pnpm/action-setup@v4 name: Install pnpm with: version: 10 run_install: false - name: Get pnpm store directory shell: bash run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - uses: actions/cache@v5 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@v6 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: Build the app uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_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 args: ${{ matrix.platform == 'macos-latest' && '--target universal-apple-darwin' || '' }} ================================================ FILE: .github/workflows/winget-releaser.yml ================================================ name: Publish Releases to WinGet on: release: types: [published] jobs: publish-alpha: runs-on: ubuntu-latest if: contains(github.event.release.tag_name, '-alpha') steps: - uses: vedantmgoyal9/winget-releaser@main with: identifier: prayag17.Blink.Alpha version: ${{ github.event.release.tag_name }} installers-regex: '\.exe$' token: ${{ secrets.WINGET_TOKEN }} publish-stable: runs-on: ubuntu-latest if: "!contains(github.event.release.tag_name, '-alpha')" steps: - uses: vedantmgoyal9/winget-releaser@main with: identifier: prayag17.Blink version: ${{ github.event.release.tag_name }} installers-regex: '\.exe$' token: ${{ secrets.WINGET_TOKEN }} ================================================ FILE: .gitignore ================================================ *dist *build __pycache__ *.mkv *.mp4 *mpv* sh-agent* .pytest_cache ### react ### .DS_* *.log logs **/*.backup.* **/*.back.* node_modules bower_components *.sublime* psd thumb sketch ### Rust ### # Generated by Cargo # will have compiled files and executables debug/ target/ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html # Cargo.lock # These are backup files generated by rustfmt **/*.rs.bk # MSVC Windows builds of rustc generate these, which store debugging information *.pdb generateBanner # Million Lint .million ================================================ FILE: .vscode/extensions.json ================================================ { "recommendations": [ "biomejs.biome", "github.vscode-github-actions", "swellaby.rust-pack", "1yib.rust-bundle", "sibiraj-s.vscode-scss-formatter", "tauri-apps.tauri-vscode" ] } ================================================ FILE: .vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "type": "lldb", "request": "launch", "name": "Tauri Development Debug", "cargo": { "args": [ "build", "--manifest-path=./src-tauri/Cargo.toml", "--no-default-features" ] }, // task for the `beforeDevCommand` if used, must be configured in `.vscode/tasks.json` "preLaunchTask": "ui:dev" }, { "type": "lldb", "request": "launch", "name": "Tauri Production Debug", "cargo": { "args": [ "build", "--release", "--manifest-path=./src-tauri/Cargo.toml" ] }, // task for the `beforeBuildCommand` if used, must be configured in `.vscode/tasks.json` "preLaunchTask": "ui:build" } ] } ================================================ FILE: .vscode/settings.json ================================================ { "editor.defaultFormatter": "biomejs.biome", "editor.codeActionsOnSave": { "quickfix.biome": "always", "source.organizeImports.biome": "explicit" }, "[github-actions-workflow]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[json]": { "editor.defaultFormatter": "biomejs.biome" }, "[typescriptreact]": { "editor.defaultFormatter": "biomejs.biome" }, "[typescript]": { "editor.defaultFormatter": "biomejs.biome" }, "[javascriptreact]": { "editor.defaultFormatter": "biomejs.biome" }, "[javascript]": { "editor.defaultFormatter": "biomejs.biome" }, "rust-analyzer.linkedProjects": ["./src-tauri/Cargo.toml"], "typescript.tsdk": "node_modules/typescript/lib", "[scss]": { "editor.defaultFormatter": "vscode.css-language-features" }, "millionLint.theme": "million", "millionLint.disableOutdatedVersionMessage": true } ================================================ FILE: .vscode/tasks.json ================================================ { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "ui:dev", "type": "shell", // `dev` keeps running in the background // ideally you should also configure a `problemMatcher` // see https://code.visualstudio.com/docs/editor/tasks#_can-a-background-task-be-used-as-a-prelaunchtask-in-launchjson "isBackground": true, // change this to your `beforeDevCommand`: "command": "yarn", "args": [ "dev" ] }, { "label": "ui:build", "type": "shell", // change this to your `beforeBuildCommand`: "command": "yarn", "args": [ "build" ] } ] } ================================================ FILE: CHANGELOG.md ================================================ - # Alpha 3 (11/12/2024) - refactor: prepare for alpha 3 - refactor: cleanup - refactor: remove unused imports - fix: series page not fetching correct season - feat: add key binding for macos users #435 - refactor: remove jellyPlayer naming from code #460 - feat: add playlist playback support - refactor: improve server add process - feat: show current time while scrubbing video progress #339 - style: increase the sharpness of card images - feat: add skip recap button - refactor: cleanup video player - feat: add chapter navigation buttons to video player #457 - feat: allow changing audio track from video player - feat: allow changing chapters from a chapter list #457 - refactor: cleanup search route - refactor: cleanup some components - refactor: unmount card image if not inView - refactor: cleanup person route - style: replace noto-sans with plus-jakarta-sans - refactor: cleanup login routes - fix: library items not of same size #380 - refactor: cleanup item.tsx - fix: series page breaking if season is not loaded - fix: do not display missing items in series - refactor: move more files to ts - refactor: move more files to ts - refactor: move more files to ts - refactor: move more files to typescript - refactor: move more components to ts - refactore: cleanup __root.tsx - chore(deps): update dependencies - fix: collections page not rendering #447 - fix: quick connect not working #445 - fix: playback error if subtitle is not set - fix: index not being assigned proper value #420 - fix: synced lyrics not working - Merge pull request #446 from prayag17/renovate/node-22.x-lockfile - refactor: use saved lyrics - refactor: change GenreView to genreFilter - fix(deps): update dependency @types/node to v22.10.1 - Merge pull request #393 from prayag17/renovate/tanstack-router-monorepo - Merge pull request #424 from prayag17/renovate/tanstack-query-monorepo - fix(deps): update tanstack-router monorepo - Merge pull request #426 from prayag17/renovate/node-22.x-lockfile - fix(deps): update dependency @types/node to v22.10.0 - Merge pull request #437 from prayag17/dependabot/cargo/src-tauri/rustls-0.23.18 - fix(deps): update tanstack-query monorepo to v5.61.4 - Merge pull request #438 from prayag17/renovate/axios-1.x-lockfile - Merge pull request #439 from prayag17/renovate/vitejs-plugin-react-4.x-lockfile - chore(deps): update dependency @vitejs/plugin-react to v4.3.4 - refactore: move more components to typescript - fix: episode and series not playing if episode is not present in nextUp and continueWatching - feat: show current episode in PlayButton - fix: episode indexing for absolute numbering indexNumbers in PlayButton - fix: unable to read Id of undefined in PlayButton - fix(deps): update dependency axios to v1.7.8 - chore(deps): bump rustls from 0.23.16 to 0.23.18 in /src-tauri - fix(ci): not uploading debug builds - refactor(ci): build debug builds in CI - Merge pull request #425 from prayag17/renovate/serde_json-1.x-lockfile - Merge pull request #436 from sambartik/macos-universal-dmg - chore(deps): update dependencies - refactor: convert more files to typescript - fix: improper handling of undefined api leading to crashes - refactor: move all buttons to tsx #338 - Add universal dmg for macOS in release job - fix: audio queue not moving after 2 changes #182 - fix: playing track from album not updating the queue #182 - refactor: use MediaSegments api for intro/outro skipping - fix: trickplay images not showing up - refactor: improve login page UI #338 #202 - chore(release): update latest.json - fix(deps): update rust crate serde_json to v1.0.133 - # 0.0.7-dev (20/11/2024) - chore(deps): update dependencies - refactor: change UI of login/list and fix Api not being defined in context - fix: player/audio route not able to interact with audioPlayer - fix: audio player info not visible - fix: audio player not playing audio - fix: toggling ssubtitles not working - fix: subtitles not being rendered #401 - fix: hero carousel indicators not scrolling - fix: vite build error for safari13 - fix: blink not launching or rendering on opening - Merge branch 'main' of https://github.com/prayag17/JellyPlayer - chore(deps): update dependencies - Merge pull request #410 from prayag17/renovate/tauri-plugin-notification-2.x-lockfile - Merge pull request #409 from Blackspirits/patch-1 - chore(deps): update dependencies - (origin/renovate/tauri-plugin-notification-2.x-lockfile) fix(deps): update rust crate tauri-plugin-notification to v2.0.1 - feat: allow downloading images from ImageViewer - Update index.tsx - feat: implement basic image viewer #338 #240 - fix: react infinite depth error - fix: vite config - refactor: remove @million/js and @million/lint - refactor: remove Cargo.lock from .gitignore #400 - chore(deps): update dependencies - refactor: code cleanup - fix: bug_report showing extra fields - refactor: remove redundant calls for getCurrentUser - feat: show queue item from currently playing item in queueButton - chore(deps): update dependencies - feat: remember library filters #192 - Merge pull request #370 from prayag17/renovate/tauri-apps-plugin-clipboard-manager-2.x - fix(deps): update dependency @tauri-apps/plugin-clipboard-manager to v2.1.0-beta.6 - Merge pull request #381 from prayag17/renovate/wavesurfer.js-7.x-lockfile - Merge pull request #342 from prayag17/renovate/tanstack-router-monorepo - Merge pull request #368 from prayag17/renovate/tauri-monorepo - chore(release): update latest.json - # 0.0.6-dev (9/7/2024) > **Note** : This is an unstable release - feat: add video player slider bubble theming #337 - feat: add trickplay support #338 #337 - fix(ci): update env variables - fix(ci): fix ubuntu build failing - chore(deps): update js and rust deps - feat: add chapter markers #337 - feat: add subtitle support #337 - fix(ci): invalid tauri build command - fix(ci):workflow repo name - feat: remember last search query - feat: add new audioPlayer route and allow reordering queue - chore(deps): update deps - chore(deps): cleanup unused dependencies and update dependencies - refactor: replace wavesurfer with html audio player - feat: add new album page - fix: quick connect not working - chore: change tauri updater signing keys - feat: show upNext card for episode items in player - fix: login page not working - Merge pull request #332 from pypp/feat/double-click-fullscreen - Merge pull request #333 from pypp/feat/scrollwheel-volume-control - fix: removed subtitleRenderer state that was added while merging - fix: fixed bug caused by merge econflicts - Merge remote-tracking branch 'upstream/main' into feat/scrollwheel-volume-control - fix: fixed fucntion to use the new API - Merge remote-tracking branch 'upstream/main' into feat/double-click-fullscreen - Merge branch 'main' of https://github.com/pypp/JellyPlayer into feat/double-click-fullscreen - fix(deps): update dependency babel-plugin-react-compiler to v0.0.0 - fix(deps): update tauri monorepo - chore(deps): update dependencies - feat: allow toggling subtitles on and off from player - fix: playNext and playPrevious logic - feat: add intro-skipper - refactor: cleanup unused variables in playbackStore - chore(deps): update packages - refactor: support vtt and ass subtitles - refactor: add sorting options to library page for Series and BoxSets - style: update hero-carousel styling - chore(deps): update deps - fix(deps): update dependency framer-motion to v11.2.9 - refactor: move most routing logic to tanstack - refactor: implement new login logic and verify context.api status - chore(deps): update dependencies - refactor: move to tanstack router - fix: videoPlayer not restoring playback position when queueItem is updated - fix: Slight UI regression when changing servers on latest version #288 - fix: eac3 codec support - refactor: queueItem playback - fix(deps): update rust crate tauri to 1.6.2 (#298) - fix: episode playback - feat: add queueButton - Merge branch 'main' of https://github.com/prayag17/JellyPlayer - chore(deps): fix vite 5.2 bundle - fix(deps): update dependency @types/react to v18.3.1 (#295) - fix: scrollTrigger in libraryView - style: improve styling - fix: backdrop flashing - feat: use tanstack virtual for rendering library items - style: improve login notice ui - refactor: fetch mediaSource for series - refactor: implement new playback method for playbutton (wip) - ui: improve glass texture - ui: implement new appBar #284 - feat: display sdr and hdr only videoRange - style: improve hdr10 logo spacing - chore: update title-movie screenshot in README.md - chore: update title-movie.png - fix: hdr10 icon height not matching - style: update mediainfo icons - style: update mediainfo icons - fix: no subtitle option not selecting - feat: use brand logo for hdr10plus - fix: default subtitle not being selected properly - style: display backdrops in boxset - fix: videoPlayer not exiting if subtitles are disabled - chore: add kitsu icon to iconLink - fix: carousel not rendering - chore: update readme - chore: update screenshots - fix: improve hdr10+ detection - feat: add quality and audio brand labels - style: improve page-margin - fix(player): unable to play media without subtitles - fix: album not displaying if no parent backdrop is found - chore: add screenshots and some features of JellyPlayer #242 - chore: upload screenshots - fix(nsis): nsis setup images not displaying correctly - style: Improve titlePage styling - style: change cardText styling - style: Improve overall app component paddings and margins and rollback vite to 5.1.6 - chore(deps): update dependency vite to v5.2.6 (#286) - fix(deps): update material-ui monorepo (#270) - fix(deps): update dependency @types/node to v20.11.29 (#292) - fix(deps): update dependency @types/react to v18.2.67 (#293) - fix(deps): update tanstack-query monorepo to v5.28.6 (#271) - fix(deps): update dependency @types/react to v18.2.67 (#272) - fix(deps): update dependency @types/node to v20.11.29 (#274) - fix(deps): update dependency framer-motion to v11.0.15 (#278) - fix(deps): update dependency typescript to v5.4.3 (#287) - fix(deps): update dependency material-symbols to v0.17.1 (#289) - chore(deps): update dependency @biomejs/biome to v1.6.2 (#290) - fix(deps): update rust crate log to ^0.4.21 (#276) - chore: update latest.json - # 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 ================================================ FILE: LICENSE ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: README.md ================================================ ![Banner](https://github.com/user-attachments/assets/cf3ffbe3-3b48-4fab-bd7e-f011928286fa)
GitHub Release GitHub Repo stars GitHub License GitHub Actions Workflow Status
### > [!IMPORTANT] > **JellyPlayer** has been renamed to **Blink** to avoid confusion with first party Jellyfin apps ## 📝 Prerequisites - Nodejs (22.14.0) - Rust (>=1.85.0) - Visual Studio C++ Build tools - [pnpm](https://pnpm.io/) ## ℹ️ Getting started - Install Nodejs, pnpm and Rust. > **Note** : Install Rust from - install depencies using pnpm: ```shell pnpm install ``` ## 🛠️ Development - Running the app: ```shell pnpm run tauri dev ``` - Building the app: ```shell pnpm run tauri build ``` - other commands can be found inside the `"scripts"` inside [package.json](https://github.com/prayag17/Blink/blob/main/package.json) ## 💻 Contribution - Checkout `issues` to see currently worked on features and bugs - Add features or fix bugs - Create a pull request ## ✨ Features - Play any media supported by the system (DirectPlay most files on windows, mac and linux) - Clean and minimal UI. - Multi Jellyfin server support - Cross Platform - Mediainfo recognition (DolbyVision, DolbyAtoms, Dts, Hdr10+, and more...) - Sort/Filter library items - Queue playback support - Intro Skip button using [jumoog/Intro-Skipper](https://github.com/jumoog/intro-skipper) plugin - Mediasegment support ## 📷 Screenshots - Home Screenshot 2026-02-10 212208 - Library Screenshot 2026-02-10 212723 - Music Player Detailed Screenshot 2026-02-10 213017 - Item Page Screenshot 2026-02-10 212653 - Album / Music Player Screenshot 2026-02-10 212949 - Search Dialog Screenshot 2026-02-10 212749 - Video Player Screenshot 2026-02-10 213049 ## 📃 Roadmap - Checkout [GitHub Project](https://github.com/users/prayag17/projects/3) ## 🎊 Special thanks to - [@ferferga](https://github.com/ferferga) for helping in development behind the scenes. - All contributors of [jellyfin/jellyfin-vue](https://github.com/jellyfin/jellyfin-vue). - And also [@jellyfin](https://github.com/jellyfin/) for creating the main service ================================================ FILE: biome.json ================================================ { "$schema": "https://biomejs.dev/schemas/2.3.13/schema.json", "assist": { "actions": { "source": { "organizeImports": "on" } } }, "linter": { "enabled": true, "rules": { "recommended": true, "style": { "noNonNullAssertion": "off", "useEnumInitializers": "off", "noParameterAssign": "error", "useAsConstAssertion": "error", "useDefaultParameterLast": "error", "useSelfClosingElements": "error", "useSingleVarDeclarator": "error", "noUnusedTemplateLiteral": "error", "useNumberNamespace": "error", "noInferrableTypes": "error", "noUselessElse": "error" }, "a11y": { "useKeyWithClickEvents": "off", "useMediaCaption": "off", "noStaticElementInteractions": "off" }, "correctness": { "useExhaustiveDependencies": "off", "noUnusedImports": "off" }, "suspicious": { "noExplicitAny": "off" }, "nursery": {} } }, "files": { "includes": [ "**/src/**/*.ts", "**/src/**/*.tsx", "**/src/**/*.jsx", "**/src/**/*.js", "**/*.json", "**/*.scss" ], "ignoreUnknown": true }, "formatter": { "formatWithErrors": true } } ================================================ FILE: index.html ================================================ Blink
================================================ FILE: latest.json ================================================ { "version": "0.0.7-dev", "notes": "![Banner](https://i.imgur.com/rnhjwsl.png)\n- chore(deps): update dependencies\n- refactor: change UI of login/list and fix Api not being defined in context\n- fix: player/audio route not able to interact with audioPlayer\n- fix: audio player info not visible\n- fix: audio player not playing audio\n- fix: toggling ssubtitles not working\n- fix: subtitles not being rendered #401\n- fix: hero carousel indicators not scrolling\n- fix: vite build error for safari13\n- fix: blink not launching or rendering on opening\n- Merge branch 'main' of https://github.com/prayag17/JellyPlayer\n- chore(deps): update dependencies\n- Merge pull request #410 from prayag17/renovate/tauri-plugin-notification-2.x-lockfile\n- Merge pull request #409 from Blackspirits/patch-1\n- chore(deps): update dependencies\n- fix(deps): update rust crate tauri-plugin-notification to v2.0.1\n- feat: allow downloading images from ImageViewer\n- Update index.tsx\n- feat: implement basic image viewer #338 #240\n- fix: react infinite depth error\n- fix: vite config\n- refactor: remove @million/js and @million/lint\n- refactor: remove Cargo.lock from .gitignore #400\n- chore(deps): update dependencies\n- refactor: code cleanup\n- fix: bug_report showing extra fields\n- refactor: remove redundant calls for getCurrentUser\n- feat: show queue item from currently playing item in queueButton\n- chore(deps): update dependencies\n- feat: remember library filters #192\n- Merge pull request #370 from prayag17/renovate/tauri-apps-plugin-clipboard-manager-2.x\n- fix(deps): update dependency @tauri-apps/plugin-clipboard-manager to v2.1.0-beta.6\n- Merge pull request #381 from prayag17/renovate/wavesurfer.js-7.x-lockfile\n- Merge pull request #342 from prayag17/renovate/tanstack-router-monorepo\n- Merge pull request #368 from prayag17/renovate/tauri-monorepo\n- chore(release): update latest.json", "pub_date": "2024-11-20T07:04:53.965Z", "platforms": { "darwin-aarch64": { "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSNkxEL1dFMElZL2RHaC9wc3VMQzJxeFRYaHVVN0xEZW91WWgwZkluYkYrdW5hUWl2UFlSeEUyRk93dm13WUdmQVZETWhmNW9MZ2lPUFdOdERzbGFibkpPNHJWMU1BYlFrPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMyMDg1ODYyCWZpbGU6QmxpbmsuYXBwLnRhci5negpjK0VIaW9oVzlrUU92UWZudzcvRGlZNExwM0NOdmpHVGd1QUc2WWZ0bnRkU2NsWkdqQUJrR01ucVVRTktvR0RaV0l0L09KQ2luZHNUdjMvTGVlM2RCUT09Cg==", "url": "https://github.com/prayag17/Blink/releases/download/v0.0.7-dev/Blink_aarch64.app.tar.gz" }, "linux-x86_64": { "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSNkxEL1dFMElZL1hKZGoxZFUvZzl5SmNnUEFRTGQ2TmFNMlphK25lTU9MTjJEM0JYQWt0Sy91Um9yRmk4QTl6dEtUSmRuRmFNODRwajJ2YW4rTGJzYVZjcmhFb1IxZkFnPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMyMDg2MTQxCWZpbGU6QmxpbmtfMC4wLjctZGV2X2FtZDY0LkFwcEltYWdlCndKZURUdjF0bkNna1VCVDNEMFNodEZBZGkzZFBKVWx2cThSNE5najBmd2U5Rzh5SDFIbUxqRHlKOWdxMnY2QU9NdTRiQmtWY2VVaVlhNjRrNDVHMUFRPT0K", "url": "https://github.com/prayag17/Blink/releases/download/v0.0.7-dev/Blink_0.0.7-dev_amd64.AppImage" }, "windows-x86_64": { "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSNkxEL1dFMElZL1MwRVJ0UXBUUEYvd01JbXhBalFwQ0w5bEdkZkdlblZNeW1EMXQxajhYeVd0cERWcnhWOWFOaXV4Q0hDU1VRTEhabXF1ekFIbzB0KzRmL0pxdEIzMEFrPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzMyMDg2Mjg5CWZpbGU6QmxpbmtfMC4wLjctZGV2X3g2NC1zZXR1cC5uc2lzLnppcApJMmRORUFhV3NKV3BCTTliQkIwcWtSZStKTzEwY002QndCWmxKb0ZRd2p2K0cvek90dmdsbmQ0MHhNOVJsWnE3Y29qQmNDckdxdUNabWpTWjJ3d0xBUT09Cg==", "url": "https://github.com/prayag17/Blink/releases/download/v0.0.7-dev/Blink_0.0.7-dev_x64-setup.nsis.zip" } } } ================================================ FILE: package.json ================================================ { "name": "blink", "private": true, "version": "1.0.0-alpha.4", "type": "module", "scripts": { "dev": "vite --force && tsr watch", "build": "vite build", "preview": "vite preview", "tauri": "tauri", "lint": "biome check src/**/*", "lint:fix": "biome check --apply src/**/*", "tanstack-router-dev": "tsr watch" }, "dependencies": { "@dnd-kit/core": "^6.3.1", "@dnd-kit/modifiers": "^9.0.0", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.1", "@fontsource-variable/jetbrains-mono": "^5.2.8", "@fontsource-variable/noto-sans": "^5.2.10", "@fontsource-variable/plus-jakarta-sans": "^5.2.8", "@fontsource-variable/space-grotesk": "^5.2.10", "@jellyfin/sdk": "0.13.0", "@mui/lab": "7.0.1-beta.21", "@mui/material": "7.3.7", "@popperjs/core": "^2.11.8", "@react-spring/web": "^10.0.3", "@tanem/react-nprogress": "^5.0.59", "@tanstack/react-form": "^1.28.0", "@tanstack/react-query": "^5.90.20", "@tanstack/react-query-devtools": "^5.91.3", "@tanstack/react-router": "^1.158.4", "@tanstack/react-router-devtools": "^1.158.4", "@tanstack/react-virtual": "^3.13.18", "@tauri-apps/api": "2.10.1", "@tauri-apps/plugin-clipboard-manager": "2.3.2", "@tauri-apps/plugin-dialog": "2.6.0", "@tauri-apps/plugin-global-shortcut": "~2.3.1", "@tauri-apps/plugin-notification": "2.3.3", "@tauri-apps/plugin-process": "2.3.1", "@tauri-apps/plugin-shell": "~2.3.5", "@tauri-apps/plugin-store": "github:tauri-apps/tauri-plugin-store#v2", "@tauri-apps/plugin-updater": "2.10.0", "@tauri-apps/plugin-upload": "2.4.0", "@tauri-apps/plugin-window-state": "~2.4.1", "@types/node": "^25.2.1", "@types/react": "^19.2.13", "@types/react-dom": "^19.2.3", "axios": "^1.13.4", "axios-tauri-api-adapter": "^2.0.6", "blurhash": "^2.0.5", "blurhash-wasm": "^0.2.0", "immer": "^11.1.3", "jassub": "^2.4.1", "libpgs": "^0.8.1", "lodash": "^4.17.23", "material-symbols": "^0.40.2", "motion": "^12.33.0", "notistack": "^3.0.2", "react": "^19.2.4", "react-blurhash": "^0.3.0", "react-dnd": "^16.0.1", "react-dnd-html5-backend": "^16.0.1", "react-dom": "^19.2.4", "react-error-boundary": "^6.1.0", "react-intersection-observer": "^10.0.2", "react-markdown": "^10.1.0", "react-multi-carousel": "^2.8.6", "react-player": "^3.4.0", "remark-gfm": "^4.0.1", "typescript": "^5.9.3", "vite-plugin-svgr": "^4.5.0", "vite-plugin-top-level-await": "^1.6.0", "wavesurfer.js": "^7.12.1", "zod": "^4.3.6", "zustand": "5.0.11" }, "devDependencies": { "@babel/plugin-proposal-optional-chaining-assign": "^7.27.1", "@biomejs/biome": "^2.3.14", "@tanstack/router-cli": "^1.158.4", "@tanstack/router-devtools": "^1.158.4", "@tanstack/router-vite-plugin": "^1.158.4", "@tauri-apps/cli": "2.10.0", "@types/lodash": "^4.17.23", "@vitejs/plugin-react": "^5.1.3", "babel-plugin-react-compiler": "19.1.0-rc.3", "eslint-plugin-react-hooks": "7.0.1", "prop-types": "^15.8.1", "sass": "^1.97.3", "vite": "^7.3.1", "vite-plugin-wasm": "^3.5.0" }, "license": "GPL-3.0-only" } ================================================ FILE: pnpm-workspace.yaml ================================================ onlyBuiltDependencies: - '@parcel/watcher' - core-js - esbuild ================================================ FILE: renovate.json ================================================ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:base", ":disableDependencyDashboard"], "labels": ["dependencies"] } ================================================ FILE: src/components/Slider/index.tsx ================================================ import React, { type ReactNode, useCallback, useEffect, useRef, useState, } from "react"; import { useSpring } from "@react-spring/web"; import { debounce } from "lodash"; import "./style.scss"; import { IconButton } from "@mui/material"; const Slider = ({ content, currentSlide, }: { content: ReactNode[]; currentSlide: number }) => { const containerRef = useRef(null); const [scrollPos, setScrollPos] = useState({ isStart: true, isEnd: false }); const handleScroll = useCallback(() => { const scrollWidth = containerRef.current?.scrollWidth ?? 0; const clientWidth = containerRef.current?.getBoundingClientRect().width ?? 0; const scrolledPostion = containerRef.current?.scrollLeft ?? 0; if (content.length === 0) { setScrollPos({ isStart: true, isEnd: true }); } else if (clientWidth >= scrollWidth) { setScrollPos({ isStart: true, isEnd: true }); } else if ( scrolledPostion >= (containerRef.current?.scrollWidth ?? 0) - clientWidth ) { setScrollPos({ isStart: false, isEnd: true }); } else if (scrolledPostion > 0) { setScrollPos({ isStart: false, isEnd: false }); } else { setScrollPos({ isStart: true, isEnd: false }); } }, [content]); const debouncedScroll = useCallback( () => debounce(handleScroll, 50), [handleScroll], ); useEffect(() => { const handleResize = () => { debouncedScroll(); }; window.addEventListener("resize", handleResize, { passive: true }); return () => window.removeEventListener("resize", handleResize); }, [debouncedScroll]); useEffect(() => { handleScroll(); }, [handleScroll, content]); const onScroll = () => { debouncedScroll(); }; const [, setX] = useSpring(() => ({ from: { x: 0 }, to: { x: 0 }, onChange: (results) => { if (containerRef.current) { containerRef.current.scrollLeft = results.value.x; } }, })); const slideLeft = useCallback(() => { const clientWidth = containerRef.current?.getBoundingClientRect().width ?? 0; const cardWidth = containerRef.current?.firstElementChild?.getBoundingClientRect().width ?? 0; const scrollPosition = containerRef.current?.scrollLeft ?? 0; const visibleItems = Math.floor(clientWidth / cardWidth); const scrollOffset = scrollPosition % cardWidth; const newX = Math.max( scrollPosition - scrollOffset - visibleItems * cardWidth, 0, ); setX({ from: { x: scrollPosition }, to: { x: newX }, onChange: (results) => { if (containerRef.current) { containerRef.current.scrollLeft = results.value.x; } }, reset: true, config: { friction: 60, tension: 1000, velocity: 2 }, }); if (newX === 0) { setScrollPos({ isStart: true, isEnd: false }); } else { setScrollPos({ isStart: false, isEnd: false }); } }, [setX]); const slideRight = useCallback(() => { const clientWidth = containerRef.current?.getBoundingClientRect().width ?? 0; const cardWidth = containerRef.current?.firstElementChild?.getBoundingClientRect().width ?? 0; const scrollPosition = containerRef.current?.scrollLeft ?? 0; const visibleItems = Math.floor(clientWidth / cardWidth); const scrollOffset = scrollPosition % cardWidth; const newX = Math.min( scrollPosition - scrollOffset + visibleItems * cardWidth, containerRef.current?.scrollWidth ?? 0 - clientWidth, ); setX({ from: { x: scrollPosition }, to: { x: newX }, onChange: (results) => { if (containerRef.current) { containerRef.current.scrollLeft = results.value.x; } }, reset: true, config: { friction: 60, tension: 500, velocity: 2 }, }); if (newX >= (containerRef.current?.scrollWidth ?? 0) - clientWidth) { setScrollPos({ isStart: false, isEnd: true }); } else { setScrollPos({ isStart: false, isEnd: false }); } }, [setX]); return (
chevron_left
{content?.map((item, index) => (
{item}
))}
chevron_right
); }; export default Slider; ================================================ FILE: src/components/Slider/style.scss ================================================ .slider { position: relative; &-track { overflow-y: hidden; overflow-x: auto; white-space: nowrap; position: relative; overscroll-behavior-x: contain; margin: 0.5em 1em; &::-webkit-scrollbar { display: none; } &-item { display: inline-block; // align-self: top; padding: 0.5em 0; } } &-button { position: absolute !important; bottom: 1.3em; &.left { left: -1.2em; } &.right { right: -1.2em; } } } ================================================ FILE: src/components/addServerDialog/index.tsx ================================================ import { LoadingButton } from "@mui/lab"; import { Box, Button, Dialog, InputBase, Stack, Typography, } from "@mui/material"; import { useMutation } from "@tanstack/react-query"; import { enqueueSnackbar } from "notistack"; import React, { useState } from "react"; import { setServer } from "@/utils/storage/servers"; import { jellyfin } from "@/utils/store/api"; type AddServerDialogProps = { open: boolean; setAddServerDialog: (value: boolean) => void; sideEffect?: () => Promise; hideBackdrop?: boolean; }; export default function AddServerDialog(props: AddServerDialogProps) { const { open, setAddServerDialog, sideEffect, hideBackdrop } = props; const [serverIp, setServerIp] = useState(""); const addServer = useMutation({ mutationKey: ["add-server"], 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", }, ); if (sideEffect) { await sideEffect(); } } }, 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 ( setAddServerDialog(false)} hideBackdrop={Boolean(hideBackdrop)} fullWidth maxWidth="sm" disableScrollLock={true} PaperProps={{ sx: { backgroundColor: "rgba(20, 20, 30, 0.7)", backdropFilter: "blur(24px) saturate(180%)", backgroundImage: "linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0))", border: "1px solid rgba(255, 255, 255, 0.08)", boxShadow: "0 20px 50px rgba(0,0,0,0.5)", borderRadius: 4, overflow: "hidden", }, }} > add_to_queue Connect to Server Enter your Jellyfin server address to continue dns setServerIp(e.target.value)} sx={{ py: 1.5 }} autoFocus onKeyDown={(e) => { if (e.key === "Enter") { addServer.mutate(); } }} /> addServer.mutate()} variant="contained" color="primary" sx={{ borderRadius: 2, px: 3 }} disabled={!serverIp} > Connect ); } ================================================ FILE: src/components/albumMusicTrack/albumMusicTrack.scss ================================================ .item-info-track{ display: grid; grid-template-columns: 3em 60% 6em 1fr; gap: 1em; padding: 1em; align-items: center; cursor: pointer; border-radius: $border-radius-default; transition: background $transition-time-fast; &.header { border-bottom: 1px solid rgb(255 255 255 / 0.2); color: rgb(255 255 255 / 0.7); border-radius: 0 !important; } .index-container { justify-self: center; position: relative; .material-symbols-rounded { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2em !important; opacity: 0; transition: none !important; color: $clr-accent-default; } } &-info { display: flex; flex-direction: column; gap: 0.1em } &:hover { background: rgb(255 255 255 / 0.1) !important; .index-container { // font-size: 0em; .index { opacity: 0; transition: opacity 0; } .material-symbols-rounded { opacity: 1; font-size: 2.2em !important; } } } &.playing { background: rgb(0 0 0 / 0.4) !important; .item-info-track-info-name, .index { color: $clr-accent-default; font-weight: 600; } } &-container { display: flex; flex-direction: column; gap: 0.4em } } ================================================ FILE: src/components/albumMusicTrack/index.tsx ================================================ import { generateAudioStreamUrl, playAudio, useAudioPlayback, } from "@/utils/store/audioPlayback"; import type { BaseItemDto, BaseItemDtoQueryResult, } from "@jellyfin/sdk/lib/generated-client"; import { Typography } from "@mui/material"; import React from "react"; import { getRuntimeMusic } from "@/utils/date/time"; import { useApiInContext } from "@/utils/store/api"; import { useCentralStore } from "@/utils/store/central"; import { setQueue } from "@/utils/store/queue"; import { useSnackbar } from "notistack"; import lyricsIcon from "../../assets/icons/lyrics.svg"; import LikeButton from "../buttons/likeButton"; import "./albumMusicTrack.scss"; type AlbumMusicTrackProps = { track: BaseItemDto; /** * This is the index of the track in the musicTracks array (not to be confused with IndexNumber property of the track) */ trackIndex: number; musicTracks: BaseItemDtoQueryResult | null; }; export default function AlbumMusicTrack(props: AlbumMusicTrackProps) { const { track, musicTracks, trackIndex } = props; const [currentPlayingItem] = useAudioPlayback((state) => [state.item]); const user = useCentralStore((state) => state.currentUser); const api = useApiInContext((s) => s.api); const { enqueueSnackbar } = useSnackbar(); const handlePlayback = ( index: number, item: BaseItemDto, queue: BaseItemDto[], ) => { if (!user?.Id || !api) { console.error("User not logged in"); enqueueSnackbar("You need to be logged in to play music", { variant: "error", }); return; } if (item.Id) { const url = generateAudioStreamUrl( item.Id, user.Id, api.deviceInfo.id, api.basePath, api.accessToken, ); playAudio(url, item); setQueue(queue, index); } }; return (
{ if (musicTracks?.Items) { handlePlayback(trackIndex, track, musicTracks.Items); } }} >
play_arrow {track.IndexNumber ?? "-"}
{track.Name} {track.HasLyrics && lyrics} {track.Artists?.join(", ")}
{getRuntimeMusic(track.RunTimeTicks ?? 0)}
); } ================================================ FILE: src/components/alphaSelector/alphaSelector.scss ================================================ .alpha-selector { position: sticky; top: 80px; right: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; margin-left: auto; user-select: none; z-index: 2; } .alpha-letter { font-size: 12px; line-height: 1; padding: 6px 8px; border-radius: 8px; background: transparent; color: rgba(255,255,255,0.7); border: none; cursor: pointer; } .alpha-letter.active { background: rgba(255,255,255,0.12); color: #fff; } .alpha-letter:hover { background: rgba(255,255,255,0.08); } ================================================ FILE: src/components/alphaSelector/index.tsx ================================================ import { getRouteApi } from "@tanstack/react-router"; import React, { useMemo } from "react"; import { useShallow } from "zustand/shallow"; import { useLibraryStateStore } from "@/utils/store/libraryState"; import "./alphaSelector.scss"; const libraryRoute = getRouteApi("/_api/library/$id"); export const AlphaSelector = React.memo(function AlphaSelector() { const { id: currentLibraryId } = libraryRoute.useParams(); const { nameStartsWith } = useLibraryStateStore( useShallow((s) => ({ nameStartsWith: s.libraries[currentLibraryId || ""]?.nameStartsWith, })), ); const updateLibrary = useLibraryStateStore((s) => s.updateLibrary); const letters = useMemo(() => { const arr = Array.from({ length: 26 }, (_, i) => String.fromCharCode(65 + i), ); return ["All", ...arr]; }, []); const handleSelect = (letter: string) => { const value = letter === "All" ? undefined : letter; if (currentLibraryId) updateLibrary(currentLibraryId, { nameStartsWith: value }); }; return (
{letters.map((l) => { const active = (nameStartsWith || "All") === l; return ( ); })}
); }); export default AlphaSelector; ================================================ FILE: src/components/appBar/appBar.scss ================================================ .appBar { // Limit transitions to cheaper properties; avoid animating box-shadow directly transition: background-color $transition-time-fast; padding: 0.8em ($page-margin - 1.7em); z-index: 999 !important; .flex { // Avoid animating padding; it causes layout reflow on each frame. transition: background-color $transition-time-fast; // Avoid using will-change: scroll-position; it can degrade performance when misused // will-change: opacity, transform; border-radius: 1000px; position: relative; // Pseudo-element handles elevation shadow; we animate its opacity &::after { content: ""; position: absolute; inset: -0.35em; pointer-events: none; border-radius: inherit; @include glass-effect; opacity: 0; z-index: -1; transition: all $transition-time-fast; } } // Inner content wrapper that we can scale without causing layout reflow .flex-inner { transform-origin: top center; transition: transform $transition-time-fast; } &.elevated{ .flex { &::after { opacity: 1; } } // Apply a subtle scale to simulate shrink without layout changes .flex-inner { transform: scaleY(0.95); } } &-avatar { background: rgb(255 255 255 / 0.1) !important; &-icon { color: white; } } &-text { opacity: 0.7; transition: opacity $transition-time-fast; position: relative; color: white; text-decoration: none; &::after { content: ""; width: 100%; height: 1.2px; background: white; opacity: 0.7; position: absolute; bottom: 4.6px; left: 0; transform: scaleX(0); transition: transform $transition-time-fast, background $transition-time-fast, opacity $transition-time-fast; } &:hover { opacity: 0.8; &::after { transform: scaleX(0.25); opacity: 0.8; } } &.active { opacity: 1; color: $clr-accent-default; &::after { transform: scaleX(0.5); opacity: 1; background: $clr-accent-default; } } } } .library-drawer { // Ensure the drawer paper itself gets the styling &.MuiDrawer-paper { width: 280px; margin: 16px; height: calc(100% - 32px) !important; // float in the middle border-radius: 24px; background: rgba(20, 20, 25, 0.75); // Darker, substantial base backdrop-filter: blur(24px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.06); box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.2); overflow: hidden; // Contain scrollbars } .MuiList-root { padding: 8px; // Reduced from 16px gap: 2px; // Reduced gap } .MuiDivider-root { border-color: rgba(255, 255, 255, 0.1); margin: 4px 12px; // Reduced margins } // Navigation Items .MuiListItemButton-root { border-radius: 12px !important; // Slightly smaller radius padding: 8px 12px; // Reduced padding (was 12px 16px) margin-bottom: 2px; transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); color: rgba(255, 255, 255, 0.6); &:hover { background: rgba(255, 255, 255, 0.08); color: #fff; transform: scale(1.02); } .material-symbols-rounded { margin-right: 12px; // Reduced spacing font-size: 22px; // Slightly smaller icons usually look better with less padding transition: all 0.2s ease; color: inherit; } .MuiListItemText-primary { font-weight: 600; font-size: 0.9rem; // Slightly smaller text letter-spacing: 0.02em; } } // Active State .library-drawer-item.active { .MuiListItemButton-root { background: linear-gradient(90deg, rgba($clr-accent-default, 0.2), rgba($clr-accent-default, 0.05)); color: $clr-accent-default; .material-symbols-rounded { font-variation-settings: 'FILL' 1; color: $clr-accent-default; } // Active Indicator Bar &::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: 24px; width: 4px; background: $clr-accent-default; border-radius: 0 4px 4px 0; } } } // Custom Scrollbar for the drawer content &::-webkit-scrollbar { width: 4px; } &::-webkit-scrollbar-track { background: transparent; } &::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; &:hover { background: rgba(255, 255, 255, 0.2); } } } .appLoading { opacity: 0; } ================================================ FILE: src/components/appBar/appBar.tsx ================================================ import MuiAppBar from "@mui/material/AppBar"; import IconButton from "@mui/material/IconButton"; import useScrollTrigger from "@mui/material/useScrollTrigger"; import { useLocation, useNavigate } from "@tanstack/react-router"; import React, { useCallback, useMemo, useState } from "react"; import "./appBar.scss"; import { useShallow } from "zustand/shallow"; // removed search placeholder; library state now managed via zustand import { useApiInContext } from "@/utils/store/api"; import { useCentralStore } from "@/utils/store/central"; import useHeaderStore from "@/utils/store/header"; import useSearchStore from "@/utils/store/search"; import BackButton from "../buttons/backButton"; import { UserAvatarMenu } from "../userAvatarMenu"; import { NavigationDrawer } from "./navigationDrawer"; const MemoizeBackButton = React.memo(BackButton); const HIDDEN_PATHS = [ "/login", "/setup", "/server", "/player", "/error", "/settings", "/library", "/search", ]; export const AppBar = () => { const navigate = useNavigate(); const location = useLocation(); const toggleSearchDialog = useSearchStore( useShallow((s) => s.toggleSearchDialog), ); const display = !HIDDEN_PATHS.some( (path) => (location.pathname.startsWith(path) && location.pathname !== "/player/audio") || location.pathname === "/", ); const trigger = useScrollTrigger({ disableHysteresis: true, threshold: 20, }); const [showDrawer, setShowDrawer] = useState(false); const appBarStyling = useMemo(() => { return { backgroundColor: "transparent", paddingRight: "0 !important", }; }, []); const _handleNavigateToSearch = useCallback( () => navigate({ to: "/search", search: { query: "" } }), [navigate], ); const handleDrawerClose = useCallback(() => { setShowDrawer(false); }, []); const handleDrawerOpen = useCallback(() => { setShowDrawer(true); }, []); const handleNavigateToHome = useCallback(() => navigate({ to: "/home" }), []); const handleNavigateToFavorite = useCallback(() => { navigate({ to: "/favorite" }); }, []); useHeaderStore(useShallow((s) => ({ pageTitle: s.pageTitle }))); if (!display) { return null; } if (display) { return ( <>
menu home
search favorite
); } }; ================================================ FILE: src/components/appBar/backOnly.tsx ================================================ import AppBar from "@mui/material/AppBar"; import IconButton from "@mui/material/IconButton"; import Toolbar from "@mui/material/Toolbar"; import { useLocation, useRouter } from "@tanstack/react-router"; import React from "react"; import QuickConnectButton from "../buttons/quickConnectButton"; export default function AppBarBackOnly() { const { history } = useRouter(); const location = useLocation(); const handleBack = () => { history.go(-1); }; const hideQuickConnect = location.pathname === "/setup/server/list"; return ( arrow_back {!hideQuickConnect && ( )} ); }; ================================================ FILE: src/components/appBar/navigationDrawer.tsx ================================================ import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api"; import { Divider, Drawer, List, ListItem, ListItemButton } from "@mui/material"; import { useQuery } from "@tanstack/react-query"; import React, { useMemo } from "react"; import { useApiInContext } from "@/utils/store/api"; import { useCentralStore } from "@/utils/store/central"; import ListItemLink from "../listItemLink"; import { getTypeIcon } from "../utils/iconsCollection"; interface NavigationDrawerProps { open: boolean; onClose: () => void; } export const NavigationDrawer = ({ open, onClose }: NavigationDrawerProps) => { const api = useApiInContext((s) => s.api); const [user] = useCentralStore((s) => [s.currentUser]); const libraries = useQuery({ queryKey: ["libraries"], queryFn: async () => { if (!user?.Id || !api?.accessToken) { return; } const libs = await getUserViewsApi(api).getUserViews({ userId: user.Id, }); return libs.data; }, enabled: !!user?.Id && !!api?.accessToken, networkMode: "always", }); const drawerPaperProps = useMemo(() => { return { className: "glass library-drawer", elevation: 6, }; }, []); return ( menu_open
Close
{libraries.isSuccess && libraries.data?.Items?.map((library) => ( ))}
); }; ================================================ FILE: src/components/avatar/avatar.module.scss ================================================ .avatar-image { aspect-ratio: 1; height: 100%; position: absolute; inset: 0; background-size: cover; background-position: center; &-container { width: fit-content; aspect-ratio: 1; position: relative; border-radius: 100vh; overflow: hidden; } &-icon { height: 100%; padding: 0.2em; background: rgb(255 255 255 / 0.1); color: white; font-size: 7em !important; } } ================================================ FILE: src/components/avatar/avatar.tsx ================================================ import React from "react"; import "./avatar.module.scss"; import { useApiInContext } from "@/utils/store/api"; export const AvatarImage = ({ userId }: { userId: string }) => { const api = useApiInContext((s) => s.api); if (!api) return null; return (
account_circle
); }; ================================================ FILE: src/components/backdrop/index.tsx ================================================ import { AnimatePresence, motion } from "motion/react"; import React from "react"; import { useShallow } from "zustand/shallow"; import { useBackdropStore } from "@/utils/store/backdrop"; import BlurhashCanvas from "../blurhash-canvas"; export default function Backdrop() { // const [backdropLoading, setBackdropLoading] = useState(true); const { backdropHash } = useBackdropStore( useShallow((state) => ({ backdropHash: state.backdropHash, })), ); if (!backdropHash) { return null; } return ( ); } ================================================ FILE: src/components/blurhash-canvas/index.tsx ================================================ import * as blurhash from "blurhash-wasm"; import React, { useEffect } from "react"; type BlurhashCanvasProps = { canvasProps?: React.CanvasHTMLAttributes; blurhashString: string; width?: number; height?: number; // punch?: number; onLoad?: () => void; onError?: (error: Error) => void; }; const BlurhashCanvas = ({ canvasProps, blurhashString, width, height, // punch, onLoad, onError, }: BlurhashCanvasProps) => { const canvasRef = React.useRef(null); useEffect(() => { const canvas = canvasRef.current; if (!canvas) return; const ctx = canvas.getContext("2d"); if (!ctx) return; const drawBlurhash = async () => { try { const imageDataBuffer = blurhash.decode( blurhashString, width || 32, height || 32, // punch || 1, ); // canvas.width = width || 32; // canvas.height = height || 32; if (!imageDataBuffer) { throw new Error("Failed to decode blurhash"); } const imageData = new ImageData( new Uint8ClampedArray(imageDataBuffer), width || 32, height || 32, ); // imageData.data.set(imageDataBuffer); ctx.putImageData(imageData, 0, 0); if (onLoad) onLoad(); } catch (error) { if (onError) onError(error as Error); else console.error("Error decoding blurhash:", error); } }; drawBlurhash(); }, [blurhash, width, height, onLoad, onError]); return ; }; export default BlurhashCanvas; ================================================ FILE: src/components/buttons/backButton.tsx ================================================ import { IconButton } from "@mui/material"; import { useRouter } from "@tanstack/react-router"; import React from "react"; export default function BackButton() { const { history } = useRouter(); const handleClick = () => { history.back(); }; return ( arrow_back ); } ================================================ FILE: src/components/buttons/likeButton.tsx ================================================ import type { UserItemDataDto } from "@jellyfin/sdk/lib/generated-client"; import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api"; import { pink } from "@mui/material/colors"; import IconButton from "@mui/material/IconButton"; import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useSnackbar } from "notistack"; import React from "react"; import { useApiInContext } from "@/utils/store/api"; export default function LikeButton({ itemId, isFavorite, queryKey, userId, itemName, }: { itemId: string | undefined; isFavorite: boolean | undefined; queryKey: string[] | undefined; userId: string | undefined; itemName?: string | null; }) { const api = useApiInContext((s) => s.api); const queryClient = useQueryClient(); const { enqueueSnackbar } = useSnackbar(); const handleLiking = async () => { let result: UserItemDataDto = null!; if (!api) return; if (!userId) return; if (!itemId) return; if (!itemName) return; if (isFavorite) { result = ( await getUserLibraryApi(api).unmarkFavoriteItem({ userId: userId, itemId: itemId, }) ).data; } else if (!isFavorite) { result = ( await getUserLibraryApi(api).markFavoriteItem({ userId: userId, itemId: itemId, }) ).data; } return result; // We need to return the result so that the onSettled function can invalidate the query }; const mutation = useMutation({ mutationFn: handleLiking, onError: (error) => { enqueueSnackbar(`An error occured while updating "${itemName}"`, { variant: "error", }); console.error(error); }, onSettled: async () => { return await queryClient.invalidateQueries({ queryKey, }); }, mutationKey: ["likeButton", itemId], }); return ( { if (!mutation.isPending) { mutation.mutate(); e.stopPropagation(); } }} style={{ opacity: mutation.isPending ? 0.5 : 1, transition: "opacity 250ms", }} > favorite ); } ================================================ FILE: src/components/buttons/markPlayedButton.tsx ================================================ import React from "react"; import IconButton from "@mui/material/IconButton"; import { green } from "@mui/material/colors"; import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useApiInContext } from "@/utils/store/api"; import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api"; import { useSnackbar } from "notistack"; export default function MarkPlayedButton({ itemId, isPlayed, queryKey, userId, itemName, }: { itemId?: string; isPlayed?: boolean; queryKey?: string[]; userId?: string; itemName?: string | null; }) { const api = useApiInContext((s) => s.api); const queryClient = useQueryClient(); const { enqueueSnackbar } = useSnackbar(); const handleMarking = async () => { let result = null; if (!api) return; if (!api) return; if (!userId) return; if (!itemId) return; if (!itemName) return; if (!isPlayed) { result = await getPlaystateApi(api).markPlayedItem({ userId: userId, itemId: itemId, }); } else if (isPlayed) { result = await getPlaystateApi(api).markUnplayedItem({ userId: userId, itemId: itemId, }); } return result; // We need to return the result so that the onSettled function can invalidate the query }; const mutation = useMutation({ mutationFn: handleMarking, onError: (error) => { enqueueSnackbar(`${error}`, { variant: "error", }); enqueueSnackbar(`An error occured while updating "${itemName}"`, { variant: "error", }); console.error(error); }, onSettled: async () => { return await queryClient.invalidateQueries({ queryKey: queryKey, }); }, mutationKey: ["markPlayedButton", itemId], }); return ( { if (!mutation.isPending) { mutation.mutate(); e.stopPropagation(); } }} style={{ opacity: mutation.isPending ? 0.5 : 1, transition: "opacity 250ms", }} >
done
); } ================================================ FILE: src/components/buttons/playButton.tsx ================================================ import { type BaseItemDto, BaseItemKind, } from "@jellyfin/sdk/lib/generated-client"; import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api"; import type { SxProps } from "@mui/material"; import Button, { type ButtonProps } from "@mui/material/Button"; import Fab from "@mui/material/Fab"; import LinearProgress from "@mui/material/LinearProgress"; import Typography from "@mui/material/Typography"; import { useMutation, useQuery } from "@tanstack/react-query"; import { useNavigate } from "@tanstack/react-router"; import { useSnackbar } from "notistack"; import React, { type MouseEvent, memo } from "react"; // Import memo import type PlayResult from "@//utils/types/playResult"; import { getRuntimeCompact } from "@/utils/date/time"; import { getNextEpisode, getPlaybackInfo } from "@/utils/methods/playback"; import { useApiInContext } from "@/utils/store/api"; import { generateAudioStreamUrl, playAudio } from "@/utils/store/audioPlayback"; import { usePhotosPlayback } from "@/utils/store/photosPlayback"; import { initializePlayback } from "@/utils/store/playback"; import { setQueue } from "@/utils/store/queue"; type PlayButtonProps = { item: BaseItemDto; userId: string | undefined; itemType: BaseItemKind; currentAudioTrack?: number | "auto"; currentVideoTrack?: number; currentSubTrack?: number | "nosub"; className?: string; sx?: SxProps; buttonProps?: ButtonProps; iconOnly?: boolean; audio?: boolean; size?: "small" | "large" | "medium"; playlistItem?: boolean; playlistItemId?: string; trackIndex?: number; }; // Memoized LinearProgress component const MemoizedLinearProgress = memo(({ value }: { value: number }) => ( )); const PlayButton = ({ item, userId, itemType, currentAudioTrack, currentSubTrack, // currentVideoTrack, className, sx, buttonProps, iconOnly, audio = false, size = "large", playlistItem, playlistItemId = "", }: PlayButtonProps) => { const api = useApiInContext((s) => s.api); const navigate = useNavigate(); // const setPlaybackDataLoading = usePlaybackDataLoadStore( // (state) => state.setisPending, // ); const playPhotos = usePhotosPlayback((s) => s.playPhotos); const { enqueueSnackbar } = useSnackbar(); const itemQuery = useMutation({ mutationKey: ["playButton", item?.Id, userId], mutationFn: async (currentEpisodeId?: string) => { if (!api) { throw new Error("API is not available"); } if (!userId) { throw new Error("User ID is not available"); } if (!item.Id) { throw new Error("Item ID is not available"); } return await getPlaybackInfo(api, userId, item, { currentAudioTrack, currentSubTrack, currentEpisodeId, playlistItem, playlistItemId, }); }, onSuccess: async (result: PlayResult | null) => { if (!api) { console.error("API is not available"); enqueueSnackbar("API is not available", { variant: "error" }); return; } if (!userId) { console.error("User ID is not available"); enqueueSnackbar("User ID is not available", { variant: "error" }); return; } if (!result?.item?.Items?.length) { console.error("No items found"); enqueueSnackbar("No items found", { variant: "error" }); return; } if (!result?.item?.Items?.[0]?.Id) { console.error("No item ID found"); enqueueSnackbar("No item ID found", { variant: "error" }); return; } if (audio) { // Album/Individual audio track playback const playbackUrl = generateAudioStreamUrl( result?.item?.Items?.[0].Id, userId, api?.deviceInfo.id, api.basePath, api.accessToken, ); playAudio(playbackUrl, result?.item?.Items?.[0], undefined); setQueue(result?.item?.Items ?? [], 0); } else if (item.Type === "Photo") { const index = result?.item?.Items?.map((i) => i.Id).indexOf(item.Id); if (result?.item?.Items && index) { playPhotos(result?.item?.Items, index); navigate({ to: "/player/photos" }); } } else { if (!result?.mediaSource?.MediaSources?.[0]?.Id) { console.error("No media source ID found"); enqueueSnackbar("No media source ID found", { variant: "error" }); return; } const episodeIndex = result.episodeIndex; const queue = result?.item?.Items ?? []; let playItemValue = queue[episodeIndex]; if (itemType === BaseItemKind.Movie) { playItemValue = queue[0]; } if (!playItemValue) { console.error("No item to play found"); return; } const startPosition = playItemValue.UserData?.PlaybackPositionTicks; initializePlayback({ api, userId, item: playItemValue, mediaSource: result.mediaSource, mediaSegments: result.mediaSegments, queueItems: queue, queueIndex: episodeIndex, startPositionTicks: startPosition, audioStreamIndex: currentAudioTrack === "auto" ? undefined : currentAudioTrack, subtitleStreamIndex: currentSubTrack === "nosub" ? -1 : currentSubTrack, }); navigate({ to: "/player" }); } }, onSettled: () => { // setPlaybackDataLoading(false); }, onError: (error) => { console.error(error); enqueueSnackbar(`${error}`, { variant: "error", }); }, }); const handleClick = ( e: MouseEvent, currentEpisodeId?: string | undefined, ) => { e.stopPropagation(); itemQuery.mutate(currentEpisodeId); }; const currentEpisode = useQuery({ queryKey: ["playButton", "currentEpisode", item?.Id], queryFn: async () => { if (!api) { throw new Error("API is not available"); } if (!userId) { throw new Error("User ID is not available"); } if (!item.Id) { throw new Error("Item ID is not available"); } const seasons = await getTvShowsApi(api).getSeasons({ seriesId: item.Id, userId: userId, enableUserData: true, }); const currentSeason = seasons.data.Items?.find((season) => { return season.UserData?.Played !== true; }); const episode = await getNextEpisode( api, userId, item.Id, currentSeason?.IndexNumber ?? 0, ); if (episode) { return { Items: [episode] }; } return { Items: [] }; }, enabled: itemType === BaseItemKind.Series, }); if (iconOnly) { return ( //@ts-expect-error { if (item.Type === "Episode") { handleClick(e, item.Id); } else if (itemType === BaseItemKind.Series) { handleClick(e, currentEpisode.data?.Items?.[0]?.Id); } else { handleClick(e); } }} sx={sx} size={size} disabled={ itemType === BaseItemKind.Series && (!currentEpisode.data || !currentEpisode.data.Items || currentEpisode.data.Items.length === 0) } {...buttonProps} > play_arrow ); } if (itemType === BaseItemKind.Series) { return (
{(currentEpisode.data?.Items?.[0]?.UserData?.PlaybackPositionTicks ?? 0) > 0 && ( {getRuntimeCompact( (currentEpisode.data?.Items?.[0]?.RunTimeTicks ?? 0) - (currentEpisode.data?.Items?.[0]?.UserData ?.PlaybackPositionTicks ?? 0), )}{" "} left )}
); } return (
{(item.UserData?.PlaybackPositionTicks ?? 0) > 0 && ( {getRuntimeCompact( (item.RunTimeTicks ?? 0) - (item.UserData?.PlaybackPositionTicks ?? 0), )}{" "} left )}
); }; export default PlayButton; ================================================ FILE: src/components/buttons/playNextButton.tsx ================================================ import { useApiInContext } from "@/utils/store/api"; import { playItemFromQueue } from "@/utils/store/playback"; import useQueue from "@/utils/store/queue"; import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api"; import { IconButton } from "@mui/material"; import { useMutation, useQuery } from "@tanstack/react-query"; import React from "react"; const PlayNextButton = () => { const api = useApiInContext((s) => s.api); const user = useQuery({ queryKey: ["user"], queryFn: async () => { if (!api) return; const result = await getUserApi(api).getCurrentUser(); return result.data; }, }); const handlePlayNext = useMutation({ mutationKey: ["playNextButton"], mutationFn: () => playItemFromQueue("next", user.data?.Id, api), onError: (error) => console.error(error), }); const [queueItems, currentItemIndex] = useQueue((state) => [ state.tracks, state.currentItemIndex, ]); return ( handlePlayNext.mutate()} > skip_next ); }; export default PlayNextButton; ================================================ FILE: src/components/buttons/playPreviousButtom.tsx ================================================ import { useApiInContext } from "@/utils/store/api"; import { playItemFromQueue } from "@/utils/store/playback"; import useQueue from "@/utils/store/queue"; import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api"; import { IconButton } from "@mui/material"; import { useMutation, useQuery } from "@tanstack/react-query"; import React from "react"; const PlayPreviousButton = () => { const api = useApiInContext((s) => s.api); const user = useQuery({ queryKey: ["user"], queryFn: async () => { if (!api) return; const result = await getUserApi(api).getCurrentUser(); return result.data; }, }); const handlePlayNext = useMutation({ mutationKey: ["playPreviousButton"], mutationFn: () => playItemFromQueue("previous", user.data?.Id, api), onError: (error) => [console.error(error)], }); const [currentItemIndex] = useQueue((state) => [state.currentItemIndex]); return ( handlePlayNext.mutate()} > skip_previous ); }; export default PlayPreviousButton; ================================================ FILE: src/components/buttons/queueButton.scss ================================================ .queue{ &-item{ --image-size: 5em; &.episode { --image-size: 8em !important; } width: 32em; padding: 1em; display: grid !important; opacity: 1 !important; gap: 1em; height: 5em; grid-template-columns: 3em var(--image-size) 1fr; justify-items: center; align-items: center; &-image{ max-height: 100%; max-width: 100%; object-fit: cover; border-radius: $border-radius_04; overflow: hidden; &-container { aspect-ratio: 1; overflow: hidden; height: 100%; display: flex; justify-content: center; align-items: center; position: relative; width: var(--image-size); } &-icon { width: 100%; height: 100%; display: grid; place-items: center; background: rgb(255 255 255 / 0.2); border-radius: 10px; .material-symbols-rounded { font-size: 2em; } } } &-info{ display: flex; flex-direction: column; gap: 0.2em; width: 100%; overflow: hidden; } } &-item.Mui-disabled { .queue-item-image,.queue-item-image-icon{ opacity: 0.5 !important; } } } ================================================ FILE: src/components/buttons/queueButton.tsx ================================================ import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api"; import { Box, Drawer, IconButton, List, Tooltip, Typography, } from "@mui/material"; import { useQuery } from "@tanstack/react-query"; import React, { useMemo, useState } from "react"; import { playItemFromQueue } from "@/utils/store/playback"; import useQueue, { clearUpcoming, removeFromQueue, reorderQueue, shuffleUpcoming, } from "@/utils/store/queue"; import "./queueButton.scss"; import { closestCenter, DndContext, type DragEndEvent, KeyboardSensor, PointerSensor, useSensor, useSensors, } from "@dnd-kit/core"; import { restrictToVerticalAxis } from "@dnd-kit/modifiers"; import { arrayMove, SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy, } from "@dnd-kit/sortable"; import { CSS } from "@dnd-kit/utilities"; import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; import { useApiInContext } from "@/utils/store/api"; import QueueListItem from "../queueListItem"; function SortableQueueItem({ item, onDelete, onPlay, index, }: { item: BaseItemDto; onDelete: () => void; onPlay: () => void; index: number; }) { const { attributes, listeners, setNodeRef, transform, transition, isDragging, } = useSortable({ id: item.Id || "" }); const style = { transform: CSS.Transform.toString(transform), transition, opacity: isDragging ? 0.5 : 1, position: "relative" as const, zIndex: isDragging ? 2 : 1, }; return (
); } const QueueButton = () => { const api = useApiInContext((s) => s.api); const [queueItems, currentItemIndex] = useQueue((state) => [ state.tracks, state.currentItemIndex, ]); const [open, setOpen] = useState(false); const user = useQuery({ queryKey: ["currentUser"], queryFn: async () => { if (!api) throw new Error("API not available"); return (await getUserApi(api).getCurrentUser()).data; }, enabled: !!api, }); const sensors = useSensors( useSensor(PointerSensor), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates, }), ); const upcomingItems = useMemo(() => { return queueItems ? queueItems.slice(currentItemIndex + 1) : []; }, [queueItems, currentItemIndex]); const upcomingIds = useMemo(() => { return upcomingItems.map((item) => item.Id || ""); }, [upcomingItems]); const handleDragEnd = (event: DragEndEvent) => { const { active, over } = event; if (active.id !== over?.id && queueItems) { const oldIndex = upcomingItems.findIndex( (item) => item.Id === active.id, ); const newIndex = upcomingItems.findIndex( (item) => item.Id === over?.id, ); if (oldIndex !== -1 && newIndex !== -1) { const newUpcoming = arrayMove(upcomingItems, oldIndex, newIndex); const newQueue = [ ...queueItems.slice(0, currentItemIndex + 1), ...newUpcoming, ]; reorderQueue(newQueue); } } }; const handleDelete = (index: number) => { removeFromQueue(index); }; const handlePlay = (index: number) => { playItemFromQueue(index, user.data?.Id, api); }; const handleClear = () => { clearUpcoming(); }; const handleShuffle = () => { shuffleUpcoming(); }; return ( <> setOpen(false)} PaperProps={{ className: "glass", sx: { width: 450, maxWidth: "100%", display: "flex", flexDirection: "column", borderLeft: "1px solid rgba(255, 255, 255, 0.08)", }, }} ModalProps={{ BackdropProps: { sx: { backgroundColor: "rgba(0, 0, 0, 0.2)", backdropFilter: "blur(4px)", }, }, }} > Play Queue {queueItems?.length || 0} shuffle clear_all setOpen(false)} size="small"> close {queueItems && queueItems.length > 0 ? ( {/* Current Item */} {queueItems[currentItemIndex] && ( NOW PLAYING )} {/* Upcoming Items */} {upcomingItems.length > 0 && ( <> NEXT UP {upcomingItems.map((item, index) => ( handleDelete(currentItemIndex + 1 + index) } onPlay={() => handlePlay(currentItemIndex + 1 + index) } index={currentItemIndex + 1 + index + 1} /> ))} )} ) : ( queue_music Your queue is empty )} setOpen(true)}> playlist_play ); }; export default QueueButton; ================================================ FILE: src/components/buttons/quickConnectButton.tsx ================================================ import { getQuickConnectApi } from "@jellyfin/sdk/lib/utils/api/quick-connect-api"; import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api"; import { LoadingButton, type LoadingButtonProps } from "@mui/lab"; import { Button, Checkbox, Dialog, DialogActions, DialogContent, DialogContentText, FormControlLabel, Slide, Tooltip, Typography, } from "@mui/material"; import type { TransitionProps } from "@mui/material/transitions"; import { skipToken, useMutation, useQuery } from "@tanstack/react-query"; import { useNavigate } from "@tanstack/react-router"; import { writeText } from "@tauri-apps/plugin-clipboard-manager"; import { useSnackbar } from "notistack"; import React, { useCallback, useState } from "react"; import useInterval from "@/utils/hooks/useInterval"; import { saveUser } from "@/utils/storage/user"; import { useApiInContext } from "@/utils/store/api"; const Transition = React.forwardRef(function Transition( props: TransitionProps & { children: React.ReactElement; }, ref: React.Ref, ) { return ( ); }); const QuickConnectButton = (props: LoadingButtonProps) => { const api = useApiInContext((s) => s.api); const createApi = useApiInContext((s) => s.createApi); // if (!api) { // console.error( // "Unable to display quick connect button, api is not available", // ); // return null; // } const headers = { "X-Emby-Authorization": `MediaBrowser Client="${api?.clientInfo.name}", Device="${api?.deviceInfo.name}", DeviceId="${api?.deviceInfo.id}", Version="${api?.clientInfo.version}"`, }; const navigate = useNavigate(); const quickConnectEnabled = useQuery({ queryKey: ["quick-connect-button", "check-quick-connect-enabled"], queryFn: api ? async () => await getQuickConnectApi(api).getQuickConnectEnabled() : skipToken, enabled: Boolean(api), }); const { enqueueSnackbar } = useSnackbar(); const [quickConnectCode, setQuickConnectCode] = useState(); const [quickConnectSecret, setQuickConnectSecret] = useState(); const [checkForQuickConnect, setCheckForQuickConnect] = useState(false); const [rememberUser, setRememberUser] = useState(true); const authenticateUser = useMutation({ mutationKey: ["quick-connect-button", "authenticate-user"], mutationFn: async () => { if (api && quickConnectSecret) { return await getUserApi(api).authenticateWithQuickConnect( { quickConnectDto: { Secret: quickConnectSecret } }, { headers }, ); } }, onSuccess: (result) => { if (api && result?.data?.AccessToken && result.data.User?.Name) { setCheckForQuickConnect(false); // saveUser({ username, password, rememberMe: rememberUser }); enqueueSnackbar(`Logged in as ${result.data.User?.Name}!`, { variant: "success", }); createApi(api.basePath, result.data.AccessToken); if (rememberUser) { saveUser(result.data.User?.Name, result.data.AccessToken); } navigate({ to: "/home", replace: true }); } }, onError: (error) => { enqueueSnackbar("Error authenticating user.", { variant: "error" }); console.error(error); }, }); const checkQuickConnectStatus = useMutation({ mutationKey: ["quick-connect-button", "check-quick-connect-status"], mutationFn: async (secret: string) => api && ( await getQuickConnectApi(api).getQuickConnectState( { secret }, { headers }, ) ).data, onSuccess: (result) => { if (result?.Authenticated) { setQuickConnectCode(null); initQuickConnect.reset(); checkQuickConnectStatus.reset(); authenticateUser.mutate(); } }, }); const initQuickConnect = useMutation({ mutationKey: ["quick-connect-button", "initiate-connection"], mutationFn: async () => { if (!quickConnectEnabled.data?.data) { enqueueSnackbar("Quick Connect is not enabled on server.", { variant: "error", }); } if (api) { return await getQuickConnectApi(api).initiateQuickConnect({ headers }); } }, onSuccess: (result) => { setQuickConnectCode(result?.data.Code); setQuickConnectSecret(result?.data.Secret); setCheckForQuickConnect(true); }, onError: (error) => { enqueueSnackbar("Error initiating Quick Connect.", { variant: "error" }); console.error(error); }, }); const handleQuickConnectClose = useCallback(() => { setQuickConnectCode(null); setCheckForQuickConnect(false); initQuickConnect.reset(); checkQuickConnectStatus.reset(); }, []); useInterval( () => { if (quickConnectSecret) { console.log(checkForQuickConnect); checkQuickConnectStatus.mutate(quickConnectSecret); } }, checkForQuickConnect ? 1500 : null, ); return (
{/* @ts-ignore */} {quickConnectEnabled.data?.data ? "Use Quick Connect" : "Quick Connect Disabled"} Quick Connect Code: Use this code in the Quick Connect tab in your server to login.
{ quickConnectCode && (await writeText(quickConnectCode)); enqueueSnackbar("Quick Connect Code copied!", { variant: "info", key: "copiedText", }); }} > {quickConnectCode}
setRememberUser(e.target.checked)} /> } label="Remember device" />
); }; export default QuickConnectButton; ================================================ FILE: src/components/buttons/trailerButton.tsx ================================================ import type { 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 (
setDialog(true)} > theaters setDialog(false)} > {props.trailerItem[0]?.Url && ( )}
); }; export default TrailerButton; ================================================ FILE: src/components/card/card.scss ================================================ .card { height: 100%; overflow: visible !important; align-items: flex-start; background: transparent !important; margin-right: 1.5em; margin-bottom: .8em; &-box { display: flex; width: 100%; height: 100%; position: relative; overflow: visible; flex-direction: column; justify-content: center; } &-image { width: 100%; height: 100%; object-fit: cover; transition: all $transition-time-fast; position: absolute; z-index: 1; top: 0; left: 0; &-container { position: relative; width: 100%; 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; &-container { background: linear-gradient(45deg, rgb(255 255 255 / 0.05), rgb(255 255 255 / 0.15)); height: 100%; width: 100%; position: absolute; z-index: 0; top: 0; left: 0; transition: filter $transition-time-default; .material-symbols-rounded { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: rgb(255 255 255 / 0.5); font-size: 4em !important; } } } &-blurhash { position: absolute; z-index: 1; top: 0; left: 0; width: 100% !important; height: 100% !important; overflow: hidden; } } &-overlay { position: absolute; width: 100%; height: 100%; left: 0; top: 0; z-index: 10; opacity: 0; transition: all $transition-time-default; display: flex; align-items: flex-end; justify-content: flex-end; padding: 0.5em; background: rgba(20, 20, 30, 0.6); backdrop-filter: blur(12px); } &:hover, &:focus, &:focus-within { .card-overlay { opacity: 1; } } &:hover { cursor: pointer; } &:focus { outline: none; } &-play-button { position: absolute !important; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; } &-indicator { position: absolute; top: 0.4em; right: 0.4em; z-index: 2; padding: 0.2em 0.75em; background: rgb(20 20 20 / 0.5); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); transition: opacity 250ms; border-radius: 100px; box-shadow: 0 0 5px rgb(0 0 0 / 0.2); } &-episode { .card-box { height: unset !important; } } &-actor { transition: all $transition-time-default; border-radius: 10px; // padding: 1em !important; &:hover { background: rgb(255 255 255 / 0.1) !important; } .card-image-container { 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; } } &-text-container { display: flex !important; flex-direction: column; } } ================================================ FILE: src/components/card/card.tsx ================================================ /** @format */ import { type BaseItemDto, BaseItemKind, type ImageType, } from "@jellyfin/sdk/lib/generated-client"; import { useNavigate } from "@tanstack/react-router"; import React, { memo, type Ref, useCallback, useState } from "react"; import { ErrorBoundary } from "react-error-boundary"; import { useInView } from "react-intersection-observer"; import getImageUrlsApi from "@/utils/methods/getImageUrlsApi"; import { useApiInContext } from "@/utils/store/api"; import LikeButton from "../buttons/likeButton"; import MarkPlayedButton from "../buttons/markPlayedButton"; import PlayButton from "../buttons/playButton"; import { getTypeIcon } from "../utils/iconsCollection"; import "./card.scss"; interface CardProps { item: BaseItemDto; cardTitle: string | undefined | null; cardCaption?: string | null | number; imageType?: ImageType; cardType: "square" | "thumb" | "portrait"; queryKey?: string[]; userId?: string; seriesId?: string | null; hideText?: boolean; onClick?: () => void; disableOverlay?: boolean; overrideIcon?: any; skipInView?: boolean; } const CardContent = ({ item, cardTitle, cardCaption, imageType = "Primary", cardType = "square", queryKey, userId, seriesId, hideText = false, onClick, disableOverlay = false, overrideIcon, inView, forwardedRef, }: CardProps & { inView: boolean; forwardedRef?: Ref; }) => { const api = useApiInContext((s) => s.api); const navigate = useNavigate(); const defaultOnClick = useCallback(() => { if (item?.Id) { switch (item?.Type) { case BaseItemKind.BoxSet: navigate({ to: "/boxset/$id", params: { id: item.Id } }); break; case BaseItemKind.Episode: navigate({ to: "/episode/$id", params: { id: item.Id } }); break; case BaseItemKind.MusicAlbum: navigate({ to: "/album/$id", params: { id: item.Id } }); break; case BaseItemKind.MusicArtist: navigate({ to: "/artist/$id", params: { id: item.Id } }); break; case BaseItemKind.Person: navigate({ to: "/person/$id", params: { id: item.Id } }); break; case BaseItemKind.Series: navigate({ to: "/series/$id", params: { id: item.Id } }); break; case BaseItemKind.Playlist: navigate({ to: "/playlist/$id", params: { id: item.Id } }); break; default: navigate({ to: "/item/$id", params: { id: item.Id } }); break; } } }, [item?.Id, item?.Type, navigate]); return (
}>
done
{item.UserData?.UnplayedItemCount}
{overrideIcon ? getTypeIcon(overrideIcon) : getTypeIcon(item.Type ?? "universal")}
{inView && ( {item.Name { e.currentTarget.style.opacity = "1"; }} className="card-image" /> )} {inView && !disableOverlay && (
)} {(item.UserData?.PlaybackPositionTicks ?? -1) > 0 && (
)}
{cardTitle}
{cardCaption}
); }; const CardWithInView = (props: CardProps) => { const { ref, inView } = useInView({ threshold: 0.1, }); return ; }; const CardComponent = (props: CardProps) => { if (props.skipInView) { return ; } return ; }; export const Card = memo(CardComponent); ================================================ FILE: src/components/cardScroller/cardScroller.scss ================================================ @use "@/styles/variables.scss" as *; .card-scroller-container { margin-bottom: 2.5em; position: relative; // Ensure the container handles overflow if needed, but usually Carousel handles it } .card-scroller { // Override carousel default outline &:focus { outline: none; } &-slide { padding-right: 0.5em; // Gap between cards (handled by slide padding instead of gap for carousel) // With react-multi-carousel, better to rely on their gap logic or item class } &-item { padding-right: 0.6em; // Consistent gap } &-header-container { display: flex; width: 100%; justify-content: space-between; align-items: center; margin-bottom: 1em; min-height: 40px; } &-heading { display: flex; align-items: center; justify-content: flex-start; gap: 0.5em; position: relative; font-weight: 600 !important; &-decoration { width: 4px; height: 24px; background: $clr-accent-default; border-radius: 4px; } } &-controls { display: flex; gap: 0.5em; .scroller-nav-btn { background-color: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.05); color: rgba(255, 255, 255, 0.7); transition: all 0.2s ease; width: 36px; height: 36px; &:hover { background-color: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.2); } // Disabled state &.Mui-disabled { background-color: transparent; border-color: transparent; color: rgba(255, 255, 255, 0.1); } .material-symbols-rounded { font-size: 1.5em; } } } } .hidden-decoration { .card-scroller-heading-decoration { display: none; } } ================================================ FILE: src/components/cardScroller/cardScroller.tsx ================================================ import React, { type ReactNode, useRef, useState } from "react"; import Carousel from "react-multi-carousel"; import "react-multi-carousel/lib/styles.css"; import IconButton from "@mui/material/IconButton"; import Typography from "@mui/material/Typography"; import "./cardScroller.scss"; // Custom Header + Button Group component const ScrollerHeader = ({ onNext, onPrevious, title, headingProps, disableDecoration, currentSlide = 0, isNextDisabled = false, }: any) => { // Basic disable logic for visual feedback const isFirst = currentSlide === 0; return (
{title}
chevron_left chevron_right
); }; type CardScrollerProps = { children: ReactNode; displayCards: number; title: string; headingProps?: object; disableDecoration?: boolean; boxProps?: object; }; export default function CardScroller({ children, displayCards, title, headingProps, disableDecoration = false, boxProps, }: CardScrollerProps) { const carouselRef = useRef(null); const [currentSlide, setCurrentSlide] = useState(0); const [slidesToShow, setSlidesToShow] = useState(displayCards); const totalItems = React.Children.count(children); const responsive = { superLargeDesktop: { breakpoint: { max: 4000, min: 3000 }, items: displayCards + 1, slidesToSlide: displayCards + 1, partialVisibilityGutter: 40, }, desktop: { breakpoint: { max: 3000, min: 925 }, items: displayCards, slidesToSlide: displayCards, partialVisibilityGutter: 30, }, tablet: { breakpoint: { max: 925, min: 600 }, items: displayCards - 3, slidesToSlide: displayCards - 3, partialVisibilityGutter: 20, }, mobile: { breakpoint: { max: 600, min: 424 }, items: displayCards - 5, slidesToSlide: displayCards - 5, partialVisibilityGutter: 10, }, smallScreen: { breakpoint: { max: 424, min: 0 }, items: 1, slidesToSlide: 1, partialVisibilityGutter: 10, }, }; const handleNext = () => { if (carouselRef.current) { carouselRef.current.next(); } }; const handlePrevious = () => { if (carouselRef.current) { carouselRef.current.previous(); } }; return (
= totalItems} /> { setCurrentSlide(nextSlide); setSlidesToShow(state.slidesToShow); }} > {children}
); } ================================================ FILE: src/components/carousel/carousel.scss ================================================ .carousel { position: relative; overflow: visible; height: 65vh; margin-bottom: 3em; display: grid; grid-template-areas: "main sidebar"; grid-template-columns: 1fr 340px; gap: 1.5em; &-sidebar { overflow-y: auto; height: 100%; position: relative; @include glass-effect($bg-color: rgba(10, 10, 14, 0.4)); border-radius: 24px; grid-area: sidebar; display: flex; flex-direction: column; padding: 12px; gap: 8px; // Ensure programmatic scroll respects padding scroll-padding-block: 24px; // Hide scrollbar but keep functionality scrollbar-width: none; -ms-overflow-style: none; &::-webkit-scrollbar { width: 0; height: 0; display: none; } } &-button { position: absolute !important; top: 50%; transform: translateY(-50%); z-index: 100; &.right { right: 0.5em; } &.left { left: 0.5em; } } &-ticker{ overflow: hidden; height: 72px; display: flex; padding: 8px; align-items: center; gap: 12px; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); position: relative; border-radius: 12px; // Slightly smaller radius to work with the bar background: transparent; border: 1px solid transparent; &:hover { background: rgba(255, 255, 255, 0.05); cursor: pointer; } &.active { background: rgba(255, 255, 255, 0.08); // Subtle background // Vertical Progress Bar &::after { content: ''; position: absolute; left: 0; bottom: 0; width: 4px; background-color: var(--mui-palette-primary-main, #fff); height: 0%; animation: ticker-v-progress 8s linear; } } &-image { height: 56px; width: 100px; flex-shrink: 0; border-radius: 8px; object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,0.2); &.placeholder { display: flex; align-items: center; justify-content: center; background: rgb(100 100 100 / 0.1); color: rgb(200 200 200 / 0.7); font-size: 2rem; } } & > div { display: flex; flex-direction: column; justify-content: center; min-width: 0; // flexible text truncation padding-left: 4px; // compensate for visual weight of potential bar .carousel-ticker-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; // Slightly lighter font-size: 0.95rem; line-height: 1.2; margin-bottom: 2px; opacity: 0.9; } .carousel-ticker-year { font-size: 0.8rem; opacity: 0.6; } } } // Pause progress when carousel is paused &.paused { .carousel-ticker.active::after { animation-play-state: paused; } } @keyframes ticker-v-progress { from { height: 0%; } to { height: 100%; } } &-indicator { aspect-ratio: 1.77777; overflow: hidden; border-radius: 2px; padding: 2px; transition: opacity $transition-time-fast; opacity: 0.5; width: auto; &:hover { cursor: pointer; opacity: 0.8; } &-container { display: flex; gap: 1em; align-items: center; justify-content: center; } &-image { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; } &-icon { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: rgb(155 155 155 / 0.4); border-radius: 4px; } &.active { opacity: 1; .material-symbols-rounded { --fill: 1; } } } } .carousel-ticker-wrapper { scroll-margin-block: 24px; } ================================================ FILE: src/components/carousel/index.tsx ================================================ import { AnimatePresence } from "motion/react"; import React, { useCallback, useEffect, useState } from "react"; import { useCarouselStore } from "../../utils/store/carousel"; import "./carousel.scss"; import { type BaseItemDto, BaseItemKind, } from "@jellyfin/sdk/lib/generated-client"; import getImageUrlsApi from "@/utils/methods/getImageUrlsApi"; import { useApiInContext } from "@/utils/store/api"; import CarouselSlide from "../carouselSlide"; import CarouselTickers from "./tickers"; // Memoize CarouselSlide to prevent unnecessary re-renders const MemoizedCarouselSlide = React.memo(CarouselSlide); const Carousel = ({ content, onChange, }: { content: BaseItemDto[]; onChange: (currentSlide: number) => void; }) => { const [currentSlide, setCurrentSlide] = useState(0); const [isPaused, setIsPaused] = useState(false); const sidebarRef = React.useRef(null); const tickerRefs = React.useRef<(HTMLDivElement | null)[]>([]); const currentSlideRef = React.useRef(currentSlide); const [setDirection] = useCarouselStore((state) => [state.setDirection]); useEffect(() => { currentSlideRef.current = currentSlide; }, [currentSlide]); useEffect(() => { onChange(currentSlide); // Auto-scroll sidebar to keep active item in view const activeTicker = tickerRefs.current[currentSlide]; const sidebar = sidebarRef.current; if (activeTicker && sidebar) { const sidebarTop = sidebar.scrollTop; const sidebarBottom = sidebarTop + sidebar.clientHeight; const activeTickerTop = activeTicker.offsetTop; const activeTickerBottom = activeTicker.offsetTop + activeTicker.offsetHeight; // If element is below the visible area if (activeTickerBottom > sidebarBottom) { sidebar.scrollTo({ top: activeTickerBottom - sidebar.clientHeight + 24, // 24px padding behavior: "smooth", }); } // If element is above the visible area else if (activeTickerTop < sidebarTop) { sidebar.scrollTo({ top: activeTickerTop - 24, // 24px padding behavior: "smooth", }); } } }, [currentSlide, content, onChange]); // Autoplay functionality useEffect(() => { if (isPaused || content.length === 0) return; const timer = setInterval(() => { setDirection("right"); setCurrentSlide((prev) => (prev + 1) % content.length); }, 8000); return () => clearInterval(timer); }, [isPaused, content.length, setDirection, currentSlide]); const api = useApiInContext((s) => s.api); const handleTickerClick = useCallback( (index: number) => { if (index === currentSlideRef.current) return; setDirection(index > currentSlideRef.current ? "right" : "left"); setCurrentSlide(index); }, [setDirection], ); if (!api) return null; return (
setIsPaused(true)} onMouseLeave={() => setIsPaused(false)} >
{content.map((item, index) => (
{ tickerRefs.current[index] = el; }} className="carousel-ticker-wrapper" >
))}
); }; export default React.memo(Carousel); ================================================ FILE: src/components/carousel/tickers.tsx ================================================ import type { BaseItemKind } from "@jellyfin/sdk/lib/generated-client"; import { Typography } from "@mui/material"; import React from "react"; import { getTypeIcon } from "../utils/iconsCollection"; type CarouselTickersProps = { imageUrl?: string | undefined | null; itemName: string; itemYear: string; onTickerClick: (index: number) => void; index: number; isActive: boolean; itemType: BaseItemKind; }; const CarouselTickers = React.memo( ({ imageUrl, itemName, itemYear, onTickerClick, index, isActive, itemType, }: CarouselTickersProps) => { const handleClick = React.useCallback(() => { onTickerClick(index); }, [index, onTickerClick]); return (
{imageUrl ? ( {itemName} ) : (
{" "} {getTypeIcon(itemType)}
)}
{itemName} {itemYear}
); }, ); export default CarouselTickers; ================================================ FILE: src/components/carouselSlide/index.tsx ================================================ import { type BaseItemDto, BaseItemKind, } from "@jellyfin/sdk/lib/generated-client"; import Button from "@mui/material/Button"; import Chip from "@mui/material/Chip"; import { green, red, yellow } from "@mui/material/colors"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import { useNavigate } from "@tanstack/react-router"; import { motion } from "motion/react"; import React from "react"; import { endsAt, getRuntime } from "@/utils/date/time"; import { useApiInContext } from "@/utils/store/api"; import { useCarouselStore } from "@/utils/store/carousel"; import { useCentralStore } from "@/utils/store/central"; import LikeButton from "../buttons/likeButton"; import MarkPlayedButton from "../buttons/markPlayedButton"; import PlayButton from "../buttons/playButton"; import { getTypeIcon } from "../utils/iconsCollection"; const textVariants = { initial: (direction: string) => ({ x: direction === "right" ? 40 : -40, opacity: 0, }), animate: { x: 0, opacity: 1, transition: { duration: 0.35, ease: [0.2, 0, 0, 1], }, }, exit: (direction: string) => ({ x: direction === "right" ? -40 : 40, opacity: 0, transition: { duration: 0.2, ease: "easeInOut", }, }), }; const CarouselSlide = ({ item }: { item: BaseItemDto }) => { const api = useApiInContext((s) => s.api); const navigate = useNavigate(); const user = useCentralStore((s) => s.currentUser); const handleMoreInfo = () => { if (item.Id) { switch (item.Type) { case BaseItemKind.BoxSet: navigate({ to: "/boxset/$id", params: { id: item.Id } }); break; case BaseItemKind.Episode: navigate({ to: "/episode/$id", params: { id: item.Id } }); break; case BaseItemKind.MusicAlbum: navigate({ to: "/album/$id", params: { id: item.Id } }); break; case BaseItemKind.MusicArtist: navigate({ to: "/artist/$id", params: { id: item.Id } }); break; case BaseItemKind.Person: navigate({ to: "/person/$id", params: { id: item.Id } }); break; case BaseItemKind.Series: navigate({ to: "/series/$id", params: { id: item.Id } }); break; case BaseItemKind.Playlist: navigate({ to: "/playlist/$id", params: { id: item.Id } }); break; default: navigate({ to: "/item/$id", params: { id: item.Id } }); break; } } }; const [animationDirection] = useCarouselStore((state) => [state.direction]); return (
{item.BackdropImageTags?.length ? ( {item.Name { e.currentTarget.style.opacity = "1"; }} loading="eager" /> ) : (
{getTypeIcon(item.Type ?? "Movie")}
)}
{/* @ts-ignore */} {!item.ImageTags?.Logo ? ( item.Name ) : ( {item.Name { e.currentTarget.style.opacity = "1"; }} /> )} {/* @ts-ignore */} {item.PremiereDate && ( {item.ProductionYear ?? ""} )} {item.OfficialRating && ( )} {item.CommunityRating && (
star
{Math.round(item.CommunityRating * 10) / 10}
)} {item.CriticRating && (
50 ? green[400] : red[400], }} > {item.CriticRating > 50 ? "thumb_up" : "thumb_down"}
{item.CriticRating}
)} {item.RunTimeTicks && ( {getRuntime(item.RunTimeTicks)} )} {item.RunTimeTicks && ( {endsAt( item.RunTimeTicks - (item.UserData?.PlaybackPositionTicks ?? 0), )} )} {item.Genres?.slice(0, 4).join(" / ")}
{/* @ts-ignore */} {item.Overview} {/* @ts-ignore */}
} onClick={handleMoreInfo} > More info
); }; export default CarouselSlide; ================================================ FILE: src/components/circularPageLoadingAnimation/index.tsx ================================================ // Write a react component that included an MUI circluar progress element utilizing NProgrss import { CircularProgress } from "@mui/material"; import { useNProgress } from "@tanem/react-nprogress"; import React from "react"; const CircularPageLoadingAnimation = () => { const { progress } = useNProgress({ isAnimating: true, }); return (
); }; export default CircularPageLoadingAnimation; ================================================ FILE: src/components/filtersDialog/index.tsx ================================================ import { getGenresApi } from "@jellyfin/sdk/lib/utils/api/genres-api"; import { getMusicGenresApi } from "@jellyfin/sdk/lib/utils/api/music-genres-api"; import { Accordion, AccordionDetails, AccordionSummary, Button, Checkbox, Dialog, DialogActions, DialogContent, DialogTitle, FormControlLabel, FormGroup, IconButton, Stack, Tooltip, Typography, } from "@mui/material"; import { useQuery, useSuspenseQuery } from "@tanstack/react-query"; import { getRouteApi } from "@tanstack/react-router"; import React, { useMemo, useRef, useState } from "react"; import { useShallow } from "zustand/shallow"; import type { FILTERS } from "@/utils/constants/library"; import { getLibraryQueryOptions } from "@/utils/queries/library"; import { useLibraryStateStore } from "@/utils/store/libraryState"; const route = getRouteApi("/_api/library/$id"); const FILTER_LABELS: Record = { isPlayed: "Played", isUnPlayed: "Unplayed", isResumable: "Resumable", isFavorite: "Favorite", hasSubtitles: "Has Subtitles", hasTrailer: "Has Trailer", hasSpecialFeature: "Special Feature", hasThemeSong: "Theme Song", hasThemeVideo: "Theme Video", isSD: "SD", isHD: "HD", is4K: "4K", is3D: "3D", }; interface FiltersDialogProps { open: boolean; onClose: () => void; } export const FiltersDialog: React.FC = React.memo( ({ open, onClose }) => { const { id: currentLibraryId } = route.useParams(); const { api, user } = route.useRouteContext(); const { routeFilters, routeVideoTypes, routeGenreIds } = useLibraryStateStore( useShallow((s) => { const slice = s.libraries[currentLibraryId || ""]; return { routeFilters: slice?.filters, routeVideoTypes: slice?.videoTypesState, routeGenreIds: slice?.genreIds, }; }), ); const updateLibrary = useLibraryStateStore((s) => s.updateLibrary); const initial = useMemo( () => ({ ...(routeFilters || {}) }), [routeFilters], ); const [localFilters, setLocalFilters] = useState>(initial); const initialVideo = useMemo( () => ({ ...(routeVideoTypes || {}) }), [routeVideoTypes], ); const [localVideoTypes, setLocalVideoTypes] = useState>(initialVideo); const initialGenres = useMemo( () => [...(routeGenreIds || [])] as string[], [routeGenreIds], ); const [localGenreIds, setLocalGenreIds] = useState(initialGenres); const dirty = useMemo( () => JSON.stringify(initial) !== JSON.stringify(localFilters) || JSON.stringify(initialVideo) !== JSON.stringify(localVideoTypes) || JSON.stringify(initialGenres) !== JSON.stringify(localGenreIds), [ initial, localFilters, initialVideo, localVideoTypes, initialGenres, localGenreIds, ], ); const debounceRef = useRef(null); const currentLibrary = useSuspenseQuery( getLibraryQueryOptions(api, user?.Id, currentLibraryId), ); const collectionType = currentLibrary.data.CollectionType; const isVideoCollection = ["movies", "tvshows", "boxsets"].includes( String(collectionType || "").toLowerCase(), ); // Fetch genres for this library (music uses music-genres API) const { data: genresData } = useQuery({ queryKey: ["library", "genres", currentLibraryId, collectionType], queryFn: async () => { if (!api || !user?.Id || !currentLibraryId) return { Items: [] } as any; if (String(collectionType || "").toLowerCase() === "music") { const res = await getMusicGenresApi(api).getMusicGenres({ parentId: currentLibraryId, userId: user.Id, }); return res.data; } const res = await getGenresApi(api).getGenres({ parentId: currentLibraryId, userId: user.Id, }); return res.data; }, staleTime: 10 * 60 * 1000, enabled: !!open && !!api && !!user?.Id && !!currentLibraryId, }); const handleToggle = (key: FILTERS) => { setLocalFilters((prev) => { const next = { ...prev }; // isHD special: undefined if unchecked instead of false if (key === "isHD") { if (next[key]) delete next[key]; else next[key] = true; } else { next[key] = !next[key]; } return next; }); }; const apply = () => { if (!currentLibraryId) return; if (debounceRef.current) window.clearTimeout(debounceRef.current); debounceRef.current = window.setTimeout(() => { updateLibrary(currentLibraryId, { filters: localFilters as any, videoTypesState: localVideoTypes as any, genreIds: localGenreIds as any, }); onClose(); }, 40); }; const clearAll = () => { setLocalFilters({}); setLocalVideoTypes({}); setLocalGenreIds([]); }; const restore = () => setLocalFilters(initial); const restoreVideo = () => setLocalVideoTypes(initialVideo); const restoreGenres = () => setLocalGenreIds(initialGenres); return ( Filters expand_more } > General {( [ "isPlayed", "isUnPlayed", "isResumable", "isFavorite", ] as FILTERS[] ).map((k) => ( handleToggle(k)} size="small" /> } label={FILTER_LABELS[k]} /> ))} {isVideoCollection && ( expand_more } > Video features {( [ "hasSubtitles", "hasTrailer", "hasSpecialFeature", "hasThemeSong", "hasThemeVideo", ] as FILTERS[] ).map((k) => ( handleToggle(k)} size="small" /> } label={FILTER_LABELS[k]} /> ))} )} {isVideoCollection && ( expand_more } > Resolution {(["isSD", "isHD", "is4K", "is3D"] as FILTERS[]).map( (k) => ( handleToggle(k)} size="small" /> } label={FILTER_LABELS[k]} /> ), )} )} {isVideoCollection && ( expand_more } > Media type {(["BluRay", "Dvd", "Iso", "VideoFile"] as const).map( (k) => ( setLocalVideoTypes((prev) => ({ ...(prev || {}), [k]: !(prev as any)?.[k], })) } size="small" /> } label={k} /> ), )} )} {/* Genres (all collection types) */} {(genresData?.Items?.length || 0) > 0 && ( expand_more } > Genres {(genresData?.Items || []).map((g: any) => ( setLocalGenreIds((prev) => prev.includes(g.Id) ? prev.filter((id) => id !== g.Id) : [...prev, g.Id], ) } size="small" /> } label={g.Name} /> ))} )} ); }, ); (FiltersDialog as any).displayName = "FiltersDialog"; export const FiltersDialogTrigger: React.FC = () => { const [open, setOpen] = React.useState(false); const { id: currentLibraryId } = route.useParams(); const { filters, videoTypesState, genreIds } = useLibraryStateStore( useShallow((s) => { const slice = s.libraries[currentLibraryId || ""]; return { filters: slice?.filters, videoTypesState: slice?.videoTypesState, genreIds: slice?.genreIds, }; }), ); const activeCount = useMemo(() => { const a = Object.values(filters || {}).filter((v) => v === true).length; const b = Object.values(videoTypesState || {}).filter( (v) => v === true, ).length; const c = (genreIds || []).length; return a + b + c; }, [filters, videoTypesState, genreIds]); return ( <> setOpen(true)} aria-label="Open filters dialog" > filter_list {activeCount > 0 && ( {activeCount} )} setOpen(false)} /> ); }; export default FiltersDialog; ================================================ FILE: src/components/iconLink/index.tsx ================================================ import { Link, Typography } from "@mui/material"; import React, { memo } from "react"; import anidbIcon from "../../assets/icons/anidb.png"; import anilistIcon from "../../assets/icons/anilist.svg"; import audioDBIcon from "../../assets/icons/audioDB.png"; import imdbIcon from "../../assets/icons/imdb.svg"; import kitsuIcon from "../../assets/icons/kitsu.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"; import tvMazeIcon from "../../assets/icons/tvmaze.png"; const knownIcons = [ "imdb", "themoviedb", "trakt", "musicbrainz", "thetvdb", "anidb", "anilist", "tvmaze", "theaudiodb", "kitsu", ]; const IconLink = memo(({ name, url }: { name: string; url: string }) => { return ( {name.toLocaleLowerCase() === "imdb" && IMDb} {name.toLocaleLowerCase() === "themoviedb" && ( TheMovieDb )} {name.toLocaleLowerCase() === "trakt" && ( Trakt )} {name.toLocaleLowerCase() === "musicbrainz" && ( MusicBrainz )} {name.toLocaleLowerCase() === "thetvdb" && ( TheTVDB )} {name.toLocaleLowerCase() === "anidb" && ( AniDB )} {name.toLocaleLowerCase() === "anilist" && ( AniList )} {name.toLocaleLowerCase() === "tvmaze" && ( TVMaze )} {name.toLocaleLowerCase() === "theaudiodb" && ( TheAudioDB )} {name.toLocaleLowerCase() === "kitsu" && ( Kitsu )} {!knownIcons.includes(name.toLocaleLowerCase()) && ( {name} )} ); }); export default IconLink; ================================================ FILE: src/components/itemBackdrop/index.tsx ================================================ import { AnimatePresence, type HTMLMotionProps, motion, useScroll, useTransform, } from "motion/react"; import React, { type RefObject, useEffect, useState } from "react"; interface ItemBackdropProps { targetRef: RefObject; backdropSrc?: string; fallbackSrc: string; alt: string; distance?: number; // parallax distance className?: string; onLoad?: (e: React.SyntheticEvent) => void; motionProps?: HTMLMotionProps<"img">; } const MotionImg = motion.img; const animationProps = { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.5 }, }; /** * ItemBackdrop delays applying motion-driven parallax until after mount * to avoid hydration timing errors ("Target ref is defined but not hydrated"). * It accepts a scroll container ref from the parent; if the ref is not yet * attached, it renders a static img to prevent motion from touching an * unhydrated DOM node. */ const ItemBackdropContent = React.memo(function ItemBackdropContent({ targetRef, src, alt, distance, className, onLoad, motionProps, }: { targetRef: RefObject; src: string; alt: string; distance: number; className?: string; onLoad?: (e: React.SyntheticEvent) => void; motionProps?: HTMLMotionProps<"img">; }) { const { scrollYProgress } = useScroll({ target: targetRef, offset: ["start start", "60vh start"], }); const y = useTransform(scrollYProgress, [0, 1], [-distance, distance]); return ( { onLoad?.(e); }} style={{ y }} {...motionProps} /> ); }); export function ItemBackdrop({ targetRef, backdropSrc, fallbackSrc, alt, distance = 50, className, onLoad, motionProps, }: ItemBackdropProps) { const src = backdropSrc || fallbackSrc; const [ready, setReady] = useState(false); // Poll a few animation frames until the target ref hydrates to avoid premature motion initialization. useEffect(() => { if (ready) return; let frame = 0; let raf: number; const tick = () => { if (targetRef.current || frame > 5) { setReady(true); return; } frame++; raf = requestAnimationFrame(tick); }; tick(); return () => cancelAnimationFrame(raf); }, [targetRef, ready]); const finalMotionProps = React.useMemo( () => ({ ...animationProps, ...motionProps, }), [motionProps], ); if (!ready) { return ( {alt} { e.currentTarget.style.opacity = "1"; onLoad?.(e); }} /> ); } return ( ); } export default ItemBackdrop; ================================================ FILE: src/components/itemHeader/index.tsx ================================================ import type { Api } from "@jellyfin/sdk"; import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; import Chip from "@mui/material/Chip"; import { green, red, yellow } from "@mui/material/colors"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import { Link } from "@tanstack/react-router"; import React, { type ReactNode, type RefObject } from "react"; import { Blurhash } from "react-blurhash"; import heroBg from "@/assets/herobg.png"; import ultraHdIcon from "@/assets/icons/4k.svg"; import dolbyAtmosIcon from "@/assets/icons/dolby-atmos.svg"; import dolbyDigitalIcon from "@/assets/icons/dolby-digital.svg"; import dolbyTrueHDIcon from "@/assets/icons/dolby-truehd.svg"; import dolbyVisionIcon from "@/assets/icons/dolby-vision.svg"; import dolbyVisionAtmosIcon from "@/assets/icons/dolby-vision-atmos.png"; import dtsIcon from "@/assets/icons/dts.svg"; import dtsHdMaIcon from "@/assets/icons/dts-hd-ma.svg"; import hdIcon from "@/assets/icons/hd.svg"; import hdrIcon from "@/assets/icons/hdr.svg"; import hdr10Icon from "@/assets/icons/hdr10.svg"; import hdr10PlusIcon from "@/assets/icons/hdr10-plus.svg"; import sdIcon from "@/assets/icons/sd.svg"; import sdrIcon from "@/assets/icons/sdr.svg"; import ItemBackdrop from "@/components/itemBackdrop"; import { getTypeIcon } from "@/components/utils/iconsCollection"; import { endsAt, getRuntime } from "@/utils/date/time"; import getImageUrlsApi from "@/utils/methods/getImageUrlsApi"; import type MediaQualityInfo from "@/utils/types/mediaQualityInfo"; import "./itemHeader.scss"; interface ItemHeaderProps { item: BaseItemDto; api: Api | undefined; mediaQualityInfo?: MediaQualityInfo; scrollTargetRef?: RefObject; children?: ReactNode; backdropSrc?: string | null; } const ItemHeader = ({ item, api, mediaQualityInfo, scrollTargetRef, children, backdropSrc, }: ItemHeaderProps) => { const isEpisode = item.Type === "Episode"; const backdropTag = isEpisode && item.ParentBackdropImageTags?.length ? item.ParentBackdropImageTags[0] : item.BackdropImageTags?.[0]; const backdropId = isEpisode && item.ParentBackdropImageTags?.length ? (item.ParentBackdropItemId ?? item.Id) : item.Id; const parentLogoImageTag = (item as any).ParentLogoImageTag || (item as any).ParentLogoImageTags?.[0]; const logoTag = isEpisode && parentLogoImageTag ? parentLogoImageTag : item.ImageTags?.Logo; const logoId = isEpisode && parentLogoImageTag ? (item.SeriesId ?? item.Id) : item.Id; const logo = logoTag ? ( {item.Name { e.currentTarget.style.opacity = "1"; }} className="item-hero-logo" /> ) : ( {isEpisode ? item.SeriesName : item.Name} ); return (
{scrollTargetRef && ( )}
{item.ImageTags?.Primary ? (
{item.Name { e.currentTarget.style.opacity = "1"; }} className="item-hero-image" />
) : (
{getTypeIcon(item.Type ?? "Movie")}
)}
{isEpisode && logoId ? ( {logo} ) : ( logo )} {isEpisode && ( {item.ParentIndexNumber !== undefined && item.IndexNumber !== undefined ? `S${item.ParentIndexNumber}:E${item.IndexNumber} - ` : ""} {item.Name} )} {mediaQualityInfo?.isUHD && ( ultra hd )} {mediaQualityInfo?.isHD && ( hd )} {mediaQualityInfo?.isSD && ( sd )} {mediaQualityInfo?.isSDR && ( sdr )} {mediaQualityInfo?.isHDR && !mediaQualityInfo?.isHDR10 && !mediaQualityInfo?.isHDR10Plus && ( hdr )} {mediaQualityInfo?.isHDR10 && ( hdr10 )} {item.PremiereDate && ( {item.ProductionYear ?? ""} )} {item.OfficialRating && ( )} {item.CommunityRating && (
star
{Math.round(item.CommunityRating * 10) / 10}
)} {item.CriticRating && (
50 ? green[400] : red[400], }} > {item.CriticRating > 50 ? "thumb_up" : "thumb_down"}
{item.CriticRating}
)} {item.RunTimeTicks && ( {getRuntime(item.RunTimeTicks)} )} {item.RunTimeTicks && ( {endsAt( item.RunTimeTicks - (item.UserData?.PlaybackPositionTicks ?? 0), )} )} {item.Genres?.slice(0, 4).join(" / ")}
{mediaQualityInfo && ( {mediaQualityInfo?.isHDR10Plus && ( hdr10+ )} {mediaQualityInfo.isDts && ( dts )} {mediaQualityInfo.isDtsHDMA && ( dts-hd ma )} {mediaQualityInfo.isAtmos && mediaQualityInfo.isDolbyVision && ( dolby vision atmos )} {mediaQualityInfo.isAtmos && !mediaQualityInfo.isDolbyVision && ( dolby atmos )} {mediaQualityInfo.isDolbyVision && !mediaQualityInfo.isAtmos && ( dolby vision )} {mediaQualityInfo.isTrueHD && ( dolby truehd )} {mediaQualityInfo.isDD && ( dolby digital )} )}
{children}
); }; export default ItemHeader; ================================================ FILE: src/components/itemHeader/itemHeader.scss ================================================ @import "../../styles/variables.scss"; $cardWidth: 18%; .item-hero { height: 60vh; gap: 2em; row-gap: 1.2em; position: relative; align-items: flex-end; display: grid; grid-template-columns: $cardWidth 1fr; grid-template-rows: 1fr auto; &-image { opacity: 0; width: 100%; object-fit: contain; transition: opacity $transition-time-default; &-container { height: fit-content; max-height: 100%; overflow: hidden; border-radius: $border-radius-default; box-shadow: $shadow-card; flex-grow: 1; flex-shrink: 0; position: relative; width: 100%; } &-blurhash { position: absolute !important; width: 100% !important; height: 100% !important; z-index: -1; } &-icon { background: linear-gradient(45deg, rgb(255 255 255 / 0.05), rgb(255 255 255 / 0.15)); height: 100%; display: flex; align-items: center; justify-content: center; .material-symbols-rounded{ font-size: 4em; } } } &-logo { max-width: 34rem; max-height: 10rem; opacity: 0; transition: opacity $transition-time-default; object-position: bottom; margin-bottom: 2em; } &-detail { width: 100%; align-items: flex-start; gap: 0.2em; justify-content: end; } &-buttons { &-container { align-items: center; justify-content: space-between; width: 100%; grid-column: 1/3; display: grid; grid-template-columns: inherit; gap: 2em; } } &-backdrop { width: 100vw; height: 100vh; object-fit: cover; object-position: top; opacity: 0; position: absolute; top: 0; left: 0; transition: opacity $transition-time-default; &-container { filter: brightness(0.8); position: absolute; top: -4.4em; left: -$page-margin; width: 100vw; height: calc(64vh + 4.4em); z-index: -1; mask-image: linear-gradient(to top, transparent, black); -webkit-mask-image: linear-gradient( to top, transparent, black ); } } & .play-button { width: 100% !important; } } ================================================ FILE: src/components/layouts/artist/albumArtist.scss ================================================ .album { &-image { aspect-ratio: 1; border-radius: 20px; overflow: hidden; width: 16em; height: 16em; box-shadow: $shadow-card-image; position: relative; flex-shrink: 0; &-icon { color: rgb(255 255 255 / 0.5); font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40; &-container { background: $clr-background-card-icon; position: absolute; width: 100%; height: 100%; top: 0; left: 0; display: flex; align-items: center; justify-content: center; z-index: 1; } } } } ================================================ FILE: src/components/layouts/artist/artistAlbum.tsx ================================================ import React from "react"; import Typography from "@mui/material/Typography"; import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api"; import { useQuery } from "@tanstack/react-query"; import { type BaseItemDto, SortOrder, type UserDto, } from "@jellyfin/sdk/lib/generated-client"; import LikeButton from "../../buttons/likeButton"; import PlayButton from "../../buttons/playButton"; import "./albumArtist.scss"; import AlbumMusicTrack from "@/components/albumMusicTrack"; import { useApiInContext } from "@/utils/store/api"; import { Link } from "@tanstack/react-router"; type ArtistAlbumProps = { user: UserDto; album: BaseItemDto; boxProps?: object; }; export const ArtistAlbum = ({ user, album, boxProps }: ArtistAlbumProps) => { const api = useApiInContext((s) => s.api); const albumTracks = useQuery({ queryKey: ["artist", "album", album.Id], queryFn: async () => { if (!api) return null; const result = await getItemsApi(api).getItems({ userId: user.Id, parentId: album.Id, sortOrder: [SortOrder.Ascending], sortBy: ["IndexNumber"], }); return result.data; }, networkMode: "always", }); return (
{!!album.ImageTags?.Primary && (
{album.Name { e.currentTarget.style.opacity = "1"; }} />
album
)}
{album.ProductionYear} {album.Name}
{albumTracks.isSuccess && (albumTracks.data?.Items?.length ?? 0) > 0 && (
tag Title Duration
{albumTracks.data?.Items?.map((track, index) => ( ))}
)}
); }; ================================================ FILE: src/components/layouts/homeSection/latestMediaSection.tsx ================================================ import { useQuery } from "@tanstack/react-query"; import React from "react"; import { Card } from "../../card/card"; import CardScroller from "../../cardScroller/cardScroller"; import { CardsSkeleton } from "../../skeleton/cards"; import { useApiInContext } from "@/utils/store/api"; import { useCentralStore } from "@/utils/store/central"; import { type BaseItemDto, BaseItemKind, } from "@jellyfin/sdk/lib/generated-client"; import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api"; /** * @description Latest Media Section */ export const LatestMediaSection = ({ latestMediaLib, }: { latestMediaLib: BaseItemDto }) => { const api = useApiInContext((s) => s.api); const user = useCentralStore((s) => s.currentUser); const fetchLatestMedia = async (library: BaseItemDto) => { if (!api || !user?.Id) return null; const media = await getUserLibraryApi(api).getLatestMedia({ userId: user.Id, parentId: library.Id, limit: 16, fields: ["PrimaryImageAspectRatio", "ParentId"], }); return media.data; }; const data = useQuery({ queryKey: ["home", "latestMedia", latestMediaLib.Id], queryFn: () => fetchLatestMedia(latestMediaLib), enabled: !!user?.Id, refetchOnMount: true, }); if (data.isPending) { return ; } if (data.isSuccess && (data.data?.length ?? 0) >= 1) { return ( {data.data?.map((item) => { return ( ); })} ); } return <>; }; ================================================ FILE: src/components/libraryHeader/index.tsx ================================================ import type { BaseItemKind } from "@jellyfin/sdk/lib/generated-client"; import { ItemSortBy, SortOrder } from "@jellyfin/sdk/lib/generated-client"; import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api"; import { AppBar, Chip, IconButton, MenuItem, TextField, Typography, useScrollTrigger, } from "@mui/material"; import { useQueryClient, useSuspenseQuery } from "@tanstack/react-query"; import { getRouteApi, useNavigate } from "@tanstack/react-router"; import type { ChangeEvent } from "react"; import React, { useCallback, useEffect, useMemo, useState } from "react"; import { useShallow } from "zustand/shallow"; import { AVAILABLE_VIEWS, SORT_BY_OPTIONS } from "@/utils/constants/library"; import { getLibraryQueryOptions } from "@/utils/queries/library"; // import removed: header reads name/count from Zustand slice import { useLibraryStateStore } from "@/utils/store/libraryState"; import useSearchStore from "@/utils/store/search"; import { NavigationDrawer } from "../appBar/navigationDrawer"; import BackButton from "../buttons/backButton"; import { FiltersDialogTrigger } from "../filtersDialog"; import { UserAvatarMenu } from "../userAvatarMenu"; import "./libraryHeader.scss"; const route = getRouteApi("/_api/library/$id"); const MemoizeBackButton = React.memo(BackButton); export const LibraryHeader = () => { const { id: currentLibraryId } = route.useParams(); const { api, user } = route.useRouteContext(); const navigate = useNavigate(); const queryClient = useQueryClient(); // Zustand library state (selected via shallow comparator) const { currentViewType, storeSortBy, storeSortAscending, filters, vts, nameStartsWith, genreIds, libraryNameFromStore, itemsTotalCount, } = useLibraryStateStore( useShallow((s) => { const slice = s.libraries[currentLibraryId || ""]; return { currentViewType: slice?.currentViewType, storeSortBy: slice?.sortBy, storeSortAscending: slice?.sortAscending, filters: slice?.filters, vts: slice?.videoTypesState, nameStartsWith: slice?.nameStartsWith, genreIds: slice?.genreIds, libraryNameFromStore: slice?.libraryName, itemsTotalCount: slice?.itemsTotalCount, }; }), ); const { initLibrary, updateLibrary } = useLibraryStateStore( useShallow((s) => ({ initLibrary: s.initLibrary, updateLibrary: s.updateLibrary, })), ); useEffect(() => { if (!currentLibraryId) return; // If the slice isn't initialized, these fields will be undefined if ( currentViewType === undefined && storeSortBy === undefined && storeSortAscending === undefined ) { initLibrary(currentLibraryId, { sortBy: ItemSortBy.Name, sortAscending: true, }); } }, [ currentLibraryId, currentViewType, storeSortBy, storeSortAscending, initLibrary, ]); const currentLibrary = useSuspenseQuery( getLibraryQueryOptions(api, user?.Id, currentLibraryId), ); const scrollTrigger = useScrollTrigger({ disableHysteresis: true, threshold: 20, }); const compatibleViews = useMemo( () => AVAILABLE_VIEWS.filter((v) => v.compatibleCollectionTypes.includes( currentLibrary.data.CollectionType as any, ), ), [currentLibrary.data.CollectionType], ); // Values from store const sortBy = (storeSortBy ?? ItemSortBy.Name) as string; const sortAscending = storeSortAscending ?? true; const effectiveViewType = currentViewType as any; const effectiveSortByRaw = sortBy; const effectiveSortAscending = sortAscending; const normalizedViewType = useMemo(() => { const values = compatibleViews.map((v) => v.value); if (effectiveViewType && values.includes(effectiveViewType as any)) return effectiveViewType as any; return values[0] as BaseItemKind | "Artist"; }, [effectiveViewType, compatibleViews]); const normalizedSortBy = useMemo(() => { const compatibleOptions = SORT_BY_OPTIONS.filter( (option) => option.compatibleViewTypes?.includes(normalizedViewType as any) || option.compatibleCollectionTypes?.includes( currentLibrary.data.CollectionType as any, ), ); const compatibleValues = compatibleOptions.map((opt) => Array.isArray(opt.value) ? opt.value.join(",") : String(opt.value), ); const current = String(effectiveSortByRaw ?? ""); if (current && compatibleValues.includes(current)) return current; return compatibleValues[0] ?? String(ItemSortBy.Name); }, [ effectiveSortByRaw, normalizedViewType, currentLibrary.data.CollectionType, ]); const handleChangeViewType = (e: ChangeEvent) => { const next = e.target.value as unknown as BaseItemKind | "Artist"; if (currentLibraryId) updateLibrary(currentLibraryId, { currentViewType: next }); }; const handleChangeSortBy = (e: ChangeEvent) => { const next = e.target.value as unknown as string; if (currentLibraryId) updateLibrary(currentLibraryId, { sortBy: next }); }; const handleSortAscendingToggle = () => { if (currentLibraryId) updateLibrary(currentLibraryId, { sortAscending: !effectiveSortAscending, }); }; // (Video type multi-select temporarily removed; logic cleaned to reduce overhead.) // Prefetch helpers to reduce perceived latency on sort changes // filters, vts, nameStartsWith, genreIds are already selected above // Prefetch handler will be attached on menu items below const prefetchItems = useCallback( async (sortByValue: string, asc: boolean) => { if (!api || !user?.Id || !currentLibraryId || !normalizedViewType) return; const key = [ "library", "items", currentLibraryId, { currentViewType: normalizedViewType, sortAscending: asc, sortBy: sortByValue, filters, videoTypesState: vts, nameStartsWith, genreIds, }, ] as const; await queryClient.prefetchQuery({ queryKey: key, queryFn: async () => { const result = await getItemsApi(api).getItems({ userId: user.Id!, parentId: currentLibraryId, recursive: true, includeItemTypes: [normalizedViewType as any], sortOrder: [asc ? SortOrder.Ascending : SortOrder.Descending], sortBy: String(sortByValue).split(",") as any, enableUserData: true, nameStartsWith: nameStartsWith || undefined, genreIds: genreIds && genreIds.length > 0 ? genreIds : undefined, }); return result.data; }, staleTime: 5_000, }); }, [ api, user?.Id, currentLibraryId, normalizedViewType, filters, vts, nameStartsWith, genreIds, queryClient, ], ); const disableSortOption = useMemo( () => !normalizedViewType || !SORT_BY_OPTIONS.some( (option) => option.compatibleViewTypes?.includes(normalizedViewType as any) || option.compatibleCollectionTypes?.includes( currentLibrary.data.CollectionType as any, ), ), [normalizedViewType, currentLibrary.data.CollectionType], ); const appBarStyling = useMemo( () => ({ backgroundColor: "transparent", paddingRight: "0 !important" }), [], ); // Read values from Zustand: name set by route, count set by grid const libraryName = libraryNameFromStore ?? currentLibrary.data.Name; const totalCount = itemsTotalCount; const toggleSearchDialog = useSearchStore( useShallow((s) => s.toggleSearchDialog), ); const handleNavigateToHome = useCallback( () => navigate({ to: "/home" }), [navigate], ); const handleNavigateToFavorite = useCallback( () => navigate({ to: "/favorite" }), [navigate], ); const [showDrawer, setShowDrawer] = useState(false); const handleDrawerClose = useCallback(() => { setShowDrawer(false); }, []); const handleDrawerOpen = useCallback(() => { setShowDrawer(true); }, []); return ( <>
menu
home
{libraryName} {typeof totalCount === "number" && ( )}
View {compatibleViews.map((v) => ( {v.title} ))}
sort
Sort By {SORT_BY_OPTIONS.map((option) => { const isCompatible = option.compatibleViewTypes?.includes(currentViewType as any) || option.compatibleCollectionTypes?.includes( currentLibrary.data.CollectionType as any, ); if (!isCompatible) return null; const valueStr = Array.isArray(option.value) ? option.value.join(",") : option.value; return ( prefetchItems(String(valueStr), sortAscending) } > {option.title} ); })}
search
favorite
); }; ================================================ FILE: src/components/libraryHeader/libraryHeader.scss ================================================ .library-header { display: flex; align-items: center; justify-content: space-between; inset: 1em 2em auto 2em !important; border-radius: 9999px; margin: 0 auto; width: fit-content; position: sticky; width: calc(100vw - 4em) !important; z-index: 10; padding: 0.25em !important; transition: all 0.2s ease-in-out; &::after { content: ""; position: absolute; inset: -0.35em; pointer-events: none; border-radius: inherit; @include glass-effect; opacity: 0; z-index: -1; transition: all 150ms; } &.scrolling { &::after { opacity: 1; } } } ================================================ FILE: src/components/libraryItemsGrid/index.tsx ================================================ import { type BaseItemDto, BaseItemKind, } from "@jellyfin/sdk/lib/generated-client"; import { useSuspenseQuery } from "@tanstack/react-query"; import { getRouteApi } from "@tanstack/react-router"; import { useWindowVirtualizer } from "@tanstack/react-virtual"; import React, { useCallback, useEffect, useMemo, useRef, useState, } from "react"; import "./libraryItemsGrid.scss"; import { useShallow } from "zustand/shallow"; import { getLibraryQueryOptions } from "@/utils/queries/library"; import { getLibraryItemsQueryOptions } from "@/utils/queries/libraryItems"; import { useApiInContext } from "@/utils/store/api"; import { useBackdropStore } from "@/utils/store/backdrop"; import { useCentralStore } from "@/utils/store/central"; import { useLibraryStateStore } from "@/utils/store/libraryState"; // @ts-expect-error: Vite worker import import BackdropWorker from "@/utils/workers/backdrop.worker?worker"; import { Card } from "../card/card"; const libraryRoute = getRouteApi("/_api/library/$id"); /** * Virtualized library items grid. * Virtualizes vertical scrolling only; items are arranged into responsive columns. * Assumptions: * - Card aspect ratio handled by CSS; we approximate a fixed height for virtualization. * - Width changes trigger re-measure via ResizeObserver. * Future improvements: * - Dynamic row height based on item type. * - Horizontal virtualization for extremely wide displays. */ const LibraryItemsGrid = () => { const api = useApiInContext((s) => s.api); const user = useCentralStore((s) => s.currentUser); const { id: currentLibraryId } = libraryRoute.useParams(); const { currentViewType, sortAscending, sortBy, filters, videoTypesState, nameStartsWith, genreIds, } = useLibraryStateStore( useShallow((s) => { const slice = s.libraries[currentLibraryId || ""]; return { currentViewType: slice?.currentViewType, sortAscending: slice?.sortAscending ?? true, sortBy: slice?.sortBy ?? "Name", filters: slice?.filters, videoTypesState: slice?.videoTypesState, nameStartsWith: slice?.nameStartsWith, genreIds: slice?.genreIds, }; }), ); const updateLibrary = useLibraryStateStore((s) => s.updateLibrary); const currentLibrary = useSuspenseQuery( getLibraryQueryOptions(api, user?.Id, currentLibraryId), ); useEffect(() => { if (currentLibraryId && !currentViewType && currentLibrary.data?.Type) { updateLibrary(currentLibraryId, { currentViewType: currentLibrary.data.Type as BaseItemKind, }); } }, [ currentLibrary.data?.Type, currentLibraryId, currentViewType, updateLibrary, ]); const items = useSuspenseQuery( getLibraryItemsQueryOptions(api, user?.Id, currentLibraryId, { currentViewType, sortAscending, sortBy, filters, videoTypesState, nameStartsWith, genreIds, collectionType: currentLibrary.data.CollectionType as any, }), ); // --- Backdrop --- const setBackdrop = useBackdropStore(useShallow((s) => s.setBackdrop)); const backdropItems = useMemo(() => { if (!items.isSuccess || !items.data?.Items) return []; return items.data.Items.filter( (item) => Object.keys(item.ImageBlurHashes?.Backdrop ?? {}).length > 0, ); }, [items.isSuccess, items.data?.Items]); useEffect(() => { const worker = new BackdropWorker(); worker.onmessage = (event: MessageEvent) => { if (event.data.type === "UPDATE_BACKDROP") { const schedule = (window as any).requestIdleCallback || window.requestAnimationFrame; schedule(() => setBackdrop(event.data.payload)); } }; if (backdropItems.length > 0) { worker.postMessage({ type: "SET_BACKDROP_ITEMS", payload: backdropItems, }); worker.postMessage({ type: "START" }); } return () => { worker.postMessage({ type: "STOP" }); worker.terminate(); }; }, [backdropItems, setBackdrop]); // --- Virtualization setup --- const parentRef = useRef(null); const [containerWidth, setContainerWidth] = useState(0); // Determine column count based on container width (simple heuristic) const [columns, setColumns] = useState(1); const measureColumns = useCallback(() => { if (!parentRef.current) return; const width = parentRef.current.clientWidth; setContainerWidth(width); // Base desired approximate card width (including gap) 180px const ideal = Math.max(1, Math.floor(width / 180)); setColumns(ideal); }, []); useEffect(() => { measureColumns(); if (!parentRef.current) return; const ro = new ResizeObserver(() => measureColumns()); ro.observe(parentRef.current); return () => ro.disconnect(); }, [measureColumns]); const itemCount = items.data?.Items?.length ?? 0; // Compute number of virtual rows const rowCount = Math.ceil(itemCount / columns); // Estimated row height (depends on card type). Using 260px as base (portrait taller) // Compute card width minus gaps const cardGap = 16; // px gap between cards const cardWidth = useMemo(() => { if (columns <= 0) return 180; const totalGap = (columns - 1) * cardGap; return Math.floor((containerWidth - totalGap) / columns); }, [columns, containerWidth]); // Approximate tallest card height (portrait ratio ~ 2:3 => height ≈ width / 0.666) + text/footer area // We add a small buffer (20px) for hover overlays and progress bars const estimatedTallCardHeight = useMemo( () => Math.round(cardWidth / 0.666666 + 90), [cardWidth], ); const estimateRowHeight = useCallback( () => estimatedTallCardHeight, [estimatedTallCardHeight], ); const virtualizer = useWindowVirtualizer({ count: rowCount, estimateSize: estimateRowHeight, overscan: 6, scrollMargin: parentRef.current?.offsetTop ?? 0, }); const virtualItems = virtualizer.getVirtualItems(); // Update count in Zustand so header can display it without extra fetches useEffect(() => { const total = items.data?.TotalRecordCount; if (currentLibraryId && typeof total === "number") { updateLibrary(currentLibraryId, { itemsTotalCount: total }); } }, [items.data?.TotalRecordCount, currentLibraryId, updateLibrary]); return (
{items.isSuccess && itemCount === 0 ? (
sentiment_dissatisfied
No items to show
Try adjusting filters, sort, or the A–Z selector.
) : (
{virtualItems.map((row) => { const startIndex = row.index * columns; const endIndex = Math.min(startIndex + columns, itemCount); return (
{ if (el) virtualizer.measureElement(el); }} > {items.data?.Items?.slice(startIndex, endIndex).map( (item: BaseItemDto, localIndex: number) => { return (
); }, )}
); })}
)}
); }; export default LibraryItemsGrid; ================================================ FILE: src/components/libraryItemsGrid/libraryItemsGrid.scss ================================================ // Overrides for virtualized library items layout to prevent horizontal overflow .library-items-container.virtualized { overflow-x: hidden; box-sizing: border-box; width: 100%; display: block !important; // override grid from route styles padding: 0 !important; // override padding from route styles position: relative; // required for absolutely positioned rows gap: 0 !important; justify-items: normal !important; align-content: stretch !important; > .card { max-width: none !important; } // Ensure no unintended padding expands width padding-right: 0; padding-left: 0; .card { margin-right: 0 !important; margin-bottom: 0.6em !important; // keep a consistent vertical rhythm } .card-image-container { // Remove box shadow spread from affecting layout width calculation box-sizing: border-box; } } // When page has audio-playing class, avoid extra bottom padding causing scrollbars .audio-playing .library-items-container.virtualized { padding-bottom: 8em; // mimic original intent without affecting width } ================================================ FILE: src/components/listItemLink/index.tsx ================================================ import { ListItem, ListItemButton, type ListItemProps, ListItemText, } from "@mui/material"; import { createLink, Link } from "@tanstack/react-router"; import React, { forwardRef, type ReactNode } from "react"; interface MUIListItemLinkProps extends ListItemProps<"a"> { icon?: ReactNode; primary: string; className?: string; } const CreatedListItemLink = forwardRef( (props, ref) => (
{props.icon}
), ); const ListItemLink = createLink(CreatedListItemLink); export default ListItemLink; /* export default function ListItemLink(props: ListItemLinkProps) { const { icon, primary, to, className } = props; return (
  • {/* @ts-expect-error /*}
    {icon}
  • ); } */ ================================================ FILE: src/components/musicTrack/index.tsx ================================================ import Typography from "@mui/material/Typography"; import React from "react"; import { getRuntimeMusic } from "../../utils/date/time"; import { useAudioPlayback } from "../../utils/store/audioPlayback"; import LikeButton from "../buttons/likeButton"; import PlayButton from "../buttons/playButton"; import "./musicTrack.scss"; import getImageUrlsApi from "@/utils/methods/getImageUrlsApi"; import { useApiInContext } from "@/utils/store/api"; import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; import { Link } from "@tanstack/react-router"; import lyrics_icon from "../../assets/icons/lyrics.svg"; /** * @description Music Track element displayed in ArtistTitlePage and Songs library */ const MusicTrack = ({ item, queryKey, userId, playlistItem = false, playlistItemId, trackIndex, className = "", }: { item: BaseItemDto; queryKey: string[]; userId?: string | undefined; playlistItem?: boolean; playlistItemId?: string; trackIndex?: number; className?: string; }) => { const api = useApiInContext((s) => s.api); const [currentTrackItem] = useAudioPlayback((state) => [state.item]); return (
    music_note
    {item.Name { e.currentTarget.style.opacity = "1"; }} />
    {item.Name}
    {item.HasLyrics && ( Lyrics )} {item.ArtistItems?.map((artist, index) => ( {artist.Name} {index !== (item.ArtistItems?.length ?? 0) - 1 && ( ,{" "} )} ))}
    {getRuntimeMusic(item.RunTimeTicks ?? 0)}
    ); }; export default MusicTrack; ================================================ FILE: src/components/musicTrack/musicTrack.scss ================================================ .music-track { display: grid; grid-template-columns: 4.5em 80% 1fr 1fr; gap: 0.5em; align-items: center; justify-items: center; width: 100%; cursor: pointer; &-icon { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: rgb(255 255 255 / 0.09); z-index: -1; } &-image { margin: 0.4em; border-radius: $border-radius_04; overflow: hidden; aspect-ratio: 1; position: relative; width: 4em; box-shadow: 0 0 10px rgb(0 0 0 / 0.2); transition: opacity $transition-time-default; &-overlay { position: absolute; top: 0; left: 0; backdrop-filter: blur(10px); width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; opacity: 0; transition: opacity $transition-time-fast; } } &-info { justify-self: start; &-lyrics { margin-right: 0.4em; } } &:hover { .music-track-image-overlay { opacity: 1; } } } ================================================ FILE: src/components/nProgress/index.tsx ================================================ import { LinearProgress } from "@mui/material"; import { useNProgress } from "@tanem/react-nprogress"; import { useIsFetching, useIsMutating } from "@tanstack/react-query"; import { useRouterState } from "@tanstack/react-router"; import React, { useMemo } from "react"; import { createPortal } from "react-dom"; export default function NProgress() { const isQueryFetching = useIsFetching(); const isMutating = useIsMutating(); const routeIsLoading = useRouterState().isLoading; const isAnimating = useMemo(() => { if (isQueryFetching || isMutating || routeIsLoading) { return true; } return false; }, [isQueryFetching, isMutating, routeIsLoading]); const { animationDuration, isFinished, progress } = useNProgress({ isAnimating, }); return (
    {isAnimating && ( )}
    ); }; ================================================ FILE: src/components/notices/emptyNotice/emptyNotice.tsx ================================================ import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import { yellow } from "@mui/material/colors"; import React from "react"; export const EmptyNotice = ({ extraMsg }: { extraMsg?: string }) => { return (
    sentiment_dissatisfied
    No results found {extraMsg}
    ); }; ================================================ FILE: src/components/notices/errorNotice/errorNotice.tsx ================================================ import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import { red } from "@mui/material/colors"; import React from "react"; export const ErrorNotice = ({ error }: { error?: Error }) => { console.error(error); return (
    error
    Something went wrong. {JSON.stringify(error?.stack)}
    ); }; ================================================ FILE: src/components/outroCard/index.tsx ================================================ import { useApiInContext } from "@/utils/store/api"; import { playItemFromQueue } from "@/utils/store/playback"; import useQueue from "@/utils/store/queue"; import { Button, Typography } from "@mui/material"; import React from "react"; import { getTypeIcon } from "../utils/iconsCollection"; import "./outroCard.scss"; import getImageUrlsApi from "@/utils/methods/getImageUrlsApi"; import { useCentralStore } from "@/utils/store/central"; import { useMutation } from "@tanstack/react-query"; const OutroCard = (props: { handleShowCredits: () => void }) => { const api = useApiInContext((s) => s.api); const [nextItemIndex, queueItems] = useQueue((s) => [ s.currentItemIndex, s.tracks, ]); const item = queueItems?.[nextItemIndex + 1]; const user = useCentralStore((s) => s.currentUser); const handlePlayNext = useMutation({ mutationKey: ["playNextButton"], mutationFn: () => playItemFromQueue("next", user?.Id, api), onError: (error) => [console.error(error)], }); if (!item || !item.Type) return null; return (
    Up Next
    {item?.ImageTags?.Primary ? ( {item.Name ) : (
    {getTypeIcon(item.Type)}
    )} {item.Name} {item.Overview}
    } > Play Now
    ); }; export default OutroCard; ================================================ FILE: src/components/outroCard/outroCard.scss ================================================ .outro-card { position: absolute; bottom: 0; left: 0; right: 0; z-index: 1000; display: flex; flex-direction: column; padding: 0 5vw 2em 5vw; gap: 1.2em; background: linear-gradient(to top, rgb(10 10 10), rgb(10 10 10 / 0.7) 50%, transparent); padding-top: 25vh; &-content { display: grid; grid-template-areas: "img title" "img info" "img buttons"; grid-template-columns: 20em 1fr; align-items: center; gap: 1em; &-image { grid-area: img; aspect-ratio: 16/9; width: 20em; object-fit: cover; border-radius: $border-radius-default; } &-title { grid-area: title; } &-overview { grid-area: info; display: -webkit-box; text-overflow: ellipsis; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; } &-buttons { grid-area: buttons; display: flex; gap: 1em; } } } ================================================ FILE: src/components/playback/audioPlayer/audioPlayer.scss ================================================ $image-size: 4em; .audio-player { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); width: 95%; max-width: 1200px; z-index: 100; display: grid; padding: 0.75em 1.5em; gap: 1.5em; box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); grid-template-columns: 25% 1fr 25%; @include glass-effect($blur: 12px, $bg-color: rgba(18, 18, 18, 0.85)); // background: rgba(18, 18, 18, 0.85) !important; // backdrop-filter: blur(12px); // -webkit-backdrop-filter: blur(12px); // border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 1rem; align-items: center; @media (max-width: 900px) { grid-template-columns: 1fr auto; padding: 0.5em 1em; bottom: 0; width: 100%; border-radius: 0; border-bottom: none; border-left: none; border-right: none; .audio-player-controls { display: none; // Hide controls on mobile for now or adjust } } #waveform { width: 100%; transform: scaleY(0); transition: transform $transition-time-default; &[data-show="true"] { transform: scaleY(1) !important; } } &-controls { display: flex; align-items: center; justify-content: center; gap: 0.5em; padding: 0.5em 0; flex-flow: column; } &-info { display: grid; gap: 1em; grid-template-columns: minmax(0, $image-size) minmax(0, 1fr); width: fit-content; align-items: center; flex-grow: 1; width: 100%; overflow: hidden; &-text { display: flex; flex-direction: column; overflow: hidden; min-width: 0; } } &-image { width: $image-size; aspect-ratio: 1; object-fit: cover; z-index: 1; flex-shrink: 0; flex-grow: 1; position: relative; &-container { border-radius: $border-radius_04; position: relative; overflow: hidden; height: fit-content; aspect-ratio: 1; background: rgb(255 255 255 / 0.1); } &-icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 2em !important; z-index: 0; } } &-track { 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; } } } } ================================================ FILE: src/components/playback/audioPlayer/components/LyricsPanel.tsx ================================================ import type { Api } from "@jellyfin/sdk"; import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; import { getLyricsApi } from "@jellyfin/sdk/lib/utils/api/lyrics-api"; import { Typography } from "@mui/material"; import { useQuery } from "@tanstack/react-query"; import React, { useEffect, useRef, useState } from "react"; import { secToTicks } from "@/utils/date/time"; interface LyricsPanelProps { item: BaseItemDto | undefined | null; api: Api | undefined; currentTime: number; } const LyricsPanel = ({ item, api, currentTime }: LyricsPanelProps) => { const lyricsContainer = useRef(null); const lyrics = useQuery({ queryKey: ["player", "audio", item?.Id, "lyrics"], queryFn: async () => { if (!item?.Id || !api) { return null; } try { const response = await getLyricsApi(api).getLyrics({ itemId: item?.Id, }); return response.data; } catch (e) { console.error("Failed to fetch lyrics", e); return null; } }, enabled: Boolean(item?.Id) && Boolean(api), }); useEffect(() => { if (lyrics.data && lyricsContainer.current) { const currentLyric = lyricsContainer.current.querySelector( "[data-active-lyric='true']", ); if (currentLyric) { currentLyric.scrollIntoView({ block: "center", inline: "nearest", behavior: "smooth", }); } } }, [currentTime, lyrics.data]); if (lyrics.isLoading) { return (
    Loading lyrics...
    ); } if (lyrics.isError || !lyrics.data || !lyrics.data.Lyrics?.length) { return (
    No lyrics available
    ); } const hasSyncedLyrics = (lyrics.data.Lyrics[0].Start ?? -1) >= 0; return (
    {lyrics.data.Lyrics.map((lyric, index) => { const isActive = hasSyncedLyrics && secToTicks(currentTime) >= (lyric.Start ?? 0) && secToTicks(currentTime) < (lyrics.data?.Lyrics?.[index + 1]?.Start ?? Number.POSITIVE_INFINITY); return ( {lyric.Text} ); })}
    {!hasSyncedLyrics && (
    info Synced lyrics not available
    )}
    ); }; export default React.memo(LyricsPanel); ================================================ FILE: src/components/playback/audioPlayer/components/PlayerActions.tsx ================================================ import IconButton from "@mui/material/IconButton"; import type { ReactNode } from "react"; import React from "react"; import QueueButton from "@/components/buttons/queueButton"; interface PlayerActionsProps { onNavigate: () => void; onClose: () => void; children?: ReactNode; } const PlayerActions = ({ onNavigate, onClose, children, }: PlayerActionsProps) => { return (
    info {children}
    close
    ); }; export default PlayerActions; ================================================ FILE: src/components/playback/audioPlayer/components/PlayerControls.tsx ================================================ import Fab from "@mui/material/Fab"; import IconButton from "@mui/material/IconButton"; import React from "react"; import PlayNextButton from "@/components/buttons/playNextButton"; import PlayPreviousButton from "@/components/buttons/playPreviousButtom"; interface PlayerControlsProps { playing: boolean; onPlayPause: () => void; size?: "small" | "medium" | "large"; onRewind?: () => void; onForward?: () => void; } const PlayerControls = ({ playing, onPlayPause, size = "small", onRewind, onForward, }: PlayerControlsProps) => { return (
    {onRewind && ( fast_rewind )}
    {playing ? "pause" : "play_arrow"}
    {onForward && ( fast_forward )}
    ); }; export default React.memo(PlayerControls); ================================================ FILE: src/components/playback/audioPlayer/components/PlayerInfo.tsx ================================================ import type { Api } from "@jellyfin/sdk"; import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; import Typography from "@mui/material/Typography"; import React from "react"; import getImageUrlsApi from "@/utils/methods/getImageUrlsApi"; interface PlayerInfoProps { item: BaseItemDto | undefined | null; api: Api | undefined; trackName?: string; } const PlayerInfo = ({ item, api, trackName }: PlayerInfoProps) => { if (!api || !item) return null; return (
    {trackName music_note
    {item?.Name} by {item?.Artists?.map((artist) => artist).join(",")}
    ); }; export default PlayerInfo; ================================================ FILE: src/components/playback/audioPlayer/components/PlayerProgress.tsx ================================================ import Slider from "@mui/material/Slider"; import Typography from "@mui/material/Typography"; import React, { useEffect, useState } from "react"; import { getRuntimeMusic } from "@/utils/date/time"; interface PlayerProgressProps { progress: number; duration: number; onSeek?: (value: number) => void; onSeekCommit: (value: number) => void; } const PlayerProgress = ({ progress, duration, onSeek, onSeekCommit, }: PlayerProgressProps) => { const [isScrubbing, setIsScrubbing] = useState(false); const [sliderValue, setSliderValue] = useState(progress); useEffect(() => { if (!isScrubbing) { setSliderValue(progress); } }, [progress, isScrubbing]); const handleChange = (_: Event, value: number | number[]) => { setIsScrubbing(true); const newValue = Array.isArray(value) ? value[0] : value; setSliderValue(newValue); onSeek?.(newValue); }; const handleChangeCommitted = (_: unknown, value: number | number[]) => { setIsScrubbing(false); const newValue = Array.isArray(value) ? value[0] : value; onSeekCommit(newValue); }; return (
    {getRuntimeMusic(sliderValue)} {getRuntimeMusic(duration)}
    ); }; export default PlayerProgress; ================================================ FILE: src/components/playback/audioPlayer/components/PlayerVolume.tsx ================================================ import IconButton from "@mui/material/IconButton"; import Slider from "@mui/material/Slider"; import React from "react"; interface PlayerVolumeProps { volume: number; isMuted: boolean; onVolumeChange: (value: number) => void; onMuteToggle: () => void; } const PlayerVolume = ({ volume, isMuted, onVolumeChange, onMuteToggle, }: PlayerVolumeProps) => { const [localVolume, setLocalVolume] = React.useState(volume * 100); React.useEffect(() => { setLocalVolume(volume * 100); }, [volume]); return ( <>
    {isMuted ? "volume_mute" : "volume_up"}
    { const newVolume = Array.isArray(newVal) ? newVal[0] : newVal; setLocalVolume(newVolume); onVolumeChange(newVolume / 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)", }, }, }} /> ); }; export default PlayerVolume; ================================================ FILE: src/components/playback/audioPlayer/components/QueuePanel.tsx ================================================ import { closestCenter, DndContext, type DragEndEvent, DragOverlay, type DragStartEvent, type DropAnimation, defaultDropAnimationSideEffects, KeyboardSensor, PointerSensor, useSensor, useSensors, } from "@dnd-kit/core"; import { restrictToVerticalAxis, restrictToWindowEdges, } from "@dnd-kit/modifiers"; import { arrayMove, SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy, } from "@dnd-kit/sortable"; import { CSS } from "@dnd-kit/utilities"; import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; import { Box, IconButton, Menu, MenuItem, Tooltip, Typography, } from "@mui/material"; import React, { useMemo, useState } from "react"; import QueueListItem from "@/components/queueListItem"; import { stopPlayback } from "@/utils/store/audioPlayback"; import useQueue, { clearQueue, removeFromQueue, setQueue, shuffleUpcoming, } from "@/utils/store/queue"; interface QueuePanelProps { queue: BaseItemDto[]; currentTrackIndex: number; } const dropAnimation: DropAnimation = { sideEffects: defaultDropAnimationSideEffects({ styles: { active: { opacity: "0.5", }, }, }), }; function SortableQueueItem({ item, onDelete, index, isActive, }: { item: BaseItemDto; onDelete: () => void; index: number; isActive: boolean; }) { const { attributes, listeners, setNodeRef, transform, transition, isDragging, } = useSortable({ id: item.Id || "" }); const style = { transform: CSS.Translate.toString(transform), transition, opacity: isDragging ? 0.3 : 1, position: "relative" as const, zIndex: isDragging ? 999 : "auto", }; return (
    ); } const QueuePanel = ({ queue, currentTrackIndex }: QueuePanelProps) => { const [activeId, setActiveId] = useState(null); const sensors = useSensors( useSensor(PointerSensor, { activationConstraint: { distance: 8, }, }), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates, }), ); const activeItem = useMemo( () => queue.find((item) => item.Id === activeId), [queue, activeId], ); const handleDragStart = (event: DragStartEvent) => { setActiveId(String(event.active.id)); }; const handleDragEnd = (event: DragEndEvent) => { const { active, over } = event; setActiveId(null); if (active.id !== over?.id) { const oldIndex = queue.map((item) => item.Id).indexOf(String(active.id)); const newIndex = queue.map((item) => item.Id).indexOf(String(over?.id)); if (oldIndex !== -1 && newIndex !== -1) { const newQueue = arrayMove(queue, oldIndex, newIndex); const currentTrackId = queue[currentTrackIndex]?.Id; const newCurrentTrackIndex = newQueue.findIndex( (item) => item.Id === currentTrackId, ); setQueue( newQueue, newCurrentTrackIndex !== -1 ? newCurrentTrackIndex : 0, ); } } }; const [anchorEl, setAnchorEl] = useState(null); const open = Boolean(anchorEl); const handleClick = (event: React.MouseEvent) => { setAnchorEl(event.currentTarget); }; const handleClose = () => { setAnchorEl(null); }; const handleClearQueue = () => { stopPlayback(); clearQueue(); handleClose(); }; return (
    Queue shuffleUpcoming()} size="small"> shuffle more_vert clear_all Clear Queue track.Id ?? "")} strategy={verticalListSortingStrategy} >
    {queue.map((track, index) => ( removeFromQueue(index)} isActive={currentTrackIndex === index} /> ))}
    {activeItem ? ( {}} // Pass empty function to render delete button space sx={{ bgcolor: "rgba(40, 40, 40, 0.9)", backdropFilter: "blur(10px)", borderRadius: 2, boxShadow: "0 8px 32px rgba(0,0,0,0.5)", outline: "1px solid rgba(255, 255, 255, 0.1)", mb: 1, ".MuiListItemText-primary": { fontWeight: 500, fontSize: "1rem", }, ".MuiListItemText-secondary": { fontSize: "0.85rem", opacity: 0.7, }, }} /> ) : null}
    ); }; export default React.memo(QueuePanel); ================================================ FILE: src/components/playback/audioPlayer/components/StatsPanel.tsx ================================================ import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; import { Box, Paper, Typography } from "@mui/material"; import React, { useEffect, useState } from "react"; interface StatsPanelProps { item: BaseItemDto | undefined | null; audioRef: React.RefObject | null; } const StatRow = ({ label, value, }: { label: string; value: string | number | undefined | null; }) => ( {label} {value || "-"} ); const StatsPanel: React.FC = ({ item, audioRef }) => { const [buffered, setBuffered] = useState("0%"); useEffect(() => { const player = audioRef?.current; if (!player) return; const updateStats = () => { if (player.buffered.length > 0) { const bufferedEnd = player.buffered.end(player.buffered.length - 1); const duration = player.duration; if (duration > 0) { setBuffered(`${Math.round((bufferedEnd / duration) * 100)}%`); } } }; const interval = setInterval(updateStats, 1000); return () => clearInterval(interval); }, [audioRef]); const mediaSource = item?.MediaSources?.[0]; const mediaStream = mediaSource?.MediaStreams?.find( (s) => s.Type === "Audio", ); return ( Stats for Nerds Media Source Audio Stream Player ); }; export default React.memo(StatsPanel); ================================================ FILE: src/components/playback/audioPlayer/index.tsx ================================================ import { useLocation, useNavigate } from "@tanstack/react-router"; import { AnimatePresence, motion } from "motion/react"; import React, { type SyntheticEvent, useEffect, useRef, useState } from "react"; import { secToTicks, ticksToSec } from "@/utils/date/time"; import getImageUrlsApi from "@/utils/methods/getImageUrlsApi"; import { useApiInContext } from "@/utils/store/api"; import { setAudioRef, setIsMuted, setVolume, useAudioPlayback, } from "@/utils/store/audioPlayback"; import { useCentralStore } from "@/utils/store/central"; import { playItemFromQueue } from "@/utils/store/playback"; import useQueue from "@/utils/store/queue"; import PlayerActions from "./components/PlayerActions"; import PlayerControls from "./components/PlayerControls"; import PlayerInfo from "./components/PlayerInfo"; import PlayerProgress from "./components/PlayerProgress"; import PlayerVolume from "./components/PlayerVolume"; import "./audioPlayer.scss"; const AudioPlayer = () => { const api = useApiInContext((s) => s.api); const user = useCentralStore((s) => s.currentUser); const navigate = useNavigate(); const location = useLocation(); const audioRef = useRef(null); const [url, display, item, volume, isMuted] = useAudioPlayback((state) => [ state.url, state.display, state.item, state.player.volume, state.player.isMuted, ]); const [tracks, currentTrack] = useQueue((state) => [ state.tracks, state.currentItemIndex, ]); const [playing, setPlaying] = useState(false); const [progress, setProgress] = useState(0); // Sync volume and ref useEffect(() => { if (display) { setAudioRef(audioRef); if (audioRef.current) { audioRef.current.volume = isMuted ? 0 : volume; } } }, [display, url, tracks?.[currentTrack]?.Id]); // Update volume when state changes useEffect(() => { if (audioRef.current) { audioRef.current.volume = isMuted ? 0 : volume; } }, [volume, isMuted]); // Media Session Metadata useEffect(() => { if ("mediaSession" in navigator && item) { const imageUrl = item.ImageTags?.Primary ? api && getImageUrlsApi(api).getItemImageUrlById(item.Id ?? "", "Primary", { tag: item.ImageTags.Primary, }) : undefined; navigator.mediaSession.metadata = new MediaMetadata({ title: item.Name ?? "Unknown Title", artist: item.Artists?.join(", ") ?? "Unknown Artist", album: item.Album ?? "Unknown Album", artwork: imageUrl ? [ { src: imageUrl, sizes: "512x512", type: "image/jpeg", }, ] : [], }); } }, [item, api]); // Media Session Action Handlers useEffect(() => { if ("mediaSession" in navigator) { navigator.mediaSession.setActionHandler("play", () => { audioRef.current?.play(); }); navigator.mediaSession.setActionHandler("pause", () => { audioRef.current?.pause(); }); navigator.mediaSession.setActionHandler("previoustrack", () => { if (user?.Id && api) { playItemFromQueue("previous", user.Id, api); } }); navigator.mediaSession.setActionHandler("nexttrack", () => { if (user?.Id && api) { playItemFromQueue("next", user.Id, api); } }); navigator.mediaSession.setActionHandler("seekto", (details) => { if (audioRef.current && details.seekTime !== undefined) { audioRef.current.currentTime = details.seekTime; } }); } }, [api, user?.Id]); const updatePositionState = () => { if ( "mediaSession" in navigator && audioRef.current && !Number.isNaN(audioRef.current.duration) ) { try { navigator.mediaSession.setPositionState({ duration: audioRef.current.duration, playbackRate: audioRef.current.playbackRate, position: audioRef.current.currentTime, }); } catch (error) { console.error("Error updating media session position state:", error); } } }; const handlePlayPause = () => { if (audioRef.current) { if (audioRef.current.paused) { audioRef.current.play(); setPlaying(true); } else { audioRef.current.pause(); setPlaying(false); } } }; const handleTimeUpdate = (e: SyntheticEvent) => { setProgress(secToTicks(e.currentTarget.currentTime)); }; const handleEnded = () => { setPlaying(false); if (tracks?.[currentTrack + 1]?.Id && api && user?.Id) { playItemFromQueue("next", user.Id, api); } }; const handleSeekCommit = (value: number) => { if (audioRef.current) { audioRef.current.currentTime = ticksToSec(value); setProgress(value); } }; const handleVolumeChange = (newVolume: number) => { setVolume(newVolume); }; const handleMuteToggle = () => { setIsMuted(!isMuted); }; const handleClose = () => { useAudioPlayback.setState(useAudioPlayback.getInitialState()); }; const handleNavigate = () => { navigate({ to: "/player/audio" }); }; // Listen to play/pause events directly from audio element to keep state in sync // (e.g. if paused by media keys) const onPlay = () => { setPlaying(true); updatePositionState(); if ("mediaSession" in navigator) { navigator.mediaSession.playbackState = "playing"; } }; const onPause = () => { setPlaying(false); updatePositionState(); if ("mediaSession" in navigator) { navigator.mediaSession.playbackState = "paused"; } }; return ( {display && ( )} ); }; export default AudioPlayer; ================================================ FILE: src/components/playback/videoPlayer/EndsAtDisplay.tsx ================================================ import { Typography } from "@mui/material"; import React from "react"; import { useShallow } from "zustand/shallow"; import { endsAt } from "@/utils/date/time"; import { usePlaybackStore } from "@/utils/store/playback"; const EndsAtDisplay = () => { const { currentTime, itemDuration } = usePlaybackStore( useShallow((state) => ({ currentTime: state.playerState.currentTime, itemDuration: state.metadata.itemDuration ?? state.metadata.item?.RunTimeTicks, })), ); if (!itemDuration) return --:--; const remaining = itemDuration - (currentTime ?? 0); return ( {endsAt(remaining)} ); }; export default EndsAtDisplay; ================================================ FILE: src/components/playback/videoPlayer/ErrorDisplay.tsx ================================================ import { Button, Typography } from "@mui/material"; import React from "react"; interface ErrorDisplayProps { error: any; onRetry?: () => void; onExit?: () => void; } const ErrorDisplay = ({ error, onRetry, onExit }: ErrorDisplayProps) => { if (!error) return null; return (
    Playback Error {error.message || "An unknown error occurred during playback."}
    {onRetry && ( )} {onExit && ( )}
    ); }; export default ErrorDisplay; ================================================ FILE: src/components/playback/videoPlayer/LoadingIndicator.tsx ================================================ import { CircularProgress } from "@mui/material"; import React from "react"; import { useShallow } from "zustand/shallow"; import { usePlaybackStore } from "@/utils/store/playback"; const LoadingIndicator = () => { const { isBuffering } = usePlaybackStore( useShallow((state) => ({ isBuffering: state.playerState.isBuffering, })), ); if (!isBuffering) { return null; } return (
    ); }; export default LoadingIndicator; ================================================ FILE: src/components/playback/videoPlayer/ProgressDisplay.tsx ================================================ import { Typography } from "@mui/material"; import React from "react"; import { useShallow } from "zustand/shallow"; import ticksDisplay from "@/utils/methods/ticksDisplay"; import { usePlaybackStore } from "@/utils/store/playback"; const ProgressDisplay = () => { const { currentTime, itemDuration, isUserSeeking, seekValue } = usePlaybackStore( useShallow((state) => ({ currentTime: state.playerState.currentTime, itemDuration: state.metadata.itemDuration ?? state.metadata.item?.RunTimeTicks, isUserSeeking: state.playerState.isUserSeeking, seekValue: state.playerState.seekValue, })), ); return (
    {ticksDisplay(isUserSeeking ? (seekValue ?? 0) : (currentTime ?? 0))} {ticksDisplay(itemDuration ?? 0)}
    ); }; export default ProgressDisplay; ================================================ FILE: src/components/playback/videoPlayer/StatsForNerds.tsx ================================================ import { IconButton, Paper, Typography } from "@mui/material"; import React, { type RefObject, useEffect, useState } from "react"; import { useShallow } from "zustand/shallow"; import { usePlaybackStore } from "@/utils/store/playback"; interface StatsForNerdsProps { playerRef: RefObject; } const StatsForNerds = ({ playerRef }: StatsForNerdsProps) => { const { showStatsForNerds, toggleShowStatsForNerds, itemId, mediaSourceId, playsessionId, volume, isBuffering, playbackStream, mediaSource, } = usePlaybackStore( useShallow((state) => ({ showStatsForNerds: state.playerState.showStatsForNerds, toggleShowStatsForNerds: state.toggleShowStatsForNerds, itemId: state.metadata.item?.Id, mediaSourceId: state.mediaSource.id, playsessionId: state.playsessionId, volume: state.playerState.volume, isBuffering: state.playerState.isBuffering, playbackStream: state.playbackStream, mediaSource: state.mediaSource, })), ); const [videoStats, setVideoStats] = useState<{ resolution: string; droppedFrames: number; totalFrames: number; buffered: string; }>({ resolution: "-", droppedFrames: 0, totalFrames: 0, buffered: "-", }); useEffect(() => { if (!showStatsForNerds) return; const interval = setInterval(() => { if (playerRef.current) { const internalPlayer = playerRef.current as HTMLVideoElement; if (internalPlayer) { const quality = internalPlayer.getVideoPlaybackQuality?.(); let bufferedEnd = 0; if (internalPlayer.buffered.length > 0) { // Find the buffered range that covers the current time for (let i = 0; i < internalPlayer.buffered.length; i++) { if ( internalPlayer.buffered.start(i) <= internalPlayer.currentTime && internalPlayer.buffered.end(i) >= internalPlayer.currentTime ) { bufferedEnd = internalPlayer.buffered.end(i); break; } } } setVideoStats({ resolution: internalPlayer.videoWidth && internalPlayer.videoHeight ? `${internalPlayer.videoWidth}x${internalPlayer.videoHeight}` : "-", droppedFrames: quality?.droppedVideoFrames ?? 0, totalFrames: quality?.totalVideoFrames ?? 0, buffered: `${(bufferedEnd - internalPlayer.currentTime).toFixed(2)}s`, }); } } }, 1000); return () => clearInterval(interval); }, [showStatsForNerds, playerRef]); if (!showStatsForNerds) return null; return (
    Stats for Nerds close
    Video ID: {itemId} Media Source ID: {mediaSourceId} Play Session ID: {playsessionId} Playback Method:{" "} {mediaSource.playMethod} Container: {mediaSource.container} Video Codec: {mediaSource.videoCodec} Audio Codec: {mediaSource.audioCodec} Bitrate:{" "} {mediaSource.bitrate ? `${(mediaSource.bitrate / 1000000).toFixed(2)} Mbps` : "-"} Stream URL:{" "} {playbackStream} Resolution: {videoStats.resolution} Volume: {Math.round(volume * 100)}% Buffer Health: {videoStats.buffered} Dropped Frames:{" "} {videoStats.droppedFrames} / {videoStats.totalFrames} Is Buffering: {isBuffering ? "Yes" : "No"}
    ); }; export default StatsForNerds; ================================================ FILE: src/components/playback/videoPlayer/VolumeChangeOverlay.tsx ================================================ import { LinearProgress } from "@mui/material"; import { AnimatePresence, motion } from "motion/react"; import React from "react"; import { useShallow } from "zustand/shallow"; import { usePlaybackStore } from "@/utils/store/playback"; const VolumeChangeOverlay = () => { const { playerVolume, showVolumeIndicator } = usePlaybackStore( useShallow((state) => ({ playerVolume: state.playerState.volume, showVolumeIndicator: state.isVolumeInidcatorVisible, })), ); return ( {showVolumeIndicator && (
    {playerVolume > 0.7 ? "volume_up" : "volume_down"}
    )}
    ); }; export default VolumeChangeOverlay; ================================================ FILE: src/components/playback/videoPlayer/bubbleSlider/index.tsx ================================================ import type { TrickplayInfo } from "@jellyfin/sdk/lib/generated-client"; import { Slider, Tooltip, Typography } from "@mui/material"; import type { Instance } from "@popperjs/core"; import React, { type MouseEvent, useCallback, useEffect, useMemo, useRef, useState, } from "react"; import { useShallow } from "zustand/shallow"; import { ticksToMs } from "@/utils/date/time"; import { useApiInContext } from "@/utils/store/api"; import { usePlaybackStore } from "@/utils/store/playback"; const ticksDisplay = (ticks: number) => { const time = Math.round(ticks / 10000); let formatedTime = ""; let timeSec = Math.floor(time / 1000); let timeMin = Math.floor(timeSec / 60); timeSec -= timeMin * 60; timeSec = timeSec === 0 ? 0o0 : timeSec; const timeHr = Math.floor(timeMin / 60); timeMin -= timeHr * 60; formatedTime = `${timeHr.toLocaleString([], { minimumIntegerDigits: 2, useGrouping: false, })}:${timeMin.toLocaleString([], { minimumIntegerDigits: 2, useGrouping: false, })}:${timeSec.toLocaleString([], { minimumIntegerDigits: 2, useGrouping: false, })}`; return formatedTime; }; const BubbleSlider = () => { const api = useApiInContext((state) => state.api); const { seekValue, currentTime, isUserSeeking, // setIsUserSeeking, // setSeekValue, // seekTo, itemDuration, itemChapters, mediaSource, itemTrickplay, itemId, handleStartSeek, handleStopSeek, } = usePlaybackStore( useShallow((state) => ({ seekValue: state.playerState.seekValue, currentTime: state.playerState.currentTime, isUserSeeking: state.playerState.isUserSeeking, // setIsUserSeeking: state.setIsUserSeeking, // setSeekValue: state.setSeekValue, // seekTo: state.seekTo, itemDuration: state.metadata.item.RunTimeTicks, itemChapters: state.metadata.item.Chapters, mediaSource: state.mediaSource, itemTrickplay: state.metadata.item.Trickplay, itemId: state.metadata.item.Id, handleStartSeek: state.handleStartSeek, handleStopSeek: state.handleStopSeek, })), ); const positionRef = useRef<{ x: number; y: number }>({ x: 0, y: 0, }); const popperRef = useRef(null); const areaRef = useRef(null); const rafRef = useRef(null); const [hoverProgress, setHoverProgress] = useState(0); useEffect(() => { return () => { if (rafRef.current) { cancelAnimationFrame(rafRef.current); } }; }, []); const handleSliderHover = useCallback( (event: MouseEvent) => { const clientX = event.clientX; const clientY = event.clientY; if ( positionRef.current.x === clientX && positionRef.current.y === clientY ) { return; } positionRef.current = { x: clientX, y: clientY }; if (rafRef.current) return; rafRef.current = requestAnimationFrame(() => { if (areaRef.current) { const rect = areaRef.current.getBoundingClientRect(); const width = rect.width; const distX = clientX - rect.left; const percentageCovered = distX / width; setHoverProgress(percentageCovered * (itemDuration ?? 0)); if (popperRef.current != null) { popperRef.current.update(); } } rafRef.current = null; }); }, [itemDuration], ); const chapterMarks = useMemo(() => { const marks: { value: number }[] = []; itemChapters?.forEach((val) => { marks.push({ value: val.StartPositionTicks ?? 0 }); }); return marks; }, [itemChapters]); const sliderDisplayFormat = (value: number) => { const currentChapter = itemChapters?.filter((chapter, index) => { if (index + 1 === itemChapters?.length) { return true; } if ( (itemChapters?.[index + 1]?.StartPositionTicks ?? value) - value >= 0 && (chapter.StartPositionTicks ?? value) - value < 0 ) { return true; } return false; }); let trickplayResolution: TrickplayInfo | undefined; const trickplayResolutions = mediaSource.id ? itemTrickplay?.[mediaSource.id] : null; if (trickplayResolutions) { let bestWidth: number | undefined; const maxWidth = window.screen.width * window.devicePixelRatio * 0.2; for (const [_, trickInfo] of Object.entries(trickplayResolutions)) { if ( !bestWidth || (trickInfo.Width && ((trickInfo.Width < bestWidth && bestWidth > maxWidth) || (trickInfo.Width > bestWidth && bestWidth <= maxWidth))) ) { bestWidth = trickInfo.Width; } } if (bestWidth) { trickplayResolution = trickplayResolutions[bestWidth]; } } let trickplayStyle: React.CSSProperties | undefined; if ( trickplayResolution?.TileWidth && trickplayResolution.TileHeight && trickplayResolution.Width && trickplayResolution.Height ) { const currentTrickplayImage = trickplayResolution?.Interval ? Math.floor(ticksToMs(value) / trickplayResolution?.Interval) : 0; const trickplayImageSize = trickplayResolution?.TileWidth * trickplayResolution?.TileHeight; // this gives the area of a single tile const trickplayImageOffset = currentTrickplayImage % trickplayImageSize; // this gives the tile index inside a trickplay image const index = Math.floor(currentTrickplayImage / trickplayImageSize); // this gives the index of trickplay image const imageOffsetX = trickplayImageOffset % trickplayResolution?.TileWidth; // this gives the x coordinate of tile in trickplay image const imageOffsetY = Math.floor( trickplayImageOffset / trickplayResolution?.TileWidth, ); // this gives the y coordinate of tile in trickplay image const backgroundOffsetX = -(imageOffsetX * trickplayResolution?.Width); const backgroundOffsetY = -(imageOffsetY * trickplayResolution?.Height); const imgUrlParamsObject: Record = { api_key: String(api?.accessToken), MediaSourceId: mediaSource.id ?? "", }; const imgUrlParams = new URLSearchParams(imgUrlParamsObject).toString(); const _imageAspectRatio = trickplayResolution.Width / trickplayResolution.Height; trickplayStyle = { backgroundImage: `url(${api?.basePath}/Videos/${itemId}/Trickplay/${trickplayResolution.Width}/${index}.jpg?${imgUrlParams})`, backgroundPositionX: `${backgroundOffsetX}px`, backgroundPositionY: `${backgroundOffsetY}px`, width: `${trickplayResolution.Width}px`, height: `${trickplayResolution.Height}px`, borderBottom: "1px solid rgba(255,255,255,0.1)", borderRadius: 0, }; } const chapterName = currentChapter?.[0]?.Name; return (
    {trickplayStyle && (
    )}
    {chapterName && ( {chapterName} )} {ticksDisplay(value)}
    ); }; const virtualAnchorEl = useMemo(() => { return { getBoundingClientRect: () => { return new DOMRect( positionRef.current.x, areaRef.current?.getBoundingClientRect().y ?? 0, 0, 0, ); }, }; }, []); return ( { // setIsUserSeeking(true); Array.isArray(newValue) ? handleStartSeek(newValue[0]) : handleStartSeek(newValue); }} onChangeCommitted={(_, newValue) => { // setIsUserSeeking(false); // Array.isArray(newValue) // ? setSeekValue(newValue[0]) // : setSeekValue(newValue); if (Array.isArray(newValue)) { handleStopSeek(newValue[0]); } else { handleStopSeek(newValue); } }} sx={{ "& .MuiSlider-thumb": { width: 14, height: 14, transition: "0.1s ease-in-out", opacity: 0, "&.Mui-active": { width: 20, height: 20, opacity: 1, }, }, "&:hover .MuiSlider-thumb": { opacity: 1, }, "& .MuiSlider-rail": { opacity: 0.28, background: "white", }, }} marks={chapterMarks} valueLabelDisplay="off" ref={areaRef} onMouseMove={handleSliderHover} /> ); }; export default BubbleSlider; ================================================ FILE: src/components/playback/videoPlayer/buttons/CaptionsButton.tsx ================================================ import { IconButton } from "@mui/material"; import React, { useTransition } from "react"; import { useShallow } from "zustand/shallow"; import { toggleSubtitleTrack, usePlaybackStore } from "@/utils/store/playback"; const CaptionsButton = () => { const { subtitle } = usePlaybackStore( useShallow((state) => ({ subtitle: state.mediaSource.subtitle })), ); const [subtitleIsChanging, startSubtitleChange] = useTransition(); return ( startSubtitleChange(toggleSubtitleTrack)} > {subtitle?.enable ? "closed_caption" : "closed_caption_disabled"} ); }; export default CaptionsButton; ================================================ FILE: src/components/playback/videoPlayer/buttons/ChaptersListButton.tsx ================================================ import { IconButton, Menu, MenuItem } from "@mui/material"; import React from "react"; import { useShallow } from "zustand/shallow"; import { ticksToSec } from "@/utils/date/time"; import { usePlaybackStore } from "@/utils/store/playback"; const ChaptersListButton = () => { const { itemChapters, seekTo } = usePlaybackStore( useShallow((state) => ({ itemChapters: state.metadata.item?.Chapters, seekTo: state.seekTo, })), ); const [showChapterList, setShowChapterList] = React.useState(null); const handleShowChapterList = (event: React.MouseEvent) => { setShowChapterList(event.currentTarget); }; return ( <> list setShowChapterList(null)} anchorOrigin={{ vertical: "top", horizontal: "center", }} transformOrigin={{ vertical: "bottom", horizontal: "center", }} > {itemChapters?.length && itemChapters?.map((chapter) => ( { seekTo(ticksToSec(chapter.StartPositionTicks ?? 0)); setShowChapterList(null); // Close the chapter list menu }} > {chapter.Name} ))} ); }; export default ChaptersListButton; ================================================ FILE: src/components/playback/videoPlayer/buttons/ForwardButton.tsx ================================================ import { IconButton } from "@mui/material"; import React, { useEffect } from "react"; import { useShallow } from "zustand/shallow"; import { usePlaybackStore } from "@/utils/store/playback"; const ForwardButton = () => { const { seekForward } = usePlaybackStore( useShallow((state) => ({ seekForward: state.seekForward, })), ); useEffect(() => { navigator.mediaSession.setActionHandler("seekforward", (details) => { if (details.seekOffset) { seekForward(details.seekOffset); } else { seekForward(10); // Default to 10 seconds } }); }, [seekForward]); return ( seekForward(15)}> fast_forward ); }; export default ForwardButton; ================================================ FILE: src/components/playback/videoPlayer/buttons/FullscreenButton.tsx ================================================ import { IconButton } from "@mui/material"; import React from "react"; import { useShallow } from "zustand/shallow"; import { usePlaybackStore } from "@/utils/store/playback"; const FullscreenButton = () => { const { isPlayerFullscreen, toggleIsPlayerFullscreen } = usePlaybackStore( useShallow((state) => ({ isPlayerFullscreen: state.playerState.isPlayerFullscreen, toggleIsPlayerFullscreen: state.toggleIsPlayerFullscreen, })), ); return ( {isPlayerFullscreen ? "fullscreen_exit" : "fullscreen"} ); }; export default FullscreenButton; ================================================ FILE: src/components/playback/videoPlayer/buttons/NextChapterButton.tsx ================================================ import { IconButton } from "@mui/material"; import React from "react"; import { useShallow } from "zustand/shallow"; import { usePlaybackStore } from "@/utils/store/playback"; const NextChapterButton = () => { const { seekToNextChapter } = usePlaybackStore( useShallow((state) => ({ seekToNextChapter: state.seekToNextChapter, })), ); return ( seekToNextChapter()}> last_page ); }; export default NextChapterButton; ================================================ FILE: src/components/playback/videoPlayer/buttons/PlayPauseButton.tsx ================================================ import { IconButton } from "@mui/material"; import React from "react"; import { useShallow } from "zustand/shallow"; import { usePlaybackStore } from "@/utils/store/playback"; const PlayPauseButton = () => { const { isPlayerPlaying, toggleIsPlaying } = usePlaybackStore( useShallow((state) => ({ isPlayerPlaying: state.playerState.isPlayerPlaying, toggleIsPlaying: state.toggleIsPlaying, })), ); return ( {isPlayerPlaying ? "pause" : "play_arrow"} ); }; export default PlayPauseButton; ================================================ FILE: src/components/playback/videoPlayer/buttons/PrevChapterButton.tsx ================================================ import { IconButton } from "@mui/material"; import React from "react"; import { useShallow } from "zustand/shallow"; import { usePlaybackStore } from "@/utils/store/playback"; const PrevChapterButton = () => { const { seekToPrevChapter } = usePlaybackStore( useShallow((state) => ({ seekToPrevChapter: state.seekToPrevChapter, })), ); return ( first_page ); }; export default PrevChapterButton; ================================================ FILE: src/components/playback/videoPlayer/buttons/RewindButton.tsx ================================================ import { IconButton } from "@mui/material"; import React from "react"; import { useShallow } from "zustand/shallow"; import { usePlaybackStore } from "@/utils/store/playback"; const RewindButton = () => { const { seekBackward } = usePlaybackStore( useShallow((state) => ({ seekBackward: state.seekBackward, })), ); React.useEffect(() => { navigator.mediaSession.setActionHandler("seekbackward", (details) => { if (details.seekOffset) { seekBackward(details.seekOffset); } else { seekBackward(10); // Default to 10 seconds } }); }, [seekBackward]); return ( { seekBackward(15); }} > fast_rewind ); }; export default RewindButton; ================================================ FILE: src/components/playback/videoPlayer/buttons/SkipSegmentButton.tsx ================================================ import { Box, Button } from "@mui/material"; import { AnimatePresence, motion } from "motion/react"; import React from "react"; import { useShallow } from "zustand/shallow"; import { usePlaybackStore } from "@/utils/store/playback"; const SkipSegmentButton = () => { const { mediaSegments, currentSegmentIndex, skipSegment, activeSegmentId, isUserHovering, isPlayerPlaying, isUserSeeking, } = usePlaybackStore( useShallow((state) => ({ mediaSegments: state.metadata.mediaSegments, currentSegmentIndex: state.nextSegmentIndex - 1, skipSegment: state.skipSegment, activeSegmentId: state.activeSegmentId, isUserHovering: state.playerState.isUserHovering, isPlayerPlaying: state.playerState.isPlayerPlaying, isUserSeeking: state.playerState.isUserSeeking, })), ); const shouldShow = mediaSegments?.Items?.length && currentSegmentIndex >= 0 && activeSegmentId && mediaSegments?.Items?.[currentSegmentIndex].Type !== "Outro"; return ( {shouldShow && ( )} ); }; const SkipSegmentButtonMemo = React.memo(SkipSegmentButton); export default SkipSegmentButtonMemo; ================================================ FILE: src/components/playback/videoPlayer/controls.scss ================================================ .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; cursor: none; display: flex; flex-direction: column; align-self: stretch; justify-content: space-between; padding: 2em 3em; background: linear-gradient( to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0.9) 100% ); &.hovering { cursor: default; } &-controls { display: flex; flex-direction: column; gap: 1em; &-timeline-text { display: flex; align-items: stretch; justify-content: space-between; margin-top: 0.5em; font-weight: 500; opacity: 0.9; } &-progress { display: flex; flex-direction: column; gap: 0.2em; align-items: stretch; justify-content: center; margin-bottom: 0.5em; &-bubble { width: 14em; top: 0; left: 0; transform-origin: bottom center; transform: translate(var(--left, 0), var(--top, 0)); position: fixed; } } &-buttons { display: flex; gap: 0.5em; align-items: center; } } .MuiSlider-valueLabel { padding: 0; background: transparent; overflow: hidden; border-radius: $border-radius-default; border: 1.2px solid rgb(255 255 255 / 0.1); } } } ================================================ FILE: src/components/playback/videoPlayer/controls.tsx ================================================ import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api"; import { IconButton, Slider, Typography } from "@mui/material"; import { WebviewWindow as appWindow } from "@tauri-apps/api/webviewWindow"; import { AnimatePresence, motion } from "motion/react"; import React, { type MouseEvent, useCallback, useEffect, useRef, useState, } from "react"; import { useShallow } from "zustand/shallow"; import PlayNextButton from "@/components/buttons/playNextButton"; import PlayPreviousButton from "@/components/buttons/playPreviousButtom"; import QueueButton from "@/components/buttons/queueButton"; import BubbleSlider from "@/components/playback/videoPlayer/bubbleSlider"; import { secToTicks } from "@/utils/date/time"; import { useApiInContext } from "@/utils/store/api"; import { usePlaybackStore } from "@/utils/store/playback"; import CaptionsButton from "./buttons/CaptionsButton"; import ChaptersListButton from "./buttons/ChaptersListButton"; import ForwardButton from "./buttons/ForwardButton"; import FullscreenButton from "./buttons/FullscreenButton"; import NextChapterButton from "./buttons/NextChapterButton"; import PlayPauseButton from "./buttons/PlayPauseButton"; import PrevChapterButton from "./buttons/PrevChapterButton"; import RewindButton from "./buttons/RewindButton"; import EndsAtDisplay from "./EndsAtDisplay"; import VideoPlayerSettingsMenu from "./settingsMenu"; import "./controls.scss"; import { clearQueue } from "@/utils/store/queue"; import ProgressDisplay from "./ProgressDisplay"; /** * Constant for the volume change interval when using the mouse wheel. * This value determines how much the volume will change with each scroll step. */ const VOLUME_SCROLL_INTERVAL = 0.02; type VideoPlayerControlsProps = { // isVisible: boolean; onHover?: (event: MouseEvent) => void; onLeave?: (event: MouseEvent) => void; }; const VideoPlayerControls = ({ // isVisible, onHover, onLeave, }: VideoPlayerControlsProps) => { const playerOSDRef = useRef(null); const api = useApiInContext((state) => state.api); const { mediaSourceId, itemId, itemName, episodeTitle, playsessionId, isPlayerPlaying, toggleIsPlaying, toggleIsPlayerFullscreen, isUserSeeking, // seekValue, isPlayerMuted, volume, setVolume, toggleIsPlayerMuted, increaseVolumeByStep, decreaseVolumeByStep, getCurrentTime, isUserHovering, } = usePlaybackStore( useShallow((state) => ({ mediaSourceId: state.mediaSource.id, itemChapters: state.metadata.item.Chapters, itemId: state.metadata.item.Id, itemName: state.metadata.itemName, episodeTitle: state.metadata.episodeTitle, // mediaSegments: state.metadata.mediaSegments, isPlayerPlaying: state.playerState.isPlayerPlaying, playsessionId: state.playsessionId, toggleIsPlaying: state.toggleIsPlaying, toggleIsPlayerFullscreen: state.toggleIsPlayerFullscreen, isUserSeeking: state.playerState.isUserSeeking, seekValue: state.playerState.seekValue, isPlayerMuted: state.playerState.isPlayerMuted, volume: state.playerState.volume, setVolume: state.setVolume, toggleIsPlayerMuted: state.toggleIsPlayerMuted, increaseVolumeByStep: state.increaseVolumeByStep, decreaseVolumeByStep: state.decreaseVolumeByStep, getCurrentTime: state.getCurrentTime, isUserHovering: state.playerState.isUserHovering, })), ); // Volume control with mouse wheel useEffect(() => { const handleMouseWheel = (event: WheelEvent) => { if (event.deltaY < 0) { increaseVolumeByStep(VOLUME_SCROLL_INTERVAL); } else if (event.deltaY > 0) { decreaseVolumeByStep(VOLUME_SCROLL_INTERVAL); } }; const currentRef = playerOSDRef.current; // attach the event listener currentRef?.addEventListener("wheel", handleMouseWheel); // remove the event listener return () => { currentRef?.removeEventListener("wheel", handleMouseWheel); }; }, [increaseVolumeByStep, decreaseVolumeByStep]); const [clickTimeout, setClickTimeout] = useState(null); const [showVolumeControl, setShowVolumeControl] = useState(false); const [settingsMenuRef, setSettingsMenuRef] = useState(null); // const creditInfo = mediaSegments?.Items?.find( // (segment) => segment.Type === "Outro", // ); // Credits and Next Episode Card // const [forceShowCredits, setForceShowCredits] = useState(false); // const showUpNextCard = useMemo(() => { // if (queue?.[currentQueueItemIndex]?.Id === queue?.[queue.length - 1]?.Id) { // return false; // Check if the current playing episode is last episode in queue // } // if (creditInfo) { // if ( // currentTime >= (creditInfo.StartTicks ?? currentTime + 1) && // currentTime < (creditInfo.EndTicks ?? 0) // ) // return true; // } // if ( // Math.ceil(ticksToSec(itemDuration) - ticksToSec(currentTime)) <= 30 && // Math.ceil(ticksToSec(itemDuration) - ticksToSec(currentTime)) > 0 // ) { // return true; // } // return false; // }, [currentTime, creditInfo, itemDuration, queue, currentQueueItemIndex]); const handleExitPlayer = useCallback(async () => { appWindow.getCurrent().setFullscreen(false); history.back(); if (!api) { throw Error("API is not available, cannot report playback stopped."); } // Report Jellyfin server: Playback has ended/stopped getPlaystateApi(api).reportPlaybackStopped({ playbackStopInfo: { Failed: false, ItemId: itemId, MediaSourceId: mediaSourceId, PlaySessionId: playsessionId, PositionTicks: secToTicks(getCurrentTime() ?? 0), }, }); usePlaybackStore.setState(usePlaybackStore.getInitialState()); clearQueue(); }, [api, mediaSourceId, playsessionId, itemId]); return ( { if (event.currentTarget !== event.target) { return; } if (event.detail === 1) { setClickTimeout( setTimeout(() => { toggleIsPlaying(); }, 200), ); } else if (event.detail === 2 && clickTimeout) { clearTimeout(clickTimeout); toggleIsPlayerFullscreen(); } }} >
    arrow_back setSettingsMenuRef(e.currentTarget)}> settings setSettingsMenuRef(null)} />
    {String(itemName)} {episodeTitle && ( {String(episodeTitle)} )}
    setShowVolumeControl(false)} > {showVolumeControl && ( { const val = Array.isArray(newValue) ? newValue[0] : newValue; setVolume(val); }} sx={{ width: 100, color: "white" }} /> )} setShowVolumeControl(true)} > {isPlayerMuted ? "volume_off" : volume < 0.4 ? "volume_down" : "volume_up"}
    ); }; export default VideoPlayerControls; ================================================ FILE: src/components/playback/videoPlayer/settingsMenu.tsx ================================================ import { MenuItem, Popover, Switch, TextField, Typography, } from "@mui/material"; import { toNumber } from "lodash"; import React, { type ChangeEventHandler, useCallback, useMemo, useTransition, } from "react"; import { useShallow } from "zustand/shallow"; import { useApiInContext } from "@/utils/store/api"; import { changeAudioTrack, changeSubtitleTrack, usePlaybackStore, } from "@/utils/store/playback"; type VideoPlayerSettingsMenuProps = { settingsMenuRef: HTMLButtonElement | null; handleClose: () => void; }; const VideoPlayerSettingsMenu = ({ settingsMenuRef, handleClose, }: VideoPlayerSettingsMenuProps) => { const settingsMenuOpen = useMemo(() => { return Boolean(settingsMenuRef); }, [settingsMenuRef]); const api = useApiInContext((state) => state.api); const { mediaSource, setIsBuffering, showStatsForNerds, toggleShowStatsForNerds, } = usePlaybackStore( useShallow((state) => ({ mediaSource: state.mediaSource, setIsBuffering: state.setIsBuffering, showStatsForNerds: state.playerState.showStatsForNerds, toggleShowStatsForNerds: state.toggleShowStatsForNerds, })), ); const [subtitleIsChanging, startSubtitleChange] = useTransition(); const handleSubtitleChange: ChangeEventHandler< HTMLInputElement | HTMLTextAreaElement > = useCallback( (e) => { startSubtitleChange(() => { if (mediaSource.subtitle.allTracks) { changeSubtitleTrack( toNumber(e.target.value), mediaSource.subtitle.allTracks, ); handleClose(); } }); }, [mediaSource.subtitle?.allTracks], ); const [audioTackIsChanging, startAudioTrackChange] = useTransition(); const handleAudioTrackChange: ChangeEventHandler< HTMLInputElement | HTMLTextAreaElement > = (e) => { // setPlaying(false); startAudioTrackChange(() => { if (api && mediaSource.audio.allTracks) { changeAudioTrack(toNumber(e.target.value), api); handleClose(); setIsBuffering(true); } }); // setPlaying(true); }; return ( {mediaSource.audio?.allTracks?.map((sub) => ( {sub.DisplayTitle} ))} No Subtitle {mediaSource.subtitle?.allTracks?.map((sub) => ( {sub.DisplayTitle} ))} Stats for Nerds ); }; export default VideoPlayerSettingsMenu; ================================================ FILE: src/components/playback/videoPlayer/upNextFlyout.scss ================================================ .video-player-up_next_flyout { position: absolute; bottom: 2em; right: 2em; width: 42em; height: fit-content; display: flex; gap: 10px; align-items: stretch; justify-content: center; background-color: rgba(60, 60, 60,1); padding: 10px; border-radius: $border-radius-default + 10px; z-index: 10; transition: bottom 0.3s ease-in-out; &.floating { bottom: 18vh } &-thumbnail { max-width: 100%; max-height: 100%; width: 15em; object-fit: cover; border-radius: $border-radius-default; } &-details { display: flex; flex-direction: column; gap: 5px; overflow: hidden; justify-content: flex-start; align-items: flex-start; // height: 100%; } &-button{ // justify-self: flex-end; margin-top: auto; } } ================================================ FILE: src/components/playback/videoPlayer/upNextFlyout.tsx ================================================ import { Box, Button, IconButton, Typography } from "@mui/material"; import { AnimatePresence, motion } from "motion/react"; import React, { useEffect, useMemo, useState } from "react"; import { useShallow } from "zustand/shallow"; import getImageUrlsApi from "@/utils/methods/getImageUrlsApi"; import { useApiInContext } from "@/utils/store/api"; import { usePlaybackStore } from "@/utils/store/playback"; import useQueue from "@/utils/store/queue"; import "./upNextFlyout.scss"; const UpNextFlyout = () => { const { activeSegmentId, currentSegmemtIndex, mediaSegments, skipSegment, isUserHovering, isUserSeeking, isPlayerPlaying, } = usePlaybackStore( useShallow((state) => ({ activeSegmentId: state.activeSegmentId, currentSegmemtIndex: state.nextSegmentIndex - 1, mediaSegments: state.metadata.mediaSegments, skipSegment: state.skipSegment, isUserHovering: state.playerState.isUserHovering, isUserSeeking: state.playerState.isUserSeeking, isPlayerPlaying: state.playerState.isPlayerPlaying, })), ); const { nextItemIndex, tracks } = useQueue( useShallow((state) => ({ nextItemIndex: state.currentItemIndex + 1, tracks: state.tracks, })), ); const [isHidden, setIsHidden] = useState(false); useEffect(() => { setIsHidden(false); }, [activeSegmentId]); const areControlsVisible = useMemo(() => { return isUserHovering || isUserSeeking || !isPlayerPlaying; }, [isUserHovering, isUserSeeking, isPlayerPlaying]); const api = useApiInContext((s) => s.api); if ( !api || !activeSegmentId || mediaSegments?.Items?.[currentSegmemtIndex].Type !== "Outro" || isHidden ) { return null; } const item = tracks?.[nextItemIndex]; if (!item || !item.Id) { return null; } return ( next item thumbnail UP NEXT {item.SeriesName || item.Name} {item.SeriesName ? `S${item.ParentIndexNumber}:E${item.IndexNumber} - ${item.Name}` : item.Overview || ""} setIsHidden(true)} sx={{ borderRadius: "8px", border: "1px solid rgba(255,255,255,0.1)", color: "text.secondary", "&:hover": { bgcolor: "rgba(255,255,255,0.1)", color: "white", }, }} > close ); }; export default UpNextFlyout; ================================================ FILE: src/components/queueListItem/index.tsx ================================================ import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; import { Box, IconButton, ListItem, ListItemAvatar, ListItemText, } from "@mui/material"; import React from "react"; import getImageUrlsApi from "@/utils/methods/getImageUrlsApi"; import { useApiInContext } from "@/utils/store/api"; import { getTypeIcon } from "../utils/iconsCollection"; type QueueListItemProps = { queueItem: BaseItemDto; active?: boolean; onDelete?: () => void; onPlay?: () => void; dragHandleProps?: any; isEpisode?: boolean; index?: number; className?: string; sx?: any; }; const QueueListItem = ({ queueItem, active, onDelete, onPlay, dragHandleProps, isEpisode, className, sx, }: QueueListItemProps) => { const api = useApiInContext((s) => s.api); const imageUrl = api && queueItem.Id && (queueItem.ImageTags?.Primary ? getImageUrlsApi(api).getItemImageUrlById(queueItem.Id, "Primary", { tag: queueItem.ImageTags.Primary, }) : queueItem.AlbumPrimaryImageTag?.[0] ? getImageUrlsApi(api).getItemImageUrlById( queueItem.AlbumId || "", "Primary", { tag: queueItem.AlbumPrimaryImageTag[0] }, ) : null); const primaryText = queueItem.SeriesName || queueItem.Name; let secondaryText = ""; if (isEpisode) { const season = queueItem.ParentIndexNumber; const episode = queueItem.IndexNumber; const episodeEnd = queueItem.IndexNumberEnd; const episodeString = episodeEnd ? `S${season}:E${episode}-${episodeEnd}` : `S${season}:E${episode}`; secondaryText = `${episodeString} - ${queueItem.Name}`; } else { secondaryText = queueItem.Artists?.join(", ") || ""; } return ( close ) } sx={{ opacity: active ? 1 : 1, bgcolor: active ? "rgba(255, 255, 255, 0.1)" : "rgba(0,0,0,0.2)", borderRadius: 3, mb: 0, transition: "all 0.2s ease", border: "1px solid", borderColor: active ? "rgba(255, 255, 255, 0.2)" : "rgba(255,255,255,0.05)", "&:hover": { bgcolor: active ? "rgba(255, 255, 255, 0.15)" : "rgba(255,255,255,0.05)", transform: active ? "none" : "translateY(-2px)", borderColor: active ? "rgba(255, 255, 255, 0.3)" : "rgba(255,255,255,0.2)", boxShadow: active ? "none" : "0 4px 12px rgba(0,0,0,0.2)", }, pr: onDelete ? 6 : 2, ...sx, }} > {dragHandleProps && (
    drag_indicator
    )} {imageUrl ? ( {queueItem.Name ) : (
    {queueItem.Type && getTypeIcon(queueItem.Type)}
    )} {active && (
    equalizer
    )} {!active && onPlay && ( play_arrow )}
    ); }; export default QueueListItem; ================================================ FILE: src/components/queueTrack/index.tsx ================================================ import { useSortable } from "@dnd-kit/sortable"; import { CSS } from "@dnd-kit/utilities"; import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; import { IconButton, Typography } from "@mui/material"; import React from "react"; import { getRuntimeMusic } from "@/utils/date/time"; import useQueue from "@/utils/store/queue"; type Props = { track: BaseItemDto; index: number; onRemove?: () => void; }; const QueueTrack = (props: Props) => { const { track, index, onRemove } = props; const [currentItemIndex] = useQueue((s) => [s.currentItemIndex]); const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id: track.Id ?? "", }); const style = { // opacity: isDragging ? 0.5 : 1, transform: CSS.Transform.toString(transform), transition, }; return (
    drag_handle
    {track.Name} {track.Artists?.join(", ")}
    {getRuntimeMusic(track.RunTimeTicks ?? 0)} {onRemove && ( close )}
    ); }; export default QueueTrack; ================================================ FILE: src/components/routerLoading/index.tsx ================================================ import { CircularProgress } from "@mui/material"; import { useRouterState } from "@tanstack/react-router"; import React from "react"; export default function RouterLoading() { const routeLoading = useRouterState().isLoading; if (!routeLoading) return null; return (
    ); } ================================================ FILE: src/components/search/index.tsx ================================================ import { ItemSortBy } from "@jellyfin/sdk/lib/generated-client"; import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api"; import { getSearchApi } from "@jellyfin/sdk/lib/utils/api/search-api"; import { Box, Button, Dialog, Grow, IconButton, InputBase, LinearProgress, Stack, Typography, useTheme, } from "@mui/material"; import type { TransitionProps } from "@mui/material/transitions"; import { useQuery } from "@tanstack/react-query"; import { useNavigate } from "@tanstack/react-router"; import { register } from "@tauri-apps/plugin-global-shortcut"; import React, { type ChangeEvent, useCallback, useEffect, useMemo, useRef, useState, } from "react"; import { useShallow } from "zustand/shallow"; import useDebounce from "@/utils/hooks/useDebounce"; import getImageUrlsApi from "@/utils/methods/getImageUrlsApi"; import { useApiInContext } from "@/utils/store/api"; import { useCentralStore } from "@/utils/store/central"; import useSearchStore from "@/utils/store/search"; import SearchItem from "./item"; const Transition = React.forwardRef(function Transition( props: TransitionProps & { children: React.ReactElement; }, ref: React.Ref, ) { return ; }); const Search = () => { const theme = useTheme(); const { isOpen, handleClose, toggleSearchDialog } = useSearchStore( useShallow((s) => ({ isOpen: s.showSearchDialog, handleClose: s.toggleSearchDialog, toggleSearchDialog: s.toggleSearchDialog, })), ); const api = useApiInContext((s) => s.api); const userId = useCentralStore((s) => s.currentUser?.Id || ""); const suggestions = useQuery({ queryKey: ["search", "suggestions"], queryFn: async () => api && ( await getItemsApi(api).getItems({ userId: userId, limit: 5, sortBy: [ItemSortBy.IsFavoriteOrLiked, ItemSortBy.Random], includeItemTypes: ["Movie", "Series", "MusicArtist"], enableImages: true, recursive: true, }) ).data, }); const [searchTerm, setSearchTerm] = useState(""); const debouncedSearchTerm = useDebounce(searchTerm, 300); const inputRef = useRef(null); useEffect(() => { if (isOpen) { setTimeout(() => { inputRef.current?.focus(); }, 100); } }, [isOpen]); const handleSearchChange = (e: ChangeEvent) => { setSearchTerm(e.target.value); }; const searchResults = useQuery({ queryKey: ["search", debouncedSearchTerm], queryFn: async () => { if (!api) return null; if (debouncedSearchTerm.trim() === "") { return null; } return ( await getSearchApi(api).getSearchHints({ searchTerm: debouncedSearchTerm, userId: userId, limit: 10, includeItemTypes: [ "Movie", "Series", "MusicAlbum", "Person", "Audio", "Photo", "PhotoAlbum", "Playlist", ], // enableImages: true, }) ).data; }, }); const showSuggestions = useMemo( () => (debouncedSearchTerm.length === 0 || searchResults.isLoading) && (suggestions.data?.Items?.length ?? 0) > 0, [ debouncedSearchTerm.length, searchResults.isLoading, suggestions.data?.Items?.length, ], ); const navigate = useNavigate(); const handleClearSearch = useCallback(() => { setSearchTerm(""); }, []); const handleAdvancedSearch = useCallback(() => { navigate({ to: "/search", search: { query: debouncedSearchTerm } }); toggleSearchDialog(); }, [navigate, toggleSearchDialog, debouncedSearchTerm]); useEffect(() => { async function registerglobalShortcut() { await register("CommandOrControl+K", (e) => { if (e.state === "Pressed") { toggleSearchDialog(); } }); } registerglobalShortcut(); }, []); return ( search {searchTerm && ( close )} {searchResults.isLoading && ( )} {debouncedSearchTerm.length > 0 && searchResults.data?.SearchHints && searchResults.data.SearchHints.length > 0 && ( Results {searchResults.data.SearchHints.map((item) => ( ))} )} {showSuggestions && ( Suggestions {suggestions.data?.Items?.map((item) => ( ))} )} {searchResults.isSuccess && searchResults.data?.SearchHints?.length === 0 && ( search_off No results found for "{debouncedSearchTerm}" )} ); }; export default Search; ================================================ FILE: src/components/search/item.tsx ================================================ import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client"; import { Box, Button, Stack, Typography } from "@mui/material"; import { useNavigate } from "@tanstack/react-router"; import React from "react"; import { useShallow } from "zustand/react/shallow"; import useSearchStore from "@/utils/store/search"; import { getTypeIcon } from "../utils/iconsCollection"; type SearchItemProps = { itemName: string; imageUrl?: string | null; itemYear?: string; itemType?: BaseItemKind; itemId: string; }; const SearchItem = (props: SearchItemProps) => { const { itemName, imageUrl, itemYear, itemType, itemId } = props; const toggleSearchDialog = useSearchStore( useShallow((s) => s.toggleSearchDialog), ); const navigate = useNavigate(); const handleOnClick = () => { toggleSearchDialog(); switch (itemType) { case BaseItemKind.BoxSet: navigate({ to: "/boxset/$id", params: { id: itemId } }); break; case BaseItemKind.Episode: navigate({ to: "/episode/$id", params: { id: itemId } }); break; case BaseItemKind.MusicAlbum: navigate({ to: "/album/$id", params: { id: itemId } }); break; case BaseItemKind.MusicArtist: navigate({ to: "/artist/$id", params: { id: itemId } }); break; case BaseItemKind.Person: navigate({ to: "/person/$id", params: { id: itemId } }); break; case BaseItemKind.Series: navigate({ to: "/series/$id", params: { id: itemId } }); break; case BaseItemKind.Playlist: navigate({ to: "/playlist/$id", params: { id: itemId } }); break; default: navigate({ to: "/item/$id", params: { id: itemId } }); break; } }; return ( ); }; export default SearchItem; ================================================ FILE: src/components/settingOption/index.tsx ================================================ import { getSetting, setSetting } from "@/utils/storage/settings"; import { FormControlLabel, Switch, Typography } from "@mui/material"; import { useQuery } from "@tanstack/react-query"; import React, { useState } from "react"; const SettingOption = ({ setting, }: { setting: { key: string; name: string; description: string } }) => { const initValue = useQuery({ queryKey: ["setting", setting.key], queryFn: async () => { const result = await getSetting(setting.key); return Boolean(result); }, }); const [settingVal, setSettingVal] = useState(initValue.data ?? false); return ( { setSetting(setting.key, checked); setSettingVal(Boolean(checked)); }} disabled={initValue.isLoading} name={setting.name} /> } label={
    {setting.name} {setting.description}
    } labelPlacement="start" className="settings-option" /> ); }; export default SettingOption; ================================================ FILE: src/components/settingOptionSelect/index.tsx ================================================ import type { CultureDto } from "@jellyfin/sdk/lib/generated-client"; import { FormControlLabel, MenuItem, TextField, Typography, } from "@mui/material"; import React, { useState } from "react"; const SettingOptionSelect = ({ setting, options, userValue, }: { setting: { name: string; description: string }; options: CultureDto[]; userValue: string | null; }) => { const [value, setValue] = useState( userValue === "" ? "anyLanguage" : userValue, ); return ( setValue(e.target.value)}> Any Language {options.map((option) => ( {option.DisplayName} ))} } label={
    {setting.name} {setting.description}
    } labelPlacement="start" className="settings-option" /> ); }; export default SettingOptionSelect; ================================================ FILE: src/components/showMoreText/index.tsx ================================================ import Button from "@mui/material/Button"; import Typography from "@mui/material/Typography"; import React from "react"; import { useEffect, useRef, useState } from "react"; const ShowMoreText = ({ content, collapsedLines, extraProps, }: { content: string; collapsedLines: number; extraProps?: Record; }) => { const [displayFull, setDisplayFull] = useState(false); const [isOverflowing, setIsOverflowing] = useState(false); const textRef = useRef(null); useEffect(() => { if (textRef.current) { if (textRef.current.offsetHeight < textRef.current.scrollHeight) { setIsOverflowing(true); } else { setIsOverflowing(false); } // textRef.current. } }, []); return (
    {content} {content.length > 0 && isOverflowing && ( )}
    ); }; export default ShowMoreText; ================================================ FILE: src/components/skeleton/cards.tsx ================================================ import Skeleton from "@mui/material/Skeleton"; import Typography from "@mui/material/Typography"; import React from "react"; export const CardsSkeleton = () => { return (
    {Array.from({ length: 12 }).map((_, index) => ( ))}
    ); }; ================================================ FILE: src/components/skeleton/carousel.tsx ================================================ import Skeleton from "@mui/material/Skeleton"; import Typography from "@mui/material/Typography"; import React from "react"; export const CarouselSkeleton = () => { return (
    ); }; ================================================ FILE: src/components/skeleton/episode.tsx ================================================ import { Divider, Skeleton, Typography } from "@mui/material"; import React from "react"; const EpisodeSkeleton = () => { return Array.from(new Array(8)).map((_, index) => { return (
    {index !== 7 && }
    ); }); } export default EpisodeSkeleton ================================================ FILE: src/components/skeleton/item.tsx ================================================ import React from "react"; import { Skeleton } from "@mui/material"; import { motion } from "motion/react"; const ItemSkeleton = () => { return (
    {/* */}
    ); }; export default ItemSkeleton; ================================================ FILE: src/components/skeleton/libraryItems.tsx ================================================ import { Skeleton } from "@mui/material"; import React from "react"; const LibraryItemsSkeleton = () => { return (
    {Array.from(new Array(18)).map((item, index) => ( ))}
    ); }; export default LibraryItemsSkeleton; ================================================ FILE: src/components/skeleton/seasonSelector.tsx ================================================ import Divider from "@mui/material/Divider"; import Grid2 from "@mui/material/Grid"; import Skeleton from "@mui/material/Skeleton"; import Typography from "@mui/material/Typography"; import React from "react"; import EpisodeSkeleton from "./episode"; export const SeasonSelectorSkeleton = () => { return (
    ); }; ================================================ FILE: src/components/tagChip/index.tsx ================================================ import { Typography } from "@mui/material"; import { Link, type LinkProps } from "@tanstack/react-router"; import React from "react"; import "./tagChip.scss"; const TagChip = ({ label, linkProps, }: { label: string; linkProps?: LinkProps }) => { return ( {label} ); }; export default TagChip; ================================================ FILE: src/components/tagChip/tagChip.scss ================================================ .tag { display: flex; padding: 0.4em 0.8em; color: white; text-decoration: none; gap: 0.2em; border: 1px solid rgb(255 255 255 / 0.3); border-radius: 4em; .MuiTypography-root { white-space: nowrap; transition: $transition-time-fast; } &:hover { border-color: rgb(255 255 255 / 0.8) !important; .MuiTypography-root { font-weight: 400; } } } ================================================ FILE: src/components/updater/index.tsx ================================================ import { LoadingButton } from "@mui/lab"; import { Box, Button, CircularProgress, Dialog, DialogActions, DialogContent, Stack, Typography, } from "@mui/material"; import { relaunch } from "@tauri-apps/plugin-process"; import { open } from "@tauri-apps/plugin-shell"; import { check, type Update } from "@tauri-apps/plugin-updater"; import { useSnackbar } from "notistack"; import React, { useCallback, useLayoutEffect, useState } from "react"; export default function Updater() { const [updateDialog, setUpdateDialog] = useState(false); const [updateDialogButton, setUpdateDialogButton] = useState(false); const [updateInfo, setUpdateInfo] = useState(undefined); useLayoutEffect(() => { async function checkForUpdates() { try { const update = await check(); if (update) { // console.log(update); setUpdateInfo(update); setUpdateDialog(true); console.info(`Update found : ${update.version}, ${update.date}`); } } catch (error) { console.error(error); } } checkForUpdates(); }, []); const { enqueueSnackbar } = useSnackbar(); const [downloadProgress, setDownloadProgress] = useState(0); const [downloadSize, setDownloadSize] = useState(0); const handleUpdate = useCallback(async () => { try { setUpdateDialogButton(true); await updateInfo?.downloadAndInstall((e) => { switch (e.event) { case "Started": setDownloadSize(e.data.contentLength ?? 0); break; case "Progress": setDownloadProgress((s) => s + e.data.chunkLength); break; case "Finished": setDownloadProgress(downloadSize); break; } }); enqueueSnackbar( "Update has been installed! You need to relaunch Blink.", { variant: "success", }, ); await relaunch(); } catch (error) { console.error(error); enqueueSnackbar(`Failed to update Blink. ${error}`, { variant: "error" }); } setUpdateDialogButton(false); }, [enqueueSnackbar, updateInfo, downloadSize]); if (!updateInfo) return null; return ( `linear-gradient(135deg, ${theme.palette.primary.main} 0%, ${theme.palette.secondary.main} 100%)`, zIndex: 0, filter: "blur(40px)", transform: "translateY(-50%) scale(1.5)", }} /> `linear-gradient(135deg, ${theme.palette.primary.main} 0%, ${theme.palette.secondary.main} 100%)`, boxShadow: (theme) => `0 10px 25px -5px ${theme.palette.primary.main}80`, mb: 1, }} > rocket_launch `linear-gradient(135deg, ${theme.palette.primary.light} 0%, ${theme.palette.secondary.light} 100%)`, backgroundClip: "text", WebkitBackgroundClip: "text", color: "transparent", }} > Update Available A new version of Blink is ready for you. Current v{updateInfo.currentVersion} arrow_forward New Version v{updateInfo.version} ); } ================================================ FILE: src/components/userAvatarMenu/index.tsx ================================================ import { Avatar, Divider, IconButton, ListItemIcon, Menu, MenuItem, } from "@mui/material"; import { useQueryClient } from "@tanstack/react-query"; import { useNavigate, useRouter } from "@tanstack/react-router"; import React, { type MouseEventHandler, useCallback, useMemo, useState, } from "react"; import { delUser } from "@/utils/storage/user"; import { useApiInContext } from "@/utils/store/api"; import { useCentralStore } from "@/utils/store/central"; export const UserAvatarMenu = () => { const api = useApiInContext((s) => s.api); const createApi = useApiInContext((s) => s.createApi); const [user, resetCurrentUser] = useCentralStore((s) => [ s.currentUser, s.resetCurrentUser, ]); const navigate = useNavigate(); const router = useRouter(); const queryClient = useQueryClient(); const [anchorEl, setAnchorEl] = useState(null); const openMenu = Boolean(anchorEl); const handleMenuOpen: MouseEventHandler = useCallback( (event) => { setAnchorEl(event.currentTarget); }, [], ); const handleMenuClose = useCallback(() => { setAnchorEl(null); }, []); const handleLogout = useCallback(async () => { console.log("Logging out user..."); await api?.logout(); createApi(api?.basePath ?? "", undefined); resetCurrentUser(); delUser(); sessionStorage.removeItem("accessToken"); queryClient.clear(); await router.invalidate(); setAnchorEl(null); navigate({ to: "/login", replace: true }); }, [api, createApi, navigate, queryClient, resetCurrentUser, router]); const menuButtonSx = useMemo(() => ({ p: 0 }), []); const menuStyle = useMemo(() => ({ mt: 2 }), []); return (
    {!!user?.Id && (user?.PrimaryImageTag === undefined ? ( account_circle ) : ( account_circle ))} { handleLogout(); handleMenuClose(); }} > logout Logout { navigate({ to: "/settings/preferences" }); handleMenuClose(); }} > tune Preferences { navigate({ to: "/settings/about" }); handleMenuClose(); }} > info About
    ); }; ================================================ FILE: src/components/utils/easterEgg.tsx ================================================ import React, { useCallback, useMemo } from "react"; import { Dialog, Slide } from "@mui/material"; // import { useKonamiEasterEgg } from "../../utils/misc/konami"; export const EasterEgg = () => { // const [easterEgg, setEasterEgg] = useKonamiEasterEgg(); // // Memoize the onClose function // const handleClose = useCallback(() => { // setEasterEgg(false); // }, [setEasterEgg]); // // Memoize the sx object // const dialogSx = useMemo( // () => ({ // background: "black", // }), // [], // ); // return ( // <> // //