diff --git a/.claude/commands/reflect.md b/.claude/commands/reflect.md new file mode 100644 index 00000000..2ee23479 --- /dev/null +++ b/.claude/commands/reflect.md @@ -0,0 +1,37 @@ +--- +description: Reflect on this session to extract and store learned facts about the codebase +--- + +Analyze the current conversation to extract useful facts that should be remembered for future sessions. Focus on: + +1. **Corrections**: Things the user corrected you about +2. **Clarifications**: Misunderstandings about how the codebase works +3. **Patterns**: Important conventions or patterns you learned +4. **Gotchas**: Surprising behaviors or edge cases discovered +5. **Locations**: Files or code that was hard to find + +## Instructions + +1. Read the existing facts file at `.claude/learned-facts.md` +2. Review this conversation for learnings worth preserving +3. For each new fact: + - Write it concisely (1-2 sentences max) + - Include context for why it matters + - Add today's date +4. Skip facts that duplicate existing entries +5. Append new facts to `.claude/learned-facts.md` + +## Fact Format + +Use this format for each fact: +``` +- **[Brief Topic]**: [Concise description of the fact] _(YYYY-MM-DD)_ +``` + +## Example Facts + +- **State management**: Use Jotai atoms for global state, NOT React Context - atoms are in `utils/atoms/` _(2025-01-09)_ +- **Package manager**: Always use `bun`, never npm or yarn - the project is configured for bun only _(2025-01-09)_ +- **TV platform**: Check `Platform.isTV` for TV-specific code paths, not just OS checks _(2025-01-09)_ + +After updating the file, summarize what facts you added (or note if nothing new was learned this session). diff --git a/.claude/learned-facts.md b/.claude/learned-facts.md new file mode 100644 index 00000000..0dba9d7e --- /dev/null +++ b/.claude/learned-facts.md @@ -0,0 +1,27 @@ +# Learned Facts + +This file contains facts about the codebase learned from past sessions. These are things Claude got wrong or needed clarification on, stored here to prevent the same mistakes in future sessions. + +This file is auto-imported into CLAUDE.md and loaded at the start of each session. + +## Facts + + + +- **Native bottom tabs + useRouter conflict**: When using `@bottom-tabs/react-navigation` with Expo Router, avoid using the `useRouter()` hook in components rendered at the provider level (outside the tab navigator). The hook subscribes to navigation state changes and can cause unexpected tab switches. Use the static `router` import from `expo-router` instead. _(2025-01-09)_ + +- **IntroSheet rendering location**: The `IntroSheet` component is rendered inside `IntroSheetProvider` which wraps the entire navigation stack. Any hooks in IntroSheet that interact with navigation state can affect the native bottom tabs. _(2025-01-09)_ + +- **Intro modal trigger location**: The intro modal trigger logic should be in the `Home.tsx` component, not in the tabs `_layout.tsx`. Triggering modals from tab layout can interfere with native bottom tabs navigation. _(2025-01-09)_ + +- **Tab folder naming**: The tab folders use underscore prefix naming like `(_home)` instead of just `(home)` based on the project's file structure conventions. _(2025-01-09)_ + +- **macOS header buttons fix**: Header buttons (`headerRight`/`headerLeft`) don't respond to touches on macOS Catalyst builds when using standard React Native `TouchableOpacity`. Fix by using `Pressable` from `react-native-gesture-handler` instead. The library is already installed and `GestureHandlerRootView` wraps the app. _(2026-01-10)_ + +- **Header button locations**: Header buttons are defined in multiple places: `app/(auth)/(tabs)/(home)/_layout.tsx` (SettingsButton, SessionsButton, back buttons), `components/common/HeaderBackButton.tsx` (reusable), `components/Chromecast.tsx`, `components/RoundButton.tsx`, and dynamically via `navigation.setOptions()` in `components/home/Home.tsx` and `app/(auth)/(tabs)/(home)/downloads/index.tsx`. _(2026-01-10)_ + +- **useNetworkAwareQueryClient limitations**: The `useNetworkAwareQueryClient` hook uses `Object.create(queryClient)` which breaks QueryClient methods that use JavaScript private fields (like `getQueriesData`, `setQueriesData`, `setQueryData`). Only use it when you ONLY need `invalidateQueries`. For cache manipulation, use standard `useQueryClient` from `@tanstack/react-query`. _(2026-01-10)_ + +- **Mark as played flow**: The "mark as played" button uses `PlayedStatus` component โ†’ `useMarkAsPlayed` hook โ†’ `usePlaybackManager.markItemPlayed()`. The hook does optimistic updates via `setQueriesData` before calling the API. Located in `components/PlayedStatus.tsx` and `hooks/useMarkAsPlayed.ts`. _(2026-01-10)_ + +- **Stack screen header configuration**: Sub-pages under `(home)` need explicit `Stack.Screen` entries in `app/(auth)/(tabs)/(home)/_layout.tsx` with `headerTransparent: Platform.OS === "ios"`, `headerBlurEffect: "none"`, and a back button. Without this, pages show with wrong header styling. _(2026-01-10)_ \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/issue_report.yml b/.github/ISSUE_TEMPLATE/issue_report.yml index 29904bd3..ccdb0d0e 100644 --- a/.github/ISSUE_TEMPLATE/issue_report.yml +++ b/.github/ISSUE_TEMPLATE/issue_report.yml @@ -77,13 +77,8 @@ body: label: Streamyfin Version description: What version of Streamyfin are you running? options: + - 0.47.1 - 0.30.2 - - 0.29.0 - - 0.28.0 - - 0.27.0 - - 0.26.1 - - 0.26.0 - - 0.25.0 - older - TestFlight/Development build validations: @@ -116,4 +111,4 @@ body: id: additional-info attributes: label: Additional information - description: Any additional context that might help us understand and reproduce the issue. \ No newline at end of file + description: Any additional context that might help us understand and reproduce the issue. diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 2111dd2e..1037334b 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -3,7 +3,7 @@ ## Project Overview Streamyfin is a cross-platform Jellyfin video streaming client built with Expo (React Native). -It supports mobile (iOS/Android) and TV platforms, integrates with Jellyfin and Jellyseerr APIs, +It supports mobile (iOS/Android) and TV platforms, integrates with Jellyfin and Seerr APIs, and provides seamless media streaming with offline capabilities and Chromecast support. ## Main Technologies diff --git a/.github/crowdin.yml b/.github/crowdin.yml deleted file mode 100644 index 4acc3208..00000000 --- a/.github/crowdin.yml +++ /dev/null @@ -1,12 +0,0 @@ -"project_id_env": "CROWDIN_PROJECT_ID" -"api_token_env": "CROWDIN_PERSONAL_TOKEN" -"base_path": "." - -"preserve_hierarchy": true - -"files": [ - { - "source": "translations/en.json", - "translation": "translations/%two_letters_code%.json" - } -] \ No newline at end of file diff --git a/.github/workflows/build-apps.yml b/.github/workflows/build-apps.yml index c0aae509..5c8caa67 100644 --- a/.github/workflows/build-apps.yml +++ b/.github/workflows/build-apps.yml @@ -21,7 +21,7 @@ jobs: steps: - name: ๐Ÿ“ฅ Checkout code - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} fetch-depth: 0 @@ -29,12 +29,12 @@ jobs: show-progress: false - name: ๐Ÿž Setup Bun - uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 + uses: oven-sh/setup-bun@b7a1c7ccf290d58743029c4f6903da283811b979 # v2.1.0 with: bun-version: latest - name: ๐Ÿ’พ Cache Bun dependencies - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: path: ~/.bun/install/cache key: ${{ runner.os }}-${{ runner.arch }}-bun-develop-${{ hashFiles('bun.lock') }} @@ -48,7 +48,7 @@ jobs: bun run submodule-reload - name: ๐Ÿ’พ Cache Gradle global - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: path: | ~/.gradle/caches @@ -61,7 +61,7 @@ jobs: run: bun run prebuild - name: ๐Ÿ’พ Cache project Gradle (.gradle) - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: path: android/.gradle key: ${{ runner.os }}-android-gradle-develop-${{ hashFiles('android/**/build.gradle', 'android/gradle/wrapper/gradle-wrapper.properties') }} @@ -76,7 +76,7 @@ jobs: run: echo "DATE_TAG=$(date +%d-%m-%Y_%H-%M-%S)" >> $GITHUB_ENV - name: ๐Ÿ“ค Upload APK artifact - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: streamyfin-android-phone-apk-${{ env.DATE_TAG }} path: | @@ -92,7 +92,7 @@ jobs: steps: - name: ๐Ÿ“ฅ Checkout code - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} fetch-depth: 0 @@ -100,12 +100,12 @@ jobs: show-progress: false - name: ๐Ÿž Setup Bun - uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 + uses: oven-sh/setup-bun@b7a1c7ccf290d58743029c4f6903da283811b979 # v2.1.0 with: bun-version: latest - name: ๐Ÿ’พ Cache Bun dependencies - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: path: ~/.bun/install/cache key: ${{ runner.os }}-${{ runner.arch }}-bun-develop-${{ hashFiles('bun.lock') }} @@ -119,7 +119,7 @@ jobs: bun run submodule-reload - name: ๐Ÿ’พ Cache Gradle global - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: path: | ~/.gradle/caches @@ -132,7 +132,7 @@ jobs: run: bun run prebuild:tv - name: ๐Ÿ’พ Cache project Gradle (.gradle) - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: path: android/.gradle key: ${{ runner.os }}-android-gradle-develop-${{ hashFiles('android/**/build.gradle', 'android/gradle/wrapper/gradle-wrapper.properties') }} @@ -147,7 +147,7 @@ jobs: run: echo "DATE_TAG=$(date +%d-%m-%Y_%H-%M-%S)" >> $GITHUB_ENV - name: ๐Ÿ“ค Upload APK artifact - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: streamyfin-android-tv-apk-${{ env.DATE_TAG }} path: | @@ -163,7 +163,7 @@ jobs: steps: - name: ๐Ÿ“ฅ Checkout code - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} fetch-depth: 0 @@ -171,12 +171,12 @@ jobs: show-progress: false - name: ๐Ÿž Setup Bun - uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 + uses: oven-sh/setup-bun@b7a1c7ccf290d58743029c4f6903da283811b979 # v2.1.0 with: bun-version: latest - name: ๐Ÿ’พ Cache Bun dependencies - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: path: ~/.bun/install/cache key: ${{ runner.os }}-bun-cache-${{ hashFiles('bun.lock') }} @@ -215,7 +215,7 @@ jobs: run: echo "DATE_TAG=$(date +%d-%m-%Y_%H-%M-%S)" >> $GITHUB_ENV - name: ๐Ÿ“ค Upload IPA artifact - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: streamyfin-ios-phone-ipa-${{ env.DATE_TAG }} path: build-*.ipa diff --git a/.github/workflows/check-lockfile.yml b/.github/workflows/check-lockfile.yml index cc606b19..2173ccfc 100644 --- a/.github/workflows/check-lockfile.yml +++ b/.github/workflows/check-lockfile.yml @@ -19,7 +19,7 @@ jobs: steps: - name: ๐Ÿ“ฅ Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} show-progress: false @@ -27,12 +27,12 @@ jobs: fetch-depth: 0 - name: ๐Ÿž Setup Bun - uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 + uses: oven-sh/setup-bun@b7a1c7ccf290d58743029c4f6903da283811b979 # v2.1.0 with: bun-version: latest - name: ๐Ÿ’พ Cache Bun dependencies - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: path: | ~/.bun/install/cache diff --git a/.github/workflows/ci-codeql.yml b/.github/workflows/ci-codeql.yml index d1a44239..b9fb8c59 100644 --- a/.github/workflows/ci-codeql.yml +++ b/.github/workflows/ci-codeql.yml @@ -24,20 +24,16 @@ jobs: steps: - name: ๐Ÿ“ฅ Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - ref: ${{ github.event.pull_request.head.sha || github.sha }} - show-progress: false - fetch-depth: 0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: ๐Ÿ Initialize CodeQL - uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 + uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 with: languages: ${{ matrix.language }} queries: +security-extended,security-and-quality - name: ๐Ÿ› ๏ธ Autobuild - uses: github/codeql-action/autobuild@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 + uses: github/codeql-action/autobuild@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 - name: ๐Ÿงช Perform CodeQL Analysis - uses: github/codeql-action/analyze@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 + uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index a49669ad..69a3c86d 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -23,12 +23,12 @@ jobs: steps: - name: ๐Ÿ“ฅ Checkout Repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: fetch-depth: 0 - name: ๐ŸŒ Sync Translations with Crowdin - uses: crowdin/github-action@08713f00a50548bfe39b37e8f44afb53e7a802d4 # v2.12.0 + uses: crowdin/github-action@60debf382ee245b21794321190ad0501db89d8c1 # v2.13.0 with: upload_sources: true upload_translations: true @@ -40,11 +40,12 @@ jobs: pull_request_base_branch_name: "develop" pull_request_labels: "๐ŸŒ translation" # Quality control options - skip_untranslated_strings: true + skip_untranslated_strings: false + skip_untranslated_files: false export_only_approved: false # Commit customization commit_message: "feat(i18n): update translations from Crowdin" env: - GITHUB_TOKEN: ${{ secrets.CROWDIN_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 55001958..43bb3418 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -51,7 +51,7 @@ jobs: contents: read steps: - name: Checkout Repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} fetch-depth: 0 @@ -69,14 +69,14 @@ jobs: runs-on: ubuntu-24.04 steps: - name: ๐Ÿ›’ Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} submodules: recursive fetch-depth: 0 - name: ๐Ÿž Setup Bun - uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 + uses: oven-sh/setup-bun@b7a1c7ccf290d58743029c4f6903da283811b979 # v2.1.0 with: bun-version: latest @@ -100,19 +100,19 @@ jobs: steps: - name: "๐Ÿ“ฅ Checkout PR code" - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} submodules: recursive fetch-depth: 0 - name: "๐ŸŸข Setup Node.js" - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: '24.x' - name: "๐Ÿž Setup Bun" - uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 + uses: oven-sh/setup-bun@b7a1c7ccf290d58743029c4f6903da283811b979 # v2.1.0 with: bun-version: latest diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 34537097..00000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: ๐Ÿ•’ Handle Stale Issues - -on: - schedule: - # Runs daily at 1:30 AM UTC (3:30 AM CEST - France time) - - cron: "30 1 * * *" - -jobs: - stale-issues: - name: ๐Ÿ—‘๏ธ Cleanup Stale Issues - runs-on: ubuntu-24.04 - permissions: - issues: write - pull-requests: write - - steps: - - name: ๐Ÿ”„ Mark/Close Stale Issues - uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0 - with: - # Global settings - repo-token: ${{ secrets.GITHUB_TOKEN }} - operations-per-run: 500 # Increase if you have >1000 issues - enable-statistics: true - - # Issue configuration - days-before-issue-stale: 90 - days-before-issue-close: 7 - stale-issue-label: "๐Ÿ•ฐ๏ธ stale" - exempt-issue-labels: "Roadmap v1,help needed,enhancement" - - # Notifications messages - stale-issue-message: | - โณ This issue has been automatically marked as **stale** because it has had no activity for 90 days. - - **Next steps:** - - If this is still relevant, add a comment to keep it open - - Otherwise, it will be closed in 7 days - - Thank you for your contributions! ๐Ÿ™Œ - - close-issue-message: | - ๐Ÿšฎ This issue has been automatically closed due to inactivity (7 days since being marked stale). - - **Need to reopen?** - Click "Reopen" and add a comment explaining why this should stay open. - - # Disable PR handling - days-before-pr-stale: -1 - days-before-pr-close: -1 diff --git a/.github/workflows/update-issue-form.yml b/.github/workflows/update-issue-form.yml index dc76a074..21615767 100644 --- a/.github/workflows/update-issue-form.yml +++ b/.github/workflows/update-issue-form.yml @@ -18,10 +18,10 @@ jobs: steps: - name: ๐Ÿ“ฅ Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: "๐ŸŸข Setup Node.js" - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 + uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: '24.x' cache: 'npm' @@ -54,7 +54,7 @@ jobs: dry_run: no-push - name: ๐Ÿ“ฌ Commit and create pull request - uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e #v7.0.8 + uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0 with: add-paths: .github/ISSUE_TEMPLATE/bug_report.yml branch: ci-update-bug-report diff --git a/.gitignore b/.gitignore index 2813f770..c022785c 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,7 @@ web-build/ /androidtv # Module-specific Builds -modules/vlc-player/android/build +modules/mpv-player/android/build modules/player/android modules/hls-downloader/android/build @@ -51,6 +51,7 @@ npm-debug.* .ruby-lsp .cursor/ .claude/ +CLAUDE.md # Environment and Configuration expo-env.d.ts @@ -66,3 +67,6 @@ streamyfin-4fec1-firebase-adminsdk.json # Version and Backup Files /version-backup-* modules/background-downloader/android/build/* +/modules/sf-player/android/build +/modules/music-controls/android/build +/modules/mpv-player/android/build diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..cc3b0a53 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,136 @@ +# CLAUDE.md + +@.claude/learned-facts.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +Streamyfin is a cross-platform Jellyfin video streaming client built with Expo (React Native). It supports mobile (iOS/Android) and TV platforms, with features including offline downloads, Chromecast support, and Jellyseerr integration. + +## Development Commands + +**CRITICAL: Always use `bun` for package management. Never use `npm`, `yarn`, or `npx`.** + +```bash +# Setup +bun i && bun run submodule-reload + +# Development builds +bun run prebuild # Mobile prebuild +bun run ios # Run iOS +bun run android # Run Android + +# TV builds (suffix with :tv) +bun run prebuild:tv +bun run ios:tv +bun run android:tv + +# Code quality +bun run typecheck # TypeScript check +bun run check # BiomeJS check +bun run lint # BiomeJS lint + fix +bun run format # BiomeJS format +bun run test # Run all checks (typecheck, lint, format, doctor) + +# iOS-specific +bun run ios:install-metal-toolchain # Fix "missing Metal Toolchain" build errors +``` + +## Tech Stack + +- **Runtime**: Bun +- **Framework**: React Native (Expo SDK 54) +- **Language**: TypeScript (strict mode) +- **State Management**: Jotai (global state atoms) + React Query (server state) +- **API**: Jellyfin SDK (`@jellyfin/sdk`) +- **Navigation**: Expo Router (file-based) +- **Linting/Formatting**: BiomeJS +- **Storage**: react-native-mmkv + +## Architecture + +### File Structure + +- `app/` - Expo Router screens with file-based routing +- `components/` - Reusable UI components +- `providers/` - React Context providers +- `hooks/` - Custom React hooks +- `utils/` - Utilities including Jotai atoms +- `modules/` - Native modules (vlc-player, mpv-player, background-downloader) +- `translations/` - i18n translation files + +### Key Patterns + +**State Management**: +- Global state uses Jotai atoms in `utils/atoms/` +- `settingsAtom` in `utils/atoms/settings.ts` for app settings +- `apiAtom` and `userAtom` in `providers/JellyfinProvider.tsx` for auth state +- Server state uses React Query with `@tanstack/react-query` + +**Jellyfin API Access**: +- Use `apiAtom` from `JellyfinProvider` for authenticated API calls +- Access user via `userAtom` +- Use Jellyfin SDK utilities from `@jellyfin/sdk/lib/utils/api` + +**Navigation**: +- File-based routing in `app/` directory +- Tab navigation: `(home)`, `(search)`, `(favorites)`, `(libraries)`, `(watchlists)` +- Shared routes use parenthesized groups like `(home,libraries,search,favorites,watchlists)` +- **IMPORTANT**: Always use `useAppRouter` from `@/hooks/useAppRouter` instead of `useRouter` from `expo-router`. This custom hook automatically handles offline mode state preservation across navigation: + ```typescript + // โœ… Correct + import useRouter from "@/hooks/useAppRouter"; + const router = useRouter(); + + // โŒ Never use this + import { useRouter } from "expo-router"; + import { router } from "expo-router"; + ``` + +**Offline Mode**: +- Use `OfflineModeProvider` from `@/providers/OfflineModeProvider` to wrap pages that support offline content +- Use `useOfflineMode()` hook to check if current context is offline +- The `useAppRouter` hook automatically injects `offline=true` param when navigating within an offline context + +**Providers** (wrapping order in `app/_layout.tsx`): +1. JotaiProvider +2. QueryClientProvider +3. JellyfinProvider (auth, API) +4. NetworkStatusProvider +5. PlaySettingsProvider +6. WebSocketProvider +7. DownloadProvider +8. MusicPlayerProvider + +### Native Modules + +Located in `modules/`: +- `vlc-player` - VLC video player integration +- `mpv-player` - MPV video player integration (iOS) +- `background-downloader` - Background download functionality +- `sf-player` - Swift player module + +### Path Aliases + +Use `@/` prefix for imports (configured in `tsconfig.json`): +```typescript +import { useSettings } from "@/utils/atoms/settings"; +import { apiAtom } from "@/providers/JellyfinProvider"; +``` + +## Coding Standards + +- Use TypeScript for all files (no .js) +- Use functional React components with hooks +- Use Jotai atoms for global state, React Query for server state +- Follow BiomeJS formatting rules (2-space indent, semicolons, LF line endings) +- Handle both mobile and TV navigation patterns +- Use existing atoms, hooks, and utilities before creating new ones +- Use Conventional Commits: `feat(scope):`, `fix(scope):`, `chore(scope):` + +## Platform Considerations + +- TV version uses `:tv` suffix for scripts +- Platform checks: `Platform.isTV`, `Platform.OS === "android"` or `"ios"` +- Some features disabled on TV (e.g., notifications, Chromecast) diff --git a/README.md b/README.md index 90349db4..fbbf8561 100644 --- a/README.md +++ b/README.md @@ -16,53 +16,75 @@     - +

## ๐ŸŒŸ Features -- ๐Ÿš€ **Skip Intro / Credits Support**: Lets you quickly skip intros and credits during playback -- ๐Ÿ–ผ๏ธ **Trickplay images**: The new golden standard for chapter previews when seeking -- ๐Ÿ“ฅ **Download media**: Save your media locally and watch it offline -- โš™๏ธ **Settings management**: Manage app configurations for all users through our plugin -- ๐Ÿค– **Seerr (formerly Jellyseerr) integration**: Request media directly in the app -- ๐Ÿ‘๏ธ **Sessions view:** View all active sessions currently streaming on your server +### ๐ŸŽฌ Media Playback +- ๐Ÿš€ **Skip Intro / Credits**: Automatically skip intros and credits during playback +- ๐Ÿ–ผ๏ธ **Trickplay Images**: Chapter previews with thumbnails when seeking +- ๐ŸŽต **Music Library**: Full support for music playback with playlists and queue management +- ๐Ÿ“บ **Live TV**: Watch and record live television streams - ๐Ÿ“ก **Chromecast**: Cast your media to any Chromecast-enabled device +- ๐ŸŽฅ **MPV Player**: Powerful open-source player with wide format support -## ๐Ÿงช Experimental Features +### ๐Ÿ“ฑ Media Management +- ๐Ÿ“ฅ **Download Media**: Save movies, shows, and music locally for offline viewing +- โญ **Favorites**: Quick access to your favorite content +- ๐Ÿ“‹ **Watchlists**: Create and manage custom watchlists with Streamystats integration +- ๐Ÿ”– **Continue Watching**: Pick up right where you left off +- ๐ŸŽฏ **Next Up**: Smart suggestions for your next episode -Streamyfin offers exciting experimental features such as media downloading and Chromecast support. These features are under active development, and your feedback and patience help us make them even better. +### โš™๏ธ Advanced Features +- ๐Ÿค– **Seerr Integration**: Request new media directly in the app +- ๐Ÿ” **Smart Search**: Powerful search with Marlin Search and Streamystats support +- ๐Ÿ‘๏ธ **Active Sessions**: View all active streams on your server +- ๐ŸŒ **Multi-Language**: Available in 20+ languages with Crowdin integration +- ๐ŸŽจ **Customizable**: Personalize your home screen and settings +- ๐Ÿ”Œ **Plugin System**: Centralized settings sync across all devices via Jellyfin plugin -### ๐Ÿ“ฅ Downloading +## ๐Ÿงฉ How It Works + +### ๐Ÿ“ฅ Downloads Downloading works by using FFmpeg to convert an HLS stream into a video file on your device. This lets you download and watch any content that you can stream. The conversion is handled in real time by Jellyfin on the server during the download. While this may take a bit longer, it ensures compatibility with any file your server can transcode. ### ๐Ÿงฉ Streamyfin Plugin -The Jellyfin Plugin for Streamyfin is a plugin you install into Jellyfin that holds all settings for the client Streamyfin. This allows you to synchronize settings across all your users, like for example: +The Jellyfin Plugin for Streamyfin synchronizes settings across all your devices and users. Install it on your Jellyfin server to enable: - Automatic Seerr login with no user input required -- Set your preferred default languages -- Configure download method and search provider -- Personalize your home screen +- Default language preferences for audio and subtitles +- Configure download settings and search providers (Marlin, Streamystats) +- Customize your home screen layout and sections +- Centralized configuration management - And much more [Streamyfin Plugin](https://github.com/streamyfin/jellyfin-plugin-streamyfin) -### ๐Ÿ“ก Chromecast +### ๐ŸŽฌ MPV Player -Chromecast support is currently under development. Video casting is already available, and we're actively working on adding subtitle support and additional features. +Streamyfin uses [MPV](https://mpv.io/) as its primary video player on all platforms, powered by [MPVKit](https://github.com/mpvkit/MPVKit). MPV is a powerful, open-source media player known for its wide format support and high-quality playback. -### ๐Ÿ” Jellysearch +Thanks to [@Alexk2309](https://github.com/Alexk2309) for the hard work building the native MPV module in Streamyfin. -[Jellysearch](https://gitlab.com/DomiStyle/jellysearch) works with Streamyfin +### ๐ŸŽต Music Library -> A fast full-text search proxy for Jellyfin. Integrates seamlessly with most Jellyfin clients. +Full music library support with playlists, queue management, background playback, and offline downloads. + +### ๐Ÿ” Search Providers + +Streamyfin supports multiple search providers: + +- **Marlin Search**: Fast semantic search for your Jellyfin library +- **Streamystats**: Advanced statistics and personalized recommendations +- **Jellysearch**: Fast full-text search proxy ([Jellysearch](https://gitlab.com/DomiStyle/jellysearch)) ## ๐Ÿ›ฃ๏ธ Roadmap -Check out our [Roadmap](https://github.com/users/fredrikburmester/projects/5) To see what we're working on next, we are always open to feedback and suggestions. Please let us know if you have any ideas or feature requests. +Check out our [Roadmap](https://github.com/users/fredrikburmester/projects/5) to see what we're working on next. We are always open to feedback and suggestions. Please let us know if you have any ideas or feature requests. ## ๐Ÿ“ฅ Download Streamyfin @@ -70,6 +92,7 @@ Check out our [Roadmap](https://github.com/users/fredrikburmester/projects/5) To Get Streamyfin on App Store Get Streamyfin on Google Play Store Get Streamyfin on Github + Add Streamyfin to Obtainium ### ๐Ÿงช Beta Testing @@ -101,12 +124,13 @@ You can contribute translations directly on our [Crowdin project page](https://c ### ๐Ÿ‘จโ€๐Ÿ’ป Development Info -1. Use node `>20` -2. Install dependencies `bun i && bun run submodule-reload` -3. Make sure you have xcode and/or android studio installed. (follow the guides for expo: https://docs.expo.dev/workflow/android-studio-emulator/) -4. Install BiomeJS extension in VSCode/Your IDE (https://biomejs.dev/) -4. run `npm run prebuild` -5. Create an expo dev build by running `npm run ios` or `npm run android`. This will open a simulator on your computer and run the app +1. Use Node.js `>20` +2. Install dependencies: `bun i && bun run submodule-reload` +3. Make sure you have Xcode and/or Android Studio installed ([Expo setup guide](https://docs.expo.dev/workflow/android-studio-emulator/)) + - If iOS builds fail with `missing Metal Toolchain` (KSPlayer shaders), run `npm run ios:install-metal-toolchain` once +4. Install the [BiomeJS extension](https://biomejs.dev/) in your IDE +5. Run `npm run prebuild` +6. Create an Expo dev build by running `npm run ios` or `npm run android`. This will open a simulator on your computer and run the app For the TV version suffix the npm commands with `:tv`. @@ -124,10 +148,20 @@ Need assistance or have any questions? ## โ“ FAQ -1. Q: Why can't I see my libraries in Streamyfin? - A: Make sure your server is running one of the latest versions and that you have at least one library that isn't audio only -2. Q: Why can't I see my music library? - A: We don't currently support music and are unlikely to support music in the near future +1. **Q: Why can't I see my libraries in Streamyfin?** + A: Ensure your Jellyfin server is running a recent version (10.10.0+) and that you have proper permissions to access the libraries. + +2. **Q: How do I enable downloads?** + A: Downloads use FFmpeg to convert HLS streams. Ensure your server has transcoding enabled and sufficient resources. + +3. **Q: Does Streamyfin support subtitles?** + A: Yes, with full customization including size, color, position, and automatic language selection. + +4. **Q: Can I use Streamyfin on Apple TV or Android TV?** + A: Yes, Streamyfin has dedicated TV builds optimized for remote control navigation. Please note that TV platforms are currently in early development and not very stable. Android TV is currently the most reliable platform for testing. + +5. **Q: How do I set up Seerr integration?** + A: Go to Settings โ†’ Plugins โ†’ Seerr, enter your server URL and Jellyfin credentials. ## ๐Ÿ“ Credits @@ -228,6 +262,7 @@ We also thank all other developers who have contributed to Streamyfin, your effo A special mention to the following people and projects for their contributions: +- [@Alexk2309](https://github.com/Alexk2309) for building the native MPV module that integrates [MPVKit](https://github.com/mpvkit/MPVKit) with React Native - [Reiverr](https://github.com/aleksilassila/reiverr) for invaluable help with understanding the Jellyfin API - [Jellyfin TS SDK](https://github.com/jellyfin/jellyfin-sdk-typescript) for providing the TypeScript SDK - [Seerr](https://github.com/seerr-team/seerr) for enabling API integration with their project @@ -240,7 +275,9 @@ A special mention to the following people and projects for their contributions: ## ๐Ÿ“„ License Streamyfin is licensed under the Mozilla Public License 2.0 (MPL-2.0). + This means you are free to use, modify, and distribute this software. The MPL-2.0 is a copyleft license that allows for more flexibility in combining the software with proprietary code. + Key points of the MPL-2.0: - You can use the software for any purpose @@ -249,10 +286,13 @@ Key points of the MPL-2.0: - You must disclose your source code for any modifications to the covered files - Larger works may combine MPL code with code under other licenses - MPL-licensed components must remain under the MPL, but the larger work can be under a different license -- For the full text of the license, please see the LICENSE file in this repository + +For the full text of the license, please see the LICENSE file in this repository. ## โš ๏ธ Disclaimer + Streamyfin does not promote, support, or condone piracy in any form. The app is intended solely for streaming media that you personally own and control. It does not provide or include any media content. Any discussions, support requests, or references to piracy, as well as any tools, software, or websites related to piracy, are strictly prohibited across all our channels. ## ๐Ÿค Sponsorship -VPS hosting generously provided by [Hexabyte](https://hexabyte.se/en/vps/?currency=eur) and [SweHosting](https://swehosting.se/en/#tj%C3%A4nster) + +VPS hosting generously provided by [Hexabyte](https://hexabyte.se/en/vps/?currency=eur) and [SweHosting](https://swehosting.se/en/#tj%C3%A4nster). diff --git a/app.json b/app.json index 5d4e9f4a..288f3e3a 100644 --- a/app.json +++ b/app.json @@ -2,7 +2,7 @@ "expo": { "name": "Streamyfin", "slug": "streamyfin", - "version": "0.48.0", + "version": "0.52.0", "orientation": "default", "icon": "./assets/images/icon.png", "scheme": "streamyfin", @@ -17,6 +17,7 @@ "NSMicrophoneUsageDescription": "The app needs access to your microphone.", "UIBackgroundModes": ["audio", "fetch"], "NSLocalNetworkUsageDescription": "The app needs access to your local network to connect to your Jellyfin server.", + "NSLocationWhenInUseUsageDescription": "Streamyfin uses your location to detect your home WiFi network for automatic local server switching.", "NSAppTransportSecurity": { "NSAllowsArbitraryLoads": true }, @@ -28,13 +29,16 @@ "usesNonExemptEncryption": false }, "supportsTablet": true, + "entitlements": { + "com.apple.developer.networking.wifi-info": true + }, "bundleIdentifier": "com.fredrikburmester.streamyfin", "icon": "./assets/images/icon-ios-liquid-glass.icon", "appleTeamId": "MWD5K362T8" }, "android": { "jsEngine": "hermes", - "versionCode": 85, + "versionCode": 92, "adaptiveIcon": { "foregroundImage": "./assets/images/icon-android-plain.png", "monochromeImage": "./assets/images/icon-android-themed.png", @@ -44,7 +48,8 @@ "permissions": [ "android.permission.FOREGROUND_SERVICE", "android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK", - "android.permission.WRITE_SETTINGS" + "android.permission.WRITE_SETTINGS", + "android.permission.ACCESS_FINE_LOCATION" ], "blockedPermissions": ["android.permission.ACTIVITY_RECOGNITION"], "googleServicesFile": "./google-services.json" @@ -53,19 +58,7 @@ "@react-native-tvos/config-tv", "expo-router", "expo-font", - [ - "react-native-video", - { - "enableNotificationControls": true, - "enableBackgroundAudio": true, - "androidExtensions": { - "useExoplayerRtsp": false, - "useExoplayerSmoothStreaming": false, - "useExoplayerHls": true, - "useExoplayerDash": false - } - } - ], + "./plugins/withExcludeMedia3Dash.js", [ "expo-build-properties", { @@ -75,11 +68,11 @@ }, "android": { "buildArchs": ["arm64-v8a", "x86_64"], - "compileSdkVersion": 35, + "compileSdkVersion": 36, "targetSdkVersion": 35, "buildToolsVersion": "35.0.0", "kotlinVersion": "2.0.21", - "minSdkVersion": 24, + "minSdkVersion": 26, "usesCleartextTraffic": true, "packagingOptions": { "jniLibs": { @@ -97,12 +90,6 @@ "initialOrientation": "DEFAULT" } ], - [ - "expo-sensors", - { - "motionPermission": "Allow Streamyfin to access your device motion for landscape video watching." - } - ], "expo-localization", "expo-asset", [ @@ -133,7 +120,14 @@ ["./plugins/withChangeNativeAndroidTextToWhite.js"], ["./plugins/withAndroidManifest.js"], ["./plugins/withTrustLocalCerts.js"], - ["./plugins/withGradleProperties.js"] + ["./plugins/withGradleProperties.js"], + [ + "./plugins/withGitPod.js", + { + "podName": "MPVKit-GPL", + "podspecUrl": "https://raw.githubusercontent.com/streamyfin/MPVKit/0.40.0-av/MPVKit-GPL.podspec" + } + ] ], "experiments": { "typedRoutes": true diff --git a/app/(auth)/(tabs)/(custom-links)/index.tsx b/app/(auth)/(tabs)/(custom-links)/index.tsx index 7dad5453..8dbb1866 100644 --- a/app/(auth)/(tabs)/(custom-links)/index.tsx +++ b/app/(auth)/(tabs)/(custom-links)/index.tsx @@ -29,7 +29,7 @@ export default function menuLinks() { ); const config = response?.data; - if (!config && !Object.hasOwn(config, "menuLinks")) { + if (!config || !Object.hasOwn(config, "menuLinks")) { console.error("Menu links not found"); return; } diff --git a/app/(auth)/(tabs)/(favorites)/see-all.tsx b/app/(auth)/(tabs)/(favorites)/see-all.tsx new file mode 100644 index 00000000..e3b0198a --- /dev/null +++ b/app/(auth)/(tabs)/(favorites)/see-all.tsx @@ -0,0 +1,212 @@ +import type { Api } from "@jellyfin/sdk"; +import type { + BaseItemDto, + BaseItemKind, +} from "@jellyfin/sdk/lib/generated-client"; +import { getItemsApi } from "@jellyfin/sdk/lib/utils/api"; +import { FlashList } from "@shopify/flash-list"; +import { useInfiniteQuery } from "@tanstack/react-query"; +import { Stack, useLocalSearchParams } from "expo-router"; +import { t } from "i18next"; +import { useAtom } from "jotai"; +import { useCallback, useMemo } from "react"; +import { useWindowDimensions, View } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Text } from "@/components/common/Text"; +import { TouchableItemRouter } from "@/components/common/TouchableItemRouter"; +import { ItemCardText } from "@/components/ItemCardText"; +import { Loader } from "@/components/Loader"; +import { ItemPoster } from "@/components/posters/ItemPoster"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; + +type FavoriteTypes = + | "Series" + | "Movie" + | "Episode" + | "Video" + | "BoxSet" + | "Playlist"; + +const favoriteTypes: readonly FavoriteTypes[] = [ + "Series", + "Movie", + "Episode", + "Video", + "BoxSet", + "Playlist", +] as const; + +function isFavoriteType(value: unknown): value is FavoriteTypes { + return ( + typeof value === "string" && + (favoriteTypes as readonly string[]).includes(value) + ); +} + +export default function FavoritesSeeAllScreen() { + const insets = useSafeAreaInsets(); + const { width: screenWidth } = useWindowDimensions(); + const [api] = useAtom(apiAtom); + const [user] = useAtom(userAtom); + + const searchParams = useLocalSearchParams<{ + type?: string; + title?: string; + }>(); + const typeParam = searchParams.type; + const titleParam = searchParams.title; + + const itemType = useMemo(() => { + if (!isFavoriteType(typeParam)) return null; + return typeParam as BaseItemKind; + }, [typeParam]); + + const headerTitle = useMemo(() => { + if (typeof titleParam === "string" && titleParam.trim().length > 0) + return titleParam; + return ""; + }, [titleParam]); + + const pageSize = 50; + + const fetchItems = useCallback( + async ({ pageParam }: { pageParam: number }): Promise => { + if (!api || !user?.Id || !itemType) return []; + + const response = await getItemsApi(api as Api).getItems({ + userId: user.Id, + sortBy: ["SeriesSortName", "SortName"], + sortOrder: ["Ascending"], + filters: ["IsFavorite"], + recursive: true, + fields: ["PrimaryImageAspectRatio"], + collapseBoxSetItems: false, + excludeLocationTypes: ["Virtual"], + enableTotalRecordCount: true, + startIndex: pageParam, + limit: pageSize, + includeItemTypes: [itemType], + }); + + return response.data.Items || []; + }, + [api, itemType, user?.Id], + ); + + const { data, isFetching, fetchNextPage, hasNextPage, isLoading } = + useInfiniteQuery({ + queryKey: ["favorites", "see-all", itemType], + queryFn: ({ pageParam = 0 }) => fetchItems({ pageParam }), + getNextPageParam: (lastPage, pages) => { + if (!lastPage || lastPage.length < pageSize) return undefined; + return pages.reduce((acc, page) => acc + page.length, 0); + }, + initialPageParam: 0, + enabled: !!api && !!user?.Id && !!itemType, + }); + + const flatData = useMemo(() => data?.pages.flat() ?? [], [data]); + + const nrOfCols = useMemo(() => { + if (screenWidth < 350) return 2; + if (screenWidth < 600) return 3; + if (screenWidth < 900) return 5; + return 6; + }, [screenWidth]); + + const renderItem = useCallback( + ({ item, index }: { item: BaseItemDto; index: number }) => ( + + + + + + + ), + [nrOfCols], + ); + + const keyExtractor = useCallback((item: BaseItemDto) => item.Id || "", []); + + const handleEndReached = useCallback(() => { + if (hasNextPage) { + fetchNextPage(); + } + }, [fetchNextPage, hasNextPage]); + + return ( + <> + + {!itemType ? ( + + + {t("favorites.noData", { defaultValue: "No items found." })} + + + ) : isLoading ? ( + + + + ) : ( + ( + + )} + ListEmptyComponent={ + + + {t("home.no_items", { defaultValue: "No items" })} + + + } + ListFooterComponent={ + isFetching ? ( + + + + ) : null + } + /> + )} + + ); +} diff --git a/app/(auth)/(tabs)/(home)/_layout.tsx b/app/(auth)/(tabs)/(home)/_layout.tsx index bfbebed5..761e868c 100644 --- a/app/(auth)/(tabs)/(home)/_layout.tsx +++ b/app/(auth)/(tabs)/(home)/_layout.tsx @@ -1,8 +1,10 @@ import { Feather, Ionicons } from "@expo/vector-icons"; -import { Stack, useRouter } from "expo-router"; +import { Stack } from "expo-router"; import { useTranslation } from "react-i18next"; -import { Platform, TouchableOpacity, View } from "react-native"; +import { Platform, View } from "react-native"; +import { Pressable } from "react-native-gesture-handler"; import { nestedTabPageScreenOptions } from "@/components/stacks/NestedTabPageStack"; +import useRouter from "@/hooks/useAppRouter"; const Chromecast = Platform.isTV ? null : require("@/components/Chromecast"); @@ -46,32 +48,13 @@ export default function IndexLayout() { headerTransparent: Platform.OS === "ios", title: t("home.downloads.downloads_title"), headerLeft: () => ( - _router.back()} className='pl-0.5' style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} > - - ), - }} - /> - ( - _router.back()} - className='pl-0.5' - style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} - > - - + ), }} /> @@ -84,13 +67,13 @@ export default function IndexLayout() { headerTransparent: Platform.OS === "ios", headerShadowVisible: false, headerLeft: () => ( - _router.back()} className='pl-0.5' style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} > - + ), }} /> @@ -102,13 +85,13 @@ export default function IndexLayout() { headerTransparent: Platform.OS === "ios", headerShadowVisible: false, headerLeft: () => ( - _router.back()} className='pl-0.5' style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} > - + ), }} /> @@ -120,13 +103,13 @@ export default function IndexLayout() { headerTransparent: Platform.OS === "ios", headerShadowVisible: false, headerLeft: () => ( - _router.back()} className='pl-0.5' style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} > - + ), }} /> @@ -138,13 +121,13 @@ export default function IndexLayout() { headerTransparent: Platform.OS === "ios", headerShadowVisible: false, headerLeft: () => ( - _router.back()} className='pl-0.5' style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} > - + ), }} /> @@ -156,13 +139,31 @@ export default function IndexLayout() { headerTransparent: Platform.OS === "ios", headerShadowVisible: false, headerLeft: () => ( - _router.back()} className='pl-0.5' style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} > - + + ), + }} + /> + ( + _router.back()} + className='pl-0.5' + style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} + > + + ), }} /> @@ -174,13 +175,13 @@ export default function IndexLayout() { headerTransparent: Platform.OS === "ios", headerShadowVisible: false, headerLeft: () => ( - _router.back()} className='pl-0.5' style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} > - + ), }} /> @@ -192,13 +193,13 @@ export default function IndexLayout() { headerTransparent: Platform.OS === "ios", headerShadowVisible: false, headerLeft: () => ( - _router.back()} className='pl-0.5' style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} > - + ), }} /> @@ -210,31 +211,67 @@ export default function IndexLayout() { headerTransparent: Platform.OS === "ios", headerShadowVisible: false, headerLeft: () => ( - _router.back()} className='pl-0.5' style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} > - + ), }} /> ( - _router.back()} className='pl-0.5' style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} > - + + ), + }} + /> + ( + _router.back()} + className='pl-0.5' + style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} + > + + + ), + }} + /> + ( + _router.back()} + className='pl-0.5' + style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} + > + + ), }} /> @@ -246,13 +283,13 @@ export default function IndexLayout() { headerTransparent: Platform.OS === "ios", headerShadowVisible: false, headerLeft: () => ( - _router.back()} className='pl-0.5' style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} > - + ), }} /> @@ -264,27 +301,32 @@ export default function IndexLayout() { headerTransparent: Platform.OS === "ios", headerShadowVisible: false, headerLeft: () => ( - _router.back()} className='pl-0.5' style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} > - + ), }} /> ( - _router.back()} className='pl-0.5'> + _router.back()} + className='pl-0.5' + style={{ marginRight: Platform.OS === "android" ? 16 : 0 }} + > - + ), - presentation: "modal", }} /> {Object.entries(nestedTabPageScreenOptions).map(([name, options]) => ( @@ -295,9 +337,9 @@ export default function IndexLayout() { options={{ title: "", headerLeft: () => ( - _router.back()} className='pl-0.5'> + _router.back()} className='pl-0.5'> - + ), headerShown: true, headerBlurEffect: "prominent", @@ -313,13 +355,13 @@ const SettingsButton = () => { const router = useRouter(); return ( - { router.push("/(auth)/settings"); }} > - + ); }; @@ -328,7 +370,7 @@ const SessionsButton = () => { const { sessions = [] } = useSessions({} as useSessionsProps); return ( - { router.push("/(auth)/sessions"); }} @@ -339,6 +381,6 @@ const SessionsButton = () => { color={sessions.length === 0 ? "white" : "#9333ea"} size={28} /> - + ); }; diff --git a/app/(auth)/(tabs)/(home)/downloads/[seriesId].tsx b/app/(auth)/(tabs)/(home)/downloads/[seriesId].tsx deleted file mode 100644 index e870f5c0..00000000 --- a/app/(auth)/(tabs)/(home)/downloads/[seriesId].tsx +++ /dev/null @@ -1,181 +0,0 @@ -import { Ionicons } from "@expo/vector-icons"; -import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; -import { FlashList } from "@shopify/flash-list"; -import { router, useLocalSearchParams, useNavigation } from "expo-router"; -import { useCallback, useEffect, useMemo, useState } from "react"; -import { Alert, Platform, TouchableOpacity, View } from "react-native"; -import { useSafeAreaInsets } from "react-native-safe-area-context"; -import { Text } from "@/components/common/Text"; -import { EpisodeCard } from "@/components/downloads/EpisodeCard"; -import { - SeasonDropdown, - type SeasonIndexState, -} from "@/components/series/SeasonDropdown"; -import { useDownload } from "@/providers/DownloadProvider"; -import { storage } from "@/utils/mmkv"; - -export default function page() { - const navigation = useNavigation(); - const local = useLocalSearchParams(); - const { seriesId, episodeSeasonIndex } = local as { - seriesId: string; - episodeSeasonIndex: number | string | undefined; - }; - - const [seasonIndexState, setSeasonIndexState] = useState( - {}, - ); - const { downloadedItems, deleteItems } = useDownload(); - const insets = useSafeAreaInsets(); - - const series = useMemo(() => { - try { - return ( - downloadedItems - ?.filter((f) => f.item.SeriesId === seriesId) - ?.sort( - (a, b) => - (a.item.ParentIndexNumber ?? 0) - (b.item.ParentIndexNumber ?? 0), - ) || [] - ); - } catch { - return []; - } - }, [downloadedItems, seriesId]); - - // Group episodes by season in a single pass - const seasonGroups = useMemo(() => { - const groups: Record = {}; - - series.forEach((episode) => { - const seasonNumber = episode.item.ParentIndexNumber; - if (seasonNumber !== undefined && seasonNumber !== null) { - if (!groups[seasonNumber]) { - groups[seasonNumber] = []; - } - groups[seasonNumber].push(episode.item); - } - }); - - // Sort episodes within each season - Object.values(groups).forEach((episodes) => { - episodes.sort((a, b) => (a.IndexNumber || 0) - (b.IndexNumber || 0)); - }); - - return groups; - }, [series]); - - // Get unique seasons (just the season numbers, sorted) - const uniqueSeasons = useMemo(() => { - const seasonNumbers = Object.keys(seasonGroups) - .map(Number) - .sort((a, b) => a - b); - return seasonNumbers.map((seasonNum) => seasonGroups[seasonNum][0]); // First episode of each season - }, [seasonGroups]); - - const seasonIndex = - seasonIndexState[series?.[0]?.item?.ParentId ?? ""] ?? - episodeSeasonIndex ?? - series?.[0]?.item?.ParentIndexNumber ?? - ""; - - const groupBySeason = useMemo(() => { - return seasonGroups[Number(seasonIndex)] ?? []; - }, [seasonGroups, seasonIndex]); - - const initialSeasonIndex = useMemo( - () => - groupBySeason?.[0]?.ParentIndexNumber ?? - series?.[0]?.item?.ParentIndexNumber, - [groupBySeason, series], - ); - - useEffect(() => { - if (series.length > 0) { - navigation.setOptions({ - title: series[0].item.SeriesName, - }); - } else { - storage.remove(seriesId); - router.back(); - } - }, [series]); - - const deleteSeries = useCallback(() => { - Alert.alert( - "Delete season", - "Are you sure you want to delete the entire season?", - [ - { - text: "Cancel", - style: "cancel", - }, - { - text: "Delete", - onPress: () => - deleteItems( - groupBySeason - .map((item) => item.Id) - .filter((id) => id !== undefined), - ), - style: "destructive", - }, - ], - ); - }, [groupBySeason, deleteItems]); - - const ListHeaderComponent = useCallback(() => { - if (series.length === 0) return null; - - return ( - - { - setSeasonIndexState((prev) => ({ - ...prev, - [series[0].item.ParentId ?? ""]: season.ParentIndexNumber, - })); - }} - /> - - {groupBySeason.length} - - - - - - - - ); - }, [ - series, - uniqueSeasons, - seasonIndexState, - initialSeasonIndex, - groupBySeason, - deleteSeries, - ]); - - return ( - - } - keyExtractor={(item, index) => item.Id ?? `episode-${index}`} - ListHeaderComponent={ListHeaderComponent} - contentInsetAdjustmentBehavior='automatic' - contentContainerStyle={{ - paddingHorizontal: 16, - paddingLeft: insets.left + 16, - paddingRight: insets.right + 16, - paddingTop: Platform.OS === "android" ? 10 : 8, - }} - /> - - ); -} diff --git a/app/(auth)/(tabs)/(home)/downloads/index.tsx b/app/(auth)/(tabs)/(home)/downloads/index.tsx index c71bebd8..fb8ef0b9 100644 --- a/app/(auth)/(tabs)/(home)/downloads/index.tsx +++ b/app/(auth)/(tabs)/(home)/downloads/index.tsx @@ -1,15 +1,10 @@ import { BottomSheetModal } from "@gorhom/bottom-sheet"; -import { useNavigation, useRouter } from "expo-router"; +import { useNavigation } from "expo-router"; import { useAtom } from "jotai"; import { useEffect, useMemo, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; -import { - Alert, - Platform, - ScrollView, - TouchableOpacity, - View, -} from "react-native"; +import { Alert, Platform, ScrollView, View } from "react-native"; +import { Pressable } from "react-native-gesture-handler"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { toast } from "sonner-native"; import { Text } from "@/components/common/Text"; @@ -18,8 +13,10 @@ import ActiveDownloads from "@/components/downloads/ActiveDownloads"; import { DownloadSize } from "@/components/downloads/DownloadSize"; import { MovieCard } from "@/components/downloads/MovieCard"; import { SeriesCard } from "@/components/downloads/SeriesCard"; +import useRouter from "@/hooks/useAppRouter"; import { useDownload } from "@/providers/DownloadProvider"; import { type DownloadedItem } from "@/providers/Downloads/types"; +import { OfflineModeProvider } from "@/providers/OfflineModeProvider"; import { queueAtom } from "@/utils/atoms/queue"; import { writeToLog } from "@/utils/log"; @@ -103,12 +100,12 @@ export default function page() { useEffect(() => { navigation.setOptions({ headerRight: () => ( - f.item) || []} /> - + ), }); }, [downloadedFiles]); @@ -166,145 +163,99 @@ export default function page() { ); return ( - - - - {/* Queue card - hidden */} - {/* + + + + + + + + {movies.length > 0 && ( + + - {t("home.downloads.queue")} + {t("home.downloads.movies")} - - {t("home.downloads.queue_hint")} - - - {queue.map((q, index) => ( - - router.push(`/(auth)/items/page?id=${q.item.Id}`) - } - className='relative bg-neutral-900 border border-neutral-800 p-4 rounded-2xl overflow-hidden flex flex-row items-center justify-between' - key={index} - > - - {q.item.Name} - - {q.item.Type} - - - { - removeProcess(q.id); - setQueue((prev) => { - if (!prev) return []; - return [...prev.filter((i) => i.id !== q.id)]; - }); - }} - > - - - + + {movies?.length} + + + + + {movies?.map((item) => ( + + + ))} - - {queue.length === 0 && ( - - {t("home.downloads.no_items_in_queue")} - - )} - */} - - - - - {movies.length > 0 && ( - - - - {t("home.downloads.movies")} - - - {movies?.length} - + - - - {movies?.map((item) => ( - - - - ))} - - - - )} - {groupedBySeries.length > 0 && ( - - - - {t("home.downloads.tvseries")} - - - - {groupedBySeries?.length} + )} + {groupedBySeries.length > 0 && ( + + + + {t("home.downloads.tvseries")} + + + {groupedBySeries?.length} + + - - - - {groupedBySeries?.map((items) => ( - - i.item)} + + + {groupedBySeries?.map((items) => ( + - - ))} - - - - )} - - {otherMedia.length > 0 && ( - - - - {t("home.downloads.other_media")} - - - {otherMedia?.length} - + > + i.item)} + key={items[0].item.SeriesId} + /> + + ))} + + - - - {otherMedia?.map((item) => ( - - - - ))} + )} + + {otherMedia.length > 0 && ( + + + + {t("home.downloads.other_media")} + + + + {otherMedia?.length} + + - - - )} - {downloadedFiles?.length === 0 && ( - - - {t("home.downloads.no_downloaded_items")} - - - )} - - + + + {otherMedia?.map((item) => ( + + + + ))} + + + + )} + {downloadedFiles?.length === 0 && ( + + + {t("home.downloads.no_downloaded_items")} + + + )} + + + ); } diff --git a/app/(auth)/(tabs)/(home)/intro/page.tsx b/app/(auth)/(tabs)/(home)/intro/page.tsx deleted file mode 100644 index 572a4980..00000000 --- a/app/(auth)/(tabs)/(home)/intro/page.tsx +++ /dev/null @@ -1,154 +0,0 @@ -import { Feather, Ionicons } from "@expo/vector-icons"; -import { Image } from "expo-image"; -import { useFocusEffect, useRouter } from "expo-router"; -import { useCallback } from "react"; -import { useTranslation } from "react-i18next"; -import { Linking, Platform, TouchableOpacity, View } from "react-native"; -import { Button } from "@/components/Button"; -import { Text } from "@/components/common/Text"; -import { storage } from "@/utils/mmkv"; - -export default function page() { - const router = useRouter(); - const { t } = useTranslation(); - - useFocusEffect( - useCallback(() => { - storage.set("hasShownIntro", true); - }, []), - ); - - return ( - - - - {t("home.intro.welcome_to_streamyfin")} - - - {t("home.intro.a_free_and_open_source_client_for_jellyfin")} - - - - - - {t("home.intro.features_title")} - - {t("home.intro.features_description")} - - - - Jellyseerr - - {t("home.intro.jellyseerr_feature_description")} - - - - {!Platform.isTV && ( - <> - - - - - - - {t("home.intro.downloads_feature_title")} - - - {t("home.intro.downloads_feature_description")} - - - - - - - - - Chromecast - - {t("home.intro.chromecast_feature_description")} - - - - - )} - - - - - - - {t("home.intro.centralised_settings_plugin_title")} - - - - {t("home.intro.centralised_settings_plugin_description")}{" "} - - { - Linking.openURL( - "https://github.com/streamyfin/jellyfin-plugin-streamyfin", - ); - }} - > - - {t("home.intro.read_more")} - - - - - - - - - { - router.back(); - router.push("/settings"); - }} - className='mt-4' - > - - {t("home.intro.go_to_settings_button")} - - - - - ); -} diff --git a/app/(auth)/(tabs)/(home)/settings.tsx b/app/(auth)/(tabs)/(home)/settings.tsx index 4bd917d6..76675ae8 100644 --- a/app/(auth)/(tabs)/(home)/settings.tsx +++ b/app/(auth)/(tabs)/(home)/settings.tsx @@ -1,4 +1,4 @@ -import { useNavigation, useRouter } from "expo-router"; +import { useNavigation } from "expo-router"; import { t } from "i18next"; import { useAtom } from "jotai"; import { useEffect } from "react"; @@ -11,6 +11,7 @@ import { AppLanguageSelector } from "@/components/settings/AppLanguageSelector"; import { QuickConnect } from "@/components/settings/QuickConnect"; import { StorageSettings } from "@/components/settings/StorageSettings"; import { UserInfo } from "@/components/settings/UserInfo"; +import useRouter from "@/hooks/useAppRouter"; import { useJellyfin, userAtom } from "@/providers/JellyfinProvider"; export default function settings() { @@ -70,6 +71,11 @@ export default function settings() { showArrow title={t("home.settings.audio_subtitles.title")} /> + router.push("/settings/music/page")} + showArrow + title={t("home.settings.music.title")} + /> router.push("/settings/appearance/page")} showArrow @@ -85,6 +91,11 @@ export default function settings() { showArrow title={t("home.settings.intro.title")} /> + router.push("/settings/network/page")} + showArrow + title={t("home.settings.network.title")} + /> router.push("/settings/logs/page")} showArrow diff --git a/app/(auth)/(tabs)/(home)/settings/appearance/hide-libraries/page.tsx b/app/(auth)/(tabs)/(home)/settings/appearance/hide-libraries/page.tsx index a0b3bab9..5fd815d2 100644 --- a/app/(auth)/(tabs)/(home)/settings/appearance/hide-libraries/page.tsx +++ b/app/(auth)/(tabs)/(home)/settings/appearance/hide-libraries/page.tsx @@ -71,7 +71,7 @@ export default function page() { ))} - {t("home.settings.other.select_liraries_you_want_to_hide")} + {t("home.settings.other.select_libraries_you_want_to_hide")} diff --git a/app/(auth)/(tabs)/(home)/settings/audio-subtitles/page.tsx b/app/(auth)/(tabs)/(home)/settings/audio-subtitles/page.tsx index 58415127..7c5f38d8 100644 --- a/app/(auth)/(tabs)/(home)/settings/audio-subtitles/page.tsx +++ b/app/(auth)/(tabs)/(home)/settings/audio-subtitles/page.tsx @@ -2,6 +2,7 @@ import { Platform, ScrollView, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { AudioToggles } from "@/components/settings/AudioToggles"; import { MediaProvider } from "@/components/settings/MediaContext"; +import { MpvSubtitleSettings } from "@/components/settings/MpvSubtitleSettings"; import { SubtitleToggles } from "@/components/settings/SubtitleToggles"; export default function AudioSubtitlesPage() { @@ -22,6 +23,7 @@ export default function AudioSubtitlesPage() { + diff --git a/app/(auth)/(tabs)/(home)/settings/hide-libraries/page.tsx b/app/(auth)/(tabs)/(home)/settings/hide-libraries/page.tsx index e1c8b56b..8bfa30a4 100644 --- a/app/(auth)/(tabs)/(home)/settings/hide-libraries/page.tsx +++ b/app/(auth)/(tabs)/(home)/settings/hide-libraries/page.tsx @@ -60,7 +60,7 @@ export default function page() { ))} - {t("home.settings.other.select_liraries_you_want_to_hide")} + {t("home.settings.other.select_libraries_you_want_to_hide")} ); diff --git a/app/(auth)/(tabs)/(home)/settings/intro/page.tsx b/app/(auth)/(tabs)/(home)/settings/intro/page.tsx index 4cb43e6d..6e04777b 100644 --- a/app/(auth)/(tabs)/(home)/settings/intro/page.tsx +++ b/app/(auth)/(tabs)/(home)/settings/intro/page.tsx @@ -1,13 +1,13 @@ -import { useRouter } from "expo-router"; import { useTranslation } from "react-i18next"; import { Platform, ScrollView, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { ListGroup } from "@/components/list/ListGroup"; import { ListItem } from "@/components/list/ListItem"; +import { useIntroSheet } from "@/providers/IntroSheetProvider"; import { storage } from "@/utils/mmkv"; export default function IntroPage() { - const router = useRouter(); + const { showIntro } = useIntroSheet(); const insets = useSafeAreaInsets(); const { t } = useTranslation(); @@ -26,7 +26,7 @@ export default function IntroPage() { { - router.push("/intro/page"); + showIntro(); }} title={t("home.settings.intro.show_intro")} /> diff --git a/app/(auth)/(tabs)/(home)/settings/music/page.tsx b/app/(auth)/(tabs)/(home)/settings/music/page.tsx new file mode 100644 index 00000000..70467b4d --- /dev/null +++ b/app/(auth)/(tabs)/(home)/settings/music/page.tsx @@ -0,0 +1,251 @@ +import { Ionicons } from "@expo/vector-icons"; +import { useQuery } from "@tanstack/react-query"; +import { useCallback, useMemo } from "react"; +import { useTranslation } from "react-i18next"; +import { Platform, ScrollView, View } from "react-native"; +import { Switch } from "react-native-gesture-handler"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { toast } from "sonner-native"; +import { Text } from "@/components/common/Text"; +import { ListGroup } from "@/components/list/ListGroup"; +import { ListItem } from "@/components/list/ListItem"; +import { PlatformDropdown } from "@/components/PlatformDropdown"; +import { useHaptic } from "@/hooks/useHaptic"; +import { useNetworkAwareQueryClient } from "@/hooks/useNetworkAwareQueryClient"; +import { + clearCache, + clearPermanentDownloads, + getStorageStats, +} from "@/providers/AudioStorage"; +import { useSettings } from "@/utils/atoms/settings"; + +const CACHE_SIZE_OPTIONS = [ + { label: "100 MB", value: 100 }, + { label: "250 MB", value: 250 }, + { label: "500 MB", value: 500 }, + { label: "1 GB", value: 1024 }, + { label: "2 GB", value: 2048 }, +]; + +const LOOKAHEAD_COUNT_OPTIONS = [ + { label: "1 song", value: 1 }, + { label: "2 songs", value: 2 }, + { label: "3 songs", value: 3 }, + { label: "5 songs", value: 5 }, +]; + +export default function MusicSettingsPage() { + const insets = useSafeAreaInsets(); + const { settings, updateSettings, pluginSettings } = useSettings(); + const { t } = useTranslation(); + const queryClient = useNetworkAwareQueryClient(); + const successHapticFeedback = useHaptic("success"); + const errorHapticFeedback = useHaptic("error"); + + const { data: musicCacheStats } = useQuery({ + queryKey: ["musicCacheStats"], + queryFn: () => getStorageStats(), + }); + + const onClearMusicCacheClicked = useCallback(async () => { + try { + await clearCache(); + queryClient.invalidateQueries({ queryKey: ["musicCacheStats"] }); + queryClient.invalidateQueries({ queryKey: ["appSize"] }); + successHapticFeedback(); + toast.success(t("home.settings.storage.music_cache_cleared")); + } catch (_e) { + errorHapticFeedback(); + toast.error(t("home.settings.toasts.error_deleting_files")); + } + }, [queryClient, successHapticFeedback, errorHapticFeedback, t]); + + const onDeleteDownloadedSongsClicked = useCallback(async () => { + try { + await clearPermanentDownloads(); + queryClient.invalidateQueries({ queryKey: ["musicCacheStats"] }); + queryClient.invalidateQueries({ queryKey: ["appSize"] }); + successHapticFeedback(); + toast.success(t("home.settings.storage.downloaded_songs_deleted")); + } catch (_e) { + errorHapticFeedback(); + toast.error(t("home.settings.toasts.error_deleting_files")); + } + }, [queryClient, successHapticFeedback, errorHapticFeedback, t]); + + const cacheSizeOptions = useMemo( + () => [ + { + options: CACHE_SIZE_OPTIONS.map((option) => ({ + type: "radio" as const, + label: option.label, + value: String(option.value), + selected: option.value === settings?.audioMaxCacheSizeMB, + onPress: () => updateSettings({ audioMaxCacheSizeMB: option.value }), + })), + }, + ], + [settings?.audioMaxCacheSizeMB, updateSettings], + ); + + const currentCacheSizeLabel = + CACHE_SIZE_OPTIONS.find((o) => o.value === settings?.audioMaxCacheSizeMB) + ?.label ?? `${settings?.audioMaxCacheSizeMB} MB`; + + const lookaheadCountOptions = useMemo( + () => [ + { + options: LOOKAHEAD_COUNT_OPTIONS.map((option) => ({ + type: "radio" as const, + label: option.label, + value: String(option.value), + selected: option.value === settings?.audioLookaheadCount, + onPress: () => updateSettings({ audioLookaheadCount: option.value }), + })), + }, + ], + [settings?.audioLookaheadCount, updateSettings], + ); + + const currentLookaheadLabel = + LOOKAHEAD_COUNT_OPTIONS.find( + (o) => o.value === settings?.audioLookaheadCount, + )?.label ?? `${settings?.audioLookaheadCount} songs`; + + return ( + + + + {t("home.settings.music.playback_description")} + + } + > + + + updateSettings({ preferLocalAudio: value }) + } + /> + + + + + + {t("home.settings.music.caching_description")} + + } + > + + + updateSettings({ audioLookaheadEnabled: value }) + } + /> + + + + + {currentLookaheadLabel} + + + + } + title={t("home.settings.music.lookahead_count")} + /> + + + + + {currentCacheSizeLabel} + + + + } + title={t("home.settings.music.max_cache_size")} + /> + + + + + {!Platform.isTV && ( + + + {t("home.settings.storage.music_cache_description")} + + } + > + + + + + + + )} + + + ); +} diff --git a/app/(auth)/(tabs)/(home)/settings/network/page.tsx b/app/(auth)/(tabs)/(home)/settings/network/page.tsx new file mode 100644 index 00000000..9f3727e4 --- /dev/null +++ b/app/(auth)/(tabs)/(home)/settings/network/page.tsx @@ -0,0 +1,48 @@ +import { useAtomValue } from "jotai"; +import { useTranslation } from "react-i18next"; +import { Platform, ScrollView, View } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { ListGroup } from "@/components/list/ListGroup"; +import { ListItem } from "@/components/list/ListItem"; +import { LocalNetworkSettings } from "@/components/settings/LocalNetworkSettings"; +import { apiAtom } from "@/providers/JellyfinProvider"; +import { storage } from "@/utils/mmkv"; + +export default function NetworkSettingsPage() { + const { t } = useTranslation(); + const insets = useSafeAreaInsets(); + const api = useAtomValue(apiAtom); + + const remoteUrl = storage.getString("serverUrl"); + + return ( + + + + + + + + + + + + + ); +} diff --git a/app/(auth)/(tabs)/(home)/settings/plugins/jellyseerr/page.tsx b/app/(auth)/(tabs)/(home)/settings/plugins/kefinTweaks/page.tsx similarity index 78% rename from app/(auth)/(tabs)/(home)/settings/plugins/jellyseerr/page.tsx rename to app/(auth)/(tabs)/(home)/settings/plugins/kefinTweaks/page.tsx index cd1efca5..05056826 100644 --- a/app/(auth)/(tabs)/(home)/settings/plugins/jellyseerr/page.tsx +++ b/app/(auth)/(tabs)/(home)/settings/plugins/kefinTweaks/page.tsx @@ -1,7 +1,7 @@ import { ScrollView } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import DisabledSetting from "@/components/settings/DisabledSetting"; -import { JellyseerrSettings } from "@/components/settings/Jellyseerr"; +import { KefinTweaksSettings } from "@/components/settings/KefinTweaks"; import { useSettings } from "@/utils/atoms/settings"; export default function page() { @@ -17,10 +17,10 @@ export default function page() { }} > - + ); diff --git a/app/(auth)/(tabs)/(home)/settings/plugins/marlin-search/page.tsx b/app/(auth)/(tabs)/(home)/settings/plugins/marlin-search/page.tsx index 4eb36aef..10be4af5 100644 --- a/app/(auth)/(tabs)/(home)/settings/plugins/marlin-search/page.tsx +++ b/app/(auth)/(tabs)/(home)/settings/plugins/marlin-search/page.tsx @@ -1,4 +1,3 @@ -import { useQueryClient } from "@tanstack/react-query"; import { useNavigation } from "expo-router"; import { useEffect, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; @@ -16,6 +15,7 @@ import { Text } from "@/components/common/Text"; import { ListGroup } from "@/components/list/ListGroup"; import { ListItem } from "@/components/list/ListItem"; import DisabledSetting from "@/components/settings/DisabledSetting"; +import { useNetworkAwareQueryClient } from "@/hooks/useNetworkAwareQueryClient"; import { useSettings } from "@/utils/atoms/settings"; export default function page() { @@ -26,7 +26,7 @@ export default function page() { const insets = useSafeAreaInsets(); const { settings, updateSettings, pluginSettings } = useSettings(); - const queryClient = useQueryClient(); + const queryClient = useNetworkAwareQueryClient(); const [value, setValue] = useState(settings?.marlinServerUrl || ""); @@ -60,7 +60,7 @@ export default function page() { ), }); } - }, [navigation, value]); + }, [navigation, value, pluginSettings?.marlinServerUrl?.locked, t]); if (!settings) return null; @@ -75,7 +75,10 @@ export default function page() { { updateSettings({ searchEngine: value ? "Marlin" : "Jellyfin", diff --git a/app/(auth)/(tabs)/(home)/settings/plugins/seerr/page.tsx b/app/(auth)/(tabs)/(home)/settings/plugins/seerr/page.tsx new file mode 100644 index 00000000..070c6468 --- /dev/null +++ b/app/(auth)/(tabs)/(home)/settings/plugins/seerr/page.tsx @@ -0,0 +1,27 @@ +import { ScrollView } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import DisabledSetting from "@/components/settings/DisabledSetting"; +import { SeerrSettings } from "@/components/settings/Seerr"; +import { useSettings } from "@/utils/atoms/settings"; + +export default function Page() { + const { pluginSettings } = useSettings(); + const insets = useSafeAreaInsets(); + + return ( + + + + + + ); +} diff --git a/app/(auth)/(tabs)/(home)/settings/plugins/streamystats/page.tsx b/app/(auth)/(tabs)/(home)/settings/plugins/streamystats/page.tsx new file mode 100644 index 00000000..697db6c4 --- /dev/null +++ b/app/(auth)/(tabs)/(home)/settings/plugins/streamystats/page.tsx @@ -0,0 +1,262 @@ +import { useNavigation } from "expo-router"; +import { useCallback, useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { + Linking, + ScrollView, + Switch, + TextInput, + TouchableOpacity, + View, +} from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { toast } from "sonner-native"; +import { Text } from "@/components/common/Text"; +import { ListGroup } from "@/components/list/ListGroup"; +import { ListItem } from "@/components/list/ListItem"; +import { useNetworkAwareQueryClient } from "@/hooks/useNetworkAwareQueryClient"; +import { useSettings } from "@/utils/atoms/settings"; + +export default function page() { + const { t } = useTranslation(); + const navigation = useNavigation(); + const insets = useSafeAreaInsets(); + + const { + settings, + updateSettings, + pluginSettings, + refreshStreamyfinPluginSettings, + } = useSettings(); + const queryClient = useNetworkAwareQueryClient(); + + // Local state for all editable fields + const [url, setUrl] = useState(settings?.streamyStatsServerUrl || ""); + const [useForSearch, setUseForSearch] = useState( + settings?.searchEngine === "Streamystats", + ); + const [movieRecs, setMovieRecs] = useState( + settings?.streamyStatsMovieRecommendations ?? false, + ); + const [seriesRecs, setSeriesRecs] = useState( + settings?.streamyStatsSeriesRecommendations ?? false, + ); + const [promotedWatchlists, setPromotedWatchlists] = useState( + settings?.streamyStatsPromotedWatchlists ?? false, + ); + const [hideWatchlistsTab, setHideWatchlistsTab] = useState( + settings?.hideWatchlistsTab ?? false, + ); + + const isUrlLocked = pluginSettings?.streamyStatsServerUrl?.locked === true; + const isStreamystatsEnabled = !!url; + + const onSave = useCallback(() => { + const cleanUrl = url.endsWith("/") ? url.slice(0, -1) : url; + updateSettings({ + streamyStatsServerUrl: cleanUrl, + searchEngine: useForSearch ? "Streamystats" : "Jellyfin", + streamyStatsMovieRecommendations: movieRecs, + streamyStatsSeriesRecommendations: seriesRecs, + streamyStatsPromotedWatchlists: promotedWatchlists, + hideWatchlistsTab: hideWatchlistsTab, + }); + queryClient.invalidateQueries({ queryKey: ["search"] }); + queryClient.invalidateQueries({ queryKey: ["streamystats"] }); + toast.success(t("home.settings.plugins.streamystats.toasts.saved")); + }, [ + url, + useForSearch, + movieRecs, + seriesRecs, + promotedWatchlists, + hideWatchlistsTab, + updateSettings, + queryClient, + t, + ]); + + // Set up header save button + useEffect(() => { + navigation.setOptions({ + headerRight: () => ( + + + {t("home.settings.plugins.streamystats.save")} + + + ), + }); + }, [navigation, onSave, t]); + + const handleClearStreamystats = useCallback(() => { + setUrl(""); + setUseForSearch(false); + setMovieRecs(false); + setSeriesRecs(false); + setPromotedWatchlists(false); + setHideWatchlistsTab(false); + updateSettings({ + streamyStatsServerUrl: "", + searchEngine: "Jellyfin", + streamyStatsMovieRecommendations: false, + streamyStatsSeriesRecommendations: false, + streamyStatsPromotedWatchlists: false, + hideWatchlistsTab: false, + }); + queryClient.invalidateQueries({ queryKey: ["streamystats"] }); + queryClient.invalidateQueries({ queryKey: ["search"] }); + toast.success(t("home.settings.plugins.streamystats.toasts.disabled")); + }, [updateSettings, queryClient, t]); + + const handleOpenLink = () => { + Linking.openURL("https://github.com/fredrikburmester/streamystats"); + }; + + const handleRefreshFromServer = useCallback(async () => { + const newPluginSettings = await refreshStreamyfinPluginSettings(true); + // Update local state with new values + const newUrl = newPluginSettings?.streamyStatsServerUrl?.value || ""; + setUrl(newUrl); + if (newUrl) { + setUseForSearch(true); + } + toast.success(t("home.settings.plugins.streamystats.toasts.refreshed")); + }, [refreshStreamyfinPluginSettings, t]); + + if (!settings) return null; + + return ( + + + + + + + + + + {t("home.settings.plugins.streamystats.streamystats_search_hint")}{" "} + + {t( + "home.settings.plugins.streamystats.read_more_about_streamystats", + )} + + + + + + + + + + + + + + + + + + + + + + {t("home.settings.plugins.streamystats.home_sections_hint")} + + + + + {t("home.settings.plugins.streamystats.refresh_from_server")} + + + + {/* Disable button - only show if URL is not locked and Streamystats is enabled */} + {!isUrlLocked && isStreamystatsEnabled && ( + + + {t("home.settings.plugins.streamystats.disable_streamystats")} + + + )} + + + ); +} diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites)/series/[id].tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites)/series/[id].tsx deleted file mode 100644 index 2636d5c0..00000000 --- a/app/(auth)/(tabs)/(home,libraries,search,favorites)/series/[id].tsx +++ /dev/null @@ -1,163 +0,0 @@ -import { Ionicons } from "@expo/vector-icons"; -import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api"; -import { useQuery } from "@tanstack/react-query"; -import { Image } from "expo-image"; -import { useLocalSearchParams, useNavigation } from "expo-router"; -import { useAtom } from "jotai"; -import type React from "react"; -import { useEffect, useMemo } from "react"; -import { useTranslation } from "react-i18next"; -import { Platform, View } from "react-native"; -import { AddToFavorites } from "@/components/AddToFavorites"; -import { DownloadItems } from "@/components/DownloadItem"; -import { ParallaxScrollView } from "@/components/ParallaxPage"; -import { NextUp } from "@/components/series/NextUp"; -import { SeasonPicker } from "@/components/series/SeasonPicker"; -import { SeriesHeader } from "@/components/series/SeriesHeader"; -import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; -import { getBackdropUrl } from "@/utils/jellyfin/image/getBackdropUrl"; -import { getLogoImageUrlById } from "@/utils/jellyfin/image/getLogoImageUrlById"; -import { getUserItemData } from "@/utils/jellyfin/user-library/getUserItemData"; - -const page: React.FC = () => { - const navigation = useNavigation(); - const { t } = useTranslation(); - const params = useLocalSearchParams(); - const { id: seriesId, seasonIndex } = params as { - id: string; - seasonIndex: string; - }; - - const [api] = useAtom(apiAtom); - const [user] = useAtom(userAtom); - - const { data: item } = useQuery({ - queryKey: ["series", seriesId], - queryFn: async () => - await getUserItemData({ - api, - userId: user?.Id, - itemId: seriesId, - }), - staleTime: 60 * 1000, - }); - - const backdropUrl = useMemo( - () => - getBackdropUrl({ - api, - item, - quality: 90, - width: 1000, - }), - [item], - ); - - const logoUrl = useMemo( - () => - getLogoImageUrlById({ - api, - item, - }), - [item], - ); - - const { data: allEpisodes, isLoading } = useQuery({ - queryKey: ["AllEpisodes", item?.Id], - queryFn: async () => { - if (!api || !user?.Id || !item?.Id) return []; - - const res = await getTvShowsApi(api).getEpisodes({ - seriesId: item.Id, - userId: user.Id, - enableUserData: true, - // Note: Including trick play is necessary to enable trick play downloads - fields: ["MediaSources", "MediaStreams", "Overview", "Trickplay"], - }); - return res?.data.Items || []; - }, - select: (data) => - // This needs to be sorted by parent index number and then index number, that way we can download the episodes in the correct order. - [...(data || [])].sort( - (a, b) => - (a.ParentIndexNumber ?? 0) - (b.ParentIndexNumber ?? 0) || - (a.IndexNumber ?? 0) - (b.IndexNumber ?? 0), - ), - staleTime: 60, - enabled: !!api && !!user?.Id && !!item?.Id, - }); - - useEffect(() => { - navigation.setOptions({ - headerRight: () => - !isLoading && - item && - allEpisodes && - allEpisodes.length > 0 && ( - - - {!Platform.isTV && ( - ( - - )} - DownloadedIconComponent={() => ( - - )} - /> - )} - - ), - }); - }, [allEpisodes, isLoading, item]); - - if (!item || !backdropUrl) return null; - - return ( - - } - logo={ - logoUrl ? ( - - ) : undefined - } - > - - - - - - - - - ); -}; - -export default page; diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites)/collections/[collectionId].tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/collections/[collectionId].tsx similarity index 100% rename from app/(auth)/(tabs)/(home,libraries,search,favorites)/collections/[collectionId].tsx rename to app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/collections/[collectionId].tsx diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites)/items/page.tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/items/page.tsx similarity index 50% rename from app/(auth)/(tabs)/(home,libraries,search,favorites)/items/page.tsx rename to app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/items/page.tsx index b3d905fa..d6107217 100644 --- a/app/(auth)/(tabs)/(home,libraries,search,favorites)/items/page.tsx +++ b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/items/page.tsx @@ -13,6 +13,7 @@ import Animated, { import { Text } from "@/components/common/Text"; import { ItemContent } from "@/components/ItemContent"; import { useItemQuery } from "@/hooks/useItemQuery"; +import { OfflineModeProvider } from "@/providers/OfflineModeProvider"; const Page: React.FC = () => { const { id } = useLocalSearchParams() as { id: string }; @@ -21,14 +22,16 @@ const Page: React.FC = () => { const { offline } = useLocalSearchParams() as { offline?: string }; const isOffline = offline === "true"; - const { data: item, isError } = useItemQuery(id, false, undefined, [ + // Exclude MediaSources/MediaStreams from initial fetch for faster loading + // (especially important for plugins like Gelato) + const { data: item, isError } = useItemQuery(id, isOffline, undefined, [ ItemFields.MediaSources, ItemFields.MediaSourceCount, ItemFields.MediaStreams, ]); - // preload media sources - const { data: itemWithSources } = useItemQuery(id, false, undefined, []); + // Lazily preload item with full media sources in background + const { data: itemWithSources } = useItemQuery(id, isOffline, undefined, []); const opacity = useSharedValue(1); const animatedStyle = useAnimatedStyle(() => { @@ -73,39 +76,35 @@ const Page: React.FC = () => { ); return ( - - - - - - - - - - - - - - - - - {item && ( - - )} - + + + + + + + + + + + + + + + + + + {item && } + + ); }; diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites)/livetv/_layout.tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/livetv/_layout.tsx similarity index 100% rename from app/(auth)/(tabs)/(home,libraries,search,favorites)/livetv/_layout.tsx rename to app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/livetv/_layout.tsx diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites)/livetv/channels.tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/livetv/channels.tsx similarity index 100% rename from app/(auth)/(tabs)/(home,libraries,search,favorites)/livetv/channels.tsx rename to app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/livetv/channels.tsx diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites)/livetv/guide.tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/livetv/guide.tsx similarity index 100% rename from app/(auth)/(tabs)/(home,libraries,search,favorites)/livetv/guide.tsx rename to app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/livetv/guide.tsx diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites)/livetv/programs.tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/livetv/programs.tsx similarity index 100% rename from app/(auth)/(tabs)/(home,libraries,search,favorites)/livetv/programs.tsx rename to app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/livetv/programs.tsx diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites)/livetv/recordings.tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/livetv/recordings.tsx similarity index 100% rename from app/(auth)/(tabs)/(home,libraries,search,favorites)/livetv/recordings.tsx rename to app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/livetv/recordings.tsx diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/music/album/[albumId].tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/music/album/[albumId].tsx new file mode 100644 index 00000000..1d1b7620 --- /dev/null +++ b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/music/album/[albumId].tsx @@ -0,0 +1,300 @@ +import { Ionicons } from "@expo/vector-icons"; +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { getItemsApi, getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api"; +import { FlashList } from "@shopify/flash-list"; +import { useQuery } from "@tanstack/react-query"; +import { Image } from "expo-image"; +import { useLocalSearchParams, useNavigation } from "expo-router"; +import { useAtom } from "jotai"; +import { useCallback, useEffect, useMemo, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { + ActivityIndicator, + Dimensions, + TouchableOpacity, + View, +} from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Text } from "@/components/common/Text"; +import { Loader } from "@/components/Loader"; +import { CreatePlaylistModal } from "@/components/music/CreatePlaylistModal"; +import { MusicTrackItem } from "@/components/music/MusicTrackItem"; +import { PlaylistPickerSheet } from "@/components/music/PlaylistPickerSheet"; +import { TrackOptionsSheet } from "@/components/music/TrackOptionsSheet"; +import { + downloadTrack, + isPermanentlyDownloaded, +} from "@/providers/AudioStorage"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { useMusicPlayer } from "@/providers/MusicPlayerProvider"; +import { getAudioStreamUrl } from "@/utils/jellyfin/audio/getAudioStreamUrl"; +import { getPrimaryImageUrl } from "@/utils/jellyfin/image/getPrimaryImageUrl"; +import { runtimeTicksToMinutes } from "@/utils/time"; + +const { width: SCREEN_WIDTH } = Dimensions.get("window"); +const ARTWORK_SIZE = SCREEN_WIDTH * 0.5; + +export default function AlbumDetailScreen() { + const { albumId } = useLocalSearchParams<{ albumId: string }>(); + const [api] = useAtom(apiAtom); + const [user] = useAtom(userAtom); + const insets = useSafeAreaInsets(); + const navigation = useNavigation(); + const { t } = useTranslation(); + const { playQueue } = useMusicPlayer(); + + const [selectedTrack, setSelectedTrack] = useState(null); + const [trackOptionsOpen, setTrackOptionsOpen] = useState(false); + const [playlistPickerOpen, setPlaylistPickerOpen] = useState(false); + const [createPlaylistOpen, setCreatePlaylistOpen] = useState(false); + const [isDownloading, setIsDownloading] = useState(false); + + const handleTrackOptionsPress = useCallback((track: BaseItemDto) => { + setSelectedTrack(track); + setTrackOptionsOpen(true); + }, []); + + const handleAddToPlaylist = useCallback(() => { + setPlaylistPickerOpen(true); + }, []); + + const handleCreateNewPlaylist = useCallback(() => { + setCreatePlaylistOpen(true); + }, []); + + const { data: album, isLoading: loadingAlbum } = useQuery({ + queryKey: ["music-album", albumId, user?.Id], + queryFn: async () => { + const response = await getUserLibraryApi(api!).getItem({ + userId: user?.Id, + itemId: albumId!, + }); + return response.data; + }, + enabled: !!api && !!user?.Id && !!albumId, + }); + + const { data: tracks, isLoading: loadingTracks } = useQuery({ + queryKey: ["music-album-tracks", albumId, user?.Id], + queryFn: async () => { + const response = await getItemsApi(api!).getItems({ + userId: user?.Id, + parentId: albumId, + sortBy: ["IndexNumber"], + sortOrder: ["Ascending"], + }); + return response.data.Items || []; + }, + enabled: !!api && !!user?.Id && !!albumId, + }); + + useEffect(() => { + navigation.setOptions({ + title: album?.Name ?? "", + headerTransparent: true, + headerStyle: { backgroundColor: "transparent" }, + headerShadowVisible: false, + }); + }, [album?.Name, navigation]); + + const imageUrl = useMemo( + () => (album ? getPrimaryImageUrl({ api, item: album }) : null), + [api, album], + ); + + const totalDuration = useMemo(() => { + if (!tracks) return ""; + const totalTicks = tracks.reduce( + (acc, track) => acc + (track.RunTimeTicks || 0), + 0, + ); + return runtimeTicksToMinutes(totalTicks); + }, [tracks]); + + const handlePlayAll = useCallback(() => { + if (tracks && tracks.length > 0) { + playQueue(tracks, 0); + } + }, [playQueue, tracks]); + + const handleShuffle = useCallback(() => { + if (tracks && tracks.length > 0) { + const shuffled = [...tracks].sort(() => Math.random() - 0.5); + playQueue(shuffled, 0); + } + }, [playQueue, tracks]); + + // Check if all tracks are already permanently downloaded + const allTracksDownloaded = useMemo(() => { + if (!tracks || tracks.length === 0) return false; + return tracks.every((track) => isPermanentlyDownloaded(track.Id)); + }, [tracks]); + + const handleDownloadAlbum = useCallback(async () => { + if (!tracks || !api || !user?.Id || isDownloading) return; + + setIsDownloading(true); + try { + for (const track of tracks) { + if (!track.Id || isPermanentlyDownloaded(track.Id)) continue; + const result = await getAudioStreamUrl(api, user.Id, track.Id); + if (result?.url && !result.isTranscoding) { + await downloadTrack(track.Id, result.url, { + permanent: true, + container: result.mediaSource?.Container || undefined, + }); + } + } + } catch { + // Silent fail + } + setIsDownloading(false); + }, [tracks, api, user?.Id, isDownloading]); + + const isLoading = loadingAlbum || loadingTracks; + + // Only show loading if we have no cached data to display + if (isLoading && !album) { + return ( + + + + ); + } + + if (!album) { + return ( + + {t("music.album_not_found")} + + ); + } + + return ( + + {/* Album artwork */} + + {imageUrl ? ( + + ) : ( + + + + )} + + + {/* Album info */} + + {album.Name} + + + {album.AlbumArtist || album.Artists?.join(", ")} + + + {album.ProductionYear && `${album.ProductionYear} โ€ข `} + {tracks?.length} tracks โ€ข {totalDuration} + + + {/* Play buttons */} + + + + + {t("music.play")} + + + + + + {t("music.shuffle")} + + + + {isDownloading ? ( + + ) : ( + + )} + + + + } + renderItem={({ item, index }) => ( + + )} + keyExtractor={(item) => item.Id!} + ListFooterComponent={ + <> + + + + + } + /> + ); +} diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/music/artist/[artistId].tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/music/artist/[artistId].tsx new file mode 100644 index 00000000..fe2631e9 --- /dev/null +++ b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/music/artist/[artistId].tsx @@ -0,0 +1,273 @@ +import { Ionicons } from "@expo/vector-icons"; +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { getItemsApi, getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api"; +import { FlashList } from "@shopify/flash-list"; +import { useQuery } from "@tanstack/react-query"; +import { Image } from "expo-image"; +import { useLocalSearchParams, useNavigation } from "expo-router"; +import { useAtom } from "jotai"; +import { useCallback, useEffect, useMemo, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { Dimensions, TouchableOpacity, View } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { HorizontalScroll } from "@/components/common/HorizontalScroll"; +import { Text } from "@/components/common/Text"; +import { Loader } from "@/components/Loader"; +import { CreatePlaylistModal } from "@/components/music/CreatePlaylistModal"; +import { MusicAlbumCard } from "@/components/music/MusicAlbumCard"; +import { MusicTrackItem } from "@/components/music/MusicTrackItem"; +import { PlaylistPickerSheet } from "@/components/music/PlaylistPickerSheet"; +import { TrackOptionsSheet } from "@/components/music/TrackOptionsSheet"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { useMusicPlayer } from "@/providers/MusicPlayerProvider"; +import { getPrimaryImageUrl } from "@/utils/jellyfin/image/getPrimaryImageUrl"; + +const { width: SCREEN_WIDTH } = Dimensions.get("window"); +const ARTWORK_SIZE = SCREEN_WIDTH * 0.4; + +export default function ArtistDetailScreen() { + const { artistId } = useLocalSearchParams<{ artistId: string }>(); + const [api] = useAtom(apiAtom); + const [user] = useAtom(userAtom); + const insets = useSafeAreaInsets(); + const navigation = useNavigation(); + const { t } = useTranslation(); + const { playQueue } = useMusicPlayer(); + + const [selectedTrack, setSelectedTrack] = useState(null); + const [trackOptionsOpen, setTrackOptionsOpen] = useState(false); + const [playlistPickerOpen, setPlaylistPickerOpen] = useState(false); + const [createPlaylistOpen, setCreatePlaylistOpen] = useState(false); + + const handleTrackOptionsPress = useCallback((track: BaseItemDto) => { + setSelectedTrack(track); + setTrackOptionsOpen(true); + }, []); + + const handleAddToPlaylist = useCallback(() => { + setPlaylistPickerOpen(true); + }, []); + + const handleCreateNewPlaylist = useCallback(() => { + setCreatePlaylistOpen(true); + }, []); + + const { data: artist, isLoading: loadingArtist } = useQuery({ + queryKey: ["music-artist", artistId, user?.Id], + queryFn: async () => { + const response = await getUserLibraryApi(api!).getItem({ + userId: user?.Id, + itemId: artistId!, + }); + return response.data; + }, + enabled: !!api && !!user?.Id && !!artistId, + }); + + const { data: albums, isLoading: loadingAlbums } = useQuery({ + queryKey: ["music-artist-albums", artistId, user?.Id], + queryFn: async () => { + const response = await getItemsApi(api!).getItems({ + userId: user?.Id, + artistIds: [artistId!], + includeItemTypes: ["MusicAlbum"], + sortBy: ["ProductionYear", "SortName"], + sortOrder: ["Descending", "Ascending"], + recursive: true, + }); + return response.data.Items || []; + }, + enabled: !!api && !!user?.Id && !!artistId, + }); + + const { data: topTracks, isLoading: loadingTracks } = useQuery({ + queryKey: ["music-artist-top-tracks", artistId, user?.Id], + queryFn: async () => { + const response = await getItemsApi(api!).getItems({ + userId: user?.Id, + artistIds: [artistId!], + includeItemTypes: ["Audio"], + sortBy: ["PlayCount"], + sortOrder: ["Descending"], + limit: 10, + recursive: true, + filters: ["IsPlayed"], + }); + return response.data.Items || []; + }, + enabled: !!api && !!user?.Id && !!artistId, + }); + + useEffect(() => { + navigation.setOptions({ + title: artist?.Name ?? "", + headerTransparent: true, + headerStyle: { backgroundColor: "transparent" }, + headerShadowVisible: false, + }); + }, [artist?.Name, navigation]); + + const imageUrl = useMemo( + () => (artist ? getPrimaryImageUrl({ api, item: artist }) : null), + [api, artist], + ); + + const handlePlayAllTracks = useCallback(() => { + if (topTracks && topTracks.length > 0) { + playQueue(topTracks, 0); + } + }, [playQueue, topTracks]); + + const isLoading = loadingArtist || loadingAlbums || loadingTracks; + + // Only show loading if we have no cached data to display + if (isLoading && !artist) { + return ( + + + + ); + } + + if (!artist) { + return ( + + {t("music.artist_not_found")} + + ); + } + + const sections = []; + + // Top tracks section + if (topTracks && topTracks.length > 0) { + sections.push({ + id: "top-tracks", + title: t("music.top_tracks"), + type: "tracks" as const, + data: topTracks, + }); + } + + // Albums section + if (albums && albums.length > 0) { + sections.push({ + id: "albums", + title: t("music.tabs.albums"), + type: "albums" as const, + data: albums, + }); + } + + return ( + + {/* Artist image */} + + {imageUrl ? ( + + ) : ( + + + + )} + + + {/* Artist info */} + + {artist.Name} + + + {albums?.length || 0} {t("music.tabs.albums").toLowerCase()} + + + {/* Play button */} + {topTracks && topTracks.length > 0 && ( + + + + {t("music.play_top_tracks")} + + + )} + + } + renderItem={({ item: section }) => ( + + {section.title} + {section.type === "albums" ? ( + item.Id!} + renderItem={(item) => } + /> + ) : ( + section.data + .slice(0, 5) + .map((track, index) => ( + + )) + )} + + )} + keyExtractor={(item) => item.id} + ListFooterComponent={ + <> + + + + + } + /> + ); +} diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/music/playlist/[playlistId].tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/music/playlist/[playlistId].tsx new file mode 100644 index 00000000..346e40aa --- /dev/null +++ b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/music/playlist/[playlistId].tsx @@ -0,0 +1,315 @@ +import { Ionicons } from "@expo/vector-icons"; +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { getItemsApi, getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api"; +import { FlashList } from "@shopify/flash-list"; +import { useQuery } from "@tanstack/react-query"; +import { Image } from "expo-image"; +import { useLocalSearchParams, useNavigation } from "expo-router"; +import { useAtom } from "jotai"; +import { useCallback, useEffect, useMemo, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { ActivityIndicator, TouchableOpacity, View } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Text } from "@/components/common/Text"; +import { Loader } from "@/components/Loader"; +import { CreatePlaylistModal } from "@/components/music/CreatePlaylistModal"; +import { MusicTrackItem } from "@/components/music/MusicTrackItem"; +import { PlaylistOptionsSheet } from "@/components/music/PlaylistOptionsSheet"; +import { PlaylistPickerSheet } from "@/components/music/PlaylistPickerSheet"; +import { TrackOptionsSheet } from "@/components/music/TrackOptionsSheet"; +import { useRemoveFromPlaylist } from "@/hooks/usePlaylistMutations"; +import { downloadTrack, getLocalPath } from "@/providers/AudioStorage"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { useMusicPlayer } from "@/providers/MusicPlayerProvider"; +import { getAudioStreamUrl } from "@/utils/jellyfin/audio/getAudioStreamUrl"; +import { getPrimaryImageUrl } from "@/utils/jellyfin/image/getPrimaryImageUrl"; +import { runtimeTicksToMinutes } from "@/utils/time"; + +const ARTWORK_SIZE = 120; + +export default function PlaylistDetailScreen() { + const { playlistId } = useLocalSearchParams<{ playlistId: string }>(); + const [api] = useAtom(apiAtom); + const [user] = useAtom(userAtom); + const insets = useSafeAreaInsets(); + const navigation = useNavigation(); + const { t } = useTranslation(); + const { playQueue } = useMusicPlayer(); + + const [selectedTrack, setSelectedTrack] = useState(null); + const [trackOptionsOpen, setTrackOptionsOpen] = useState(false); + const [playlistPickerOpen, setPlaylistPickerOpen] = useState(false); + const [createPlaylistOpen, setCreatePlaylistOpen] = useState(false); + const [playlistOptionsOpen, setPlaylistOptionsOpen] = useState(false); + const [isDownloading, setIsDownloading] = useState(false); + + const removeFromPlaylist = useRemoveFromPlaylist(); + + const handleTrackOptionsPress = useCallback((track: BaseItemDto) => { + setSelectedTrack(track); + setTrackOptionsOpen(true); + }, []); + + const handleAddToPlaylist = useCallback(() => { + setPlaylistPickerOpen(true); + }, []); + + const handleCreateNewPlaylist = useCallback(() => { + setCreatePlaylistOpen(true); + }, []); + + const handleRemoveFromPlaylist = useCallback(() => { + if (selectedTrack?.Id && playlistId) { + removeFromPlaylist.mutate({ + playlistId, + entryIds: [selectedTrack.PlaylistItemId ?? selectedTrack.Id], + }); + } + }, [selectedTrack, playlistId, removeFromPlaylist]); + + const { data: playlist, isLoading: loadingPlaylist } = useQuery({ + queryKey: ["music-playlist", playlistId, user?.Id], + queryFn: async () => { + const response = await getUserLibraryApi(api!).getItem({ + userId: user?.Id, + itemId: playlistId!, + }); + return response.data; + }, + enabled: !!api && !!user?.Id && !!playlistId, + }); + + const { data: tracks, isLoading: loadingTracks } = useQuery({ + queryKey: ["music-playlist-tracks", playlistId, user?.Id], + queryFn: async () => { + const response = await getItemsApi(api!).getItems({ + userId: user?.Id, + parentId: playlistId, + }); + return response.data.Items || []; + }, + enabled: !!api && !!user?.Id && !!playlistId, + }); + + useEffect(() => { + navigation.setOptions({ + title: playlist?.Name ?? "", + headerTransparent: true, + headerStyle: { backgroundColor: "transparent" }, + headerShadowVisible: false, + headerRight: () => ( + setPlaylistOptionsOpen(true)} + className='p-1.5' + > + + + ), + }); + }, [playlist?.Name, navigation]); + + const imageUrl = useMemo( + () => (playlist ? getPrimaryImageUrl({ api, item: playlist }) : null), + [api, playlist], + ); + + const totalDuration = useMemo(() => { + if (!tracks) return ""; + const totalTicks = tracks.reduce( + (acc, track) => acc + (track.RunTimeTicks || 0), + 0, + ); + return runtimeTicksToMinutes(totalTicks); + }, [tracks]); + + const handlePlayAll = useCallback(() => { + if (tracks && tracks.length > 0) { + playQueue(tracks, 0); + } + }, [playQueue, tracks]); + + const handleShuffle = useCallback(() => { + if (tracks && tracks.length > 0) { + const shuffled = [...tracks].sort(() => Math.random() - 0.5); + playQueue(shuffled, 0); + } + }, [playQueue, tracks]); + + // Check if all tracks are already downloaded + const allTracksDownloaded = useMemo(() => { + if (!tracks || tracks.length === 0) return false; + return tracks.every((track) => !!getLocalPath(track.Id)); + }, [tracks]); + + const handleDownloadPlaylist = useCallback(async () => { + if (!tracks || !api || !user?.Id || isDownloading) return; + + setIsDownloading(true); + try { + for (const track of tracks) { + if (!track.Id || getLocalPath(track.Id)) continue; + const result = await getAudioStreamUrl(api, user.Id, track.Id); + if (result?.url && !result.isTranscoding) { + await downloadTrack(track.Id, result.url, { + permanent: true, + container: result.mediaSource?.Container || undefined, + }); + } + } + } catch { + // Silent fail + } + setIsDownloading(false); + }, [tracks, api, user?.Id, isDownloading]); + + const isLoading = loadingPlaylist || loadingTracks; + + // Only show loading if we have no cached data to display + if (isLoading && !playlist) { + return ( + + + + ); + } + + if (!playlist) { + return ( + + + {t("music.playlist_not_found")} + + + ); + } + + return ( + + {/* Playlist artwork */} + + {imageUrl ? ( + + ) : ( + + + + )} + + + {/* Playlist info */} + + {playlist.Name} + + + {tracks?.length} tracks โ€ข {totalDuration} + + + {/* Play buttons */} + + + + + {t("music.play")} + + + + + + {t("music.shuffle")} + + + + {isDownloading ? ( + + ) : ( + + )} + + + + } + renderItem={({ item, index }) => ( + + )} + keyExtractor={(item) => item.Id!} + ListFooterComponent={ + <> + + + + + + } + /> + ); +} diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites)/persons/[personId].tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/persons/[personId].tsx similarity index 100% rename from app/(auth)/(tabs)/(home,libraries,search,favorites)/persons/[personId].tsx rename to app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/persons/[personId].tsx diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites)/jellyseerr/company/[companyId].tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/seerr/company/[companyId].tsx similarity index 69% rename from app/(auth)/(tabs)/(home,libraries,search,favorites)/jellyseerr/company/[companyId].tsx rename to app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/seerr/company/[companyId].tsx index cd9cc3cc..359ebfd1 100644 --- a/app/(auth)/(tabs)/(home,libraries,search,favorites)/jellyseerr/company/[companyId].tsx +++ b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/seerr/company/[companyId].tsx @@ -3,9 +3,9 @@ import { Image } from "expo-image"; import { useLocalSearchParams } from "expo-router"; import { uniqBy } from "lodash"; import { useMemo } from "react"; -import ParallaxSlideShow from "@/components/jellyseerr/ParallaxSlideShow"; -import JellyseerrPoster from "@/components/posters/JellyseerrPoster"; -import { Endpoints, useJellyseerr } from "@/hooks/useJellyseerr"; +import SeerrPoster from "@/components/posters/SeerrPoster"; +import ParallaxSlideShow from "@/components/seerr/ParallaxSlideShow"; +import { Endpoints, useSeerr } from "@/hooks/useSeerr"; import { DiscoverSliderType } from "@/utils/jellyseerr/server/constants/discover"; import { type MovieResult, @@ -13,34 +13,33 @@ import { } from "@/utils/jellyseerr/server/models/Search"; import { COMPANY_LOGO_IMAGE_FILTER } from "@/utils/jellyseerr/src/components/Discover/NetworkSlider"; -export default function page() { +export default function CompanyPage() { const local = useLocalSearchParams(); - const { jellyseerrApi, isJellyseerrMovieOrTvResult } = useJellyseerr(); + const { seerrApi, isSeerrMovieOrTvResult } = useSeerr(); const { companyId, image, type } = local as unknown as { companyId: string; name: string; image: string; - type: DiscoverSliderType; + type: DiscoverSliderType; //This gets converted to a string because it's a url param }; - const { data, fetchNextPage, hasNextPage } = useInfiniteQuery({ - queryKey: ["jellyseerr", "company", type, companyId], + const { data, fetchNextPage, hasNextPage, isLoading } = useInfiniteQuery({ + queryKey: ["seerr", "company", type, companyId], queryFn: async ({ pageParam }) => { const params: any = { page: Number(pageParam), }; - - return jellyseerrApi?.discover( + return seerrApi?.discover( `${ - type === DiscoverSliderType.NETWORKS + Number(type) === DiscoverSliderType.NETWORKS ? Endpoints.DISCOVER_TV_NETWORK : Endpoints.DISCOVER_MOVIES_STUDIO }/${companyId}`, params, ); }, - enabled: !!jellyseerrApi && !!companyId, + enabled: !!seerrApi && !!companyId, initialPageParam: 1, getNextPageParam: (lastPage, pages) => (lastPage?.page || pages?.findLast((p) => p?.results.length)?.page || 1) + @@ -54,8 +53,7 @@ export default function page() { data?.pages ?.filter((p) => p?.results.length) .flatMap( - (p) => - p?.results.filter((r) => isJellyseerrMovieOrTvResult(r)) ?? [], + (p) => p?.results.filter((r) => isSeerrMovieOrTvResult(r)) ?? [], ), "id", ) ?? [], @@ -64,15 +62,15 @@ export default function page() { const backdrops = useMemo( () => - jellyseerrApi + seerrApi ? flatData.map((r) => - jellyseerrApi.imageProxy( + seerrApi.imageProxy( (r as TvResult | MovieResult).backdropPath, "w1920_and_h800_multi_faces", ), ) : [], - [jellyseerrApi, flatData], + [seerrApi, flatData], ); return ( @@ -86,13 +84,14 @@ export default function page() { fetchNextPage(); } }} + isLoading={isLoading} logo={ } - renderItem={(item, _index) => } + renderItem={(item, _index) => } /> ); } diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites)/jellyseerr/genre/[genreId].tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/seerr/genre/[genreId].tsx similarity index 67% rename from app/(auth)/(tabs)/(home,libraries,search,favorites)/jellyseerr/genre/[genreId].tsx rename to app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/seerr/genre/[genreId].tsx index 7ea00808..a61cff40 100644 --- a/app/(auth)/(tabs)/(home,libraries,search,favorites)/jellyseerr/genre/[genreId].tsx +++ b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/seerr/genre/[genreId].tsx @@ -3,15 +3,15 @@ import { useLocalSearchParams } from "expo-router"; import { uniqBy } from "lodash"; import { useMemo } from "react"; import { Text } from "@/components/common/Text"; -import { textShadowStyle } from "@/components/jellyseerr/discover/GenericSlideCard"; -import ParallaxSlideShow from "@/components/jellyseerr/ParallaxSlideShow"; -import JellyseerrPoster from "@/components/posters/JellyseerrPoster"; -import { Endpoints, useJellyseerr } from "@/hooks/useJellyseerr"; +import SeerrPoster from "@/components/posters/SeerrPoster"; +import { textShadowStyle } from "@/components/seerr/discover/GenericSlideCard"; +import ParallaxSlideShow from "@/components/seerr/ParallaxSlideShow"; +import { Endpoints, useSeerr } from "@/hooks/useSeerr"; import { DiscoverSliderType } from "@/utils/jellyseerr/server/constants/discover"; -export default function page() { +export default function GenrePage() { const local = useLocalSearchParams(); - const { jellyseerrApi, isJellyseerrMovieOrTvResult } = useJellyseerr(); + const { seerrApi, isSeerrMovieOrTvResult } = useSeerr(); const { genreId, name, type } = local as unknown as { genreId: string; @@ -20,21 +20,21 @@ export default function page() { }; const { data, fetchNextPage, hasNextPage } = useInfiniteQuery({ - queryKey: ["jellyseerr", "company", type, genreId], + queryKey: ["seerr", "company", type, genreId], queryFn: async ({ pageParam }) => { const params: any = { page: Number(pageParam), genre: genreId, }; - return jellyseerrApi?.discover( + return seerrApi?.discover( type === DiscoverSliderType.MOVIE_GENRES ? Endpoints.DISCOVER_MOVIES : Endpoints.DISCOVER_TV, params, ); }, - enabled: !!jellyseerrApi && !!genreId, + enabled: !!seerrApi && !!genreId, initialPageParam: 1, getNextPageParam: (lastPage, pages) => (lastPage?.page || pages?.findLast((p) => p?.results.length)?.page || 1) + @@ -48,8 +48,7 @@ export default function page() { data?.pages ?.filter((p) => p?.results.length) .flatMap( - (p) => - p?.results.filter((r) => isJellyseerrMovieOrTvResult(r)) ?? [], + (p) => p?.results.filter((r) => isSeerrMovieOrTvResult(r)) ?? [], ), "id", ) ?? [], @@ -58,15 +57,12 @@ export default function page() { const backdrops = useMemo( () => - jellyseerrApi + seerrApi ? flatData.map((r) => - jellyseerrApi.imageProxy( - r.backdropPath, - "w1920_and_h800_multi_faces", - ), + seerrApi.imageProxy(r.backdropPath, "w1920_and_h800_multi_faces"), ) : [], - [jellyseerrApi, flatData], + [seerrApi, flatData], ); return ( @@ -91,7 +87,7 @@ export default function page() { {name} } - renderItem={(item, _index) => } + renderItem={(item, _index) => } /> ); } diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites)/jellyseerr/page.tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/seerr/page.tsx similarity index 87% rename from app/(auth)/(tabs)/(home,libraries,search,favorites)/jellyseerr/page.tsx rename to app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/seerr/page.tsx index c8ab71ab..901f5032 100644 --- a/app/(auth)/(tabs)/(home,libraries,search,favorites)/jellyseerr/page.tsx +++ b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/seerr/page.tsx @@ -8,7 +8,7 @@ import { } from "@gorhom/bottom-sheet"; import { useQuery } from "@tanstack/react-query"; import { Image } from "expo-image"; -import { useLocalSearchParams, useNavigation, useRouter } from "expo-router"; +import { useLocalSearchParams, useNavigation } from "expo-router"; import type React from "react"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; @@ -18,17 +18,18 @@ import { toast } from "sonner-native"; import { Button } from "@/components/Button"; import { Text } from "@/components/common/Text"; import { GenreTags } from "@/components/GenreTags"; -import Cast from "@/components/jellyseerr/Cast"; -import DetailFacts from "@/components/jellyseerr/DetailFacts"; -import RequestModal from "@/components/jellyseerr/RequestModal"; import { OverviewText } from "@/components/OverviewText"; import { ParallaxScrollView } from "@/components/ParallaxPage"; import { PlatformDropdown } from "@/components/PlatformDropdown"; -import { JellyserrRatings } from "@/components/Ratings"; -import JellyseerrSeasons from "@/components/series/JellyseerrSeasons"; +import { SeerrRatings } from "@/components/Ratings"; +import Cast from "@/components/seerr/Cast"; +import DetailFacts from "@/components/seerr/DetailFacts"; +import RequestModal from "@/components/seerr/RequestModal"; +import SeerrSeasons from "@/components/series/SeerrSeasons"; import { ItemActions } from "@/components/series/SeriesActions"; -import { useJellyseerr } from "@/hooks/useJellyseerr"; -import { useJellyseerrCanRequest } from "@/utils/_jellyseerr/useJellyseerrCanRequest"; +import useRouter from "@/hooks/useAppRouter"; +import { useSeerr } from "@/hooks/useSeerr"; +import { useSeerrCanRequest } from "@/utils/_seerr/useSeerrCanRequest"; import { ANIME_KEYWORD_ID } from "@/utils/jellyseerr/server/api/themoviedb/constants"; import { type IssueType, @@ -67,7 +68,7 @@ const Page: React.FC = () => { } & Partial; const navigation = useNavigation(); - const { jellyseerrApi, jellyseerrUser, requestMedia } = useJellyseerr(); + const { seerrApi, seerrUser, requestMedia } = useSeerr(); const [issueType, setIssueType] = useState(); const [issueMessage, setIssueMessage] = useState(); @@ -82,8 +83,8 @@ const Page: React.FC = () => { isLoading, refetch, } = useQuery({ - enabled: !!jellyseerrApi && !!result && !!result.id, - queryKey: ["jellyseerr", "detail", mediaType, result.id], + enabled: !!seerrApi && !!result && !!result.id, + queryKey: ["seerr", "detail", mediaType, result.id], staleTime: 0, refetchOnMount: true, refetchOnReconnect: true, @@ -92,21 +93,18 @@ const Page: React.FC = () => { refetchInterval: 0, queryFn: async () => { return mediaType === MediaType.MOVIE - ? jellyseerrApi?.movieDetails(result.id!) - : jellyseerrApi?.tvDetails(result.id!); + ? seerrApi?.movieDetails(result.id!) + : seerrApi?.tvDetails(result.id!); }, }); const [canRequest, hasAdvancedRequestPermission] = - useJellyseerrCanRequest(details); + useSeerrCanRequest(details); const canManageRequests = useMemo(() => { - if (!jellyseerrUser) return false; - return hasPermission( - Permission.MANAGE_REQUESTS, - jellyseerrUser.permissions, - ); - }, [jellyseerrUser]); + if (!seerrUser) return false; + return hasPermission(Permission.MANAGE_REQUESTS, seerrUser.permissions); + }, [seerrUser]); const pendingRequest = useMemo(() => { return details?.mediaInfo?.requests?.find( @@ -118,27 +116,27 @@ const Page: React.FC = () => { if (!pendingRequest?.id) return; try { - await jellyseerrApi?.approveRequest(pendingRequest.id); - toast.success(t("jellyseerr.toasts.request_approved")); + await seerrApi?.approveRequest(pendingRequest.id); + toast.success(t("seerr.toasts.request_approved")); refetch(); } catch (error) { - toast.error(t("jellyseerr.toasts.failed_to_approve_request")); + toast.error(t("seerr.toasts.failed_to_approve_request")); console.error("Failed to approve request:", error); } - }, [jellyseerrApi, pendingRequest, refetch, t]); + }, [seerrApi, pendingRequest, refetch, t]); const handleDeclineRequest = useCallback(async () => { if (!pendingRequest?.id) return; try { - await jellyseerrApi?.declineRequest(pendingRequest.id); - toast.success(t("jellyseerr.toasts.request_declined")); + await seerrApi?.declineRequest(pendingRequest.id); + toast.success(t("seerr.toasts.request_declined")); refetch(); } catch (error) { - toast.error(t("jellyseerr.toasts.failed_to_decline_request")); + toast.error(t("seerr.toasts.failed_to_decline_request")); console.error("Failed to decline request:", error); } - }, [jellyseerrApi, pendingRequest, refetch, t]); + }, [seerrApi, pendingRequest, refetch, t]); const renderBackdrop = useCallback( (props: BottomSheetBackdropProps) => ( @@ -153,7 +151,7 @@ const Page: React.FC = () => { const submitIssue = useCallback(() => { if (result.id && issueType && issueMessage && details) { - jellyseerrApi + seerrApi ?.submitIssue(details.mediaInfo.id, Number(issueType), issueMessage) .then(() => { setIssueType(undefined); @@ -161,7 +159,7 @@ const Page: React.FC = () => { bottomSheetModalRef?.current?.close(); }); } - }, [jellyseerrApi, details, result, issueType, issueMessage]); + }, [seerrApi, details, result, issueType, issueMessage]); const handleIssueModalDismiss = useCallback(() => { setIssueTypeDropdownOpen(false); @@ -213,7 +211,7 @@ const Page: React.FC = () => { const issueTypeOptionGroups = useMemo( () => [ { - title: t("jellyseerr.types"), + title: t("seerr.types"), options: Object.entries(IssueTypeName) .reverse() .map(([key, value]) => ({ @@ -264,7 +262,7 @@ const Page: React.FC = () => { height: "100%", }} source={{ - uri: jellyseerrApi?.imageProxy( + uri: seerrApi?.imageProxy( result.backdropPath, "w1920_and_h800_multi_faces", ), @@ -294,7 +292,7 @@ const Page: React.FC = () => { - { /> ) : canRequest ? ( ) : ( details?.mediaInfo?.jellyfinMediaId && ( @@ -352,7 +350,7 @@ const Page: React.FC = () => { }} > - {t("jellyseerr.report_issue_button")} + {t("seerr.report_issue_button")} )} @@ -388,12 +386,12 @@ const Page: React.FC = () => { - {t("jellyseerr.requested_by", { + {t("seerr.requested_by", { user: pendingRequest.requestedBy?.displayName || pendingRequest.requestedBy?.username || pendingRequest.requestedBy?.jellyfinUsername || - t("jellyseerr.unknown_user"), + t("seerr.unknown_user"), })} @@ -414,7 +412,7 @@ const Page: React.FC = () => { borderStyle: "solid", }} > - {t("jellyseerr.approve")} + {t("seerr.approve")} @@ -441,7 +439,7 @@ const Page: React.FC = () => { {mediaType === MediaType.TV && ( - { - {t("jellyseerr.whats_wrong")} + {t("seerr.whats_wrong")} - {t("jellyseerr.issue_type")} + {t("seerr.issue_type")} { {issueType ? IssueTypeName[issueType] - : t("jellyseerr.select_an_issue")} + : t("seerr.select_an_issue")} } - title={t("jellyseerr.types")} + title={t("seerr.types")} open={issueTypeDropdownOpen} onOpenChange={setIssueTypeDropdownOpen} /> @@ -521,7 +519,7 @@ const Page: React.FC = () => { maxLength={254} style={{ color: "white" }} clearButtonMode='always' - placeholder={t("jellyseerr.describe_the_issue")} + placeholder={t("seerr.describe_the_issue")} placeholderTextColor='#9CA3AF' // Issue with multiline + Textinput inside a portal // https://github.com/callstack/react-native-paper/issues/1668 @@ -531,7 +529,7 @@ const Page: React.FC = () => { diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites)/jellyseerr/person/[personId].tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/seerr/person/[personId].tsx similarity index 69% rename from app/(auth)/(tabs)/(home,libraries,search,favorites)/jellyseerr/person/[personId].tsx rename to app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/seerr/person/[personId].tsx index 0bfb35be..fd44bff4 100644 --- a/app/(auth)/(tabs)/(home,libraries,search,favorites)/jellyseerr/person/[personId].tsx +++ b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/seerr/person/[personId].tsx @@ -5,31 +5,27 @@ import { orderBy, uniqBy } from "lodash"; import { useMemo } from "react"; import { useTranslation } from "react-i18next"; import { Text } from "@/components/common/Text"; -import ParallaxSlideShow from "@/components/jellyseerr/ParallaxSlideShow"; import { OverviewText } from "@/components/OverviewText"; -import JellyseerrPoster from "@/components/posters/JellyseerrPoster"; -import { useJellyseerr } from "@/hooks/useJellyseerr"; +import SeerrPoster from "@/components/posters/SeerrPoster"; +import ParallaxSlideShow from "@/components/seerr/ParallaxSlideShow"; +import { useSeerr } from "@/hooks/useSeerr"; import type { PersonCreditCast } from "@/utils/jellyseerr/server/models/Person"; -export default function page() { +export default function PersonPage() { const local = useLocalSearchParams(); const { t } = useTranslation(); - const { - jellyseerrApi, - jellyseerrRegion: region, - jellyseerrLocale: locale, - } = useJellyseerr(); + const { seerrApi, seerrRegion: region, seerrLocale: locale } = useSeerr(); const { personId } = local as { personId: string }; const { data } = useQuery({ - queryKey: ["jellyseerr", "person", personId], + queryKey: ["seerr", "person", personId], queryFn: async () => ({ - details: await jellyseerrApi?.personDetails(personId), - combinedCredits: await jellyseerrApi?.personCombinedCredits(personId), + details: await seerrApi?.personDetails(personId), + combinedCredits: await seerrApi?.personCombinedCredits(personId), }), - enabled: !!jellyseerrApi && !!personId, + enabled: !!seerrApi && !!personId, }); const castedRoles: PersonCreditCast[] = useMemo( @@ -46,22 +42,19 @@ export default function page() { ); const backdrops = useMemo( () => - jellyseerrApi + seerrApi ? castedRoles.map((c) => - jellyseerrApi.imageProxy( - c.backdropPath, - "w1920_and_h800_multi_faces", - ), + seerrApi.imageProxy(c.backdropPath, "w1920_and_h800_multi_faces"), ) : [], - [jellyseerrApi, data?.combinedCredits], + [seerrApi, data?.combinedCredits], ); return ( item.id.toString()} logo={ {data?.details?.name} - {t("jellyseerr.born")}{" "} + {t("seerr.born")}{" "} {data?.details?.birthday && new Date(data.details.birthday).toLocaleDateString(locale, { year: "numeric", @@ -100,7 +93,7 @@ export default function page() { MainContent={() => ( )} - renderItem={(item, _index) => } + renderItem={(item, _index) => } /> ); } diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/series/[id].tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/series/[id].tsx new file mode 100644 index 00000000..9c2d3f48 --- /dev/null +++ b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/series/[id].tsx @@ -0,0 +1,216 @@ +import { Ionicons } from "@expo/vector-icons"; +import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api"; +import { useQuery } from "@tanstack/react-query"; +import { Image } from "expo-image"; +import { useLocalSearchParams, useNavigation } from "expo-router"; +import { useAtom } from "jotai"; +import type React from "react"; +import { useEffect, useMemo } from "react"; +import { useTranslation } from "react-i18next"; +import { Platform, View } from "react-native"; +import { AddToFavorites } from "@/components/AddToFavorites"; +import { DownloadItems } from "@/components/DownloadItem"; +import { ParallaxScrollView } from "@/components/ParallaxPage"; +import { NextUp } from "@/components/series/NextUp"; +import { SeasonPicker } from "@/components/series/SeasonPicker"; +import { SeriesHeader } from "@/components/series/SeriesHeader"; +import { useDownload } from "@/providers/DownloadProvider"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { OfflineModeProvider } from "@/providers/OfflineModeProvider"; +import { + buildOfflineSeriesFromEpisodes, + getDownloadedEpisodesForSeries, +} from "@/utils/downloads/offline-series"; +import { getBackdropUrl } from "@/utils/jellyfin/image/getBackdropUrl"; +import { getLogoImageUrlById } from "@/utils/jellyfin/image/getLogoImageUrlById"; +import { getUserItemData } from "@/utils/jellyfin/user-library/getUserItemData"; +import { storage } from "@/utils/mmkv"; + +const page: React.FC = () => { + const navigation = useNavigation(); + const { t } = useTranslation(); + const params = useLocalSearchParams(); + const { + id: seriesId, + seasonIndex, + offline: offlineParam, + } = params as { + id: string; + seasonIndex: string; + offline?: string; + }; + + const isOffline = offlineParam === "true"; + + const [api] = useAtom(apiAtom); + const [user] = useAtom(userAtom); + const { getDownloadedItems, downloadedItems } = useDownload(); + + // For offline mode, construct series data from downloaded episodes + // Include downloadedItems.length so query refetches when items are deleted + const { data: item } = useQuery({ + queryKey: ["series", seriesId, isOffline, downloadedItems.length], + queryFn: async () => { + if (isOffline) { + return buildOfflineSeriesFromEpisodes(getDownloadedItems(), seriesId); + } + return await getUserItemData({ + api, + userId: user?.Id, + itemId: seriesId, + }); + }, + staleTime: isOffline ? Infinity : 60 * 1000, + enabled: isOffline || (!!api && !!user?.Id), + }); + + // For offline mode, use stored base64 image + const base64Image = useMemo(() => { + if (isOffline) { + return storage.getString(seriesId); + } + return null; + }, [isOffline, seriesId]); + + const backdropUrl = useMemo(() => { + if (isOffline && base64Image) { + return `data:image/jpeg;base64,${base64Image}`; + } + return getBackdropUrl({ + api, + item, + quality: 90, + width: 1000, + }); + }, [isOffline, base64Image, api, item]); + + const logoUrl = useMemo(() => { + if (isOffline) { + return null; // No logo in offline mode + } + return getLogoImageUrlById({ + api, + item, + }); + }, [isOffline, api, item]); + + const { data: allEpisodes, isLoading } = useQuery({ + queryKey: ["AllEpisodes", seriesId, isOffline, downloadedItems.length], + queryFn: async () => { + if (isOffline) { + return getDownloadedEpisodesForSeries(getDownloadedItems(), seriesId); + } + if (!api || !user?.Id) return []; + + const res = await getTvShowsApi(api).getEpisodes({ + seriesId: seriesId, + userId: user.Id, + enableUserData: true, + fields: ["MediaSources", "MediaStreams", "Overview", "Trickplay"], + }); + return res?.data.Items || []; + }, + select: (data) => + [...(data || [])].sort( + (a, b) => + (a.ParentIndexNumber ?? 0) - (b.ParentIndexNumber ?? 0) || + (a.IndexNumber ?? 0) - (b.IndexNumber ?? 0), + ), + staleTime: isOffline ? Infinity : 60, + enabled: isOffline || (!!api && !!user?.Id), + }); + + useEffect(() => { + // Don't show header buttons in offline mode + if (isOffline) { + navigation.setOptions({ + headerRight: () => null, + }); + return; + } + + navigation.setOptions({ + headerRight: () => + !isLoading && item && allEpisodes && allEpisodes.length > 0 ? ( + + + {!Platform.isTV && ( + ( + + )} + DownloadedIconComponent={() => ( + + )} + /> + )} + + ) : null, + }); + }, [allEpisodes, isLoading, item, isOffline]); + + // For offline mode, we can show the page even without backdropUrl + if (!item || (!isOffline && !backdropUrl)) return null; + + return ( + + + ) : ( + + ) + } + logo={ + logoUrl ? ( + + ) : undefined + } + > + + + {!isOffline && ( + + + + )} + + + + + ); +}; + +export default page; diff --git a/app/(auth)/(tabs)/(libraries)/[libraryId].tsx b/app/(auth)/(tabs)/(libraries)/[libraryId].tsx index 481881fc..d96bf5b5 100644 --- a/app/(auth)/(tabs)/(libraries)/[libraryId].tsx +++ b/app/(auth)/(tabs)/(libraries)/[libraryId].tsx @@ -2,6 +2,7 @@ import type { BaseItemDto, BaseItemDtoQueryResult, BaseItemKind, + ItemFilter, } from "@jellyfin/sdk/lib/generated-client/models"; import { getFilterApi, @@ -27,7 +28,11 @@ import { useOrientation } from "@/hooks/useOrientation"; import * as ScreenOrientation from "@/packages/expo-screen-orientation"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; import { + FilterByOption, + FilterByPreferenceAtom, + filterByAtom, genreFilterAtom, + getFilterByPreference, getSortByPreference, getSortOrderPreference, SortByOption, @@ -39,12 +44,19 @@ import { sortOrderOptions, sortOrderPreferenceAtom, tagsFilterAtom, + useFilterOptions, yearFilterAtom, } from "@/utils/atoms/filters"; +import { useSettings } from "@/utils/atoms/settings"; const Page = () => { - const searchParams = useLocalSearchParams(); - const { libraryId } = searchParams as { libraryId: string }; + const searchParams = useLocalSearchParams() as { + libraryId: string; + sortBy?: string; + sortOrder?: string; + filterBy?: string; + }; + const { libraryId } = searchParams; const [api] = useAtom(apiAtom); const [user] = useAtom(userAtom); @@ -54,9 +66,13 @@ const Page = () => { const [selectedYears, setSelectedYears] = useAtom(yearFilterAtom); const [selectedTags, setSelectedTags] = useAtom(tagsFilterAtom); const [sortBy, _setSortBy] = useAtom(sortByAtom); + const [filterBy, _setFilterBy] = useAtom(filterByAtom); const [sortOrder, _setSortOrder] = useAtom(sortOrderAtom); const [sortByPreference, setSortByPreference] = useAtom(sortByPreferenceAtom); - const [sortOrderPreference, setOderByPreference] = useAtom( + const [filterByPreference, setFilterByPreference] = useAtom( + FilterByPreferenceAtom, + ); + const [sortOrderPreference, setOrderByPreference] = useAtom( sortOrderPreferenceAtom, ); @@ -65,17 +81,33 @@ const Page = () => { const { t } = useTranslation(); useEffect(() => { - const sop = getSortOrderPreference(libraryId, sortOrderPreference); - if (sop) { - _setSortOrder([sop]); + // Check for URL params first (from "See All" navigation) + const urlSortBy = searchParams.sortBy as SortByOption | undefined; + const urlSortOrder = searchParams.sortOrder as SortOrderOption | undefined; + const urlFilterBy = searchParams.filterBy as FilterByOption | undefined; + + // Apply sortOrder: URL param > saved preference > default + if (urlSortOrder && Object.values(SortOrderOption).includes(urlSortOrder)) { + _setSortOrder([urlSortOrder]); } else { - _setSortOrder([SortOrderOption.Ascending]); + const sop = getSortOrderPreference(libraryId, sortOrderPreference); + _setSortOrder([sop || SortOrderOption.Ascending]); } - const obp = getSortByPreference(libraryId, sortByPreference); - if (obp) { - _setSortBy([obp]); + + // Apply sortBy: URL param > saved preference > default + if (urlSortBy && Object.values(SortByOption).includes(urlSortBy)) { + _setSortBy([urlSortBy]); } else { - _setSortBy([SortByOption.SortName]); + const obp = getSortByPreference(libraryId, sortByPreference); + _setSortBy([obp || SortByOption.SortName]); + } + + // Apply filterBy: URL param > saved preference > default + if (urlFilterBy && Object.values(FilterByOption).includes(urlFilterBy)) { + _setFilterBy([urlFilterBy]); + } else { + const fp = getFilterByPreference(libraryId, filterByPreference); + _setFilterBy(fp ? [fp] : []); } }, [ libraryId, @@ -83,6 +115,11 @@ const Page = () => { sortByPreference, _setSortOrder, _setSortBy, + filterByPreference, + _setFilterBy, + searchParams.sortBy, + searchParams.sortOrder, + searchParams.filterBy, ]); const setSortBy = useCallback( @@ -100,14 +137,28 @@ const Page = () => { (sortOrder: SortOrderOption[]) => { const sop = getSortOrderPreference(libraryId, sortOrderPreference); if (sortOrder[0] !== sop) { - setOderByPreference({ + setOrderByPreference({ ...sortOrderPreference, [libraryId]: sortOrder[0], }); } _setSortOrder(sortOrder); }, - [libraryId, sortOrderPreference, setOderByPreference, _setSortOrder], + [libraryId, sortOrderPreference, setOrderByPreference, _setSortOrder], + ); + + const setFilter = useCallback( + (filterBy: FilterByOption[]) => { + const fp = getFilterByPreference(libraryId, filterByPreference); + if (filterBy[0] !== fp) { + setFilterByPreference({ + ...filterByPreference, + [libraryId]: filterBy[0], + }); + } + _setFilterBy(filterBy); + }, + [libraryId, filterByPreference, setFilterByPreference, _setFilterBy], ); const nrOfCols = useMemo(() => { @@ -158,6 +209,10 @@ const Page = () => { itemType = "Series"; } else if (library.CollectionType === "boxsets") { itemType = "BoxSet"; + } else if (library.CollectionType === "homevideos") { + itemType = "Video"; + } else if (library.CollectionType === "musicvideos") { + itemType = "MusicVideo"; } const response = await getItemsApi(api).getItems({ @@ -168,6 +223,7 @@ const Page = () => { sortBy: [sortBy[0], "SortName", "ProductionYear"], sortOrder: [sortOrder[0]], enableImageTypes: ["Primary", "Backdrop", "Banner", "Thumb"], + filters: filterBy as ItemFilter[], // true is needed for merged versions recursive: true, imageTypeLimit: 1, @@ -190,6 +246,7 @@ const Page = () => { selectedTags, sortBy, sortOrder, + filterBy, ], ); @@ -203,6 +260,7 @@ const Page = () => { selectedTags, sortBy, sortOrder, + filterBy, ], queryFn: fetchItems, getNextPageParam: (lastPage, pages) => { @@ -268,7 +326,8 @@ const Page = () => { ); const keyExtractor = useCallback((item: BaseItemDto) => item.Id || "", []); - + const generalFilters = useFilterOptions(); + const settings = useSettings(); const ListHeaderComponent = useCallback( () => ( { /> ), }, + { + key: "filterOptions", + component: ( + generalFilters.map((s) => s.key)} + set={setFilter} + values={filterBy} + title={t("library.filters.filter_by")} + renderItemLabel={(item) => + generalFilters.find((i) => i.key === item)?.value || "" + } + searchFilter={(item, search) => + item.toLowerCase().includes(search.toLowerCase()) + } + /> + ), + }, ]} renderItem={({ item }) => item.component} keyExtractor={(item) => item.key} @@ -424,6 +503,9 @@ const Page = () => { sortOrder, setSortOrder, isFetching, + filterBy, + setFilter, + settings, ], ); diff --git a/app/(auth)/(tabs)/(libraries)/index.tsx b/app/(auth)/(tabs)/(libraries)/index.tsx index b56397f9..37b89bbf 100644 --- a/app/(auth)/(tabs)/(libraries)/index.tsx +++ b/app/(auth)/(tabs)/(libraries)/index.tsx @@ -39,7 +39,6 @@ export default function index() { () => data ?.filter((l) => !settings?.hiddenLibraries?.includes(l.Id!)) - .filter((l) => l.CollectionType !== "music") .filter((l) => l.CollectionType !== "books") || [], [data, settings?.hiddenLibraries], ); diff --git a/app/(auth)/(tabs)/(libraries)/music/[libraryId]/_layout.tsx b/app/(auth)/(tabs)/(libraries)/music/[libraryId]/_layout.tsx new file mode 100644 index 00000000..69daf929 --- /dev/null +++ b/app/(auth)/(tabs)/(libraries)/music/[libraryId]/_layout.tsx @@ -0,0 +1,85 @@ +import { + createMaterialTopTabNavigator, + MaterialTopTabNavigationEventMap, + MaterialTopTabNavigationOptions, +} from "@react-navigation/material-top-tabs"; +import type { + ParamListBase, + TabNavigationState, +} from "@react-navigation/native"; +import { Stack, useLocalSearchParams, withLayoutContext } from "expo-router"; +import { useTranslation } from "react-i18next"; + +const { Navigator } = createMaterialTopTabNavigator(); + +const TAB_LABEL_FONT_SIZE = 13; +const TAB_ITEM_HORIZONTAL_PADDING = 12; + +export const Tab = withLayoutContext< + MaterialTopTabNavigationOptions, + typeof Navigator, + TabNavigationState, + MaterialTopTabNavigationEventMap +>(Navigator); + +const Layout = () => { + const { libraryId } = useLocalSearchParams<{ libraryId: string }>(); + const { t } = useTranslation(); + + return ( + <> + + + + + + + + + ); +}; + +export default Layout; diff --git a/app/(auth)/(tabs)/(libraries)/music/[libraryId]/albums.tsx b/app/(auth)/(tabs)/(libraries)/music/[libraryId]/albums.tsx new file mode 100644 index 00000000..3fb5305b --- /dev/null +++ b/app/(auth)/(tabs)/(libraries)/music/[libraryId]/albums.tsx @@ -0,0 +1,120 @@ +import { getItemsApi } from "@jellyfin/sdk/lib/utils/api"; +import { useRoute } from "@react-navigation/native"; +import { FlashList } from "@shopify/flash-list"; +import { useInfiniteQuery } from "@tanstack/react-query"; +import { useLocalSearchParams } from "expo-router"; +import { useAtom } from "jotai"; +import { useCallback, useMemo } from "react"; +import { useTranslation } from "react-i18next"; +import { RefreshControl, View } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Text } from "@/components/common/Text"; +import { Loader } from "@/components/Loader"; +import { MusicAlbumRowCard } from "@/components/music/MusicAlbumRowCard"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; + +const ITEMS_PER_PAGE = 40; + +export default function AlbumsScreen() { + const localParams = useLocalSearchParams<{ libraryId?: string | string[] }>(); + const route = useRoute(); + const libraryId = + (Array.isArray(localParams.libraryId) + ? localParams.libraryId[0] + : localParams.libraryId) ?? route?.params?.libraryId; + const [api] = useAtom(apiAtom); + const [user] = useAtom(userAtom); + const insets = useSafeAreaInsets(); + const { t } = useTranslation(); + + const { + data, + isLoading, + fetchNextPage, + hasNextPage, + isFetchingNextPage, + refetch, + } = useInfiniteQuery({ + queryKey: ["music-albums", libraryId, user?.Id], + queryFn: async ({ pageParam = 0 }) => { + const response = await getItemsApi(api!).getItems({ + userId: user?.Id, + parentId: libraryId, + includeItemTypes: ["MusicAlbum"], + sortBy: ["SortName"], + sortOrder: ["Ascending"], + limit: ITEMS_PER_PAGE, + startIndex: pageParam, + recursive: true, + }); + return { + items: response.data.Items || [], + totalCount: response.data.TotalRecordCount || 0, + startIndex: pageParam, + }; + }, + getNextPageParam: (lastPage) => { + const nextStart = lastPage.startIndex + ITEMS_PER_PAGE; + return nextStart < lastPage.totalCount ? nextStart : undefined; + }, + initialPageParam: 0, + enabled: !!api && !!user?.Id && !!libraryId, + }); + + const albums = useMemo(() => { + return data?.pages.flatMap((page) => page.items) || []; + }, [data]); + + const handleEndReached = useCallback(() => { + if (hasNextPage && !isFetchingNextPage) { + fetchNextPage(); + } + }, [hasNextPage, isFetchingNextPage, fetchNextPage]); + + if (isLoading) { + return ( + + + + ); + } + + if (albums.length === 0) { + return ( + + {t("music.no_albums")} + + ); + } + + return ( + + + } + onEndReached={handleEndReached} + onEndReachedThreshold={0.5} + renderItem={({ item }) => } + keyExtractor={(item) => item.Id!} + ListFooterComponent={ + isFetchingNextPage ? ( + + + + ) : null + } + /> + + ); +} diff --git a/app/(auth)/(tabs)/(libraries)/music/[libraryId]/artists.tsx b/app/(auth)/(tabs)/(libraries)/music/[libraryId]/artists.tsx new file mode 100644 index 00000000..e8191404 --- /dev/null +++ b/app/(auth)/(tabs)/(libraries)/music/[libraryId]/artists.tsx @@ -0,0 +1,157 @@ +import { getArtistsApi } from "@jellyfin/sdk/lib/utils/api"; +import { useRoute } from "@react-navigation/native"; +import { FlashList } from "@shopify/flash-list"; +import { useInfiniteQuery } from "@tanstack/react-query"; +import { useLocalSearchParams } from "expo-router"; +import { useAtom } from "jotai"; +import { useCallback, useMemo } from "react"; +import { useTranslation } from "react-i18next"; +import { RefreshControl, View } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Text } from "@/components/common/Text"; +import { Loader } from "@/components/Loader"; +import { MusicArtistCard } from "@/components/music/MusicArtistCard"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; + +// Web uses Limit=100 +const ITEMS_PER_PAGE = 100; + +export default function ArtistsScreen() { + const localParams = useLocalSearchParams<{ libraryId?: string | string[] }>(); + const route = useRoute(); + const libraryId = + (Array.isArray(localParams.libraryId) + ? localParams.libraryId[0] + : localParams.libraryId) ?? route?.params?.libraryId; + const [api] = useAtom(apiAtom); + const [user] = useAtom(userAtom); + const insets = useSafeAreaInsets(); + const { t } = useTranslation(); + + const isReady = Boolean(api && user?.Id && libraryId); + + const { + data, + isLoading, + isError, + error, + fetchNextPage, + hasNextPage, + isFetchingNextPage, + refetch, + } = useInfiniteQuery({ + queryKey: ["music-artists", libraryId, user?.Id], + queryFn: async ({ pageParam = 0 }) => { + const response = await getArtistsApi(api!).getArtists({ + userId: user?.Id, + parentId: libraryId, + sortBy: ["SortName"], + sortOrder: ["Ascending"], + fields: ["PrimaryImageAspectRatio", "SortName"], + imageTypeLimit: 1, + enableImageTypes: ["Primary", "Backdrop", "Banner", "Thumb"], + limit: ITEMS_PER_PAGE, + startIndex: pageParam, + }); + return { + items: response.data.Items || [], + totalCount: response.data.TotalRecordCount || 0, + startIndex: pageParam, + }; + }, + getNextPageParam: (lastPage) => { + const nextStart = lastPage.startIndex + ITEMS_PER_PAGE; + return nextStart < lastPage.totalCount ? nextStart : undefined; + }, + initialPageParam: 0, + enabled: isReady, + }); + + const artists = useMemo(() => { + return data?.pages.flatMap((page) => page.items) || []; + }, [data]); + + const handleEndReached = useCallback(() => { + if (hasNextPage && !isFetchingNextPage) { + fetchNextPage(); + } + }, [hasNextPage, isFetchingNextPage, fetchNextPage]); + + if (!api || !user?.Id) { + return ( + + + + ); + } + + if (!libraryId) { + return ( + + + Missing music library id. + + + ); + } + + // Only show loading if we have no cached data to display + if (isLoading && artists.length === 0) { + return ( + + + + ); + } + + // Only show error if we have no cached data to display + // This allows offline access to previously cached artists + if (isError && artists.length === 0) { + return ( + + + Failed to load artists: {(error as Error)?.message || "Unknown error"} + + + ); + } + + if (artists.length === 0) { + return ( + + {t("music.no_artists")} + + ); + } + + return ( + + + } + onEndReached={handleEndReached} + onEndReachedThreshold={0.5} + renderItem={({ item }) => } + keyExtractor={(item) => item.Id!} + ListFooterComponent={ + isFetchingNextPage ? ( + + + + ) : null + } + /> + + ); +} diff --git a/app/(auth)/(tabs)/(libraries)/music/[libraryId]/playlists.tsx b/app/(auth)/(tabs)/(libraries)/music/[libraryId]/playlists.tsx new file mode 100644 index 00000000..a03f9c3d --- /dev/null +++ b/app/(auth)/(tabs)/(libraries)/music/[libraryId]/playlists.tsx @@ -0,0 +1,234 @@ +import { Ionicons } from "@expo/vector-icons"; +import { getItemsApi } from "@jellyfin/sdk/lib/utils/api"; +import { useNavigation, useRoute } from "@react-navigation/native"; +import { FlashList } from "@shopify/flash-list"; +import { useInfiniteQuery } from "@tanstack/react-query"; +import { useLocalSearchParams } from "expo-router"; +import { useAtom } from "jotai"; +import { useCallback, useLayoutEffect, useMemo, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { RefreshControl, TouchableOpacity, View } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Text } from "@/components/common/Text"; +import { Loader } from "@/components/Loader"; +import { CreatePlaylistModal } from "@/components/music/CreatePlaylistModal"; +import { MusicPlaylistCard } from "@/components/music/MusicPlaylistCard"; +import { + type PlaylistSortOption, + type PlaylistSortOrder, + PlaylistSortSheet, +} from "@/components/music/PlaylistSortSheet"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; + +const ITEMS_PER_PAGE = 40; + +export default function PlaylistsScreen() { + const localParams = useLocalSearchParams<{ libraryId?: string | string[] }>(); + const route = useRoute(); + const navigation = useNavigation(); + const libraryId = + (Array.isArray(localParams.libraryId) + ? localParams.libraryId[0] + : localParams.libraryId) ?? route?.params?.libraryId; + const [api] = useAtom(apiAtom); + const [user] = useAtom(userAtom); + const insets = useSafeAreaInsets(); + const { t } = useTranslation(); + + const [createModalOpen, setCreateModalOpen] = useState(false); + const [sortSheetOpen, setSortSheetOpen] = useState(false); + const [sortBy, setSortBy] = useState("SortName"); + const [sortOrder, setSortOrder] = useState("Ascending"); + + const isReady = Boolean(api && user?.Id && libraryId); + + const handleSortChange = useCallback( + (newSortBy: PlaylistSortOption, newSortOrder: PlaylistSortOrder) => { + setSortBy(newSortBy); + setSortOrder(newSortOrder); + }, + [], + ); + + useLayoutEffect(() => { + navigation.setOptions({ + headerRight: () => ( + setCreateModalOpen(true)} + className='mr-4' + hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }} + > + + + ), + }); + }, [navigation]); + + const { + data, + isLoading, + isError, + error, + fetchNextPage, + hasNextPage, + isFetchingNextPage, + refetch, + } = useInfiniteQuery({ + queryKey: ["music-playlists", libraryId, user?.Id, sortBy, sortOrder], + queryFn: async ({ pageParam = 0 }) => { + const response = await getItemsApi(api!).getItems({ + userId: user?.Id, + includeItemTypes: ["Playlist"], + sortBy: [sortBy], + sortOrder: [sortOrder], + limit: ITEMS_PER_PAGE, + startIndex: pageParam, + recursive: true, + mediaTypes: ["Audio"], + }); + return { + items: response.data.Items || [], + totalCount: response.data.TotalRecordCount || 0, + startIndex: pageParam, + }; + }, + getNextPageParam: (lastPage) => { + const nextStart = lastPage.startIndex + ITEMS_PER_PAGE; + return nextStart < lastPage.totalCount ? nextStart : undefined; + }, + initialPageParam: 0, + enabled: isReady, + }); + + const playlists = useMemo(() => { + return data?.pages.flatMap((page) => page.items) || []; + }, [data]); + + const handleEndReached = useCallback(() => { + if (hasNextPage && !isFetchingNextPage) { + fetchNextPage(); + } + }, [hasNextPage, isFetchingNextPage, fetchNextPage]); + + if (!api || !user?.Id) { + return ( + + + + ); + } + + if (!libraryId) { + return ( + + + Missing music library id. + + + ); + } + + // Only show loading if we have no cached data to display + if (isLoading && playlists.length === 0) { + return ( + + + + ); + } + + // Only show error if we have no cached data to display + // This allows offline access to previously cached playlists + if (isError && playlists.length === 0) { + return ( + + + Failed to load playlists:{" "} + {(error as Error)?.message || "Unknown error"} + + + ); + } + + if (playlists.length === 0) { + return ( + + {t("music.no_playlists")} + setCreateModalOpen(true)} + className='flex-row items-center bg-purple-600 px-6 py-3 rounded-full' + > + + + {t("music.playlists.create_playlist")} + + + + + ); + } + + return ( + + + } + onEndReached={handleEndReached} + onEndReachedThreshold={0.5} + ListHeaderComponent={ + setSortSheetOpen(true)} + className='flex-row items-center mb-2 py-1' + > + + + {t( + `music.sort.${sortBy === "SortName" ? "alphabetical" : "date_created"}`, + )} + + + + } + renderItem={({ item }) => } + keyExtractor={(item) => item.Id!} + ListFooterComponent={ + isFetchingNextPage ? ( + + + + ) : null + } + /> + + + + ); +} diff --git a/app/(auth)/(tabs)/(libraries)/music/[libraryId]/suggestions.tsx b/app/(auth)/(tabs)/(libraries)/music/[libraryId]/suggestions.tsx new file mode 100644 index 00000000..fb762862 --- /dev/null +++ b/app/(auth)/(tabs)/(libraries)/music/[libraryId]/suggestions.tsx @@ -0,0 +1,333 @@ +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { getItemsApi } from "@jellyfin/sdk/lib/utils/api"; +import { useRoute } from "@react-navigation/native"; +import { FlashList } from "@shopify/flash-list"; +import { useQuery } from "@tanstack/react-query"; +import { useLocalSearchParams } from "expo-router"; +import { useAtom } from "jotai"; +import { useCallback, useMemo, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { RefreshControl, View } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { HorizontalScroll } from "@/components/common/HorizontalScroll"; +import { Text } from "@/components/common/Text"; +import { Loader } from "@/components/Loader"; +import { CreatePlaylistModal } from "@/components/music/CreatePlaylistModal"; +import { MusicAlbumCard } from "@/components/music/MusicAlbumCard"; +import { MusicTrackItem } from "@/components/music/MusicTrackItem"; +import { PlaylistPickerSheet } from "@/components/music/PlaylistPickerSheet"; +import { TrackOptionsSheet } from "@/components/music/TrackOptionsSheet"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { writeDebugLog } from "@/utils/log"; + +export default function SuggestionsScreen() { + const localParams = useLocalSearchParams<{ libraryId?: string | string[] }>(); + const route = useRoute(); + const libraryId = + (Array.isArray(localParams.libraryId) + ? localParams.libraryId[0] + : localParams.libraryId) ?? route?.params?.libraryId; + const [api] = useAtom(apiAtom); + const [user] = useAtom(userAtom); + const insets = useSafeAreaInsets(); + const { t } = useTranslation(); + + const [selectedTrack, setSelectedTrack] = useState(null); + const [trackOptionsOpen, setTrackOptionsOpen] = useState(false); + const [playlistPickerOpen, setPlaylistPickerOpen] = useState(false); + const [createPlaylistOpen, setCreatePlaylistOpen] = useState(false); + + const handleTrackOptionsPress = useCallback((track: BaseItemDto) => { + setSelectedTrack(track); + setTrackOptionsOpen(true); + }, []); + + const handleAddToPlaylist = useCallback(() => { + setPlaylistPickerOpen(true); + }, []); + + const handleCreateNewPlaylist = useCallback(() => { + setCreatePlaylistOpen(true); + }, []); + + const isReady = Boolean(api && user?.Id && libraryId); + + writeDebugLog("Music suggestions params", { + libraryId, + localParams, + routeParams: route?.params, + isReady, + }); + + // Latest audio - uses the same endpoint as web: /Users/{userId}/Items/Latest + // This returns the most recently added albums + const { + data: latestAlbums, + isLoading: loadingLatest, + isError: isLatestError, + error: latestError, + refetch: refetchLatest, + } = useQuery({ + queryKey: ["music-latest", libraryId, user?.Id], + queryFn: async () => { + // Prefer the exact endpoint the Web client calls (HAR): + // /Users/{userId}/Items/Latest?IncludeItemTypes=Audio&ParentId=... + // IMPORTANT: must use api.get(...) (not axiosInstance.get(fullUrl)) so the auth header is attached. + const res = await api!.get( + `/Users/${user!.Id}/Items/Latest`, + { + params: { + IncludeItemTypes: "Audio", + Limit: 20, + Fields: "PrimaryImageAspectRatio", + ParentId: libraryId, + ImageTypeLimit: 1, + EnableImageTypes: "Primary,Backdrop,Banner,Thumb", + EnableTotalRecordCount: false, + }, + }, + ); + + if (Array.isArray(res.data) && res.data.length > 0) { + return res.data; + } + + // Fallback: ask for albums directly via /Items (more reliable across server variants) + const fallback = await getItemsApi(api!).getItems({ + userId: user!.Id, + parentId: libraryId, + includeItemTypes: ["MusicAlbum"], + sortBy: ["DateCreated"], + sortOrder: ["Descending"], + limit: 20, + recursive: true, + fields: ["PrimaryImageAspectRatio", "SortName"], + imageTypeLimit: 1, + enableImageTypes: ["Primary", "Backdrop", "Banner", "Thumb"], + enableTotalRecordCount: false, + }); + return fallback.data.Items || []; + }, + enabled: isReady, + }); + + // Recently played - matches web: SortBy=DatePlayed, Filters=IsPlayed + const { + data: recentlyPlayed, + isLoading: loadingRecentlyPlayed, + isError: isRecentlyPlayedError, + error: recentlyPlayedError, + refetch: refetchRecentlyPlayed, + } = useQuery({ + queryKey: ["music-recently-played", libraryId, user?.Id], + queryFn: async () => { + const response = await getItemsApi(api!).getItems({ + userId: user?.Id, + parentId: libraryId, + includeItemTypes: ["Audio"], + sortBy: ["DatePlayed"], + sortOrder: ["Descending"], + limit: 10, + recursive: true, + fields: ["PrimaryImageAspectRatio", "SortName"], + filters: ["IsPlayed"], + imageTypeLimit: 1, + enableImageTypes: ["Primary", "Backdrop", "Banner", "Thumb"], + enableTotalRecordCount: false, + }); + return response.data.Items || []; + }, + enabled: isReady, + }); + + // Frequently played - matches web: SortBy=PlayCount, Filters=IsPlayed + const { + data: frequentlyPlayed, + isLoading: loadingFrequent, + isError: isFrequentError, + error: frequentError, + refetch: refetchFrequent, + } = useQuery({ + queryKey: ["music-frequently-played", libraryId, user?.Id], + queryFn: async () => { + const response = await getItemsApi(api!).getItems({ + userId: user?.Id, + parentId: libraryId, + includeItemTypes: ["Audio"], + sortBy: ["PlayCount"], + sortOrder: ["Descending"], + limit: 10, + recursive: true, + fields: ["PrimaryImageAspectRatio", "SortName"], + filters: ["IsPlayed"], + imageTypeLimit: 1, + enableImageTypes: ["Primary", "Backdrop", "Banner", "Thumb"], + enableTotalRecordCount: false, + }); + return response.data.Items || []; + }, + enabled: isReady, + }); + + const isLoading = loadingLatest || loadingRecentlyPlayed || loadingFrequent; + + const handleRefresh = useCallback(() => { + refetchLatest(); + refetchRecentlyPlayed(); + refetchFrequent(); + }, [refetchLatest, refetchRecentlyPlayed, refetchFrequent]); + + const sections = useMemo(() => { + const result: { + title: string; + data: BaseItemDto[]; + type: "albums" | "tracks"; + }[] = []; + + // Latest albums section + if (latestAlbums && latestAlbums.length > 0) { + result.push({ + title: t("music.recently_added"), + data: latestAlbums, + type: "albums", + }); + } + + // Recently played tracks + if (recentlyPlayed && recentlyPlayed.length > 0) { + result.push({ + title: t("music.recently_played"), + data: recentlyPlayed, + type: "tracks", + }); + } + + // Frequently played tracks + if (frequentlyPlayed && frequentlyPlayed.length > 0) { + result.push({ + title: t("music.frequently_played"), + data: frequentlyPlayed, + type: "tracks", + }); + } + + return result; + }, [latestAlbums, frequentlyPlayed, recentlyPlayed, t]); + + if (!api || !user?.Id) { + return ( + + + + ); + } + + if (!libraryId) { + return ( + + + Missing music library id. + + + ); + } + + // Only show loading if we have no cached data to display + if (isLoading && sections.length === 0) { + return ( + + + + ); + } + + // Only show error if we have no cached data to display + // This allows offline access to previously cached suggestions + if ( + (isLatestError || isRecentlyPlayedError || isFrequentError) && + sections.length === 0 + ) { + const msg = + (latestError as Error | undefined)?.message || + (recentlyPlayedError as Error | undefined)?.message || + (frequentError as Error | undefined)?.message || + "Unknown error"; + return ( + + + Failed to load music: {msg} + + + ); + } + + if (sections.length === 0) { + return ( + + {t("music.no_suggestions")} + + ); + } + + return ( + + + } + renderItem={({ item: section }) => ( + + {section.title} + {section.type === "albums" ? ( + item.Id!} + renderItem={(item) => } + /> + ) : ( + section.data + .slice(0, 5) + .map((track, index, _tracks) => ( + + )) + )} + + )} + keyExtractor={(item) => item.title} + /> + + + + + ); +} diff --git a/app/(auth)/(tabs)/(search)/_layout.tsx b/app/(auth)/(tabs)/(search)/_layout.tsx index f4d34978..b008c04d 100644 --- a/app/(auth)/(tabs)/(search)/_layout.tsx +++ b/app/(auth)/(tabs)/(search)/_layout.tsx @@ -33,17 +33,17 @@ export default function SearchLayout() { headerShadowVisible: false, }} /> - + diff --git a/app/(auth)/(tabs)/(search)/index.tsx b/app/(auth)/(tabs)/(search)/index.tsx index bedf5ffa..cff07dd4 100644 --- a/app/(auth)/(tabs)/(search)/index.tsx +++ b/app/(auth)/(tabs)/(search)/index.tsx @@ -3,9 +3,11 @@ import type { BaseItemKind, } from "@jellyfin/sdk/lib/generated-client/models"; import { getItemsApi } from "@jellyfin/sdk/lib/utils/api"; +import { useAsyncDebouncer } from "@tanstack/react-pacer"; import { useQuery } from "@tanstack/react-query"; import axios from "axios"; -import { router, useLocalSearchParams, useNavigation } from "expo-router"; +import { Image } from "expo-image"; +import { useLocalSearchParams, useNavigation } from "expo-router"; import { useAtom } from "jotai"; import { useCallback, @@ -19,26 +21,28 @@ import { import { useTranslation } from "react-i18next"; import { Platform, ScrollView, TouchableOpacity, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; -import { useDebounce } from "use-debounce"; import ContinueWatchingPoster from "@/components/ContinueWatchingPoster"; import { Input } from "@/components/common/Input"; import { Text } from "@/components/common/Text"; import { TouchableItemRouter } from "@/components/common/TouchableItemRouter"; import { ItemCardText } from "@/components/ItemCardText"; -import { - JellyseerrSearchSort, - JellyserrIndexPage, -} from "@/components/jellyseerr/JellyseerrIndexPage"; import MoviePoster from "@/components/posters/MoviePoster"; import SeriesPoster from "@/components/posters/SeriesPoster"; import { DiscoverFilters } from "@/components/search/DiscoverFilters"; import { LoadingSkeleton } from "@/components/search/LoadingSkeleton"; import { SearchItemWrapper } from "@/components/search/SearchItemWrapper"; import { SearchTabButtons } from "@/components/search/SearchTabButtons"; -import { useJellyseerr } from "@/hooks/useJellyseerr"; +import { + SeerrIndexPage, + SeerrSearchSort, +} from "@/components/seerr/SeerrIndexPage"; +import useRouter from "@/hooks/useAppRouter"; +import { useSeerr } from "@/hooks/useSeerr"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; import { useSettings } from "@/utils/atoms/settings"; import { eventBus } from "@/utils/eventBus"; +import { getPrimaryImageUrl } from "@/utils/jellyfin/image/getPrimaryImageUrl"; +import { createStreamystatsApi } from "@/utils/streamystats"; type SearchType = "Library" | "Discover"; @@ -51,9 +55,10 @@ const exampleSearches = [ "The Mandalorian", ]; -export default function search() { +export default function SearchPage() { const params = useLocalSearchParams(); const insets = useSafeAreaInsets(); + const router = useRouter(); const [user] = useAtom(userAtom); @@ -67,21 +72,32 @@ export default function search() { const [searchType, setSearchType] = useState("Library"); const [search, setSearch] = useState(""); - const [debouncedSearch] = useDebounce(search, 500); + const [debouncedSearch, setDebouncedSearch] = useState(""); + const abortControllerRef = useRef(null); + + const searchDebouncer = useAsyncDebouncer( + async (query: string) => { + // Cancel previous in-flight requests + abortControllerRef.current?.abort(); + abortControllerRef.current = new AbortController(); + setDebouncedSearch(query); + return query; + }, + { wait: 200 }, + ); + + useEffect(() => { + searchDebouncer.maybeExecute(search); + }, [search]); const [api] = useAtom(apiAtom); const { settings } = useSettings(); - const { jellyseerrApi } = useJellyseerr(); - const [jellyseerrOrderBy, setJellyseerrOrderBy] = - useState( - JellyseerrSearchSort[ - JellyseerrSearchSort.DEFAULT - ] as unknown as JellyseerrSearchSort, - ); - const [jellyseerrSortOrder, setJellyseerrSortOrder] = useState< - "asc" | "desc" - >("desc"); + const { seerrApi } = useSeerr(); + const [seerrOrderBy, setSeerrOrderBy] = useState( + SeerrSearchSort[SeerrSearchSort.DEFAULT] as unknown as SeerrSearchSort, + ); + const [seerrSortOrder, setSeerrSortOrder] = useState<"asc" | "desc">("desc"); const searchEngine = useMemo(() => { return settings?.searchEngine || "Jellyfin"; @@ -97,9 +113,11 @@ export default function search() { async ({ types, query, + signal, }: { types: BaseItemKind[]; query: string; + signal?: AbortSignal; }): Promise => { if (!api || !query) { return []; @@ -107,16 +125,71 @@ export default function search() { try { if (searchEngine === "Jellyfin") { - const searchApi = await getItemsApi(api).getItems({ - searchTerm: query, - limit: 10, - includeItemTypes: types, - recursive: true, - userId: user?.Id, - }); + const searchApi = await getItemsApi(api).getItems( + { + searchTerm: query, + limit: 10, + includeItemTypes: types, + recursive: true, + userId: user?.Id, + }, + { signal }, + ); return (searchApi.data.Items as BaseItemDto[]) || []; } + + if (searchEngine === "Streamystats") { + if (!settings?.streamyStatsServerUrl || !api.accessToken) { + return []; + } + + const streamyStatsApi = createStreamystatsApi({ + serverUrl: settings.streamyStatsServerUrl, + jellyfinToken: api.accessToken, + }); + + const typeMap: Record = { + Movie: "movies", + Series: "series", + Episode: "episodes", + Person: "actors", + BoxSet: "movies", + Audio: "audio", + } as Record; + + const searchType = types.length === 1 ? typeMap[types[0]] : "media"; + const response = await streamyStatsApi.searchIds( + query, + searchType as "movies" | "series" | "episodes" | "actors" | "media", + 10, + signal, + ); + + const allIds: string[] = [ + ...(response.data.movies || []), + ...(response.data.series || []), + ...(response.data.episodes || []), + ...(response.data.actors || []), + ...(response.data.audio || []), + ]; + + if (!allIds.length) { + return []; + } + + const itemsResponse = await getItemsApi(api).getItems( + { + ids: allIds, + enableImageTypes: ["Primary", "Backdrop", "Thumb"], + }, + { signal }, + ); + + return (itemsResponse.data.Items as BaseItemDto[]) || []; + } + + // Marlin search if (!settings?.marlinServerUrl) { return []; } @@ -127,7 +200,7 @@ export default function search() { .map((type) => encodeURIComponent(type)) .join("&includeItemTypes=")}`; - const response1 = await axios.get(url); + const response1 = await axios.get(url, { signal }); const ids = response1.data.ids; @@ -135,18 +208,63 @@ export default function search() { return []; } - const response2 = await getItemsApi(api).getItems({ - ids, - enableImageTypes: ["Primary", "Backdrop", "Thumb"], - }); + const response2 = await getItemsApi(api).getItems( + { + ids, + enableImageTypes: ["Primary", "Backdrop", "Thumb"], + }, + { signal }, + ); return (response2.data.Items as BaseItemDto[]) || []; } catch (error) { - console.error("Error during search:", error); - return []; // Ensure an empty array is returned in case of an error + // Silently handle aborted requests + if (error instanceof Error && error.name === "AbortError") { + return []; + } + return []; } }, - [api, searchEngine, settings], + [api, searchEngine, settings, user?.Id], + ); + + // Separate search function for music types - always uses Jellyfin since Streamystats doesn't support music + const jellyfinSearchFn = useCallback( + async ({ + types, + query, + signal, + }: { + types: BaseItemKind[]; + query: string; + signal?: AbortSignal; + }): Promise => { + if (!api || !query) { + return []; + } + + try { + const searchApi = await getItemsApi(api).getItems( + { + searchTerm: query, + limit: 10, + includeItemTypes: types, + recursive: true, + userId: user?.Id, + }, + { signal }, + ); + + return (searchApi.data.Items as BaseItemDto[]) || []; + } catch (error) { + // Silently handle aborted requests + if (error instanceof Error && error.name === "AbortError") { + return []; + } + return []; + } + }, + [api, user?.Id], ); type HeaderSearchBarRef = { @@ -195,6 +313,7 @@ export default function search() { searchFn({ query: debouncedSearch, types: ["Movie"], + signal: abortControllerRef.current?.signal, }), enabled: searchType === "Library" && debouncedSearch.length > 0, }); @@ -205,6 +324,7 @@ export default function search() { searchFn({ query: debouncedSearch, types: ["Series"], + signal: abortControllerRef.current?.signal, }), enabled: searchType === "Library" && debouncedSearch.length > 0, }); @@ -215,6 +335,7 @@ export default function search() { searchFn({ query: debouncedSearch, types: ["Episode"], + signal: abortControllerRef.current?.signal, }), enabled: searchType === "Library" && debouncedSearch.length > 0, }); @@ -225,6 +346,7 @@ export default function search() { searchFn({ query: debouncedSearch, types: ["BoxSet"], + signal: abortControllerRef.current?.signal, }), enabled: searchType === "Library" && debouncedSearch.length > 0, }); @@ -235,6 +357,52 @@ export default function search() { searchFn({ query: debouncedSearch, types: ["Person"], + signal: abortControllerRef.current?.signal, + }), + enabled: searchType === "Library" && debouncedSearch.length > 0, + }); + + // Music search queries - always use Jellyfin since Streamystats doesn't support music + const { data: artists, isFetching: l9 } = useQuery({ + queryKey: ["search", "artists", debouncedSearch], + queryFn: () => + jellyfinSearchFn({ + query: debouncedSearch, + types: ["MusicArtist"], + signal: abortControllerRef.current?.signal, + }), + enabled: searchType === "Library" && debouncedSearch.length > 0, + }); + + const { data: albums, isFetching: l10 } = useQuery({ + queryKey: ["search", "albums", debouncedSearch], + queryFn: () => + jellyfinSearchFn({ + query: debouncedSearch, + types: ["MusicAlbum"], + signal: abortControllerRef.current?.signal, + }), + enabled: searchType === "Library" && debouncedSearch.length > 0, + }); + + const { data: songs, isFetching: l11 } = useQuery({ + queryKey: ["search", "songs", debouncedSearch], + queryFn: () => + jellyfinSearchFn({ + query: debouncedSearch, + types: ["Audio"], + signal: abortControllerRef.current?.signal, + }), + enabled: searchType === "Library" && debouncedSearch.length > 0, + }); + + const { data: playlists, isFetching: l12 } = useQuery({ + queryKey: ["search", "playlists", debouncedSearch], + queryFn: () => + jellyfinSearchFn({ + query: debouncedSearch, + types: ["Playlist"], + signal: abortControllerRef.current?.signal, }), enabled: searchType === "Library" && debouncedSearch.length > 0, }); @@ -245,13 +413,27 @@ export default function search() { episodes?.length || series?.length || collections?.length || - actors?.length + actors?.length || + artists?.length || + albums?.length || + songs?.length || + playlists?.length ); - }, [episodes, movies, series, collections, actors]); + }, [ + episodes, + movies, + series, + collections, + actors, + artists, + albums, + songs, + playlists, + ]); const loading = useMemo(() => { - return l1 || l2 || l3 || l7 || l8; - }, [l1, l2, l3, l7, l8]); + return l1 || l2 || l3 || l7 || l8 || l9 || l10 || l11 || l12; + }, [l1, l2, l3, l7, l8, l9, l10, l11, l12]); return ( {/* - {jellyseerrApi && ( + {seerrApi && ( )} @@ -398,12 +581,178 @@ export default function search() { )} /> + {/* Music search results */} + { + const imageUrl = getPrimaryImageUrl({ api, item }); + return ( + + + {imageUrl ? ( + + ) : ( + + ๐Ÿ‘ค + + )} + + + {item.Name} + + + ); + }} + /> + { + const imageUrl = getPrimaryImageUrl({ api, item }); + return ( + + + {imageUrl ? ( + + ) : ( + + ๐ŸŽต + + )} + + + {item.Name} + + + {item.AlbumArtist || item.Artists?.join(", ")} + + + ); + }} + /> + { + const imageUrl = getPrimaryImageUrl({ api, item }); + return ( + + + {imageUrl ? ( + + ) : ( + + ๐ŸŽต + + )} + + + {item.Name} + + + {item.Artists?.join(", ") || item.AlbumArtist} + + + ); + }} + /> + { + const imageUrl = getPrimaryImageUrl({ api, item }); + return ( + + + {imageUrl ? ( + + ) : ( + + ๐ŸŽถ + + )} + + + {item.Name} + + + {item.ChildCount} tracks + + + ); + }} + /> ) : ( - )} diff --git a/app/(auth)/(tabs)/(watchlists)/[watchlistId].tsx b/app/(auth)/(tabs)/(watchlists)/[watchlistId].tsx new file mode 100644 index 00000000..831feac7 --- /dev/null +++ b/app/(auth)/(tabs)/(watchlists)/[watchlistId].tsx @@ -0,0 +1,298 @@ +import { Ionicons } from "@expo/vector-icons"; +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { FlashList } from "@shopify/flash-list"; +import { useLocalSearchParams, useNavigation } from "expo-router"; +import { useAtomValue } from "jotai"; +import { useCallback, useEffect, useMemo, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { + ActivityIndicator, + Alert, + RefreshControl, + TouchableOpacity, + useWindowDimensions, + View, +} from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { HeaderBackButton } from "@/components/common/HeaderBackButton"; +import { Text } from "@/components/common/Text"; +import { TouchableItemRouter } from "@/components/common/TouchableItemRouter"; +import { ItemCardText } from "@/components/ItemCardText"; +import { ItemPoster } from "@/components/posters/ItemPoster"; +import useRouter from "@/hooks/useAppRouter"; +import { useOrientation } from "@/hooks/useOrientation"; +import { + useDeleteWatchlist, + useRemoveFromWatchlist, +} from "@/hooks/useWatchlistMutations"; +import { + useWatchlistDetailQuery, + useWatchlistItemsQuery, +} from "@/hooks/useWatchlists"; +import * as ScreenOrientation from "@/packages/expo-screen-orientation"; +import { userAtom } from "@/providers/JellyfinProvider"; + +export default function WatchlistDetailScreen() { + const { t } = useTranslation(); + const router = useRouter(); + const navigation = useNavigation(); + const insets = useSafeAreaInsets(); + const { watchlistId } = useLocalSearchParams<{ watchlistId: string }>(); + const user = useAtomValue(userAtom); + const { width: screenWidth } = useWindowDimensions(); + const { orientation } = useOrientation(); + + const watchlistIdNum = watchlistId + ? Number.parseInt(watchlistId, 10) + : undefined; + + const nrOfCols = useMemo(() => { + if (screenWidth < 300) return 2; + if (screenWidth < 500) return 3; + if (screenWidth < 800) return 5; + if (screenWidth < 1000) return 6; + if (screenWidth < 1500) return 7; + return 6; + }, [screenWidth]); + + const { + data: watchlist, + isLoading: watchlistLoading, + refetch: refetchWatchlist, + } = useWatchlistDetailQuery(watchlistIdNum); + + const { + data: items, + isLoading: itemsLoading, + refetch: refetchItems, + } = useWatchlistItemsQuery(watchlistIdNum); + + const deleteWatchlist = useDeleteWatchlist(); + const removeFromWatchlist = useRemoveFromWatchlist(); + const [refreshing, setRefreshing] = useState(false); + + const isOwner = useMemo( + () => watchlist?.userId === user?.Id, + [watchlist?.userId, user?.Id], + ); + + // Set up header + useEffect(() => { + navigation.setOptions({ + headerTitle: watchlist?.name || "", + headerLeft: () => , + headerRight: isOwner + ? () => ( + + + router.push(`/(auth)/(tabs)/(watchlists)/edit/${watchlistId}`) + } + className='p-2' + > + + + + + + + ) + : undefined, + }); + }, [navigation, watchlist?.name, isOwner, watchlistId]); + + const handleRefresh = useCallback(async () => { + setRefreshing(true); + await Promise.all([refetchWatchlist(), refetchItems()]); + setRefreshing(false); + }, [refetchWatchlist, refetchItems]); + + const handleDelete = useCallback(() => { + Alert.alert( + t("watchlists.delete_confirm_title"), + t("watchlists.delete_confirm_message", { name: watchlist?.name }), + [ + { text: t("watchlists.cancel_button"), style: "cancel" }, + { + text: t("watchlists.delete_button"), + style: "destructive", + onPress: async () => { + if (watchlistIdNum) { + await deleteWatchlist.mutateAsync(watchlistIdNum); + router.back(); + } + }, + }, + ], + ); + }, [deleteWatchlist, watchlistIdNum, watchlist?.name, router, t]); + + const handleRemoveItem = useCallback( + (item: BaseItemDto) => { + if (!watchlistIdNum || !item.Id) return; + + Alert.alert( + t("watchlists.remove_item_title"), + t("watchlists.remove_item_message", { name: item.Name }), + [ + { text: t("watchlists.cancel_button"), style: "cancel" }, + { + text: t("watchlists.remove_button"), + style: "destructive", + onPress: async () => { + await removeFromWatchlist.mutateAsync({ + watchlistId: watchlistIdNum, + itemId: item.Id!, + watchlistName: watchlist?.name, + }); + }, + }, + ], + ); + }, + [removeFromWatchlist, watchlistIdNum, watchlist?.name, t], + ); + + const renderItem = useCallback( + ({ item, index }: { item: BaseItemDto; index: number }) => ( + handleRemoveItem(item) : undefined} + > + + + + + + ), + [isOwner, handleRemoveItem, orientation, nrOfCols], + ); + + const ListHeader = useMemo( + () => + watchlist ? ( + + {watchlist.description && ( + + {watchlist.description} + + )} + + + + + {items?.length ?? 0}{" "} + {(items?.length ?? 0) === 1 + ? t("watchlists.item") + : t("watchlists.items")} + + + + + + {watchlist.isPublic + ? t("watchlists.public") + : t("watchlists.private")} + + + {!isOwner && ( + + {t("watchlists.by_owner")} + + )} + + + ) : null, + [watchlist, items?.length, isOwner, t], + ); + + const EmptyComponent = useMemo( + () => ( + + + + {t("watchlists.empty_watchlist")} + + {isOwner && ( + + {t("watchlists.empty_watchlist_hint")} + + )} + + ), + [isOwner, t], + ); + + const keyExtractor = useCallback((item: BaseItemDto) => item.Id || "", []); + + if (watchlistLoading || itemsLoading) { + return ( + + + + ); + } + + if (!watchlist) { + return ( + + + {t("watchlists.not_found")} + + + ); + } + + return ( + + } + renderItem={renderItem} + ItemSeparatorComponent={() => ( + + )} + /> + ); +} diff --git a/app/(auth)/(tabs)/(watchlists)/_layout.tsx b/app/(auth)/(tabs)/(watchlists)/_layout.tsx new file mode 100644 index 00000000..807530ac --- /dev/null +++ b/app/(auth)/(tabs)/(watchlists)/_layout.tsx @@ -0,0 +1,76 @@ +import { Ionicons } from "@expo/vector-icons"; +import { Stack } from "expo-router"; +import { useTranslation } from "react-i18next"; +import { Platform } from "react-native"; +import { Pressable } from "react-native-gesture-handler"; +import { nestedTabPageScreenOptions } from "@/components/stacks/NestedTabPageStack"; +import useRouter from "@/hooks/useAppRouter"; +import { useStreamystatsEnabled } from "@/hooks/useWatchlists"; + +export default function WatchlistsLayout() { + const { t } = useTranslation(); + const router = useRouter(); + const streamystatsEnabled = useStreamystatsEnabled(); + + return ( + + ( + + router.push("/(auth)/(tabs)/(watchlists)/create") + } + className='p-1.5' + > + + + ) + : undefined, + }} + /> + + + + {Object.entries(nestedTabPageScreenOptions).map(([name, options]) => ( + + ))} + + ); +} diff --git a/app/(auth)/(tabs)/(watchlists)/create.tsx b/app/(auth)/(tabs)/(watchlists)/create.tsx new file mode 100644 index 00000000..af77d5db --- /dev/null +++ b/app/(auth)/(tabs)/(watchlists)/create.tsx @@ -0,0 +1,221 @@ +import { Ionicons } from "@expo/vector-icons"; +import { useCallback, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { + ActivityIndicator, + KeyboardAvoidingView, + Platform, + ScrollView, + Switch, + TextInput, + TouchableOpacity, + View, +} from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Button } from "@/components/Button"; +import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; +import { useCreateWatchlist } from "@/hooks/useWatchlistMutations"; +import type { + StreamystatsWatchlistAllowedItemType, + StreamystatsWatchlistSortOrder, +} from "@/utils/streamystats/types"; + +const ITEM_TYPES: Array<{ + value: StreamystatsWatchlistAllowedItemType; + label: string; +}> = [ + { value: null, label: "All Types" }, + { value: "Movie", label: "Movies Only" }, + { value: "Series", label: "Series Only" }, + { value: "Episode", label: "Episodes Only" }, +]; + +const SORT_OPTIONS: Array<{ + value: StreamystatsWatchlistSortOrder; + label: string; +}> = [ + { value: "custom", label: "Custom Order" }, + { value: "name", label: "Name" }, + { value: "dateAdded", label: "Date Added" }, + { value: "releaseDate", label: "Release Date" }, +]; + +export default function CreateWatchlistScreen() { + const { t } = useTranslation(); + const router = useRouter(); + const insets = useSafeAreaInsets(); + const createWatchlist = useCreateWatchlist(); + + const [name, setName] = useState(""); + const [description, setDescription] = useState(""); + const [isPublic, setIsPublic] = useState(false); + const [allowedItemType, setAllowedItemType] = + useState(null); + const [defaultSortOrder, setDefaultSortOrder] = + useState("custom"); + + const handleCreate = useCallback(async () => { + if (!name.trim()) return; + + try { + await createWatchlist.mutateAsync({ + name: name.trim(), + description: description.trim() || undefined, + isPublic, + allowedItemType, + defaultSortOrder, + }); + router.back(); + } catch { + // Error handled by mutation + } + }, [ + name, + description, + isPublic, + allowedItemType, + defaultSortOrder, + createWatchlist, + router, + ]); + + return ( + + + {/* Name */} + + + {t("watchlists.name_label")} * + + + + + {/* Description */} + + + {t("watchlists.description_label")} + + + + + {/* Public Toggle */} + + + + {t("watchlists.is_public_label")} + + + {t("watchlists.is_public_description")} + + + + + + {/* Content Type */} + + + {t("watchlists.allowed_type_label")} + + + {ITEM_TYPES.map((type) => ( + setAllowedItemType(type.value)} + className={`px-4 py-2 rounded-lg ${allowedItemType === type.value ? "bg-purple-600" : "bg-neutral-800"}`} + > + + {type.label} + + + ))} + + + + {/* Sort Order */} + + + {t("watchlists.sort_order_label")} + + + {SORT_OPTIONS.map((sort) => ( + setDefaultSortOrder(sort.value)} + className={`px-4 py-2 rounded-lg ${defaultSortOrder === sort.value ? "bg-purple-600" : "bg-neutral-800"}`} + > + + {sort.label} + + + ))} + + + + {/* Create Button */} + + + + + + ); +} diff --git a/app/(auth)/(tabs)/(watchlists)/edit/[watchlistId].tsx b/app/(auth)/(tabs)/(watchlists)/edit/[watchlistId].tsx new file mode 100644 index 00000000..5329d6a6 --- /dev/null +++ b/app/(auth)/(tabs)/(watchlists)/edit/[watchlistId].tsx @@ -0,0 +1,274 @@ +import { Ionicons } from "@expo/vector-icons"; +import { useLocalSearchParams } from "expo-router"; +import { useCallback, useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { + ActivityIndicator, + KeyboardAvoidingView, + Platform, + ScrollView, + Switch, + TextInput, + TouchableOpacity, + View, +} from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Button } from "@/components/Button"; +import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; +import { useUpdateWatchlist } from "@/hooks/useWatchlistMutations"; +import { useWatchlistDetailQuery } from "@/hooks/useWatchlists"; +import type { + StreamystatsWatchlistAllowedItemType, + StreamystatsWatchlistSortOrder, +} from "@/utils/streamystats/types"; + +const ITEM_TYPES: Array<{ + value: StreamystatsWatchlistAllowedItemType; + label: string; +}> = [ + { value: null, label: "All Types" }, + { value: "Movie", label: "Movies Only" }, + { value: "Series", label: "Series Only" }, + { value: "Episode", label: "Episodes Only" }, +]; + +const SORT_OPTIONS: Array<{ + value: StreamystatsWatchlistSortOrder; + label: string; +}> = [ + { value: "custom", label: "Custom Order" }, + { value: "name", label: "Name" }, + { value: "dateAdded", label: "Date Added" }, + { value: "releaseDate", label: "Release Date" }, +]; + +export default function EditWatchlistScreen() { + const { t } = useTranslation(); + const router = useRouter(); + const insets = useSafeAreaInsets(); + const { watchlistId } = useLocalSearchParams<{ watchlistId: string }>(); + const watchlistIdNum = watchlistId + ? Number.parseInt(watchlistId, 10) + : undefined; + + const { data: watchlist, isLoading } = + useWatchlistDetailQuery(watchlistIdNum); + const updateWatchlist = useUpdateWatchlist(); + + const [name, setName] = useState(""); + const [description, setDescription] = useState(""); + const [isPublic, setIsPublic] = useState(false); + const [allowedItemType, setAllowedItemType] = + useState(null); + const [defaultSortOrder, setDefaultSortOrder] = + useState("custom"); + + // Initialize form with watchlist data + useEffect(() => { + if (watchlist) { + setName(watchlist.name); + setDescription(watchlist.description ?? ""); + setIsPublic(watchlist.isPublic); + setAllowedItemType( + (watchlist.allowedItemType as StreamystatsWatchlistAllowedItemType) ?? + null, + ); + setDefaultSortOrder( + (watchlist.defaultSortOrder as StreamystatsWatchlistSortOrder) ?? + "custom", + ); + } + }, [watchlist]); + + const handleSave = useCallback(async () => { + if (!name.trim() || !watchlistIdNum) return; + + try { + await updateWatchlist.mutateAsync({ + watchlistId: watchlistIdNum, + data: { + name: name.trim(), + description: description.trim() || undefined, + isPublic, + allowedItemType, + defaultSortOrder, + }, + }); + router.back(); + } catch { + // Error handled by mutation + } + }, [ + name, + description, + isPublic, + allowedItemType, + defaultSortOrder, + watchlistIdNum, + updateWatchlist, + router, + ]); + + if (isLoading) { + return ( + + + + ); + } + + if (!watchlist) { + return ( + + + {t("watchlists.not_found")} + + + ); + } + + return ( + + + {/* Name */} + + + {t("watchlists.name_label")} * + + + + + {/* Description */} + + + {t("watchlists.description_label")} + + + + + {/* Public Toggle */} + + + + {t("watchlists.is_public_label")} + + + {t("watchlists.is_public_description")} + + + + + + {/* Content Type */} + + + {t("watchlists.allowed_type_label")} + + + {ITEM_TYPES.map((type) => ( + setAllowedItemType(type.value)} + className={`px-4 py-2 rounded-lg ${allowedItemType === type.value ? "bg-purple-600" : "bg-neutral-800"}`} + > + + {type.label} + + + ))} + + + + {/* Sort Order */} + + + {t("watchlists.sort_order_label")} + + + {SORT_OPTIONS.map((sort) => ( + setDefaultSortOrder(sort.value)} + className={`px-4 py-2 rounded-lg ${defaultSortOrder === sort.value ? "bg-purple-600" : "bg-neutral-800"}`} + > + + {sort.label} + + + ))} + + + + {/* Save Button */} + + + + + + ); +} diff --git a/app/(auth)/(tabs)/(watchlists)/index.tsx b/app/(auth)/(tabs)/(watchlists)/index.tsx new file mode 100644 index 00000000..76d446d4 --- /dev/null +++ b/app/(auth)/(tabs)/(watchlists)/index.tsx @@ -0,0 +1,239 @@ +import { Ionicons } from "@expo/vector-icons"; +import { FlashList } from "@shopify/flash-list"; +import { useAtomValue } from "jotai"; +import { useCallback, useMemo, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { Platform, RefreshControl, TouchableOpacity, View } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Button } from "@/components/Button"; +import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; +import { + useStreamystatsEnabled, + useWatchlistsQuery, +} from "@/hooks/useWatchlists"; +import { userAtom } from "@/providers/JellyfinProvider"; +import type { StreamystatsWatchlist } from "@/utils/streamystats/types"; + +interface WatchlistCardProps { + watchlist: StreamystatsWatchlist; + isOwner: boolean; + onPress: () => void; +} + +const WatchlistCard: React.FC = ({ + watchlist, + isOwner, + onPress, +}) => { + const { t } = useTranslation(); + + return ( + + + + {watchlist.name} + + + {isOwner && ( + + + {t("watchlists.you")} + + + )} + + + + + {watchlist.description && ( + + {watchlist.description} + + )} + + + + + + {watchlist.itemCount ?? 0}{" "} + {(watchlist.itemCount ?? 0) === 1 + ? t("watchlists.item") + : t("watchlists.items")} + + + {watchlist.allowedItemType && ( + + + {watchlist.allowedItemType} + + + )} + + + ); +}; + +const EmptyState: React.FC<{ onCreatePress: () => void }> = ({ + onCreatePress: _onCreatePress, +}) => { + const { t } = useTranslation(); + + return ( + + + + {t("watchlists.empty_title")} + + + {t("watchlists.empty_description")} + + + ); +}; + +const NotConfiguredState: React.FC = () => { + const { t } = useTranslation(); + const router = useRouter(); + + return ( + + + + {t("watchlists.not_configured_title")} + + + {t("watchlists.not_configured_description")} + + + + ); +}; + +export default function WatchlistsScreen() { + const { t } = useTranslation(); + const router = useRouter(); + const insets = useSafeAreaInsets(); + const user = useAtomValue(userAtom); + const streamystatsEnabled = useStreamystatsEnabled(); + const { data: watchlists, isLoading, refetch } = useWatchlistsQuery(); + const [refreshing, setRefreshing] = useState(false); + + const handleRefresh = useCallback(async () => { + setRefreshing(true); + await refetch(); + setRefreshing(false); + }, [refetch]); + + const handleCreatePress = useCallback(() => { + router.push("/(auth)/(tabs)/(watchlists)/create"); + }, [router]); + + const handleWatchlistPress = useCallback( + (watchlistId: number) => { + router.push(`/(auth)/(tabs)/(watchlists)/${watchlistId}`); + }, + [router], + ); + + // Separate watchlists into "mine" and "public" + const { myWatchlists, publicWatchlists } = useMemo(() => { + if (!watchlists) return { myWatchlists: [], publicWatchlists: [] }; + + const mine: StreamystatsWatchlist[] = []; + const pub: StreamystatsWatchlist[] = []; + + for (const w of watchlists) { + if (w.userId === user?.Id) { + mine.push(w); + } else { + pub.push(w); + } + } + + return { myWatchlists: mine, publicWatchlists: pub }; + }, [watchlists, user?.Id]); + + // Combine into sections for FlashList + const sections = useMemo(() => { + const result: Array< + | { type: "header"; title: string } + | { type: "watchlist"; data: StreamystatsWatchlist; isOwner: boolean } + > = []; + + if (myWatchlists.length > 0) { + result.push({ type: "header", title: t("watchlists.my_watchlists") }); + for (const w of myWatchlists) { + result.push({ type: "watchlist", data: w, isOwner: true }); + } + } + + if (publicWatchlists.length > 0) { + result.push({ type: "header", title: t("watchlists.public_watchlists") }); + for (const w of publicWatchlists) { + result.push({ type: "watchlist", data: w, isOwner: false }); + } + } + + return result; + }, [myWatchlists, publicWatchlists, t]); + + if (!streamystatsEnabled) { + return ; + } + + if (!isLoading && (!watchlists || watchlists.length === 0)) { + return ; + } + + return ( + + } + renderItem={({ item }) => { + if (item.type === "header") { + return ( + + {item.title} + + ); + } + + return ( + handleWatchlistPress(item.data.id)} + /> + ); + }} + getItemType={(item) => item.type} + /> + ); +} diff --git a/app/(auth)/(tabs)/_layout.tsx b/app/(auth)/(tabs)/_layout.tsx index e8a79728..df1ed986 100644 --- a/app/(auth)/(tabs)/_layout.tsx +++ b/app/(auth)/(tabs)/_layout.tsx @@ -7,15 +7,15 @@ import type { ParamListBase, TabNavigationState, } from "@react-navigation/native"; -import { useFocusEffect, useRouter, withLayoutContext } from "expo-router"; -import { useCallback } from "react"; +import { withLayoutContext } from "expo-router"; import { useTranslation } from "react-i18next"; -import { Platform } from "react-native"; +import { Platform, View } from "react-native"; import { SystemBars } from "react-native-edge-to-edge"; +import { MiniPlayerBar } from "@/components/music/MiniPlayerBar"; +import { MusicPlaybackEngine } from "@/components/music/MusicPlaybackEngine"; import { Colors } from "@/constants/Colors"; import { useSettings } from "@/utils/atoms/settings"; import { eventBus } from "@/utils/eventBus"; -import { storage } from "@/utils/mmkv"; const { Navigator } = createNativeBottomTabNavigator(); @@ -29,25 +29,9 @@ export const NativeTabs = withLayoutContext< export default function TabLayout() { const { settings } = useSettings(); const { t } = useTranslation(); - const router = useRouter(); - - useFocusEffect( - useCallback(() => { - const hasShownIntro = storage.getBoolean("hasShownIntro"); - if (!hasShownIntro) { - const timer = setTimeout(() => { - router.push("/intro/page"); - }, 1000); - - return () => { - clearTimeout(timer); - }; - } - }, []), - ); return ( - <> + ); } diff --git a/app/(auth)/now-playing.tsx b/app/(auth)/now-playing.tsx new file mode 100644 index 00000000..934175fb --- /dev/null +++ b/app/(auth)/now-playing.tsx @@ -0,0 +1,845 @@ +import { ExpoAvRoutePickerView } from "@douglowder/expo-av-route-picker-view"; +import { Ionicons } from "@expo/vector-icons"; +import { BottomSheetModalProvider } from "@gorhom/bottom-sheet"; +import type { + BaseItemDto, + MediaSourceInfo, +} from "@jellyfin/sdk/lib/generated-client/models"; +import { Image } from "expo-image"; +import { useAtom } from "jotai"; +import React, { + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from "react"; +import { + ActivityIndicator, + Dimensions, + Platform, + ScrollView, + TouchableOpacity, + View, +} from "react-native"; +import { Slider } from "react-native-awesome-slider"; +import DraggableFlatList, { + type RenderItemParams, + ScaleDecorator, +} from "react-native-draggable-flatlist"; +import { CastButton, CastState } from "react-native-google-cast"; +import { useSharedValue } from "react-native-reanimated"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import TextTicker from "react-native-text-ticker"; +import type { VolumeResult } from "react-native-volume-manager"; +import { Badge } from "@/components/Badge"; +import { Text } from "@/components/common/Text"; +import { CreatePlaylistModal } from "@/components/music/CreatePlaylistModal"; +import { PlaylistPickerSheet } from "@/components/music/PlaylistPickerSheet"; +import { TrackOptionsSheet } from "@/components/music/TrackOptionsSheet"; +import useRouter from "@/hooks/useAppRouter"; +import { useFavorite } from "@/hooks/useFavorite"; +import { useMusicCast } from "@/hooks/useMusicCast"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { + type RepeatMode, + useMusicPlayer, +} from "@/providers/MusicPlayerProvider"; +import { formatBitrate } from "@/utils/bitrate"; +import { formatDuration } from "@/utils/time"; + +// Conditionally require VolumeManager (not available on TV) +const VolumeManager = Platform.isTV + ? null + : require("react-native-volume-manager"); + +const formatFileSize = (bytes?: number | null) => { + if (!bytes) return null; + const sizes = ["B", "KB", "MB", "GB"]; + if (bytes === 0) return "0 B"; + const i = Math.floor(Math.log(bytes) / Math.log(1024)); + return `${Math.round((bytes / 1024 ** i) * 100) / 100} ${sizes[i]}`; +}; + +const formatSampleRate = (sampleRate?: number | null) => { + if (!sampleRate) return null; + return `${(sampleRate / 1000).toFixed(1)} kHz`; +}; + +const { width: SCREEN_WIDTH } = Dimensions.get("window"); +const ARTWORK_SIZE = SCREEN_WIDTH - 80; + +type ViewMode = "player" | "queue"; + +export default function NowPlayingScreen() { + const [api] = useAtom(apiAtom); + const [user] = useAtom(userAtom); + const router = useRouter(); + const insets = useSafeAreaInsets(); + const [viewMode, setViewMode] = useState("player"); + const [trackOptionsOpen, setTrackOptionsOpen] = useState(false); + const [playlistPickerOpen, setPlaylistPickerOpen] = useState(false); + const [createPlaylistOpen, setCreatePlaylistOpen] = useState(false); + + const { + isConnected: isCastConnected, + castQueue, + castState, + } = useMusicCast({ + api, + userId: user?.Id, + }); + + const { + currentTrack, + queue, + queueIndex, + isPlaying, + isLoading, + progress, + duration, + repeatMode, + shuffleEnabled, + mediaSource, + isTranscoding, + togglePlayPause, + next, + previous, + seek, + setRepeatMode, + toggleShuffle, + jumpToIndex, + removeFromQueue, + reorderQueue, + stop, + pause, + } = useMusicPlayer(); + + const { isFavorite, toggleFavorite } = useFavorite( + currentTrack ?? ({ Id: "" } as BaseItemDto), + ); + + const sliderProgress = useSharedValue(0); + const sliderMin = useSharedValue(0); + const sliderMax = useSharedValue(1); + + useEffect(() => { + sliderProgress.value = progress; + }, [progress, sliderProgress]); + + useEffect(() => { + sliderMax.value = duration > 0 ? duration : 1; + }, [duration, sliderMax]); + + // Auto-cast queue when Chromecast becomes connected and pause local playback + const prevCastState = useRef(null); + useEffect(() => { + if ( + castState === CastState.CONNECTED && + prevCastState.current !== CastState.CONNECTED && + queue.length > 0 + ) { + // Just connected - pause local playback and cast the queue + pause(); + castQueue({ queue, startIndex: queueIndex }); + } + prevCastState.current = castState; + }, [castState, queue, queueIndex, castQueue, pause]); + + const imageUrl = useMemo(() => { + if (!api || !currentTrack) return null; + const albumId = currentTrack.AlbumId || currentTrack.ParentId; + if (albumId) { + return `${api.basePath}/Items/${albumId}/Images/Primary?maxHeight=600&maxWidth=600`; + } + return `${api.basePath}/Items/${currentTrack.Id}/Images/Primary?maxHeight=600&maxWidth=600`; + }, [api, currentTrack]); + + const progressText = useMemo(() => { + const progressTicks = progress * 10000000; + return formatDuration(progressTicks); + }, [progress]); + + const _durationText = useMemo(() => { + const durationTicks = duration * 10000000; + return formatDuration(durationTicks); + }, [duration]); + + const remainingText = useMemo(() => { + const remaining = Math.max(0, duration - progress); + const remainingTicks = remaining * 10000000; + return `-${formatDuration(remainingTicks)}`; + }, [duration, progress]); + + const handleSliderComplete = useCallback( + (value: number) => { + seek(value); + }, + [seek], + ); + + const handleClose = useCallback(() => { + router.back(); + }, [router]); + + const _handleStop = useCallback(() => { + stop(); + router.back(); + }, [stop, router]); + + const cycleRepeatMode = useCallback(() => { + const modes: RepeatMode[] = ["off", "all", "one"]; + const currentIndex = modes.indexOf(repeatMode); + const nextMode = modes[(currentIndex + 1) % modes.length]; + setRepeatMode(nextMode); + }, [repeatMode, setRepeatMode]); + + const handleOptionsPress = useCallback(() => { + setTrackOptionsOpen(true); + }, []); + + const handleAddToPlaylist = useCallback(() => { + setPlaylistPickerOpen(true); + }, []); + + const handleCreateNewPlaylist = useCallback(() => { + setCreatePlaylistOpen(true); + }, []); + + const getRepeatIcon = (): string => { + switch (repeatMode) { + case "one": + return "repeat"; + case "all": + return "repeat"; + default: + return "repeat"; + } + }; + + const canGoNext = queueIndex < queue.length - 1 || repeatMode === "all"; + const canGoPrevious = queueIndex > 0 || progress > 3 || repeatMode === "all"; + + if (!currentTrack) { + return ( + + + No track playing + + + ); + } + + return ( + + + {/* Header */} + + + + + + + setViewMode("player")} + className='px-3 py-1' + > + + Now Playing + + + setViewMode("queue")} + className='px-3 py-1' + > + + Queue ({queue.length}) + + + + {/* Empty placeholder to balance header layout */} + + + + {viewMode === "player" ? ( + + ) : ( + + )} + + + + + + + ); +} + +interface PlayerViewProps { + api: any; + currentTrack: BaseItemDto; + imageUrl: string | null; + sliderProgress: any; + sliderMin: any; + sliderMax: any; + progressText: string; + remainingText: string; + isPlaying: boolean; + isLoading: boolean; + repeatMode: RepeatMode; + shuffleEnabled: boolean; + canGoNext: boolean; + canGoPrevious: boolean; + onSliderComplete: (value: number) => void; + onTogglePlayPause: () => void; + onNext: () => void; + onPrevious: () => void; + onCycleRepeat: () => void; + onToggleShuffle: () => void; + getRepeatIcon: () => string; + mediaSource: MediaSourceInfo | null; + isTranscoding: boolean; + isFavorite: boolean | undefined; + onToggleFavorite: () => void; + onOptionsPress: () => void; + isCastConnected: boolean; +} + +const PlayerView: React.FC = ({ + currentTrack, + imageUrl, + sliderProgress, + sliderMin, + sliderMax, + progressText, + remainingText, + isPlaying, + isLoading, + repeatMode, + shuffleEnabled, + canGoNext, + canGoPrevious, + onSliderComplete, + onTogglePlayPause, + onNext, + onPrevious, + onCycleRepeat, + onToggleShuffle, + getRepeatIcon, + mediaSource, + isTranscoding, + isFavorite, + onToggleFavorite, + onOptionsPress, + isCastConnected, +}) => { + const audioStream = useMemo(() => { + return mediaSource?.MediaStreams?.find((stream) => stream.Type === "Audio"); + }, [mediaSource]); + + // Volume slider state + const volumeProgress = useSharedValue(0); + const volumeMin = useSharedValue(0); + const volumeMax = useSharedValue(1); + const isTv = Platform.isTV; + + useEffect(() => { + if (isTv || !VolumeManager) return; + // Get initial volume + VolumeManager.getVolume().then(({ volume }: { volume: number }) => { + volumeProgress.value = volume; + }); + // Listen to volume changes + const listener = VolumeManager.addVolumeListener((result: VolumeResult) => { + volumeProgress.value = result.volume; + }); + return () => listener.remove(); + }, [isTv, volumeProgress]); + + const handleVolumeChange = useCallback((value: number) => { + if (VolumeManager) { + VolumeManager.setVolume(value); + } + }, []); + + const fileSize = formatFileSize(mediaSource?.Size); + const codec = audioStream?.Codec?.toUpperCase(); + const bitrate = formatBitrate(audioStream?.BitRate); + const sampleRate = formatSampleRate(audioStream?.SampleRate); + const playbackMethod = isTranscoding ? "Transcoding" : "Direct"; + + const hasAudioStats = + mediaSource && (fileSize || codec || bitrate || sampleRate); + return ( + + {/* Album artwork */} + + {imageUrl ? ( + + ) : ( + + + + )} + + + {/* Track info with actions */} + + + + t} + > + {currentTrack.Name} + + t} + > + {currentTrack.Artists?.join(", ") || currentTrack.AlbumArtist} + + + + + + + + + + + {/* Audio Stats */} + {hasAudioStats && ( + + {fileSize && } + {codec && } + + } + /> + {bitrate && bitrate !== "N/A" && ( + + )} + {sampleRate && } + + )} + + + {/* Progress slider */} + + null} + sliderHeight={8} + containerStyle={{ borderRadius: 100 }} + renderBubble={() => null} + /> + + {progressText} + {remainingText} + + + + {/* Main Controls with Shuffle & Repeat */} + + + + + + + + + + + {isLoading ? ( + + ) : ( + + )} + + + + + + + + + {repeatMode === "one" && ( + + 1 + + )} + + + + {/* Volume Slider */} + {!isTv && VolumeManager && ( + + + + null} + sliderHeight={8} + containerStyle={{ borderRadius: 100 }} + renderBubble={() => null} + /> + + + + )} + + {/* AirPlay & Chromecast Buttons */} + {!isTv && ( + + {/* AirPlay (iOS only) */} + {Platform.OS === "ios" && ( + + + + )} + {/* Chromecast */} + + + )} + + ); +}; + +interface QueueViewProps { + api: any; + queue: BaseItemDto[]; + queueIndex: number; + onJumpToIndex: (index: number) => void; + onRemoveFromQueue: (index: number) => void; + onReorderQueue: (newQueue: BaseItemDto[]) => void; +} + +const QueueView: React.FC = ({ + api, + queue, + queueIndex, + onJumpToIndex, + onRemoveFromQueue, + onReorderQueue, +}) => { + const renderQueueItem = useCallback( + ({ item, drag, isActive, getIndex }: RenderItemParams) => { + const index = getIndex() ?? 0; + const isCurrentTrack = index === queueIndex; + const isPast = index < queueIndex; + + const albumId = item.AlbumId || item.ParentId; + const imageUrl = api + ? albumId + ? `${api.basePath}/Items/${albumId}/Images/Primary?maxHeight=80&maxWidth=80` + : `${api.basePath}/Items/${item.Id}/Images/Primary?maxHeight=80&maxWidth=80` + : null; + + return ( + + onJumpToIndex(index)} + onLongPress={drag} + disabled={isActive} + className='flex-row items-center px-4 py-3' + style={{ + opacity: isPast && !isActive ? 0.5 : 1, + backgroundColor: isActive + ? "#2a2a2a" + : isCurrentTrack + ? "rgba(147, 52, 233, 0.3)" + : "#121212", + }} + > + {/* Drag handle */} + + + + + {/* Album art */} + + {imageUrl ? ( + + ) : ( + + + + )} + + + {/* Track info */} + + + {item.Name} + + + {item.Artists?.join(", ") || item.AlbumArtist} + + + + {/* Now playing indicator */} + {isCurrentTrack && ( + + )} + + {/* Remove button (not for current track) */} + {!isCurrentTrack && ( + onRemoveFromQueue(index)} + hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }} + className='p-2' + > + + + )} + + + ); + }, + [api, queueIndex, onJumpToIndex, onRemoveFromQueue], + ); + + const handleDragEnd = useCallback( + ({ data }: { data: BaseItemDto[] }) => { + onReorderQueue(data); + }, + [onReorderQueue], + ); + + const history = queue.slice(0, queueIndex); + + return ( + `${item.Id}-${index}`} + renderItem={renderQueueItem} + onDragEnd={handleDragEnd} + showsVerticalScrollIndicator={false} + ListHeaderComponent={ + + + {history.length > 0 ? "Playing from queue" : "Up next"} + + + } + ListEmptyComponent={ + + Queue is empty + + } + /> + ); +}; diff --git a/app/(auth)/player/_layout.tsx b/app/(auth)/player/_layout.tsx index 97a3f7eb..5604160e 100644 --- a/app/(auth)/player/_layout.tsx +++ b/app/(auth)/player/_layout.tsx @@ -1,7 +1,33 @@ import { Stack } from "expo-router"; +import { useEffect } from "react"; +import { AppState } from "react-native"; import { SystemBars } from "react-native-edge-to-edge"; +import { useOrientation } from "@/hooks/useOrientation"; +import { useSettings } from "@/utils/atoms/settings"; + export default function Layout() { + const { settings } = useSettings(); + const { lockOrientation, unlockOrientation } = useOrientation(); + + useEffect(() => { + if (settings?.defaultVideoOrientation) { + lockOrientation(settings.defaultVideoOrientation); + } + + // Re-apply orientation lock when app returns to foreground (iOS resets it) + const subscription = AppState.addEventListener("change", (nextAppState) => { + if (nextAppState === "active" && settings?.defaultVideoOrientation) { + lockOrientation(settings.defaultVideoOrientation); + } + }); + + return () => { + subscription.remove(); + unlockOrientation(); + }; + }, [settings?.defaultVideoOrientation, lockOrientation, unlockOrientation]); + return ( <> @@ -398,8 +482,8 @@ const Login: React.FC = () => { style={{ flex: 1 }} > {api?.basePath ? ( - - + + {serverName ? ( @@ -415,21 +499,23 @@ const Login: React.FC = () => { - setCredentials({ ...credentials, username: text }) + setCredentials((prev) => ({ ...prev, username: text })) } onEndEditing={(e) => { const newValue = e.nativeEvent.text; if (newValue && newValue !== credentials.username) { - setCredentials({ ...credentials, username: newValue }); + setCredentials((prev) => ({ + ...prev, + username: newValue, + })); } }} value={credentials.username} keyboardType='default' returnKeyType='done' autoCapitalize='none' - // Changed from username to oneTimeCode because it is a known issue in RN - // https://github.com/facebook/react-native/issues/47106#issuecomment-2521270037 - textContentType='oneTimeCode' + autoCorrect={false} + textContentType='username' clearButtonMode='while-editing' maxLength={500} /> @@ -437,12 +523,15 @@ const Login: React.FC = () => { - setCredentials({ ...credentials, password: text }) + setCredentials((prev) => ({ ...prev, password: text })) } onEndEditing={(e) => { const newValue = e.nativeEvent.text; if (newValue && newValue !== credentials.password) { - setCredentials({ ...credentials, password: newValue }); + setCredentials((prev) => ({ + ...prev, + password: newValue, + })); } }} value={credentials.password} @@ -454,6 +543,21 @@ const Login: React.FC = () => { clearButtonMode='while-editing' maxLength={500} /> + setSaveAccount(!saveAccount)} + className='flex flex-row items-center py-2' + activeOpacity={0.7} + > + + + {t("save_account.save_for_later")} + + + + + + ); +}; diff --git a/components/AddToFavorites.tsx b/components/AddToFavorites.tsx index c69a83df..35221f1a 100644 --- a/components/AddToFavorites.tsx +++ b/components/AddToFavorites.tsx @@ -16,6 +16,7 @@ export const AddToFavorites: FC = ({ item, ...props }) => { diff --git a/components/AddToWatchlist.tsx b/components/AddToWatchlist.tsx new file mode 100644 index 00000000..0e1d6a37 --- /dev/null +++ b/components/AddToWatchlist.tsx @@ -0,0 +1,43 @@ +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; +import type { FC } from "react"; +import { useCallback, useRef } from "react"; +import { View, type ViewProps } from "react-native"; +import { RoundButton } from "@/components/RoundButton"; +import { + WatchlistSheet, + type WatchlistSheetRef, +} from "@/components/watchlists/WatchlistSheet"; +import { + useItemInWatchlists, + useStreamystatsEnabled, +} from "@/hooks/useWatchlists"; + +interface Props extends ViewProps { + item: BaseItemDto; +} + +export const AddToWatchlist: FC = ({ item, ...props }) => { + const streamystatsEnabled = useStreamystatsEnabled(); + const sheetRef = useRef(null); + + const { data: watchlistsContainingItem } = useItemInWatchlists(item.Id); + const isInAnyWatchlist = (watchlistsContainingItem?.length ?? 0) > 0; + + const handlePress = useCallback(() => { + sheetRef.current?.open(item); + }, [item]); + + // Don't render if Streamystats is not enabled + if (!streamystatsEnabled) return null; + + return ( + + + + + ); +}; diff --git a/components/Badge.tsx b/components/Badge.tsx index aff8cb83..b33fff2b 100644 --- a/components/Badge.tsx +++ b/components/Badge.tsx @@ -1,4 +1,5 @@ -import { View, type ViewProps } from "react-native"; +import { Platform, StyleSheet, View, type ViewProps } from "react-native"; +import { GlassEffectView } from "react-native-glass-effect-view"; import { Text } from "./common/Text"; interface Props extends ViewProps { @@ -13,6 +14,30 @@ export const Badge: React.FC = ({ variant = "purple", ...props }) => { + const content = ( + + {iconLeft && {iconLeft}} + + {text} + + + ); + + if (Platform.OS === "ios") { + return ( + + + {content} + + + ); + } + return ( = ({ ); }; + +const styles = StyleSheet.create({ + container: { + overflow: "hidden", + alignSelf: "flex-start", + flexShrink: 1, + flexGrow: 0, + }, + content: { + flexDirection: "row", + alignItems: "center", + paddingHorizontal: 10, + paddingVertical: 4, + borderRadius: 50, + backgroundColor: "transparent", + }, + iconLeft: { + marginRight: 4, + }, +}); diff --git a/components/Chromecast.tsx b/components/Chromecast.tsx index e009a12d..dbc36f9c 100644 --- a/components/Chromecast.tsx +++ b/components/Chromecast.tsx @@ -1,6 +1,7 @@ import { Feather } from "@expo/vector-icons"; import { useCallback, useEffect } from "react"; -import { Platform, TouchableOpacity } from "react-native"; +import { Platform } from "react-native"; +import { Pressable } from "react-native-gesture-handler"; import GoogleCast, { CastButton, CastContext, @@ -44,7 +45,7 @@ export function Chromecast({ if (Platform.OS === "ios") { return ( - { if (mediaStatus?.currentItemId) CastContext.showExpandedControls(); @@ -54,7 +55,7 @@ export function Chromecast({ > - + ); } diff --git a/components/ContextMenu.tv.ts b/components/ContextMenu.tv.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/components/DownloadItem.tsx b/components/DownloadItem.tsx index 2f2268b6..e50b4efc 100644 --- a/components/DownloadItem.tsx +++ b/components/DownloadItem.tsx @@ -9,13 +9,14 @@ import type { BaseItemDto, MediaSourceInfo, } from "@jellyfin/sdk/lib/generated-client/models"; -import { type Href, router } from "expo-router"; +import { type Href } from "expo-router"; import { t } from "i18next"; import { useAtom } from "jotai"; import type React from "react"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { Alert, Platform, Switch, View, type ViewProps } from "react-native"; import { toast } from "sonner-native"; +import useRouter from "@/hooks/useAppRouter"; import useDefaultPlaySettings from "@/hooks/useDefaultPlaySettings"; import { useDownload } from "@/providers/DownloadProvider"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; @@ -62,6 +63,7 @@ export const DownloadItems: React.FC = ({ const [user] = useAtom(userAtom); const [queue, _setQueue] = useAtom(queueAtom); const { settings } = useSettings(); + const router = useRouter(); const [downloadUnwatchedOnly, setDownloadUnwatchedOnly] = useState(false); const { processes, startBackgroundDownload, downloadedItems } = useDownload(); @@ -109,7 +111,7 @@ export const DownloadItems: React.FC = ({ useEffect(() => { setSelectedOptions(() => ({ bitrate: defaultBitrate, - mediaSource: defaultMediaSource, + mediaSource: defaultMediaSource ?? undefined, subtitleIndex: defaultSubtitleIndex ?? -1, audioIndex: defaultAudioIndex, })); @@ -170,9 +172,11 @@ export const DownloadItems: React.FC = ({ firstItem.Type !== "Episode" ? "/downloads" : ({ - pathname: `/downloads/${firstItem.SeriesId}`, + pathname: "/series/[id]", params: { - episodeSeasonIndex: firstItem.ParentIndexNumber, + id: firstItem.SeriesId!, + seasonIndex: firstItem.ParentIndexNumber?.toString(), + offline: "true", }, } as Href), ); @@ -209,6 +213,7 @@ export const DownloadItems: React.FC = ({ subtitleStreamIndex: subtitleIndex ?? -1, maxBitrate: selectedOptions?.bitrate || defaultBitrate, deviceId: api.deviceInfo.id, + audioMode: settings?.audioTranscodeMode, }); return { @@ -236,11 +241,23 @@ export const DownloadItems: React.FC = ({ ); continue; } + // Get the audio/subtitle indices that were used for this download + const downloadAudioIndex = + itemsNotDownloaded.length > 1 + ? getDefaultPlaySettings(item, settings!).audioIndex + : selectedOptions?.audioIndex; + const downloadSubtitleIndex = + itemsNotDownloaded.length > 1 + ? getDefaultPlaySettings(item, settings!).subtitleIndex + : selectedOptions?.subtitleIndex; + await startBackgroundDownload( url, item, mediaSource, selectedOptions?.bitrate || defaultBitrate, + downloadAudioIndex, + downloadSubtitleIndex, ); } }, diff --git a/components/ExampleGlobalModalUsage.tsx b/components/ExampleGlobalModalUsage.tsx deleted file mode 100644 index ccebb823..00000000 --- a/components/ExampleGlobalModalUsage.tsx +++ /dev/null @@ -1,203 +0,0 @@ -/** - * Example Usage of Global Modal - * - * This file demonstrates how to use the global modal system from anywhere in your app. - * You can delete this file after understanding how it works. - */ - -import { Ionicons } from "@expo/vector-icons"; -import { TouchableOpacity, View } from "react-native"; -import { Text } from "@/components/common/Text"; -import { useGlobalModal } from "@/providers/GlobalModalProvider"; - -/** - * Example 1: Simple Content Modal - */ -export const SimpleModalExample = () => { - const { showModal } = useGlobalModal(); - - const handleOpenModal = () => { - showModal( - - Simple Modal - - This is a simple modal with just some text content. - - - Swipe down or tap outside to close. - - , - ); - }; - - return ( - - Open Simple Modal - - ); -}; - -/** - * Example 2: Modal with Custom Snap Points - */ -export const CustomSnapPointsExample = () => { - const { showModal } = useGlobalModal(); - - const handleOpenModal = () => { - showModal( - - - Custom Snap Points - - - This modal has custom snap points (25%, 50%, 90%). - - - - Try dragging the modal to different heights! - - - , - { - snapPoints: ["25%", "50%", "90%"], - enableDynamicSizing: false, - }, - ); - }; - - return ( - - Custom Snap Points - - ); -}; - -/** - * Example 3: Complex Component in Modal - */ -const SettingsModalContent = () => { - const { hideModal } = useGlobalModal(); - - const settings = [ - { - id: 1, - title: "Notifications", - icon: "notifications-outline" as const, - enabled: true, - }, - { id: 2, title: "Dark Mode", icon: "moon-outline" as const, enabled: true }, - { - id: 3, - title: "Auto-play", - icon: "play-outline" as const, - enabled: false, - }, - ]; - - return ( - - Settings - - {settings.map((setting, index) => ( - - - - {setting.title} - - - - - - ))} - - - Close - - - ); -}; - -export const ComplexModalExample = () => { - const { showModal } = useGlobalModal(); - - const handleOpenModal = () => { - showModal(); - }; - - return ( - - Complex Component - - ); -}; - -/** - * Example 4: Modal Triggered from Function (e.g., API response) - */ -export const useShowSuccessModal = () => { - const { showModal } = useGlobalModal(); - - return (message: string) => { - showModal( - - - - - Success! - {message} - , - ); - }; -}; - -/** - * Main Demo Component - */ -export const GlobalModalDemo = () => { - const showSuccess = useShowSuccessModal(); - - return ( - - - Global Modal Examples - - - - - - - showSuccess("Operation completed successfully!")} - className='bg-orange-600 px-4 py-2 rounded-lg' - > - Show Success Modal - - - ); -}; diff --git a/components/GenreTags.tsx b/components/GenreTags.tsx index 6708269d..030d554c 100644 --- a/components/GenreTags.tsx +++ b/components/GenreTags.tsx @@ -1,11 +1,14 @@ // GenreTags.tsx import type React from "react"; import { + Platform, type StyleProp, + StyleSheet, type TextStyle, View, type ViewProps, } from "react-native"; +import { GlassEffectView } from "react-native-glass-effect-view"; import { Text } from "./common/Text"; interface TagProps { @@ -20,6 +23,23 @@ export const Tag: React.FC< textStyle?: StyleProp; } & ViewProps > = ({ text, textClass, textStyle, ...props }) => { + if (Platform.OS === "ios") { + return ( + + + + {text} + + + + ); + } + return ( @@ -29,6 +49,16 @@ export const Tag: React.FC< ); }; +const styles = StyleSheet.create({ + container: { + overflow: "hidden", + borderRadius: 50, + }, + glass: { + borderRadius: 50, + }, +}); + export const Tags: React.FC< TagProps & { tagProps?: ViewProps } & ViewProps > = ({ tags, textClass = "text-xs", tagProps, ...props }) => { diff --git a/components/GlobalModal.tsx b/components/GlobalModal.tsx index 361321d3..107f78e4 100644 --- a/components/GlobalModal.tsx +++ b/components/GlobalModal.tsx @@ -3,7 +3,7 @@ import { type BottomSheetBackdropProps, BottomSheetModal, } from "@gorhom/bottom-sheet"; -import { useCallback } from "react"; +import { useCallback, useEffect } from "react"; import { useGlobalModal } from "@/providers/GlobalModalProvider"; /** @@ -16,7 +16,13 @@ import { useGlobalModal } from "@/providers/GlobalModalProvider"; * after BottomSheetModalProvider. */ export const GlobalModal = () => { - const { hideModal, modalState, modalRef } = useGlobalModal(); + const { hideModal, modalState, modalRef, isVisible } = useGlobalModal(); + + useEffect(() => { + if (isVisible && modalState.content) { + modalRef.current?.present(); + } + }, [isVisible, modalState.content, modalRef]); const handleSheetChanges = useCallback( (index: number) => { diff --git a/components/IntroSheet.tsx b/components/IntroSheet.tsx new file mode 100644 index 00000000..7317b7e8 --- /dev/null +++ b/components/IntroSheet.tsx @@ -0,0 +1,203 @@ +import { Feather, Ionicons } from "@expo/vector-icons"; +import { + BottomSheetBackdrop, + type BottomSheetBackdropProps, + BottomSheetModal, + BottomSheetScrollView, +} from "@gorhom/bottom-sheet"; +import { Image } from "expo-image"; +import { forwardRef, useCallback, useImperativeHandle, useRef } from "react"; +import { useTranslation } from "react-i18next"; +import { Linking, Platform, TouchableOpacity, View } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Button } from "@/components/Button"; +import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; +import { storage } from "@/utils/mmkv"; + +export interface IntroSheetRef { + present: () => void; + dismiss: () => void; +} + +export const IntroSheet = forwardRef((_, ref) => { + const bottomSheetRef = useRef(null); + const { t } = useTranslation(); + const insets = useSafeAreaInsets(); + const router = useRouter(); + + useImperativeHandle(ref, () => ({ + present: () => { + storage.set("hasShownIntro", true); + bottomSheetRef.current?.present(); + }, + dismiss: () => { + bottomSheetRef.current?.dismiss(); + }, + })); + + const renderBackdrop = useCallback( + (props: BottomSheetBackdropProps) => ( + + ), + [], + ); + + const handleDismiss = useCallback(() => { + bottomSheetRef.current?.dismiss(); + }, []); + + const handleGoToSettings = useCallback(() => { + bottomSheetRef.current?.dismiss(); + router.push("/settings"); + }, []); + + return ( + + + + + + {t("home.intro.welcome_to_streamyfin")} + + + {t("home.intro.a_free_and_open_source_client_for_jellyfin")} + + + + + + {t("home.intro.features_title")} + + + {t("home.intro.features_description")} + + + + + Seerr + + {t("home.intro.seerr_feature_description")} + + + + {!Platform.isTV && ( + <> + + + + + + + {t("home.intro.downloads_feature_title")} + + + {t("home.intro.downloads_feature_description")} + + + + + + + + + Chromecast + + {t("home.intro.chromecast_feature_description")} + + + + + )} + + + + + + + {t("home.intro.centralized_settings_plugin_title")} + + + + {t( + "home.intro.centralized_settings_plugin_description", + )}{" "} + + { + Linking.openURL( + "https://github.com/streamyfin/jellyfin-plugin-streamyfin", + ); + }} + > + + {t("home.intro.read_more")} + + + + + + + + + + + + {t("home.intro.go_to_settings_button")} + + + + + + + + + ); +}); + +IntroSheet.displayName = "IntroSheet"; diff --git a/components/ItemContent.tsx b/components/ItemContent.tsx index 6b8f1bba..1b2cbbac 100644 --- a/components/ItemContent.tsx +++ b/components/ItemContent.tsx @@ -11,6 +11,7 @@ import { useSafeAreaInsets } from "react-native-safe-area-context"; import { type Bitrate } from "@/components/BitrateSelector"; import { ItemImage } from "@/components/common/ItemImage"; import { DownloadSingleItem } from "@/components/DownloadItem"; +import { ItemPeopleSections } from "@/components/item/ItemPeopleSections"; import { MediaSourceButton } from "@/components/MediaSourceButton"; import { OverviewText } from "@/components/OverviewText"; import { ParallaxScrollView } from "@/components/ParallaxPage"; @@ -18,7 +19,6 @@ import { ParallaxScrollView } from "@/components/ParallaxPage"; import { PlayButton } from "@/components/PlayButton"; import { PlayedStatus } from "@/components/PlayedStatus"; import { SimilarItems } from "@/components/SimilarItems"; -import { CastAndCrew } from "@/components/series/CastAndCrew"; import { CurrentSeries } from "@/components/series/CurrentSeries"; import { SeasonEpisodesCarousel } from "@/components/series/SeasonEpisodesCarousel"; import useDefaultPlaySettings from "@/hooks/useDefaultPlaySettings"; @@ -26,12 +26,13 @@ import { useImageColorsReturn } from "@/hooks/useImageColorsReturn"; import { useOrientation } from "@/hooks/useOrientation"; import * as ScreenOrientation from "@/packages/expo-screen-orientation"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { useOfflineMode } from "@/providers/OfflineModeProvider"; import { useSettings } from "@/utils/atoms/settings"; import { getLogoImageUrlById } from "@/utils/jellyfin/image/getLogoImageUrlById"; import { AddToFavorites } from "./AddToFavorites"; +import { AddToWatchlist } from "./AddToWatchlist"; import { ItemHeader } from "./ItemHeader"; import { ItemTechnicalDetails } from "./ItemTechnicalDetails"; -import { MoreMoviesWithActor } from "./MoreMoviesWithActor"; import { PlayInRemoteSessionButton } from "./PlayInRemoteSession"; const Chromecast = !Platform.isTV ? require("./Chromecast") : null; @@ -45,13 +46,13 @@ export type SelectedOptions = { interface ItemContentProps { item: BaseItemDto; - isOffline: boolean; itemWithSources?: BaseItemDto | null; } export const ItemContent: React.FC = React.memo( - ({ item, isOffline, itemWithSources }) => { + ({ item, itemWithSources }) => { const [api] = useAtom(apiAtom); + const isOffline = useOfflineMode(); const { settings } = useSettings(); const { orientation } = useOrientation(); const navigation = useNavigation(); @@ -67,18 +68,23 @@ export const ItemContent: React.FC = React.memo( SelectedOptions | undefined >(undefined); + // Use itemWithSources for play settings since it has MediaSources data const { defaultAudioIndex, defaultBitrate, defaultMediaSource, defaultSubtitleIndex, - } = useDefaultPlaySettings(item!, settings); + } = useDefaultPlaySettings(itemWithSources ?? item, settings); const logoUrl = useMemo( () => (item ? getLogoImageUrlById({ api, item }) : null), [api, item], ); + const onLogoLoad = React.useCallback(() => { + setLoadingLogo(false); + }, []); + const loading = useMemo(() => { return Boolean(logoUrl && loadingLogo); }, [loadingLogo, logoUrl]); @@ -87,7 +93,7 @@ export const ItemContent: React.FC = React.memo( useEffect(() => { setSelectedOptions(() => ({ bitrate: defaultBitrate, - mediaSource: defaultMediaSource, + mediaSource: defaultMediaSource ?? undefined, subtitleIndex: defaultSubtitleIndex ?? -1, audioIndex: defaultAudioIndex, })); @@ -111,12 +117,17 @@ export const ItemContent: React.FC = React.memo( {!Platform.isTV && ( )} - {user?.Policy?.IsAdministrator && ( - - )} + {user?.Policy?.IsAdministrator && + !settings.hideRemoteSessionButton && ( + + )} + {settings.streamyStatsServerUrl && + !settings.hideWatchlistsTab && ( + + )} )} @@ -128,19 +139,32 @@ export const ItemContent: React.FC = React.memo( {!Platform.isTV && ( )} - {user?.Policy?.IsAdministrator && ( - - )} + {user?.Policy?.IsAdministrator && + !settings.hideRemoteSessionButton && ( + + )} + {settings.streamyStatsServerUrl && + !settings.hideWatchlistsTab && ( + + )} )} )), }); } - }, [item, navigation, user, itemWithSources]); + }, [ + item, + navigation, + user, + itemWithSources, + settings.hideRemoteSessionButton, + settings.streamyStatsServerUrl, + settings.hideWatchlistsTab, + ]); useEffect(() => { if (item) { @@ -162,7 +186,7 @@ export const ItemContent: React.FC = React.memo( }} > @@ -189,8 +213,8 @@ export const ItemContent: React.FC = React.memo( width: "100%", }} contentFit='contain' - onLoad={() => setLoadingLogo(false)} - onError={() => setLoadingLogo(false)} + onLoad={onLogoLoad} + onError={onLogoLoad} /> ) : ( @@ -205,7 +229,6 @@ export const ItemContent: React.FC = React.memo( @@ -220,11 +243,7 @@ export const ItemContent: React.FC = React.memo( {item.Type === "Episode" && ( - + )} {!isOffline && @@ -238,25 +257,10 @@ export const ItemContent: React.FC = React.memo( {item.Type !== "Program" && ( <> {item.Type === "Episode" && !isOffline && ( - + )} - {!isOffline && ( - - )} - - {item.People && item.People.length > 0 && !isOffline && ( - - {item.People.slice(0, 3).map((person, idx) => ( - - ))} - - )} + {!isOffline && } diff --git a/components/ItemTechnicalDetails.tsx b/components/ItemTechnicalDetails.tsx index c0d5e54d..49614a2c 100644 --- a/components/ItemTechnicalDetails.tsx +++ b/components/ItemTechnicalDetails.tsx @@ -183,6 +183,12 @@ const VideoStreamInfo = ({ source }: { source?: MediaSourceInfo }) => { if (!source || !videoStream) return null; + // Dolby Vision video check + const isDolbyVision = + videoStream.VideoRangeType === "DOVI" || + videoStream.DvVersionMajor != null || + videoStream.DvVersionMinor != null; + return ( { iconLeft={} text={`${videoStream.Width}x${videoStream.Height}`} /> + {isDolbyVision && ( + + } + text={"DV"} + /> + )} = ({ actorId, + actorName, currentItem, ...props }) => { @@ -27,19 +32,6 @@ export const MoreMoviesWithActor: React.FC = ({ const [user] = useAtom(userAtom); const { t } = useTranslation(); - const { data: actor } = useQuery({ - queryKey: ["actor", actorId], - queryFn: async () => { - if (!api || !user?.Id) return null; - return await getUserItemData({ - api, - userId: user.Id, - itemId: actorId, - }); - }, - enabled: !!api && !!user?.Id && !!actorId, - }); - const { data: items, isLoading } = useQuery({ queryKey: ["actor", "movies", actorId, currentItem.Id], queryFn: async () => { @@ -72,29 +64,34 @@ export const MoreMoviesWithActor: React.FC = ({ enabled: !!api && !!user?.Id && !!actorId, }); + const renderItem = useCallback( + (item: BaseItemDto, idx: number) => ( + + + + + + + ), + [], + ); + if (items?.length === 0) return null; return ( - {t("item_card.more_with", { name: actor?.Name })} + {t("item_card.more_with", { name: actorName ?? "" })} ( - - - - - - - )} + height={POSTER_CAROUSEL_HEIGHT} + renderItem={renderItem} /> ); diff --git a/components/PINEntryModal.tsx b/components/PINEntryModal.tsx new file mode 100644 index 00000000..f450f5eb --- /dev/null +++ b/components/PINEntryModal.tsx @@ -0,0 +1,231 @@ +import { + BottomSheetBackdrop, + type BottomSheetBackdropProps, + BottomSheetModal, + BottomSheetView, +} from "@gorhom/bottom-sheet"; +import type React from "react"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { + Alert, + Animated, + Keyboard, + Platform, + TouchableOpacity, + View, +} from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { useHaptic } from "@/hooks/useHaptic"; +import { verifyAccountPIN } from "@/utils/secureCredentials"; +import { Button } from "./Button"; +import { Text } from "./common/Text"; +import { PinInput } from "./inputs/PinInput"; + +interface PINEntryModalProps { + visible: boolean; + onClose: () => void; + onSuccess: () => void; + onForgotPIN?: () => void; + serverUrl: string; + userId: string; + username: string; +} + +export const PINEntryModal: React.FC = ({ + visible, + onClose, + onSuccess, + onForgotPIN, + serverUrl, + userId, + username, +}) => { + const { t } = useTranslation(); + const insets = useSafeAreaInsets(); + const bottomSheetModalRef = useRef(null); + const [pinCode, setPinCode] = useState(""); + const [error, setError] = useState(null); + const [isVerifying, setIsVerifying] = useState(false); + const shakeAnimation = useRef(new Animated.Value(0)).current; + const errorHaptic = useHaptic("error"); + const successHaptic = useHaptic("success"); + + const isAndroid = Platform.OS === "android"; + const snapPoints = useMemo( + () => (isAndroid ? ["100%"] : ["50%"]), + [isAndroid], + ); + + useEffect(() => { + if (visible) { + bottomSheetModalRef.current?.present(); + setPinCode(""); + setError(null); + } else { + bottomSheetModalRef.current?.dismiss(); + } + }, [visible]); + + const handleSheetChanges = useCallback( + (index: number) => { + if (index === -1) { + setPinCode(""); + setError(null); + onClose(); + } + }, + [onClose], + ); + + const renderBackdrop = useCallback( + (props: BottomSheetBackdropProps) => ( + + ), + [], + ); + + const shake = () => { + Animated.sequence([ + Animated.timing(shakeAnimation, { + toValue: 10, + duration: 50, + useNativeDriver: true, + }), + Animated.timing(shakeAnimation, { + toValue: -10, + duration: 50, + useNativeDriver: true, + }), + Animated.timing(shakeAnimation, { + toValue: 10, + duration: 50, + useNativeDriver: true, + }), + Animated.timing(shakeAnimation, { + toValue: 0, + duration: 50, + useNativeDriver: true, + }), + ]).start(); + }; + + const handlePinChange = async (value: string) => { + setPinCode(value); + setError(null); + + // Auto-verify when 4 digits entered + if (value.length === 4) { + setIsVerifying(true); + try { + const isValid = await verifyAccountPIN(serverUrl, userId, value); + if (isValid) { + Keyboard.dismiss(); + successHaptic(); + onSuccess(); + setPinCode(""); + } else { + errorHaptic(); + setError(t("pin.invalid_pin")); + shake(); + setPinCode(""); + } + } catch { + errorHaptic(); + setError(t("pin.invalid_pin")); + shake(); + setPinCode(""); + } finally { + setIsVerifying(false); + } + } + }; + + const handleForgotPIN = () => { + Alert.alert(t("pin.forgot_pin"), t("pin.forgot_pin_desc"), [ + { text: t("common.cancel"), style: "cancel" }, + { + text: t("common.continue"), + style: "destructive", + onPress: () => { + onClose(); + onForgotPIN?.(); + }, + }, + ]); + }; + + return ( + + + + {/* Header */} + + + {t("pin.enter_pin")} + + + {t("pin.enter_pin_for", { username })} + + + + {/* PIN Input */} + + + {error && ( + {error} + )} + {isVerifying && ( + + {t("common.verifying") || "Verifying..."} + + )} + + + {/* Forgot PIN */} + + + {t("pin.forgot_pin")} + + + + {/* Cancel Button */} + + + + + ); +}; diff --git a/components/PasswordEntryModal.tsx b/components/PasswordEntryModal.tsx new file mode 100644 index 00000000..63b4efe6 --- /dev/null +++ b/components/PasswordEntryModal.tsx @@ -0,0 +1,185 @@ +import { + BottomSheetBackdrop, + type BottomSheetBackdropProps, + BottomSheetModal, + BottomSheetTextInput, + BottomSheetView, +} from "@gorhom/bottom-sheet"; +import type React from "react"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { ActivityIndicator, Platform, View } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { useHaptic } from "@/hooks/useHaptic"; +import { Button } from "./Button"; +import { Text } from "./common/Text"; + +interface PasswordEntryModalProps { + visible: boolean; + onClose: () => void; + onSubmit: (password: string) => Promise; + username: string; +} + +export const PasswordEntryModal: React.FC = ({ + visible, + onClose, + onSubmit, + username, +}) => { + const { t } = useTranslation(); + const insets = useSafeAreaInsets(); + const bottomSheetModalRef = useRef(null); + const [password, setPassword] = useState(""); + const [error, setError] = useState(null); + const [isLoading, setIsLoading] = useState(false); + const errorHaptic = useHaptic("error"); + + const isAndroid = Platform.OS === "android"; + const snapPoints = useMemo( + () => (isAndroid ? ["100%"] : ["50%"]), + [isAndroid], + ); + + useEffect(() => { + if (visible) { + bottomSheetModalRef.current?.present(); + setPassword(""); + setError(null); + } else { + bottomSheetModalRef.current?.dismiss(); + } + }, [visible]); + + const handleSheetChanges = useCallback( + (index: number) => { + if (index === -1) { + setPassword(""); + setError(null); + onClose(); + } + }, + [onClose], + ); + + const renderBackdrop = useCallback( + (props: BottomSheetBackdropProps) => ( + + ), + [], + ); + + const handleSubmit = async () => { + if (!password) { + setError(t("password.enter_password")); + return; + } + + setIsLoading(true); + setError(null); + + try { + await onSubmit(password); + setPassword(""); + } catch { + errorHaptic(); + setError(t("password.invalid_password")); + } finally { + setIsLoading(false); + } + }; + + return ( + + + + {/* Header */} + + + {t("password.enter_password")} + + + {t("password.enter_password_for", { username })} + + + + {/* Password Input */} + + + {t("login.password")} + + { + setPassword(text); + setError(null); + }} + placeholder={t("login.password")} + placeholderTextColor='#6B7280' + secureTextEntry + autoFocus + autoCapitalize='none' + autoCorrect={false} + style={{ + backgroundColor: "#1F2937", + borderRadius: 8, + padding: 12, + color: "white", + fontSize: 16, + }} + onSubmitEditing={handleSubmit} + returnKeyType='done' + /> + {error && {error}} + + + {/* Buttons */} + + + + + + + + ); +}; diff --git a/components/PlatformDropdown.tsx b/components/PlatformDropdown.tsx index 43ecb6c9..b33d2b2c 100644 --- a/components/PlatformDropdown.tsx +++ b/components/PlatformDropdown.tsx @@ -54,9 +54,7 @@ const ToggleSwitch: React.FC<{ value: boolean }> = ({ value }) => ( className={`w-12 h-7 rounded-full ${value ? "bg-purple-600" : "bg-neutral-600"} flex-row items-center`} > ); @@ -73,9 +71,7 @@ const OptionItem: React.FC<{ option: Option; isLast?: boolean }> = ({ {option.label} {isToggle ? ( @@ -219,11 +215,7 @@ const PlatformDropdownComponent = ({ return ( - - - {trigger || } - - + {trigger} {groups.flatMap((group, groupIndex) => { // Check if this group has radio options diff --git a/components/PlayButton.tsx b/components/PlayButton.tsx index 6dee64c2..1c3fd46f 100644 --- a/components/PlayButton.tsx +++ b/components/PlayButton.tsx @@ -1,14 +1,14 @@ import { useActionSheet } from "@expo/react-native-action-sheet"; -import { Feather, Ionicons, MaterialCommunityIcons } from "@expo/vector-icons"; +import { Feather, Ionicons } from "@expo/vector-icons"; import { BottomSheetView } from "@gorhom/bottom-sheet"; import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; -import { useRouter } from "expo-router"; import { useAtom, useAtomValue } from "jotai"; import { useCallback, useEffect } from "react"; import { useTranslation } from "react-i18next"; import { Alert, Platform, TouchableOpacity, View } from "react-native"; import CastContext, { CastButton, + MediaStreamType, PlayServicesState, useMediaStatus, useRemoteMediaClient, @@ -23,11 +23,13 @@ import Animated, { useSharedValue, withTiming, } from "react-native-reanimated"; +import useRouter from "@/hooks/useAppRouter"; import { useHaptic } from "@/hooks/useHaptic"; import type { ThemeColors } from "@/hooks/useImageColorsReturn"; import { getDownloadedItemById } from "@/providers/Downloads/database"; import { useGlobalModal } from "@/providers/GlobalModalProvider"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { useOfflineMode } from "@/providers/OfflineModeProvider"; import { itemThemeColorAtom } from "@/utils/atoms/primaryColor"; import { useSettings } from "@/utils/atoms/settings"; import { getParentBackdropImageUrl } from "@/utils/jellyfin/image/getParentBackdropImageUrl"; @@ -43,7 +45,6 @@ import type { SelectedOptions } from "./ItemContent"; interface Props extends React.ComponentProps { item: BaseItemDto; selectedOptions: SelectedOptions; - isOffline?: boolean; colors?: ThemeColors; } @@ -53,9 +54,9 @@ const MIN_PLAYBACK_WIDTH = 15; export const PlayButton: React.FC = ({ item, selectedOptions, - isOffline, colors, }: Props) => { + const isOffline = useOfflineMode(); const { showActionSheetWithOptions } = useActionSheet(); const client = useRemoteMediaClient(); const mediaStatus = useMediaStatus(); @@ -185,11 +186,23 @@ export const PlayButton: React.FC = ({ return; } + // Calculate start time in seconds from playback position + const startTimeSeconds = + (item?.UserData?.PlaybackPositionTicks ?? 0) / 10000000; + + // Calculate stream duration in seconds from runtime + const streamDurationSeconds = item.RunTimeTicks + ? item.RunTimeTicks / 10000000 + : undefined; + client .loadMedia({ mediaInfo: { + contentId: item.Id, contentUrl: data?.url, contentType: "video/mp4", + streamType: MediaStreamType.BUFFERED, + streamDuration: streamDurationSeconds, metadata: item.Type === "Episode" ? { @@ -241,7 +254,7 @@ export const PlayButton: React.FC = ({ ], }, }, - startTime: 0, + startTime: startTimeSeconds, }) .then(() => { // state is already set when reopening current media, so skip it here. @@ -280,7 +293,6 @@ export const PlayButton: React.FC = ({ ]); const onPress = useCallback(async () => { - console.log("onPress"); if (!item) return; lightHapticFeedback(); @@ -288,6 +300,19 @@ export const PlayButton: React.FC = ({ // Check if item is downloaded const downloadedItem = item.Id ? getDownloadedItemById(item.Id) : undefined; + // If already in offline mode, play downloaded file directly + if (isOffline && downloadedItem) { + const queryParams = new URLSearchParams({ + itemId: item.Id!, + offline: "true", + playbackPosition: + item.UserData?.PlaybackPositionTicks?.toString() ?? "0", + }); + goToPlayer(queryParams.toString()); + return; + } + + // If online but file is downloaded, ask user which version to play if (downloadedItem) { if (Platform.OS === "android") { // Show bottom sheet for Android @@ -474,52 +499,6 @@ export const PlayButton: React.FC = ({ ), })); - // if (Platform.OS === "ios") - // return ( - // - // - // - // ); - return ( = ({ )} - {!client && settings?.openInVLC && ( - - - - )} diff --git a/components/PlayButton.tv.tsx b/components/PlayButton.tv.tsx index 8e3b9811..f79a3174 100644 --- a/components/PlayButton.tv.tsx +++ b/components/PlayButton.tv.tsx @@ -1,6 +1,5 @@ -import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons"; +import { Ionicons } from "@expo/vector-icons"; import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; -import { useRouter } from "expo-router"; import { useAtom } from "jotai"; import { useCallback, useEffect } from "react"; import { TouchableOpacity, View } from "react-native"; @@ -14,10 +13,10 @@ import Animated, { useSharedValue, withTiming, } from "react-native-reanimated"; +import useRouter from "@/hooks/useAppRouter"; import { useHaptic } from "@/hooks/useHaptic"; import type { ThemeColors } from "@/hooks/useImageColorsReturn"; import { itemThemeColorAtom } from "@/utils/atoms/primaryColor"; -import { useSettings } from "@/utils/atoms/settings"; import { runtimeTicksToMinutes } from "@/utils/time"; import type { Button } from "./Button"; import type { SelectedOptions } from "./ItemContent"; @@ -50,7 +49,6 @@ export const PlayButton: React.FC = ({ const startColor = useSharedValue(effectiveColors); const widthProgress = useSharedValue(0); const colorChangeProgress = useSharedValue(0); - const { settings } = useSettings(); const lightHapticFeedback = useHaptic("light"); const goToPlayer = useCallback( @@ -61,7 +59,6 @@ export const PlayButton: React.FC = ({ ); const onPress = () => { - console.log("onpress"); if (!item) return; lightHapticFeedback(); @@ -207,15 +204,6 @@ export const PlayButton: React.FC = ({ - {settings?.openInVLC && ( - - - - )} diff --git a/components/PlaybackSpeedSelector.tsx b/components/PlaybackSpeedSelector.tsx new file mode 100644 index 00000000..70b69ba4 --- /dev/null +++ b/components/PlaybackSpeedSelector.tsx @@ -0,0 +1,180 @@ +import { Ionicons } from "@expo/vector-icons"; +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; +import { useCallback, useEffect, useMemo, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { Platform, View } from "react-native"; +import { useSettings } from "@/utils/atoms/settings"; +import { type OptionGroup, PlatformDropdown } from "./PlatformDropdown"; +import { PlaybackSpeedScope } from "./video-player/controls/utils/playback-speed-settings"; + +export const PLAYBACK_SPEEDS = [ + { label: "0.25x", value: 0.25 }, + { label: "0.5x", value: 0.5 }, + { label: "0.75x", value: 0.75 }, + { label: "1x", value: 1.0 }, + { label: "1.25x", value: 1.25 }, + { label: "1.5x", value: 1.5 }, + { label: "1.75x", value: 1.75 }, + { label: "2x", value: 2.0 }, + { label: "2.25x", value: 2.25 }, + { label: "2.5x", value: 2.5 }, + { label: "2.75x", value: 2.75 }, + { label: "3x", value: 3.0 }, +]; + +interface Props extends React.ComponentProps { + onChange: (value: number, scope: PlaybackSpeedScope) => void; + selected: number; + item?: BaseItemDto; + open?: boolean; + onOpenChange?: (open: boolean) => void; +} + +export const PlaybackSpeedSelector: React.FC = ({ + onChange, + selected, + item, + open: controlledOpen, + onOpenChange, + ...props +}) => { + const isTv = Platform.isTV; + const { t } = useTranslation(); + const { settings } = useSettings(); + const [internalOpen, setInternalOpen] = useState(false); + + // Determine initial scope based on existing settings + const initialScope = useMemo(() => { + if (!item || !settings) return PlaybackSpeedScope.All; + + const itemId = item?.Id; + if (!itemId) return PlaybackSpeedScope.All; + + // Check for media-specific speed preference + if (settings?.playbackSpeedPerMedia?.[itemId] !== undefined) { + return PlaybackSpeedScope.Media; + } + + // Check for show-specific speed preference (only for episodes) + const seriesId = item?.SeriesId; + const perShowSettings = settings?.playbackSpeedPerShow; + if ( + seriesId && + perShowSettings && + perShowSettings[seriesId] !== undefined + ) { + return PlaybackSpeedScope.Show; + } + + // If no custom setting exists, check default playback speed + // Show "All" if speed is not 1x, otherwise show "Media" + return (settings?.defaultPlaybackSpeed ?? 1.0) !== 1.0 + ? PlaybackSpeedScope.All + : PlaybackSpeedScope.Media; + }, [item?.Id, item?.SeriesId, settings]); + + const [selectedScope, setSelectedScope] = + useState(initialScope); + + // Update selectedScope when initialScope changes + useEffect(() => { + setSelectedScope(initialScope); + }, [initialScope]); + + const open = controlledOpen !== undefined ? controlledOpen : internalOpen; + const setOpen = onOpenChange || setInternalOpen; + + const scopeLabels = useMemo>(() => { + const labels: Record = { + [PlaybackSpeedScope.Media]: t("playback_speed.scope.media"), + }; + + if (item?.SeriesId) { + labels[PlaybackSpeedScope.Show] = t("playback_speed.scope.show"); + } + + labels[PlaybackSpeedScope.All] = t("playback_speed.scope.all"); + + return labels as Record; + }, [item?.SeriesId, t]); + + const availableScopes = useMemo(() => { + const scopes = [PlaybackSpeedScope.Media]; + if (item?.SeriesId) { + scopes.push(PlaybackSpeedScope.Show); + } + scopes.push(PlaybackSpeedScope.All); + return scopes; + }, [item?.SeriesId]); + + const handleSpeedSelect = useCallback( + (speed: number) => { + onChange(speed, selectedScope); + setOpen(false); + }, + [onChange, selectedScope, setOpen], + ); + + const optionGroups = useMemo(() => { + const groups: OptionGroup[] = []; + + // Scope selection group + groups.push({ + title: t("playback_speed.apply_to"), + options: availableScopes.map((scope) => ({ + type: "radio" as const, + label: scopeLabels[scope], + value: scope, + selected: selectedScope === scope, + onPress: () => setSelectedScope(scope), + })), + }); + + // Speed selection group + groups.push({ + title: t("playback_speed.speed"), + options: PLAYBACK_SPEEDS.map((speed) => ({ + type: "radio" as const, + label: speed.label, + value: speed.value, + selected: selected === speed.value, + onPress: () => handleSpeedSelect(speed.value), + })), + }); + + return groups; + }, [ + t, + availableScopes, + scopeLabels, + selectedScope, + selected, + handleSpeedSelect, + ]); + + const trigger = useMemo( + () => ( + + + + ), + [], + ); + + if (isTv) return null; + + return ( + + + + ); +}; diff --git a/components/PlayedStatus.tsx b/components/PlayedStatus.tsx index 0023b014..dd2198cd 100644 --- a/components/PlayedStatus.tsx +++ b/components/PlayedStatus.tsx @@ -1,12 +1,12 @@ import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import type React from "react"; +import { useCallback } from "react"; import { View, type ViewProps } from "react-native"; import { useMarkAsPlayed } from "@/hooks/useMarkAsPlayed"; import { RoundButton } from "./RoundButton"; interface Props extends ViewProps { items: BaseItemDto[]; - isOffline?: boolean; size?: "default" | "large"; } @@ -14,14 +14,16 @@ export const PlayedStatus: React.FC = ({ items, ...props }) => { const allPlayed = items.every((item) => item.UserData?.Played); const toggle = useMarkAsPlayed(items); + const handlePress = useCallback(() => { + void toggle(!allPlayed); + }, [allPlayed, toggle]); + return ( { - await toggle(!allPlayed); - }} + onPress={handlePress} size={props.size} /> diff --git a/components/PreviousServersList.tsx b/components/PreviousServersList.tsx index ffa310d3..008e1be2 100644 --- a/components/PreviousServersList.tsx +++ b/components/PreviousServersList.tsx @@ -1,42 +1,266 @@ +import { Ionicons } from "@expo/vector-icons"; import type React from "react"; -import { useMemo } from "react"; +import { useCallback, useMemo, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; -import { View } from "react-native"; +import { ActivityIndicator, Alert, TouchableOpacity, View } from "react-native"; +import { Swipeable } from "react-native-gesture-handler"; import { useMMKVString } from "react-native-mmkv"; +import { Colors } from "@/constants/Colors"; +import { + deleteAccountCredential, + getPreviousServers, + removeServerFromList, + type SavedServer, + type SavedServerAccount, +} from "@/utils/secureCredentials"; +import { AccountsSheet } from "./AccountsSheet"; +import { Text } from "./common/Text"; import { ListGroup } from "./list/ListGroup"; import { ListItem } from "./list/ListItem"; - -interface Server { - address: string; -} +import { PasswordEntryModal } from "./PasswordEntryModal"; +import { PINEntryModal } from "./PINEntryModal"; interface PreviousServersListProps { - onServerSelect: (server: Server) => void; + onServerSelect: (server: SavedServer) => void; + onQuickLogin?: (serverUrl: string, userId: string) => Promise; + onPasswordLogin?: ( + serverUrl: string, + username: string, + password: string, + ) => Promise; + onAddAccount?: (server: SavedServer) => void; } export const PreviousServersList: React.FC = ({ onServerSelect, + onQuickLogin, + onPasswordLogin, + onAddAccount, }) => { const [_previousServers, setPreviousServers] = useMMKVString("previousServers"); + const [loadingServer, setLoadingServer] = useState(null); + + // Modal states + const [accountsSheetOpen, setAccountsSheetOpen] = useState(false); + const [selectedServer, setSelectedServer] = useState( + null, + ); + const [pinModalVisible, setPinModalVisible] = useState(false); + const [passwordModalVisible, setPasswordModalVisible] = useState(false); + const [selectedAccount, setSelectedAccount] = + useState(null); const previousServers = useMemo(() => { - return JSON.parse(_previousServers || "[]") as Server[]; + return JSON.parse(_previousServers || "[]") as SavedServer[]; }, [_previousServers]); const { t } = useTranslation(); + const refreshServers = () => { + const servers = getPreviousServers(); + setPreviousServers(JSON.stringify(servers)); + }; + + const handleAccountLogin = async ( + server: SavedServer, + account: SavedServerAccount, + ) => { + switch (account.securityType) { + case "none": + // Quick login without protection + if (onQuickLogin) { + setLoadingServer(server.address); + try { + await onQuickLogin(server.address, account.userId); + } catch { + Alert.alert( + t("server.session_expired"), + t("server.please_login_again"), + [{ text: t("common.ok"), onPress: () => onServerSelect(server) }], + ); + } finally { + setLoadingServer(null); + } + } + break; + + case "pin": + // Show PIN entry modal + setSelectedServer(server); + setSelectedAccount(account); + setPinModalVisible(true); + break; + + case "password": + // Show password entry modal + setSelectedServer(server); + setSelectedAccount(account); + setPasswordModalVisible(true); + break; + } + }; + + const handleServerPress = async (server: SavedServer) => { + if (loadingServer) return; // Prevent double-tap + + const accountCount = server.accounts?.length || 0; + + if (accountCount === 0) { + // No saved accounts, go to manual login + onServerSelect(server); + } else { + // Has accounts, show account sheet (allows adding new account too) + setSelectedServer(server); + setAccountsSheetOpen(true); + } + }; + + const handlePinSuccess = async () => { + setPinModalVisible(false); + if (selectedServer && selectedAccount && onQuickLogin) { + setLoadingServer(selectedServer.address); + try { + await onQuickLogin(selectedServer.address, selectedAccount.userId); + } catch { + Alert.alert( + t("server.session_expired"), + t("server.please_login_again"), + [ + { + text: t("common.ok"), + onPress: () => onServerSelect(selectedServer), + }, + ], + ); + } finally { + setLoadingServer(null); + setSelectedAccount(null); + setSelectedServer(null); + } + } + }; + + const handlePasswordSubmit = async (password: string) => { + if (selectedServer && selectedAccount && onPasswordLogin) { + await onPasswordLogin( + selectedServer.address, + selectedAccount.username, + password, + ); + setPasswordModalVisible(false); + setSelectedAccount(null); + setSelectedServer(null); + } + }; + + const handleForgotPIN = async () => { + if (selectedServer && selectedAccount) { + await deleteAccountCredential( + selectedServer.address, + selectedAccount.userId, + ); + refreshServers(); + // Go to manual login + onServerSelect(selectedServer); + setSelectedAccount(null); + setSelectedServer(null); + } + }; + + const handleRemoveFirstCredential = async (serverUrl: string) => { + const server = previousServers.find((s) => s.address === serverUrl); + if (!server || server.accounts.length === 0) return; + + Alert.alert( + t("server.remove_saved_login"), + t("server.remove_saved_login_description"), + [ + { text: t("common.cancel"), style: "cancel" }, + { + text: t("common.remove"), + style: "destructive", + onPress: async () => { + // Remove first account + await deleteAccountCredential(serverUrl, server.accounts[0].userId); + refreshServers(); + }, + }, + ], + ); + }; + + const handleRemoveServer = useCallback( + async (serverUrl: string) => { + await removeServerFromList(serverUrl); + refreshServers(); + }, + [setPreviousServers], + ); + + const renderRightActions = useCallback( + (serverUrl: string, swipeableRef: React.RefObject) => ( + { + swipeableRef.current?.close(); + handleRemoveServer(serverUrl); + }} + className='bg-red-600 justify-center items-center px-5' + > + + + ), + [handleRemoveServer], + ); + + const getServerSubtitle = (server: SavedServer): string | undefined => { + const accountCount = server.accounts?.length || 0; + + if (accountCount > 1) { + return t("server.accounts_count", { count: accountCount }); + } + if (accountCount === 1) { + return `${server.accounts[0].username} โ€ข ${t("server.saved")}`; + } + return server.name ? server.address : undefined; + }; + + const getSecurityIcon = ( + server: SavedServer, + ): keyof typeof Ionicons.glyphMap | null => { + const accountCount = server.accounts?.length || 0; + if (accountCount === 0) return null; + + if (accountCount > 1) { + return "people"; + } + + const account = server.accounts[0]; + switch (account.securityType) { + case "pin": + return "keypad"; + case "password": + return "lock-closed"; + default: + return "key"; + } + }; + if (!previousServers.length) return null; return ( {previousServers.map((s) => ( - onServerSelect(s)} - title={s.address} - showArrow + server={s} + loadingServer={loadingServer} + onPress={() => handleServerPress(s)} + onRemoveCredential={() => handleRemoveFirstCredential(s.address)} + renderRightActions={renderRightActions} + subtitle={getServerSubtitle(s)} + securityIcon={getSecurityIcon(s)} /> ))} = ({ textColor='red' /> + + {t("server.swipe_to_remove")} + + + {/* Account Selection Sheet */} + { + if (selectedServer) { + handleAccountLogin(selectedServer, account); + } + }} + onAddAccount={() => { + if (selectedServer && onAddAccount) { + onAddAccount(selectedServer); + } + }} + onAccountDeleted={refreshServers} + /> + + {/* PIN Entry Modal */} + { + setPinModalVisible(false); + setSelectedAccount(null); + setSelectedServer(null); + }} + onSuccess={handlePinSuccess} + onForgotPIN={handleForgotPIN} + serverUrl={selectedServer?.address || ""} + userId={selectedAccount?.userId || ""} + username={selectedAccount?.username || ""} + /> + + {/* Password Entry Modal */} + { + setPasswordModalVisible(false); + setSelectedAccount(null); + setSelectedServer(null); + }} + onSubmit={handlePasswordSubmit} + username={selectedAccount?.username || ""} + /> ); }; + +interface ServerItemProps { + server: SavedServer; + loadingServer: string | null; + onPress: () => void; + onRemoveCredential: () => void; + renderRightActions: ( + serverUrl: string, + swipeableRef: React.RefObject, + ) => React.ReactNode; + subtitle?: string; + securityIcon: keyof typeof Ionicons.glyphMap | null; +} + +const ServerItem: React.FC = ({ + server, + loadingServer, + onPress, + onRemoveCredential, + renderRightActions, + subtitle, + securityIcon, +}) => { + const swipeableRef = useRef(null); + const hasAccounts = server.accounts?.length > 0; + + return ( + + renderRightActions(server.address, swipeableRef) + } + overshootRight={false} + > + + {loadingServer === server.address ? ( + + ) : hasAccounts && securityIcon ? ( + { + e.stopPropagation(); + onRemoveCredential(); + }} + className='p-1' + hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }} + > + + + ) : null} + + + ); +}; diff --git a/components/Ratings.tsx b/components/Ratings.tsx index 5741233f..e091c64c 100644 --- a/components/Ratings.tsx +++ b/components/Ratings.tsx @@ -4,7 +4,7 @@ import { useQuery } from "@tanstack/react-query"; import { Image } from "expo-image"; import { useMemo } from "react"; import { View, type ViewProps } from "react-native"; -import { useJellyseerr } from "@/hooks/useJellyseerr"; +import { useSeerr } from "@/hooks/useSeerr"; import { MediaType } from "@/utils/jellyseerr/server/constants/media"; import type { MovieDetails } from "@/utils/jellyseerr/server/models/Movie"; import type { @@ -55,23 +55,23 @@ export const Ratings: React.FC = ({ item, ...props }) => { ); }; -export const JellyserrRatings: React.FC<{ +export const SeerrRatings: React.FC<{ result: MovieResult | TvResult | TvDetails | MovieDetails; }> = ({ result }) => { - const { jellyseerrApi, getMediaType } = useJellyseerr(); + const { seerrApi, getMediaType } = useSeerr(); const mediaType = useMemo(() => getMediaType(result), [result]); const { data, isLoading } = useQuery({ - queryKey: ["jellyseerr", result.id, mediaType, "ratings"], + queryKey: ["seerr", result.id, mediaType, "ratings"], queryFn: async () => { return mediaType === MediaType.MOVIE - ? jellyseerrApi?.movieRatings(result.id) - : jellyseerrApi?.tvRatings(result.id); + ? seerrApi?.movieRatings(result.id) + : seerrApi?.tvRatings(result.id); }, staleTime: (5).minutesToMilliseconds(), retry: false, - enabled: !!jellyseerrApi, + enabled: !!seerrApi, }); return ( diff --git a/components/RoundButton.tsx b/components/RoundButton.tsx index 5d490f19..5493d94f 100644 --- a/components/RoundButton.tsx +++ b/components/RoundButton.tsx @@ -1,7 +1,8 @@ import { Ionicons } from "@expo/vector-icons"; import { BlurView } from "expo-blur"; import type { PropsWithChildren } from "react"; -import { Platform, TouchableOpacity, type ViewProps } from "react-native"; +import { Platform, type ViewProps } from "react-native"; +import { Pressable } from "react-native-gesture-handler"; import { useHaptic } from "@/hooks/useHaptic"; interface Props extends ViewProps { @@ -38,7 +39,7 @@ export const RoundButton: React.FC> = ({ if (Platform.OS === "ios") { return ( - > = ({ /> ) : null} {children ? children : null} - + ); } if (fillColor) return ( - > = ({ /> ) : null} {children ? children : null} - + ); if (background === false) return ( - > = ({ /> ) : null} {children ? children : null} - + ); if (Platform.OS === "android") return ( - > = ({ ) : null} {children ? children : null} - + ); return ( - + > = ({ ) : null} {children ? children : null} - + ); }; diff --git a/components/SaveAccountModal.tsx b/components/SaveAccountModal.tsx new file mode 100644 index 00000000..42615c7d --- /dev/null +++ b/components/SaveAccountModal.tsx @@ -0,0 +1,252 @@ +import { Ionicons } from "@expo/vector-icons"; +import { + BottomSheetBackdrop, + type BottomSheetBackdropProps, + BottomSheetModal, + BottomSheetView, +} from "@gorhom/bottom-sheet"; +import type React from "react"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { Platform, TouchableOpacity, View } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import type { AccountSecurityType } from "@/utils/secureCredentials"; +import { Button } from "./Button"; +import { Text } from "./common/Text"; +import { PinInput } from "./inputs/PinInput"; + +interface SaveAccountModalProps { + visible: boolean; + onClose: () => void; + onSave: (securityType: AccountSecurityType, pinCode?: string) => void; + username: string; +} + +interface SecurityOption { + type: AccountSecurityType; + titleKey: string; + descriptionKey: string; + icon: keyof typeof Ionicons.glyphMap; +} + +const SECURITY_OPTIONS: SecurityOption[] = [ + { + type: "none", + titleKey: "save_account.no_protection", + descriptionKey: "save_account.no_protection_desc", + icon: "flash-outline", + }, + { + type: "pin", + titleKey: "save_account.pin_code", + descriptionKey: "save_account.pin_code_desc", + icon: "keypad-outline", + }, + { + type: "password", + titleKey: "save_account.password", + descriptionKey: "save_account.password_desc", + icon: "lock-closed-outline", + }, +]; + +export const SaveAccountModal: React.FC = ({ + visible, + onClose, + onSave, + username, +}) => { + const { t } = useTranslation(); + const insets = useSafeAreaInsets(); + const bottomSheetModalRef = useRef(null); + const [selectedType, setSelectedType] = useState("none"); + const [pinCode, setPinCode] = useState(""); + const [pinError, setPinError] = useState(null); + + const isAndroid = Platform.OS === "android"; + const snapPoints = useMemo( + () => (isAndroid ? ["100%"] : ["70%"]), + [isAndroid], + ); + + useEffect(() => { + if (visible) { + bottomSheetModalRef.current?.present(); + } else { + bottomSheetModalRef.current?.dismiss(); + } + }, [visible]); + + const handleSheetChanges = useCallback( + (index: number) => { + if (index === -1) { + resetState(); + onClose(); + } + }, + [onClose], + ); + + const resetState = () => { + setSelectedType("none"); + setPinCode(""); + setPinError(null); + }; + + const renderBackdrop = useCallback( + (props: BottomSheetBackdropProps) => ( + + ), + [], + ); + + const handleOptionSelect = (type: AccountSecurityType) => { + setSelectedType(type); + setPinCode(""); + setPinError(null); + }; + + const handleSave = () => { + if (selectedType === "pin") { + if (pinCode.length !== 4) { + setPinError(t("pin.enter_4_digits") || "Enter 4 digits"); + return; + } + onSave("pin", pinCode); + } else { + onSave(selectedType); + } + resetState(); + }; + + const handleCancel = () => { + resetState(); + onClose(); + }; + + const canSave = () => { + if (selectedType === "pin") { + return pinCode.length === 4; + } + return true; + }; + + return ( + + + + {/* Header */} + + + {t("save_account.title")} + + {username} + + + {/* PIN Entry Step */} + {selectedType === "pin" ? ( + + + + {t("pin.setup_pin")} + + + {pinError && ( + + {pinError} + + )} + + + ) : ( + /* Security Options */ + + + {t("save_account.security_option")} + + + {SECURITY_OPTIONS.map((option, index) => ( + handleOptionSelect(option.type)} + className={`flex-row items-center p-4 ${ + index < SECURITY_OPTIONS.length - 1 + ? "border-b border-neutral-700" + : "" + }`} + > + + + + + + {t(option.titleKey)} + + + {t(option.descriptionKey)} + + + + {selectedType === option.type && ( + + )} + + + ))} + + + )} + + {/* Buttons */} + + + + + + + + ); +}; diff --git a/components/SimilarItems.tsx b/components/SimilarItems.tsx index b73e5518..7ed99535 100644 --- a/components/SimilarItems.tsx +++ b/components/SimilarItems.tsx @@ -7,6 +7,10 @@ import { useTranslation } from "react-i18next"; import { View, type ViewProps } from "react-native"; import MoviePoster from "@/components/posters/MoviePoster"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; + +// Matches `w-28` poster cards (approx 112px wide, 10/15 aspect ratio) + 2 lines of text. +const POSTER_CAROUSEL_HEIGHT = 220; + import { HorizontalScroll } from "./common/HorizontalScroll"; import { Text } from "./common/Text"; import { TouchableItemRouter } from "./common/TouchableItemRouter"; @@ -53,7 +57,7 @@ export const SimilarItems: React.FC = ({ ( = ({ if (currentItem) { setSelectedOptions({ bitrate: defaultBitrate, - mediaSource: defaultMediaSource, + mediaSource: defaultMediaSource ?? undefined, subtitleIndex: defaultSubtitleIndex ?? -1, audioIndex: defaultAudioIndex, }); diff --git a/components/common/HeaderBackButton.tsx b/components/common/HeaderBackButton.tsx index 686cab5d..8818a9a0 100644 --- a/components/common/HeaderBackButton.tsx +++ b/components/common/HeaderBackButton.tsx @@ -1,42 +1,36 @@ import { Ionicons } from "@expo/vector-icons"; import { BlurView, type BlurViewProps } from "expo-blur"; -import { useRouter } from "expo-router"; -import { - Platform, - TouchableOpacity, - type TouchableOpacityProps, -} from "react-native"; +import { Platform } from "react-native"; +import { Pressable, type PressableProps } from "react-native-gesture-handler"; +import useRouter from "@/hooks/useAppRouter"; interface Props extends BlurViewProps { background?: "blur" | "transparent"; - touchableOpacityProps?: TouchableOpacityProps; + pressableProps?: Omit; } export const HeaderBackButton: React.FC = ({ background = "transparent", - touchableOpacityProps, + pressableProps, ...props }) => { const router = useRouter(); if (Platform.OS === "ios") { return ( - router.back()} className='flex items-center justify-center w-9 h-9' - {...touchableOpacityProps} + {...pressableProps} > - + ); } if (background === "transparent" && Platform.OS !== "android") return ( - router.back()} - {...touchableOpacityProps} - > + router.back()} {...pressableProps}> = ({ color='white' /> - + ); return ( - router.back()} className=' rounded-full p-2' - {...touchableOpacityProps} + {...pressableProps} > = ({ size={24} color='white' /> - + ); }; diff --git a/components/common/HorizontalScroll.tsx b/components/common/HorizontalScroll.tsx index 6c6af8e7..e907f52f 100644 --- a/components/common/HorizontalScroll.tsx +++ b/components/common/HorizontalScroll.tsx @@ -58,7 +58,7 @@ export const HorizontalScroll = ( if (!data || loading) { return ( - + diff --git a/components/common/LargePoster.tsx b/components/common/LargePoster.tsx deleted file mode 100644 index ab3b16fb..00000000 --- a/components/common/LargePoster.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { Image } from "expo-image"; -import { View } from "react-native"; - -export const LargePoster: React.FC<{ url?: string | null }> = ({ url }) => { - if (!url) - return ( - - - - ); - - return ( - - - - ); -}; diff --git a/components/common/SectionHeader.tsx b/components/common/SectionHeader.tsx new file mode 100644 index 00000000..aa9efc43 --- /dev/null +++ b/components/common/SectionHeader.tsx @@ -0,0 +1,42 @@ +import { TouchableOpacity, View } from "react-native"; +import { Colors } from "@/constants/Colors"; +import { Text } from "./Text"; + +type Props = { + title: string; + actionLabel?: string; + actionDisabled?: boolean; + onPressAction?: () => void; +}; + +export const SectionHeader: React.FC = ({ + title, + actionLabel, + actionDisabled = false, + onPressAction, +}) => { + const shouldShowAction = Boolean(actionLabel) && Boolean(onPressAction); + + return ( + + {title} + {shouldShowAction && ( + + + {actionLabel} + + + )} + + ); +}; diff --git a/components/common/JellyseerrItemRouter.tsx b/components/common/SeerrItemRouter.tsx similarity index 87% rename from components/common/JellyseerrItemRouter.tsx rename to components/common/SeerrItemRouter.tsx index 2fdaa801..184ef490 100644 --- a/components/common/JellyseerrItemRouter.tsx +++ b/components/common/SeerrItemRouter.tsx @@ -1,7 +1,8 @@ -import { useRouter, useSegments } from "expo-router"; +import { useSegments } from "expo-router"; import type React from "react"; import { type PropsWithChildren } from "react"; import { TouchableOpacity, type TouchableOpacityProps } from "react-native"; +import useRouter from "@/hooks/useAppRouter"; import { MediaType } from "@/utils/jellyseerr/server/constants/media"; import type { MovieDetails } from "@/utils/jellyseerr/server/models/Movie"; import { PersonCreditCast } from "@/utils/jellyseerr/server/models/Person"; @@ -20,7 +21,7 @@ interface Props extends TouchableOpacityProps { mediaType: MediaType; } -export const TouchableJellyseerrRouter: React.FC> = ({ +export const TouchableSeerrRouter: React.FC> = ({ result, mediaTitle, releaseYear, @@ -42,7 +43,7 @@ export const TouchableJellyseerrRouter: React.FC> = ({ if (!result) return; router.push({ - pathname: `/(auth)/(tabs)/${from}/jellyseerr/page`, + pathname: `/(auth)/(tabs)/${from}/seerr/page`, // @ts-expect-error params: { ...result, diff --git a/components/common/TouchableItemRouter.tsx b/components/common/TouchableItemRouter.tsx index e95fd5e7..2c85e094 100644 --- a/components/common/TouchableItemRouter.tsx +++ b/components/common/TouchableItemRouter.tsx @@ -1,14 +1,16 @@ import { useActionSheet } from "@expo/react-native-action-sheet"; import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; -import { useRouter, useSegments } from "expo-router"; +import { useSegments } from "expo-router"; import { type PropsWithChildren, useCallback } from "react"; import { TouchableOpacity, type TouchableOpacityProps } from "react-native"; +import useRouter from "@/hooks/useAppRouter"; import { useFavorite } from "@/hooks/useFavorite"; import { useMarkAsPlayed } from "@/hooks/useMarkAsPlayed"; +import { useDownload } from "@/providers/DownloadProvider"; +import { useOfflineMode } from "@/providers/OfflineModeProvider"; interface Props extends TouchableOpacityProps { item: BaseItemDto; - isOffline?: boolean; } export const itemRouter = (item: BaseItemDto, from: string) => { @@ -16,6 +18,10 @@ export const itemRouter = (item: BaseItemDto, from: string) => { return `/(auth)/(tabs)/${from}/livetv`; } + if ("CollectionType" in item && item.CollectionType === "music") { + return `/(auth)/(tabs)/(libraries)/music/${item.Id}`; + } + if (item.Type === "Series") { return `/(auth)/(tabs)/${from}/series/${item.Id}`; } @@ -50,6 +56,13 @@ export const getItemNavigation = (item: BaseItemDto, _from: string) => { }; } + if ("CollectionType" in item && item.CollectionType === "music") { + return { + pathname: "/music/[libraryId]" as const, + params: { libraryId: item.Id! }, + }; + } + if (item.Type === "Series") { return { pathname: "/series/[id]" as const, @@ -71,13 +84,49 @@ export const getItemNavigation = (item: BaseItemDto, _from: string) => { }; } - if (item.Type === "CollectionFolder" || item.Type === "Playlist") { + if (item.Type === "CollectionFolder") { return { pathname: "/[libraryId]" as const, params: { libraryId: item.Id! }, }; } + // Music types - use shared routes for proper back navigation + if (item.Type === "MusicArtist") { + return { + pathname: "/music/artist/[artistId]" as const, + params: { artistId: item.Id! }, + }; + } + + if (item.Type === "MusicAlbum") { + return { + pathname: "/music/album/[albumId]" as const, + params: { albumId: item.Id! }, + }; + } + + if (item.Type === "Audio") { + // Navigate to the album if available, otherwise to the item page + if (item.AlbumId) { + return { + pathname: "/music/album/[albumId]" as const, + params: { albumId: item.AlbumId }, + }; + } + return { + pathname: "/items/page" as const, + params: { id: item.Id! }, + }; + } + + if (item.Type === "Playlist") { + return { + pathname: "/music/playlist/[playlistId]" as const, + params: { playlistId: item.Id! }, + }; + } + // Default case - items page return { pathname: "/items/page" as const, @@ -87,18 +136,31 @@ export const getItemNavigation = (item: BaseItemDto, _from: string) => { export const TouchableItemRouter: React.FC> = ({ item, - isOffline = false, children, ...props }) => { - const router = useRouter(); const segments = useSegments(); const { showActionSheetWithOptions } = useActionSheet(); const markAsPlayedStatus = useMarkAsPlayed([item]); const { isFavorite, toggleFavorite } = useFavorite(item); + const router = useRouter(); + const isOffline = useOfflineMode(); + const { deleteFile } = useDownload(); const from = (segments as string[])[2] || "(home)"; + const handlePress = useCallback(() => { + // Force music libraries to navigate via the explicit string route. + // This avoids losing the dynamic [libraryId] param when going through a nested navigator. + if ("CollectionType" in item && item.CollectionType === "music") { + router.push(itemRouter(item, from) as any); + return; + } + + const navigation = getItemNavigation(item, from); + router.push(navigation as any); + }, [from, item, router]); + const showActionSheet = useCallback(() => { if ( !( @@ -108,18 +170,24 @@ export const TouchableItemRouter: React.FC> = ({ ) ) return; - const options = [ + + const options: string[] = [ "Mark as Played", "Mark as Not Played", isFavorite ? "Unmark as Favorite" : "Mark as Favorite", + ...(isOffline ? ["Delete Download"] : []), "Cancel", ]; - const cancelButtonIndex = 3; + const cancelButtonIndex = options.length - 1; + const destructiveButtonIndex = isOffline + ? cancelButtonIndex - 1 + : undefined; showActionSheetWithOptions( { options, cancelButtonIndex, + destructiveButtonIndex, }, async (selectedIndex) => { if (selectedIndex === 0) { @@ -128,31 +196,32 @@ export const TouchableItemRouter: React.FC> = ({ await markAsPlayedStatus(false); } else if (selectedIndex === 2) { toggleFavorite(); + } else if (isOffline && selectedIndex === 3 && item.Id) { + deleteFile(item.Id); } }, ); - }, [showActionSheetWithOptions, isFavorite, markAsPlayedStatus]); + }, [ + showActionSheetWithOptions, + isFavorite, + markAsPlayedStatus, + toggleFavorite, + isOffline, + deleteFile, + item.Id, + ]); if ( from === "(home)" || from === "(search)" || from === "(libraries)" || - from === "(favorites)" + from === "(favorites)" || + from === "(watchlists)" ) return ( { - if (isOffline) { - // For offline mode, we still need to use query params - const url = `${itemRouter(item, from)}&offline=true`; - router.push(url as any); - return; - } - - const navigation = getItemNavigation(item, from); - router.push(navigation as any); - }} + onPress={handlePress} {...props} > {children} diff --git a/components/common/VerticalSkeleton.tsx b/components/common/VerticalSkeleton.tsx deleted file mode 100644 index 02a8a256..00000000 --- a/components/common/VerticalSkeleton.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { View, type ViewProps } from "react-native"; - -interface Props extends ViewProps { - index: number; -} - -export const VerticalSkeleton: React.FC = ({ index, ...props }) => { - return ( - - - - - - - ); -}; diff --git a/components/downloads/DownloadCard.tsx b/components/downloads/DownloadCard.tsx index 5453f32a..66f2a81b 100644 --- a/components/downloads/DownloadCard.tsx +++ b/components/downloads/DownloadCard.tsx @@ -1,7 +1,5 @@ import { Ionicons } from "@expo/vector-icons"; -import { useQueryClient } from "@tanstack/react-query"; import { Image } from "expo-image"; -import { useRouter } from "expo-router"; import { t } from "i18next"; import { useMemo } from "react"; import { @@ -12,6 +10,8 @@ import { } from "react-native"; import { toast } from "sonner-native"; import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; +import { useNetworkAwareQueryClient } from "@/hooks/useNetworkAwareQueryClient"; import { useDownload } from "@/providers/DownloadProvider"; import { calculateSmoothedETA } from "@/providers/Downloads/hooks/useDownloadSpeedCalculator"; import { JobStatus } from "@/providers/Downloads/types"; @@ -37,7 +37,7 @@ interface DownloadCardProps extends TouchableOpacityProps { export const DownloadCard = ({ process, ...props }: DownloadCardProps) => { const { cancelDownload } = useDownload(); const router = useRouter(); - const queryClient = useQueryClient(); + const queryClient = useNetworkAwareQueryClient(); const handleDelete = async (id: string) => { try { diff --git a/components/downloads/EpisodeCard.tsx b/components/downloads/EpisodeCard.tsx index 3c57a17a..f907bacf 100644 --- a/components/downloads/EpisodeCard.tsx +++ b/components/downloads/EpisodeCard.tsx @@ -61,7 +61,6 @@ export const EpisodeCard: React.FC = ({ item }) => { return ( diff --git a/components/downloads/MovieCard.tsx b/components/downloads/MovieCard.tsx index f02fe796..9d805ddb 100644 --- a/components/downloads/MovieCard.tsx +++ b/components/downloads/MovieCard.tsx @@ -67,7 +67,7 @@ export const MovieCard: React.FC = ({ item }) => { }, [showActionSheetWithOptions, handleDeleteFile]); return ( - + {base64Image ? ( = ({ items }) => { const { deleteItems } = useDownload(); const { showActionSheetWithOptions } = useActionSheet(); + const router = useRouter(); const base64Image = useMemo(() => { return storage.getString(items[0].SeriesId!); @@ -46,7 +47,12 @@ export const SeriesCard: React.FC<{ items: BaseItemDto[] }> = ({ items }) => { return ( router.push(`/downloads/${items[0].SeriesId}`)} + onPress={() => + router.push({ + pathname: "/series/[id]", + params: { id: items[0].SeriesId!, offline: "true" }, + }) + } onLongPress={showActionSheet} > {base64Image ? ( diff --git a/components/filters/ResetFiltersButton.tsx b/components/filters/ResetFiltersButton.tsx index c0cc6d68..856ccd3b 100644 --- a/components/filters/ResetFiltersButton.tsx +++ b/components/filters/ResetFiltersButton.tsx @@ -2,6 +2,7 @@ import { Ionicons } from "@expo/vector-icons"; import { useAtom } from "jotai"; import { TouchableOpacity, type TouchableOpacityProps } from "react-native"; import { + filterByAtom, genreFilterAtom, tagsFilterAtom, yearFilterAtom, @@ -13,11 +14,13 @@ export const ResetFiltersButton: React.FC = ({ ...props }) => { const [selectedGenres, setSelectedGenres] = useAtom(genreFilterAtom); const [selectedTags, setSelectedTags] = useAtom(tagsFilterAtom); const [selectedYears, setSelectedYears] = useAtom(yearFilterAtom); + const [selectedFilters, setSelectedFilters] = useAtom(filterByAtom); if ( selectedGenres.length === 0 && selectedTags.length === 0 && - selectedYears.length === 0 + selectedYears.length === 0 && + selectedFilters.length === 0 ) { return null; } @@ -28,6 +31,7 @@ export const ResetFiltersButton: React.FC = ({ ...props }) => { setSelectedGenres([]); setSelectedTags([]); setSelectedYears([]); + setSelectedFilters([]); }} className='bg-purple-600 rounded-full w-[30px] h-[30px] flex items-center justify-center mr-1' {...props} diff --git a/components/home/Favorites.tsx b/components/home/Favorites.tsx index b1b32d95..84fa36b9 100644 --- a/components/home/Favorites.tsx +++ b/components/home/Favorites.tsx @@ -9,6 +9,7 @@ import { Text, View } from "react-native"; // PNG ASSET import heart from "@/assets/icons/heart.fill.png"; import { Colors } from "@/constants/Colors"; +import useRouter from "@/hooks/useAppRouter"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; import { InfiniteScrollingCollectionList } from "./InfiniteScrollingCollectionList"; @@ -22,8 +23,10 @@ type FavoriteTypes = type EmptyState = Record; export const Favorites = () => { + const router = useRouter(); const [api] = useAtom(apiAtom); const [user] = useAtom(userAtom); + const pageSize = 20; const [emptyState, setEmptyState] = useState({ Series: false, Movie: false, @@ -91,35 +94,77 @@ export const Favorites = () => { const fetchFavoriteSeries = useCallback( ({ pageParam }: { pageParam: number }) => - fetchFavoritesByType("Series", pageParam), - [fetchFavoritesByType], + fetchFavoritesByType("Series", pageParam, pageSize), + [fetchFavoritesByType, pageSize], ); const fetchFavoriteMovies = useCallback( ({ pageParam }: { pageParam: number }) => - fetchFavoritesByType("Movie", pageParam), - [fetchFavoritesByType], + fetchFavoritesByType("Movie", pageParam, pageSize), + [fetchFavoritesByType, pageSize], ); const fetchFavoriteEpisodes = useCallback( ({ pageParam }: { pageParam: number }) => - fetchFavoritesByType("Episode", pageParam), - [fetchFavoritesByType], + fetchFavoritesByType("Episode", pageParam, pageSize), + [fetchFavoritesByType, pageSize], ); const fetchFavoriteVideos = useCallback( ({ pageParam }: { pageParam: number }) => - fetchFavoritesByType("Video", pageParam), - [fetchFavoritesByType], + fetchFavoritesByType("Video", pageParam, pageSize), + [fetchFavoritesByType, pageSize], ); const fetchFavoriteBoxsets = useCallback( ({ pageParam }: { pageParam: number }) => - fetchFavoritesByType("BoxSet", pageParam), - [fetchFavoritesByType], + fetchFavoritesByType("BoxSet", pageParam, pageSize), + [fetchFavoritesByType, pageSize], ); const fetchFavoritePlaylists = useCallback( ({ pageParam }: { pageParam: number }) => - fetchFavoritesByType("Playlist", pageParam), - [fetchFavoritesByType], + fetchFavoritesByType("Playlist", pageParam, pageSize), + [fetchFavoritesByType, pageSize], ); + const handleSeeAllSeries = useCallback(() => { + router.push({ + pathname: "/(auth)/(tabs)/(favorites)/see-all", + params: { type: "Series", title: t("favorites.series") }, + } as any); + }, [router]); + + const handleSeeAllMovies = useCallback(() => { + router.push({ + pathname: "/(auth)/(tabs)/(favorites)/see-all", + params: { type: "Movie", title: t("favorites.movies") }, + } as any); + }, [router]); + + const handleSeeAllEpisodes = useCallback(() => { + router.push({ + pathname: "/(auth)/(tabs)/(favorites)/see-all", + params: { type: "Episode", title: t("favorites.episodes") }, + } as any); + }, [router]); + + const handleSeeAllVideos = useCallback(() => { + router.push({ + pathname: "/(auth)/(tabs)/(favorites)/see-all", + params: { type: "Video", title: t("favorites.videos") }, + } as any); + }, [router]); + + const handleSeeAllBoxsets = useCallback(() => { + router.push({ + pathname: "/(auth)/(tabs)/(favorites)/see-all", + params: { type: "BoxSet", title: t("favorites.boxsets") }, + } as any); + }, [router]); + + const handleSeeAllPlaylists = useCallback(() => { + router.push({ + pathname: "/(auth)/(tabs)/(favorites)/see-all", + params: { type: "Playlist", title: t("favorites.playlists") }, + } as any); + }, [router]); + return ( {areAllEmpty() && ( @@ -143,6 +188,8 @@ export const Favorites = () => { queryKey={["home", "favorites", "series"]} title={t("favorites.series")} hideIfEmpty + pageSize={pageSize} + onPressSeeAll={handleSeeAllSeries} /> { title={t("favorites.movies")} hideIfEmpty orientation='vertical' + pageSize={pageSize} + onPressSeeAll={handleSeeAllMovies} /> ); diff --git a/components/home/Home.tsx b/components/home/Home.tsx index 5803083d..1da3b358 100644 --- a/components/home/Home.tsx +++ b/components/home/Home.tsx @@ -12,7 +12,7 @@ import { getUserViewsApi, } from "@jellyfin/sdk/lib/utils/api"; import { type QueryFunction, useQuery } from "@tanstack/react-query"; -import { useNavigation, useRouter, useSegments } from "expo-router"; +import { useNavigation, useSegments } from "expo-router"; import { useAtomValue } from "jotai"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; @@ -21,22 +21,28 @@ import { Platform, RefreshControl, ScrollView, - TouchableOpacity, View, } from "react-native"; +import { Pressable } from "react-native-gesture-handler"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { Button } from "@/components/Button"; import { Text } from "@/components/common/Text"; import { InfiniteScrollingCollectionList } from "@/components/home/InfiniteScrollingCollectionList"; +import { StreamystatsPromotedWatchlists } from "@/components/home/StreamystatsPromotedWatchlists"; +import { StreamystatsRecommendations } from "@/components/home/StreamystatsRecommendations"; import { Loader } from "@/components/Loader"; import { MediaListSection } from "@/components/medialists/MediaListSection"; import { Colors } from "@/constants/Colors"; +import useRouter from "@/hooks/useAppRouter"; import { useNetworkStatus } from "@/hooks/useNetworkStatus"; import { useInvalidatePlaybackProgressCache } from "@/hooks/useRevalidatePlaybackProgressCache"; import { useDownload } from "@/providers/DownloadProvider"; +import { useIntroSheet } from "@/providers/IntroSheetProvider"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { SortByOption, SortOrderOption } from "@/utils/atoms/filters"; import { useSettings } from "@/utils/atoms/settings"; import { eventBus } from "@/utils/eventBus"; +import { storage } from "@/utils/mmkv"; type InfiniteScrollingCollectionListSection = { type: "InfiniteScrollingCollectionList"; @@ -45,12 +51,15 @@ type InfiniteScrollingCollectionListSection = { queryFn: QueryFunction; orientation?: "horizontal" | "vertical"; pageSize?: number; + priority?: 1 | 2; // 1 = high priority (loads first), 2 = low priority + parentId?: string; // Library ID for "See All" navigation }; type MediaListSectionType = { type: "MediaListSection"; queryKey: (string | undefined)[]; queryFn: QueryFunction; + priority?: 1 | 2; }; type Section = InfiniteScrollingCollectionListSection | MediaListSectionType; @@ -74,7 +83,22 @@ export const Home = () => { retryCheck, } = useNetworkStatus(); const invalidateCache = useInvalidatePlaybackProgressCache(); - const [scrollY, setScrollY] = useState(0); + const [loadedSections, setLoadedSections] = useState>(new Set()); + const { showIntro } = useIntroSheet(); + + // Show intro modal on first launch + useEffect(() => { + const hasShownIntro = storage.getBoolean("hasShownIntro"); + if (!hasShownIntro) { + const timer = setTimeout(() => { + showIntro(); + }, 1000); + + return () => { + clearTimeout(timer); + }; + } + }, [showIntro]); useEffect(() => { if (isConnected && !prevIsConnected.current) { @@ -97,7 +121,7 @@ export const Home = () => { } navigation.setOptions({ headerLeft: () => ( - { router.push("/(auth)/downloads"); }} @@ -109,7 +133,7 @@ export const Home = () => { color={hasDownloads ? Colors.primary : "white"} size={24} /> - + ), }); }, [navigation, router, hasDownloads]); @@ -172,6 +196,7 @@ export const Home = () => { const refetch = async () => { setLoading(true); + setLoadedSections(new Set()); await refreshStreamyfinPluginSettings(); await invalidateCache(); setLoading(false); @@ -194,10 +219,10 @@ export const Home = () => { ( await getUserLibraryApi(api).getLatestMedia({ userId: user?.Id, - limit: 100, // Fetch a larger set for pagination - fields: ["PrimaryImageAspectRatio", "Path", "Genres"], + limit: 10, + fields: ["PrimaryImageAspectRatio"], imageTypeLimit: 1, - enableImageTypes: ["Primary", "Backdrop", "Thumb", "Logo"], + enableImageTypes: ["Primary", "Backdrop", "Thumb"], includeItemTypes, parentId, }) @@ -208,6 +233,7 @@ export const Home = () => { }, type: "InfiniteScrollingCollectionList", pageSize, + parentId, }), [api, user?.Id], ); @@ -236,64 +262,143 @@ export const Home = () => { ); }); + // Helper to sort items by most recent activity + const sortByRecentActivity = (items: BaseItemDto[]): BaseItemDto[] => { + return items.sort((a, b) => { + const dateA = a.UserData?.LastPlayedDate || a.DateCreated || ""; + const dateB = b.UserData?.LastPlayedDate || b.DateCreated || ""; + return new Date(dateB).getTime() - new Date(dateA).getTime(); + }); + }; + + // Helper to deduplicate items by ID + const deduplicateById = (items: BaseItemDto[]): BaseItemDto[] => { + const seen = new Set(); + return items.filter((item) => { + if (!item.Id || seen.has(item.Id)) return false; + seen.add(item.Id); + return true; + }); + }; + + // Build the first sections based on merge setting + const firstSections: Section[] = settings.mergeNextUpAndContinueWatching + ? [ + { + title: t("home.continue_and_next_up"), + queryKey: ["home", "continueAndNextUp"], + queryFn: async ({ pageParam = 0 }) => { + // Fetch both in parallel + const [resumeResponse, nextUpResponse] = await Promise.all([ + getItemsApi(api).getResumeItems({ + userId: user.Id, + enableImageTypes: ["Primary", "Backdrop", "Thumb"], + includeItemTypes: ["Movie", "Series", "Episode"], + startIndex: 0, + limit: 20, + }), + getTvShowsApi(api).getNextUp({ + userId: user?.Id, + startIndex: 0, + limit: 20, + enableImageTypes: ["Primary", "Backdrop", "Thumb"], + enableResumable: false, + }), + ]); + + const resumeItems = resumeResponse.data.Items || []; + const nextUpItems = nextUpResponse.data.Items || []; + + // Combine, sort by recent activity, deduplicate + const combined = [...resumeItems, ...nextUpItems]; + const sorted = sortByRecentActivity(combined); + const deduplicated = deduplicateById(sorted); + + // Paginate client-side + return deduplicated.slice(pageParam, pageParam + 10); + }, + type: "InfiniteScrollingCollectionList", + orientation: "horizontal", + pageSize: 10, + priority: 1, + }, + ] + : [ + { + title: t("home.continue_watching"), + queryKey: ["home", "resumeItems"], + queryFn: async ({ pageParam = 0 }) => + ( + await getItemsApi(api).getResumeItems({ + userId: user.Id, + enableImageTypes: ["Primary", "Backdrop", "Thumb"], + includeItemTypes: ["Movie", "Series", "Episode"], + startIndex: pageParam, + limit: 10, + }) + ).data.Items || [], + type: "InfiniteScrollingCollectionList", + orientation: "horizontal", + pageSize: 10, + priority: 1, + }, + { + title: t("home.next_up"), + queryKey: ["home", "nextUp-all"], + queryFn: async ({ pageParam = 0 }) => + ( + await getTvShowsApi(api).getNextUp({ + userId: user?.Id, + startIndex: pageParam, + limit: 10, + enableImageTypes: ["Primary", "Backdrop", "Thumb"], + enableResumable: false, + }) + ).data.Items || [], + type: "InfiniteScrollingCollectionList", + orientation: "horizontal", + pageSize: 10, + priority: 1, + }, + ]; + const ss: Section[] = [ - { - title: t("home.continue_watching"), - queryKey: ["home", "resumeItems"], - queryFn: async ({ pageParam = 0 }) => - ( - await getItemsApi(api).getResumeItems({ - userId: user.Id, - enableImageTypes: ["Primary", "Backdrop", "Thumb", "Logo"], - includeItemTypes: ["Movie", "Series", "Episode"], - fields: ["Genres"], - startIndex: pageParam, - limit: 10, - }) - ).data.Items || [], - type: "InfiniteScrollingCollectionList", - orientation: "horizontal", - pageSize: 10, - }, - { - title: t("home.next_up"), - queryKey: ["home", "nextUp-all"], - queryFn: async ({ pageParam = 0 }) => - ( - await getTvShowsApi(api).getNextUp({ - userId: user?.Id, - fields: ["MediaSourceCount", "Genres"], - startIndex: pageParam, - limit: 10, - enableImageTypes: ["Primary", "Backdrop", "Thumb", "Logo"], - enableResumable: false, - }) - ).data.Items || [], - type: "InfiniteScrollingCollectionList", - orientation: "horizontal", - pageSize: 10, - }, - ...latestMediaViews, - { - title: t("home.suggested_movies"), - queryKey: ["home", "suggestedMovies", user?.Id], - queryFn: async ({ pageParam = 0 }) => - ( - await getSuggestionsApi(api).getSuggestions({ - userId: user?.Id, - startIndex: pageParam, - limit: 10, - mediaType: ["Video"], - type: ["Movie"], - }) - ).data.Items || [], - type: "InfiniteScrollingCollectionList", - orientation: "vertical", - pageSize: 10, - }, + ...firstSections, + ...latestMediaViews.map((s) => ({ ...s, priority: 2 as const })), + // Only show Jellyfin suggested movies if StreamyStats recommendations are disabled + ...(!settings?.streamyStatsMovieRecommendations + ? [ + { + title: t("home.suggested_movies"), + queryKey: ["home", "suggestedMovies", user?.Id], + queryFn: async ({ pageParam = 0 }: { pageParam?: number }) => + ( + await getSuggestionsApi(api).getSuggestions({ + userId: user?.Id, + startIndex: pageParam, + limit: 10, + mediaType: ["Video"], + type: ["Movie"], + }) + ).data.Items || [], + type: "InfiniteScrollingCollectionList" as const, + orientation: "vertical" as const, + pageSize: 10, + priority: 2 as const, + }, + ] + : []), ]; return ss; - }, [api, user?.Id, collections, t, createCollectionConfig]); + }, [ + api, + user?.Id, + collections, + t, + createCollectionConfig, + settings?.streamyStatsMovieRecommendations, + settings.mergeNextUpAndContinueWatching, + ]); const customSections = useMemo(() => { if (!api || !user?.Id || !settings?.home?.sections) return []; @@ -322,10 +427,9 @@ export const Home = () => { if (section.nextUp) { const response = await getTvShowsApi(api).getNextUp({ userId: user?.Id, - fields: ["MediaSourceCount", "Genres"], startIndex: pageParam, limit: section.nextUp?.limit || pageSize, - enableImageTypes: ["Primary", "Backdrop", "Thumb", "Logo"], + enableImageTypes: ["Primary", "Backdrop", "Thumb"], enableResumable: section.nextUp?.enableResumable, enableRewatching: section.nextUp?.enableRewatching, }); @@ -338,7 +442,7 @@ export const Home = () => { await getUserLibraryApi(api).getLatestMedia({ userId: user?.Id, includeItemTypes: section.latest?.includeItemTypes, - limit: section.latest?.limit || 100, // Fetch larger set + limit: section.latest?.limit || 10, isPlayed: section.latest?.isPlayed, groupItems: section.latest?.groupItems, }) @@ -367,6 +471,8 @@ export const Home = () => { type: "InfiniteScrollingCollectionList", orientation: section?.orientation || "vertical", pageSize, + // First 2 custom sections are high priority + priority: index < 2 ? 1 : 2, }); }); return ss; @@ -374,6 +480,25 @@ export const Home = () => { const sections = settings?.home?.sections ? customSections : defaultSections; + // Get all high priority section keys and check if all have loaded + const highPrioritySectionKeys = useMemo(() => { + return sections + .filter((s) => s.priority === 1) + .map((s) => s.queryKey.join("-")); + }, [sections]); + + const allHighPriorityLoaded = useMemo(() => { + return highPrioritySectionKeys.every((key) => loadedSections.has(key)); + }, [highPrioritySectionKeys, loadedSections]); + + const markSectionLoaded = useCallback( + (queryKey: (string | undefined | null)[]) => { + const key = queryKey.join("-"); + setLoadedSections((prev) => new Set(prev).add(key)); + }, + [], + ); + if (!isConnected || serverConnected !== true) { let title = ""; let subtitle = ""; @@ -451,10 +576,6 @@ export const Home = () => { ref={scrollRef} nestedScrollEnabled contentInsetAdjustmentBehavior='automatic' - onScroll={(event) => { - setScrollY(event.nativeEvent.contentOffset.y - 500); - }} - scrollEventThrottle={16} refreshControl={ { style={{ paddingTop: Platform.OS === "android" ? 10 : 0 }} > {sections.map((section, index) => { + // Render Streamystats sections after Continue Watching and Next Up + // When merged, they appear after index 0; otherwise after index 1 + const streamystatsIndex = settings.mergeNextUpAndContinueWatching + ? 0 + : 1; + const hasStreamystatsContent = + settings.streamyStatsMovieRecommendations || + settings.streamyStatsSeriesRecommendations || + settings.streamyStatsPromotedWatchlists; + const streamystatsSections = + index === streamystatsIndex && hasStreamystatsContent ? ( + + {settings.streamyStatsMovieRecommendations && ( + + )} + {settings.streamyStatsSeriesRecommendations && ( + + )} + {settings.streamyStatsPromotedWatchlists && ( + + )} + + ) : null; if (section.type === "InfiniteScrollingCollectionList") { + const isHighPriority = section.priority === 1; + const handleSeeAll = section.parentId + ? () => { + router.push({ + pathname: "/(auth)/(tabs)/(libraries)/[libraryId]", + params: { + libraryId: section.parentId!, + sortBy: SortByOption.DateCreated, + sortOrder: SortOrderOption.Descending, + }, + } as any); + } + : undefined; return ( - + + markSectionLoaded(section.queryKey) + : undefined + } + onPressSeeAll={handleSeeAll} + /> + {streamystatsSections} + ); } if (section.type === "MediaListSection") { return ( - + + + {streamystatsSections} + ); } return null; diff --git a/components/home/HomeWithCarousel.tsx b/components/home/HomeWithCarousel.tsx index 43e7fefb..9bddb3f9 100644 --- a/components/home/HomeWithCarousel.tsx +++ b/components/home/HomeWithCarousel.tsx @@ -12,7 +12,7 @@ import { getUserViewsApi, } from "@jellyfin/sdk/lib/utils/api"; import { type QueryFunction, useQuery } from "@tanstack/react-query"; -import { useNavigation, useRouter, useSegments } from "expo-router"; +import { useNavigation, useSegments } from "expo-router"; import { useAtomValue } from "jotai"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; @@ -30,9 +30,12 @@ import { useSafeAreaInsets } from "react-native-safe-area-context"; import { Button } from "@/components/Button"; import { Text } from "@/components/common/Text"; import { InfiniteScrollingCollectionList } from "@/components/home/InfiniteScrollingCollectionList"; +import { StreamystatsPromotedWatchlists } from "@/components/home/StreamystatsPromotedWatchlists"; +import { StreamystatsRecommendations } from "@/components/home/StreamystatsRecommendations"; import { Loader } from "@/components/Loader"; import { MediaListSection } from "@/components/medialists/MediaListSection"; import { Colors } from "@/constants/Colors"; +import useRouter from "@/hooks/useAppRouter"; import { useNetworkStatus } from "@/hooks/useNetworkStatus"; import { useInvalidatePlaybackProgressCache } from "@/hooks/useRevalidatePlaybackProgressCache"; import { useDownload } from "@/providers/DownloadProvider"; @@ -241,64 +244,143 @@ export const HomeWithCarousel = () => { ); }); + // Helper to sort items by most recent activity + const sortByRecentActivity = (items: BaseItemDto[]): BaseItemDto[] => { + return items.sort((a, b) => { + const dateA = a.UserData?.LastPlayedDate || a.DateCreated || ""; + const dateB = b.UserData?.LastPlayedDate || b.DateCreated || ""; + return new Date(dateB).getTime() - new Date(dateA).getTime(); + }); + }; + + // Helper to deduplicate items by ID + const deduplicateById = (items: BaseItemDto[]): BaseItemDto[] => { + const seen = new Set(); + return items.filter((item) => { + if (!item.Id || seen.has(item.Id)) return false; + seen.add(item.Id); + return true; + }); + }; + + // Build the first sections based on merge setting + const firstSections: Section[] = settings.mergeNextUpAndContinueWatching + ? [ + { + title: t("home.continue_and_next_up"), + queryKey: ["home", "continueAndNextUp"], + queryFn: async ({ pageParam = 0 }) => { + // Fetch both in parallel + const [resumeResponse, nextUpResponse] = await Promise.all([ + getItemsApi(api).getResumeItems({ + userId: user.Id, + enableImageTypes: ["Primary", "Backdrop", "Thumb", "Logo"], + includeItemTypes: ["Movie", "Series", "Episode"], + fields: ["Genres"], + startIndex: 0, + limit: 20, + }), + getTvShowsApi(api).getNextUp({ + userId: user?.Id, + fields: ["MediaSourceCount", "Genres"], + startIndex: 0, + limit: 20, + enableImageTypes: ["Primary", "Backdrop", "Thumb", "Logo"], + enableResumable: false, + }), + ]); + + const resumeItems = resumeResponse.data.Items || []; + const nextUpItems = nextUpResponse.data.Items || []; + + // Combine, sort by recent activity, deduplicate + const combined = [...resumeItems, ...nextUpItems]; + const sorted = sortByRecentActivity(combined); + const deduplicated = deduplicateById(sorted); + + // Paginate client-side + return deduplicated.slice(pageParam, pageParam + 10); + }, + type: "InfiniteScrollingCollectionList", + orientation: "horizontal", + pageSize: 10, + }, + ] + : [ + { + title: t("home.continue_watching"), + queryKey: ["home", "resumeItems"], + queryFn: async ({ pageParam = 0 }) => + ( + await getItemsApi(api).getResumeItems({ + userId: user.Id, + enableImageTypes: ["Primary", "Backdrop", "Thumb", "Logo"], + includeItemTypes: ["Movie", "Series", "Episode"], + fields: ["Genres"], + startIndex: pageParam, + limit: 10, + }) + ).data.Items || [], + type: "InfiniteScrollingCollectionList", + orientation: "horizontal", + pageSize: 10, + }, + { + title: t("home.next_up"), + queryKey: ["home", "nextUp-all"], + queryFn: async ({ pageParam = 0 }) => + ( + await getTvShowsApi(api).getNextUp({ + userId: user?.Id, + fields: ["MediaSourceCount", "Genres"], + startIndex: pageParam, + limit: 10, + enableImageTypes: ["Primary", "Backdrop", "Thumb", "Logo"], + enableResumable: false, + }) + ).data.Items || [], + type: "InfiniteScrollingCollectionList", + orientation: "horizontal", + pageSize: 10, + }, + ]; + const ss: Section[] = [ - { - title: t("home.continue_watching"), - queryKey: ["home", "resumeItems"], - queryFn: async ({ pageParam = 0 }) => - ( - await getItemsApi(api).getResumeItems({ - userId: user.Id, - enableImageTypes: ["Primary", "Backdrop", "Thumb", "Logo"], - includeItemTypes: ["Movie", "Series", "Episode"], - fields: ["Genres"], - startIndex: pageParam, - limit: 10, - }) - ).data.Items || [], - type: "InfiniteScrollingCollectionList", - orientation: "horizontal", - pageSize: 10, - }, - { - title: t("home.next_up"), - queryKey: ["home", "nextUp-all"], - queryFn: async ({ pageParam = 0 }) => - ( - await getTvShowsApi(api).getNextUp({ - userId: user?.Id, - fields: ["MediaSourceCount", "Genres"], - startIndex: pageParam, - limit: 10, - enableImageTypes: ["Primary", "Backdrop", "Thumb", "Logo"], - enableResumable: false, - }) - ).data.Items || [], - type: "InfiniteScrollingCollectionList", - orientation: "horizontal", - pageSize: 10, - }, + ...firstSections, ...latestMediaViews, - { - title: t("home.suggested_movies"), - queryKey: ["home", "suggestedMovies", user?.Id], - queryFn: async ({ pageParam = 0 }) => - ( - await getSuggestionsApi(api).getSuggestions({ - userId: user?.Id, - startIndex: pageParam, - limit: 10, - mediaType: ["Video"], - type: ["Movie"], - }) - ).data.Items || [], - type: "InfiniteScrollingCollectionList", - orientation: "vertical", - pageSize: 10, - }, + // Only show Jellyfin suggested movies if StreamyStats recommendations are disabled + ...(!settings?.streamyStatsMovieRecommendations + ? [ + { + title: t("home.suggested_movies"), + queryKey: ["home", "suggestedMovies", user?.Id], + queryFn: async ({ pageParam = 0 }: { pageParam?: number }) => + ( + await getSuggestionsApi(api).getSuggestions({ + userId: user?.Id, + startIndex: pageParam, + limit: 10, + mediaType: ["Video"], + type: ["Movie"], + }) + ).data.Items || [], + type: "InfiniteScrollingCollectionList" as const, + orientation: "vertical" as const, + pageSize: 10, + }, + ] + : []), ]; return ss; - }, [api, user?.Id, collections, t, createCollectionConfig]); + }, [ + api, + user?.Id, + collections, + t, + createCollectionConfig, + settings?.streamyStatsMovieRecommendations, + settings.mergeNextUpAndContinueWatching, + ]); const customSections = useMemo(() => { if (!api || !user?.Id || !settings?.home?.sections) return []; @@ -477,28 +559,68 @@ export const HomeWithCarousel = () => { > {sections.map((section, index) => { + // Render Streamystats sections after Continue Watching and Next Up + // When merged, they appear after index 0; otherwise after index 1 + const streamystatsIndex = settings.mergeNextUpAndContinueWatching + ? 0 + : 1; + const hasStreamystatsContent = + settings.streamyStatsMovieRecommendations || + settings.streamyStatsSeriesRecommendations || + settings.streamyStatsPromotedWatchlists; + const streamystatsSections = + index === streamystatsIndex && hasStreamystatsContent + ? [ + settings.streamyStatsMovieRecommendations && ( + + ), + settings.streamyStatsSeriesRecommendations && ( + + ), + settings.streamyStatsPromotedWatchlists && ( + + ), + ].filter(Boolean) + : null; + if (section.type === "InfiniteScrollingCollectionList") { return ( - + + + {streamystatsSections} + ); } if (section.type === "MediaListSection") { return ( - + + + {streamystatsSections} + ); } return null; diff --git a/components/home/InfiniteScrollingCollectionList.tsx b/components/home/InfiniteScrollingCollectionList.tsx index 73a1c21d..e5e5b7a6 100644 --- a/components/home/InfiniteScrollingCollectionList.tsx +++ b/components/home/InfiniteScrollingCollectionList.tsx @@ -4,7 +4,7 @@ import { type QueryKey, useInfiniteQuery, } from "@tanstack/react-query"; -import { useMemo } from "react"; +import { useEffect, useMemo, useRef } from "react"; import { useTranslation } from "react-i18next"; import { ActivityIndicator, @@ -12,6 +12,7 @@ import { View, type ViewProps, } from "react-native"; +import { SectionHeader } from "@/components/common/SectionHeader"; import { Text } from "@/components/common/Text"; import MoviePoster from "@/components/posters/MoviePoster"; import { Colors } from "../../constants/Colors"; @@ -28,6 +29,9 @@ interface Props extends ViewProps { queryFn: QueryFunction; hideIfEmpty?: boolean; pageSize?: number; + onPressSeeAll?: () => void; + enabled?: boolean; + onLoaded?: () => void; } export const InfiniteScrollingCollectionList: React.FC = ({ @@ -38,32 +42,67 @@ export const InfiniteScrollingCollectionList: React.FC = ({ queryKey, hideIfEmpty = false, pageSize = 10, + onPressSeeAll, + enabled = true, + onLoaded, ...props }) => { - const { data, isLoading, isFetchingNextPage, hasNextPage, fetchNextPage } = - useInfiniteQuery({ - queryKey: queryKey, - queryFn: ({ pageParam = 0, ...context }) => - queryFn({ ...context, queryKey, pageParam }), - getNextPageParam: (lastPage, allPages) => { - // If the last page has fewer items than pageSize, we've reached the end - if (lastPage.length < pageSize) { - return undefined; - } - // Otherwise, return the next start index - return allPages.length * pageSize; - }, - initialPageParam: 0, - staleTime: 60 * 1000, // 1 minute - refetchOnMount: false, - refetchOnWindowFocus: false, - refetchOnReconnect: true, - }); + const effectivePageSize = Math.max(1, pageSize); + const hasCalledOnLoaded = useRef(false); + const { + data, + isLoading, + isFetchingNextPage, + hasNextPage, + fetchNextPage, + isSuccess, + } = useInfiniteQuery({ + queryKey: queryKey, + queryFn: ({ pageParam = 0, ...context }) => + queryFn({ ...context, queryKey, pageParam }), + getNextPageParam: (lastPage, allPages) => { + // If the last page has fewer items than pageSize, we've reached the end + if (lastPage.length < effectivePageSize) { + return undefined; + } + // Otherwise, return the next start index based on how many items we already loaded. + // This avoids overlaps if the server/page size differs from our configured page size. + return allPages.reduce((acc, page) => acc + page.length, 0); + }, + initialPageParam: 0, + staleTime: 60 * 1000, // 1 minute + refetchOnMount: false, + refetchOnWindowFocus: false, + refetchOnReconnect: true, + enabled, + }); + + // Notify parent when data has loaded + useEffect(() => { + if (isSuccess && !hasCalledOnLoaded.current && onLoaded) { + hasCalledOnLoaded.current = true; + onLoaded(); + } + }, [isSuccess, onLoaded]); const { t } = useTranslation(); - // Flatten all pages into a single array - const allItems = data?.pages.flat() || []; + // Flatten all pages into a single array (and de-dupe by Id to avoid UI duplicates) + const allItems = useMemo(() => { + const items = data?.pages.flat() ?? []; + const seen = new Set(); + const deduped: BaseItemDto[] = []; + + for (const item of items) { + const id = item.Id; + if (!id) continue; + if (seen.has(id)) continue; + seen.add(id); + deduped.push(item); + } + + return deduped; + }, [data]); const snapOffsets = useMemo(() => { const itemWidth = orientation === "horizontal" ? 184 : 120; // w-44 (176px) + mr-2 (8px) or w-28 (112px) + mr-2 (8px) @@ -90,9 +129,12 @@ export const InfiniteScrollingCollectionList: React.FC = ({ return ( - - {title} - + {isLoading === false && allItems.length === 0 && ( {t("home.no_items")} @@ -136,11 +178,11 @@ export const InfiniteScrollingCollectionList: React.FC = ({ decelerationRate='fast' > - {allItems.map((item) => ( + {allItems.map((item, index) => ( diff --git a/components/home/LargeMovieCarousel.tsx b/components/home/LargeMovieCarousel.tsx index 913e024b..cf79af73 100644 --- a/components/home/LargeMovieCarousel.tsx +++ b/components/home/LargeMovieCarousel.tsx @@ -2,7 +2,7 @@ import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { getItemsApi } from "@jellyfin/sdk/lib/utils/api"; import { useQuery } from "@tanstack/react-query"; import { Image } from "expo-image"; -import { useRouter, useSegments } from "expo-router"; +import { useSegments } from "expo-router"; import { useAtom } from "jotai"; import React, { useCallback, useMemo } from "react"; import { Dimensions, View, type ViewProps } from "react-native"; @@ -16,6 +16,7 @@ import Carousel, { type ICarouselInstance, Pagination, } from "react-native-reanimated-carousel"; +import useRouter from "@/hooks/useAppRouter"; import { useHaptic } from "@/hooks/useHaptic"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; import { useSettings } from "@/utils/atoms/settings"; diff --git a/components/home/ScrollingCollectionList.tsx b/components/home/ScrollingCollectionList.tsx index 54542c44..3d64466f 100644 --- a/components/home/ScrollingCollectionList.tsx +++ b/components/home/ScrollingCollectionList.tsx @@ -21,7 +21,6 @@ interface Props extends ViewProps { queryKey: QueryKey; queryFn: QueryFunction; hideIfEmpty?: boolean; - isOffline?: boolean; scrollY?: number; // For lazy loading enableLazyLoading?: boolean; // Enable/disable lazy loading } @@ -33,7 +32,6 @@ export const ScrollingCollectionList: React.FC = ({ queryFn, queryKey, hideIfEmpty = false, - isOffline = false, scrollY = 0, enableLazyLoading = false, ...props @@ -106,7 +104,6 @@ export const ScrollingCollectionList: React.FC = ({ = ({ + watchlist, + jellyfinServerId, + ...props +}) => { + const api = useAtomValue(apiAtom); + const user = useAtomValue(userAtom); + const { settings } = useSettings(); + const router = useRouter(); + const { t } = useTranslation(); + + const { data: items, isLoading } = useQuery({ + queryKey: [ + "streamystats", + "watchlist", + watchlist.id, + jellyfinServerId, + settings?.streamyStatsServerUrl, + ], + queryFn: async (): Promise => { + if (!settings?.streamyStatsServerUrl || !api?.accessToken || !user?.Id) { + return []; + } + + const streamystatsApi = createStreamystatsApi({ + serverUrl: settings.streamyStatsServerUrl, + jellyfinToken: api.accessToken, + }); + + const watchlistDetail = await streamystatsApi.getWatchlistItemIds({ + watchlistId: watchlist.id, + jellyfinServerId, + }); + + const itemIds = watchlistDetail.data?.items; + if (!itemIds?.length) { + return []; + } + + const response = await getItemsApi(api).getItems({ + userId: user.Id, + ids: itemIds, + fields: ["PrimaryImageAspectRatio", "Genres"], + enableImageTypes: ["Primary", "Backdrop", "Thumb"], + }); + + return response.data.Items || []; + }, + enabled: + Boolean(settings?.streamyStatsServerUrl) && + Boolean(api?.accessToken) && + Boolean(user?.Id), + staleTime: 5 * 60 * 1000, + refetchOnMount: false, + refetchOnWindowFocus: false, + }); + + const snapOffsets = useMemo(() => { + return items?.map((_, index) => index * ITEM_WIDTH) ?? []; + }, [items]); + + const handleSeeAll = () => { + router.push({ + pathname: "/(auth)/(tabs)/(watchlists)/[watchlistId]", + params: { watchlistId: watchlist.id.toString() }, + } as any); + }; + + if (!isLoading && (!items || items.length === 0)) return null; + + return ( + + + {isLoading ? ( + + {[1, 2, 3].map((i) => ( + + + + + Loading... + + + + ))} + + ) : ( + + + {items?.map((item) => ( + + {item.Type === "Movie" && } + {item.Type === "Series" && } + + + ))} + + + )} + + ); +}; + +interface StreamystatsPromotedWatchlistsProps extends ViewProps { + enabled?: boolean; +} + +export const StreamystatsPromotedWatchlists: React.FC< + StreamystatsPromotedWatchlistsProps +> = ({ enabled = true, ...props }) => { + const api = useAtomValue(apiAtom); + const user = useAtomValue(userAtom); + const { settings } = useSettings(); + + const streamyStatsEnabled = useMemo(() => { + return Boolean(settings?.streamyStatsServerUrl); + }, [settings?.streamyStatsServerUrl]); + + // Fetch server info to get the Jellyfin server ID + const { data: serverInfo } = useQuery({ + queryKey: ["jellyfin", "serverInfo"], + queryFn: async (): Promise => { + if (!api) return null; + const response = await getSystemApi(api).getPublicSystemInfo(); + return response.data; + }, + enabled: enabled && Boolean(api) && streamyStatsEnabled, + staleTime: 60 * 60 * 1000, + }); + + const jellyfinServerId = serverInfo?.Id; + + const { + data: watchlists, + isLoading, + isError, + } = useQuery({ + queryKey: [ + "streamystats", + "promotedWatchlists", + jellyfinServerId, + settings?.streamyStatsServerUrl, + ], + queryFn: async (): Promise => { + if ( + !settings?.streamyStatsServerUrl || + !api?.accessToken || + !jellyfinServerId + ) { + return []; + } + + const streamystatsApi = createStreamystatsApi({ + serverUrl: settings.streamyStatsServerUrl, + jellyfinToken: api.accessToken, + }); + + const response = await streamystatsApi.getPromotedWatchlists({ + jellyfinServerId, + includePreview: false, + }); + + return response.data || []; + }, + enabled: + enabled && + streamyStatsEnabled && + Boolean(api?.accessToken) && + Boolean(jellyfinServerId) && + Boolean(user?.Id), + staleTime: 5 * 60 * 1000, + refetchOnMount: false, + refetchOnWindowFocus: false, + }); + + if (!streamyStatsEnabled) return null; + if (isError) return null; + if (!isLoading && (!watchlists || watchlists.length === 0)) return null; + + if (isLoading) { + return ( + + + + {[1, 2, 3].map((i) => ( + + + + + Loading... + + + + ))} + + + ); + } + + return ( + + {watchlists?.map((watchlist) => ( + + ))} + + ); +}; diff --git a/components/home/StreamystatsRecommendations.tsx b/components/home/StreamystatsRecommendations.tsx new file mode 100644 index 00000000..fb26708c --- /dev/null +++ b/components/home/StreamystatsRecommendations.tsx @@ -0,0 +1,197 @@ +import type { + BaseItemDto, + PublicSystemInfo, +} from "@jellyfin/sdk/lib/generated-client/models"; +import { getItemsApi, getSystemApi } from "@jellyfin/sdk/lib/utils/api"; +import { useQuery } from "@tanstack/react-query"; +import { useAtomValue } from "jotai"; +import { useMemo } from "react"; +import { ScrollView, View, type ViewProps } from "react-native"; + +import { SectionHeader } from "@/components/common/SectionHeader"; +import { Text } from "@/components/common/Text"; +import MoviePoster from "@/components/posters/MoviePoster"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { useSettings } from "@/utils/atoms/settings"; +import { createStreamystatsApi } from "@/utils/streamystats/api"; +import type { StreamystatsRecommendationsIdsResponse } from "@/utils/streamystats/types"; +import { TouchableItemRouter } from "../common/TouchableItemRouter"; +import { ItemCardText } from "../ItemCardText"; +import SeriesPoster from "../posters/SeriesPoster"; + +const ITEM_WIDTH = 120; // w-28 (112px) + mr-2 (8px) + +interface Props extends ViewProps { + title: string; + type: "Movie" | "Series"; + limit?: number; + enabled?: boolean; +} + +export const StreamystatsRecommendations: React.FC = ({ + title, + type, + limit = 20, + enabled = true, + ...props +}) => { + const api = useAtomValue(apiAtom); + const user = useAtomValue(userAtom); + const { settings } = useSettings(); + + const streamyStatsEnabled = useMemo(() => { + return Boolean(settings?.streamyStatsServerUrl); + }, [settings?.streamyStatsServerUrl]); + + // Fetch server info to get the Jellyfin server ID + const { data: serverInfo } = useQuery({ + queryKey: ["jellyfin", "serverInfo"], + queryFn: async (): Promise => { + if (!api) return null; + const response = await getSystemApi(api).getPublicSystemInfo(); + return response.data; + }, + enabled: enabled && Boolean(api) && streamyStatsEnabled, + staleTime: 60 * 60 * 1000, // 1 hour - server info rarely changes + }); + + const jellyfinServerId = serverInfo?.Id; + + const { + data: recommendationIds, + isLoading: isLoadingRecommendations, + isError: isRecommendationsError, + } = useQuery({ + queryKey: [ + "streamystats", + "recommendations", + type, + jellyfinServerId, + settings?.streamyStatsServerUrl, + ], + queryFn: async (): Promise => { + if ( + !settings?.streamyStatsServerUrl || + !api?.accessToken || + !jellyfinServerId + ) { + return []; + } + + const streamyStatsApi = createStreamystatsApi({ + serverUrl: settings.streamyStatsServerUrl, + jellyfinToken: api.accessToken, + }); + + const response = await streamyStatsApi.getRecommendationIds( + jellyfinServerId, + type, + limit, + ); + + const data = response as StreamystatsRecommendationsIdsResponse; + + if (type === "Movie") { + return data.data.movies || []; + } + return data.data.series || []; + }, + enabled: + enabled && + streamyStatsEnabled && + Boolean(api?.accessToken) && + Boolean(jellyfinServerId) && + Boolean(user?.Id), + staleTime: 5 * 60 * 1000, // 5 minutes + refetchOnMount: false, + refetchOnWindowFocus: false, + }); + + const { + data: items, + isLoading: isLoadingItems, + isError: isItemsError, + } = useQuery({ + queryKey: [ + "streamystats", + "recommendations", + "items", + type, + recommendationIds, + ], + queryFn: async (): Promise => { + if (!api || !user?.Id || !recommendationIds?.length) { + return []; + } + + const response = await getItemsApi(api).getItems({ + userId: user.Id, + ids: recommendationIds, + fields: ["PrimaryImageAspectRatio", "Genres"], + enableImageTypes: ["Primary", "Backdrop", "Thumb"], + }); + + return response.data.Items || []; + }, + enabled: + Boolean(recommendationIds?.length) && Boolean(api) && Boolean(user?.Id), + staleTime: 5 * 60 * 1000, + refetchOnMount: false, + refetchOnWindowFocus: false, + }); + + const isLoading = isLoadingRecommendations || isLoadingItems; + const isError = isRecommendationsError || isItemsError; + + const snapOffsets = useMemo(() => { + return items?.map((_, index) => index * ITEM_WIDTH) ?? []; + }, [items]); + + if (!streamyStatsEnabled) return null; + if (isError) return null; + if (!isLoading && (!items || items.length === 0)) return null; + + return ( + + + {isLoading ? ( + + {[1, 2, 3].map((i) => ( + + + + + Loading title... + + + + ))} + + ) : ( + + + {items?.map((item) => ( + + {item.Type === "Movie" && } + {item.Type === "Series" && } + + + ))} + + + )} + + ); +}; diff --git a/components/item/ItemPeopleSections.tsx b/components/item/ItemPeopleSections.tsx new file mode 100644 index 00000000..0b16271f --- /dev/null +++ b/components/item/ItemPeopleSections.tsx @@ -0,0 +1,77 @@ +import type { + BaseItemDto, + BaseItemPerson, +} from "@jellyfin/sdk/lib/generated-client/models"; +import type React from "react"; +import { useCallback, useEffect, useMemo, useState } from "react"; +import { InteractionManager, View, type ViewProps } from "react-native"; +import { MoreMoviesWithActor } from "@/components/MoreMoviesWithActor"; +import { CastAndCrew } from "@/components/series/CastAndCrew"; +import { useItemPeopleQuery } from "@/hooks/useItemPeopleQuery"; +import { useOfflineMode } from "@/providers/OfflineModeProvider"; + +interface Props extends ViewProps { + item: BaseItemDto; +} + +export const ItemPeopleSections: React.FC = ({ item, ...props }) => { + const isOffline = useOfflineMode(); + const [enabled, setEnabled] = useState(false); + + useEffect(() => { + if (isOffline) return; + const task = InteractionManager.runAfterInteractions(() => + setEnabled(true), + ); + return () => task.cancel(); + }, [isOffline]); + + const { data, isLoading } = useItemPeopleQuery( + item.Id, + enabled && !isOffline, + ); + + const people = useMemo(() => (Array.isArray(data) ? data : []), [data]); + + const itemWithPeople = useMemo(() => { + return { ...item, People: people } as BaseItemDto; + }, [item, people]); + + const topPeople = useMemo(() => people.slice(0, 3), [people]); + + const renderActorSection = useCallback( + (person: BaseItemPerson, idx: number, total: number) => { + if (!person.Id) return null; + + const spacingClassName = idx === total - 1 ? undefined : "mb-2"; + + return ( + + ); + }, + [item], + ); + + if (isOffline || !enabled) return null; + + const shouldSpaceCastAndCrew = topPeople.length > 0; + + return ( + + + {topPeople.map((person, idx) => + renderActorSection(person, idx, topPeople.length), + )} + + ); +}; diff --git a/components/library/LibraryItemCard.tsx b/components/library/LibraryItemCard.tsx index efb29013..09de500d 100644 --- a/components/library/LibraryItemCard.tsx +++ b/components/library/LibraryItemCard.tsx @@ -63,6 +63,10 @@ export const LibraryItemCard: React.FC = ({ library, ...props }) => { _itemType = "Series"; } else if (library.CollectionType === "boxsets") { _itemType = "BoxSet"; + } else if (library.CollectionType === "homevideos") { + _itemType = "Video"; + } else if (library.CollectionType === "musicvideos") { + _itemType = "MusicVideo"; } return _itemType; diff --git a/components/list/ListItem.tsx b/components/list/ListItem.tsx index 7ce33986..fed62315 100644 --- a/components/list/ListItem.tsx +++ b/components/list/ListItem.tsx @@ -6,6 +6,7 @@ import { Text } from "../common/Text"; interface Props extends ViewProps { title?: string | null | undefined; subtitle?: string | null | undefined; + subtitleColor?: "default" | "red"; value?: string | null | undefined; children?: ReactNode; iconAfter?: ReactNode; @@ -14,6 +15,7 @@ interface Props extends ViewProps { textColor?: "default" | "blue" | "red"; onPress?: () => void; disabled?: boolean; + disabledByAdmin?: boolean; } export const ListItem: React.FC> = ({ @@ -27,21 +29,23 @@ export const ListItem: React.FC> = ({ textColor = "default", onPress, disabled = false, + disabledByAdmin = false, ...viewProps }) => { + const effectiveSubtitle = disabledByAdmin ? "Disabled by admin" : subtitle; + const isDisabled = disabled || disabledByAdmin; if (onPress) return ( > = ({ ); return ( > = ({ const ListItemContent = ({ title, subtitle, + subtitleColor, textColor, icon, value, @@ -107,7 +111,7 @@ const ListItemContent = ({ {subtitle && ( {subtitle} diff --git a/components/music/AnimatedEqualizer.tsx b/components/music/AnimatedEqualizer.tsx new file mode 100644 index 00000000..35092931 --- /dev/null +++ b/components/music/AnimatedEqualizer.tsx @@ -0,0 +1,98 @@ +import React, { useEffect } from "react"; +import { View } from "react-native"; +import Animated, { + Easing, + interpolate, + useAnimatedStyle, + useSharedValue, + withDelay, + withRepeat, + withTiming, +} from "react-native-reanimated"; + +interface Props { + color?: string; + barWidth?: number; + barCount?: number; + height?: number; + gap?: number; +} + +const MIN_SCALE = 0.35; +const MAX_SCALE = 1; +const DURATIONS = [800, 650, 750]; +const DELAYS = [0, 200, 100]; + +const Bar: React.FC<{ + color: string; + barWidth: number; + height: number; + duration: number; + delay: number; +}> = ({ color, barWidth, height, duration, delay }) => { + const progress = useSharedValue(0); + + useEffect(() => { + progress.value = withDelay( + delay, + withRepeat( + withTiming(1, { duration, easing: Easing.inOut(Easing.ease) }), + -1, + true, + ), + ); + }, []); + + const animatedStyle = useAnimatedStyle(() => ({ + transform: [ + { + scaleY: interpolate(progress.value, [0, 1], [MIN_SCALE, MAX_SCALE]), + }, + ], + })); + + return ( + + ); +}; + +export const AnimatedEqualizer: React.FC = ({ + color = "#9334E9", + barWidth = 3, + barCount = 3, + height = 12, + gap = 2, +}) => { + return ( + + {Array.from({ length: barCount }).map((_, index) => ( + + ))} + + ); +}; diff --git a/components/music/CreatePlaylistModal.tsx b/components/music/CreatePlaylistModal.tsx new file mode 100644 index 00000000..fea1421f --- /dev/null +++ b/components/music/CreatePlaylistModal.tsx @@ -0,0 +1,157 @@ +import { + BottomSheetBackdrop, + type BottomSheetBackdropProps, + BottomSheetModal, + BottomSheetTextInput, + BottomSheetView, +} from "@gorhom/bottom-sheet"; +import React, { + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from "react"; +import { useTranslation } from "react-i18next"; +import { ActivityIndicator, Keyboard } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Button } from "@/components/Button"; +import { Text } from "@/components/common/Text"; +import { useCreatePlaylist } from "@/hooks/usePlaylistMutations"; + +interface Props { + open: boolean; + setOpen: (open: boolean) => void; + onPlaylistCreated?: (playlistId: string) => void; + initialTrackId?: string; +} + +export const CreatePlaylistModal: React.FC = ({ + open, + setOpen, + onPlaylistCreated, + initialTrackId, +}) => { + const bottomSheetModalRef = useRef(null); + const insets = useSafeAreaInsets(); + const { t } = useTranslation(); + const createPlaylist = useCreatePlaylist(); + + const [name, setName] = useState(""); + const snapPoints = useMemo(() => ["40%"], []); + + useEffect(() => { + if (open) { + setName(""); + bottomSheetModalRef.current?.present(); + } else { + bottomSheetModalRef.current?.dismiss(); + } + }, [open]); + + const handleSheetChanges = useCallback( + (index: number) => { + if (index === -1) { + setOpen(false); + Keyboard.dismiss(); + } + }, + [setOpen], + ); + + const renderBackdrop = useCallback( + (props: BottomSheetBackdropProps) => ( + + ), + [], + ); + + const handleCreate = useCallback(async () => { + if (!name.trim()) return; + + const result = await createPlaylist.mutateAsync({ + name: name.trim(), + trackIds: initialTrackId ? [initialTrackId] : undefined, + }); + + if (result) { + onPlaylistCreated?.(result); + } + setOpen(false); + }, [name, createPlaylist, initialTrackId, onPlaylistCreated, setOpen]); + + const isValid = name.trim().length > 0; + + return ( + + + + {t("music.playlists.create_playlist")} + + + + {t("music.playlists.playlist_name")} + + + + + + + ); +}; diff --git a/components/music/MiniPlayerBar.tsx b/components/music/MiniPlayerBar.tsx new file mode 100644 index 00000000..41f5a553 --- /dev/null +++ b/components/music/MiniPlayerBar.tsx @@ -0,0 +1,359 @@ +import { Ionicons } from "@expo/vector-icons"; +import { Image } from "expo-image"; +import { useAtom } from "jotai"; +import React, { useCallback, useMemo } from "react"; +import { + ActivityIndicator, + Platform, + StyleSheet, + TouchableOpacity, + View, +} from "react-native"; +import { Gesture, GestureDetector } from "react-native-gesture-handler"; +import { GlassEffectView } from "react-native-glass-effect-view"; +import Animated, { + Easing, + Extrapolation, + interpolate, + runOnJS, + useAnimatedStyle, + useSharedValue, + withTiming, +} from "react-native-reanimated"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; +import { apiAtom } from "@/providers/JellyfinProvider"; +import { useMusicPlayer } from "@/providers/MusicPlayerProvider"; + +const HORIZONTAL_MARGIN = Platform.OS === "android" ? 12 : 20; +const BOTTOM_TAB_HEIGHT = Platform.OS === "android" ? 56 : 52; +const BAR_HEIGHT = Platform.OS === "android" ? 58 : 50; + +// Gesture thresholds +const VELOCITY_THRESHOLD = 1000; + +// Logarithmic slowdown - never stops, just gets progressively slower +const rubberBand = (distance: number, scale: number = 8): number => { + "worklet"; + const absDistance = Math.abs(distance); + const sign = distance < 0 ? -1 : 1; + // Logarithmic: keeps growing but slower and slower + return sign * scale * Math.log(1 + absDistance / scale); +}; + +export const MiniPlayerBar: React.FC = () => { + const [api] = useAtom(apiAtom); + const insets = useSafeAreaInsets(); + const router = useRouter(); + const { + currentTrack, + isPlaying, + isLoading, + progress, + duration, + togglePlayPause, + next, + stop, + } = useMusicPlayer(); + + // Gesture state + const translateY = useSharedValue(0); + + const imageUrl = useMemo(() => { + if (!api || !currentTrack) return null; + const albumId = currentTrack.AlbumId || currentTrack.ParentId; + if (albumId) { + return `${api.basePath}/Items/${albumId}/Images/Primary?maxHeight=100&maxWidth=100`; + } + return `${api.basePath}/Items/${currentTrack.Id}/Images/Primary?maxHeight=100&maxWidth=100`; + }, [api, currentTrack]); + + const _progressPercentage = useMemo(() => { + if (!duration || duration === 0) return 0; + return (progress / duration) * 100; + }, [progress, duration]); + + const handlePress = useCallback(() => { + router.push("/(auth)/now-playing"); + }, [router]); + + const handlePlayPause = useCallback( + (e: any) => { + e.stopPropagation(); + togglePlayPause(); + }, + [togglePlayPause], + ); + + const handleNext = useCallback( + (e: any) => { + e.stopPropagation(); + next(); + }, + [next], + ); + + const handleDismiss = useCallback(() => { + stop(); + }, [stop]); + + // Pan gesture for swipe up (open modal) and swipe down (dismiss) + const panGesture = Gesture.Pan() + .activeOffsetY([-15, 15]) + .onUpdate((event) => { + // Logarithmic slowdown - keeps moving but progressively slower + translateY.value = rubberBand(event.translationY, 6); + }) + .onEnd((event) => { + const velocity = event.velocityY; + const currentPosition = translateY.value; + + // Swipe up - open modal (check position OR velocity) + if (currentPosition < -16 || velocity < -VELOCITY_THRESHOLD) { + // Slow return animation - won't jank with navigation + translateY.value = withTiming(0, { + duration: 600, + easing: Easing.out(Easing.cubic), + }); + runOnJS(handlePress)(); + return; + } + // Swipe down - stop playback and dismiss (check position OR velocity) + if (currentPosition > 16 || velocity > VELOCITY_THRESHOLD) { + // No need to reset - component will unmount + runOnJS(handleDismiss)(); + return; + } + + // Only animate back if no action was triggered + translateY.value = withTiming(0, { + duration: 200, + easing: Easing.out(Easing.cubic), + }); + }); + + // Animated styles for the container + const animatedContainerStyle = useAnimatedStyle(() => ({ + transform: [{ translateY: translateY.value }], + })); + + // Animated styles for the inner bar + const animatedBarStyle = useAnimatedStyle(() => ({ + height: interpolate( + translateY.value, + [-50, 0, 50], + [BAR_HEIGHT + 12, BAR_HEIGHT, BAR_HEIGHT], + Extrapolation.EXTEND, + ), + opacity: interpolate( + translateY.value, + [0, 30], + [1, 0.6], + Extrapolation.CLAMP, + ), + })); + + if (!currentTrack) return null; + + const content = ( + <> + {/* Tappable area: Album art + Track info */} + + {/* Album art */} + + {imageUrl ? ( + + ) : ( + + + + )} + + + {/* Track info */} + + + {currentTrack.Name} + + + {currentTrack.Artists?.join(", ") || currentTrack.AlbumArtist} + + + + + {/* Controls */} + + {isLoading ? ( + + ) : ( + <> + + + + + + + + )} + + + {/* Progress bar at bottom */} + {/* + + */} + + ); + + return ( + + + + {Platform.OS === "ios" ? ( + + + {content} + + + ) : ( + {content} + )} + + + + ); +}; + +const styles = StyleSheet.create({ + container: { + position: "absolute", + left: HORIZONTAL_MARGIN, + right: HORIZONTAL_MARGIN, + shadowColor: "#000", + shadowOffset: { width: 0, height: 4 }, + shadowOpacity: 0.3, + shadowRadius: 8, + elevation: 8, + }, + touchable: { + borderRadius: 50, + overflow: "hidden", + }, + blurContainer: { + flex: 1, + }, + androidContainer: { + flex: 1, + flexDirection: "row", + alignItems: "center", + paddingHorizontal: 10, + paddingVertical: 8, + backgroundColor: "rgba(28, 28, 30, 0.97)", + borderRadius: 14, + borderWidth: 0.5, + borderColor: "rgba(255, 255, 255, 0.1)", + }, + tappableArea: { + flex: 1, + flexDirection: "row", + alignItems: "center", + }, + albumArt: { + width: 32, + height: 32, + borderRadius: 8, + overflow: "hidden", + backgroundColor: "#333", + }, + albumImage: { + width: "100%", + height: "100%", + }, + albumPlaceholder: { + flex: 1, + alignItems: "center", + justifyContent: "center", + backgroundColor: "#2a2a2a", + }, + trackInfo: { + flex: 1, + marginLeft: 12, + marginRight: 8, + justifyContent: "center", + }, + trackTitle: { + color: "white", + fontSize: 14, + fontWeight: "600", + }, + artistName: { + color: "rgba(255, 255, 255, 0.6)", + fontSize: 12, + }, + controls: { + flexDirection: "row", + alignItems: "center", + }, + controlButton: { + padding: 8, + }, + loader: { + marginHorizontal: 16, + }, + progressContainer: { + position: "absolute", + bottom: 0, + left: 10, + right: 10, + height: 3, + backgroundColor: "rgba(255, 255, 255, 0.15)", + borderRadius: 1.5, + }, + progressFill: { + height: "100%", + backgroundColor: "white", + borderRadius: 1.5, + }, +}); diff --git a/components/music/MusicAlbumCard.tsx b/components/music/MusicAlbumCard.tsx new file mode 100644 index 00000000..11e78610 --- /dev/null +++ b/components/music/MusicAlbumCard.tsx @@ -0,0 +1,65 @@ +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { Image } from "expo-image"; +import { useAtom } from "jotai"; +import React, { useCallback, useMemo } from "react"; +import { TouchableOpacity, View } from "react-native"; +import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; +import { apiAtom } from "@/providers/JellyfinProvider"; +import { getPrimaryImageUrl } from "@/utils/jellyfin/image/getPrimaryImageUrl"; + +interface Props { + album: BaseItemDto; + width?: number; +} + +export const MusicAlbumCard: React.FC = ({ album, width = 130 }) => { + const [api] = useAtom(apiAtom); + const router = useRouter(); + + const imageUrl = useMemo( + () => getPrimaryImageUrl({ api, item: album }), + [api, album], + ); + + const handlePress = useCallback(() => { + router.push(`/music/album/${album.Id}`); + }, [router, album.Id]); + + return ( + + + {imageUrl ? ( + + ) : ( + + ๐ŸŽต + + )} + + + {album.Name} + + + {album.AlbumArtist || album.Artists?.join(", ")} + + + ); +}; diff --git a/components/music/MusicAlbumRowCard.tsx b/components/music/MusicAlbumRowCard.tsx new file mode 100644 index 00000000..e794a793 --- /dev/null +++ b/components/music/MusicAlbumRowCard.tsx @@ -0,0 +1,67 @@ +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { Image } from "expo-image"; +import { useAtom } from "jotai"; +import React, { useCallback, useMemo } from "react"; +import { TouchableOpacity, View } from "react-native"; +import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; +import { apiAtom } from "@/providers/JellyfinProvider"; +import { getPrimaryImageUrl } from "@/utils/jellyfin/image/getPrimaryImageUrl"; + +interface Props { + album: BaseItemDto; +} + +const IMAGE_SIZE = 56; + +export const MusicAlbumRowCard: React.FC = ({ album }) => { + const [api] = useAtom(apiAtom); + const router = useRouter(); + + const imageUrl = useMemo( + () => getPrimaryImageUrl({ api, item: album }), + [api, album], + ); + + const handlePress = useCallback(() => { + router.push(`/music/album/${album.Id}`); + }, [router, album.Id]); + + return ( + + + {imageUrl ? ( + + ) : ( + + ๐ŸŽต + + )} + + + + {album.Name} + + + {album.AlbumArtist || album.Artists?.join(", ")} + + + + ); +}; diff --git a/components/music/MusicArtistCard.tsx b/components/music/MusicArtistCard.tsx new file mode 100644 index 00000000..a9bfc61b --- /dev/null +++ b/components/music/MusicArtistCard.tsx @@ -0,0 +1,66 @@ +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { Image } from "expo-image"; +import { useAtom } from "jotai"; +import React, { useCallback, useMemo } from "react"; +import { TouchableOpacity, View } from "react-native"; +import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; +import { apiAtom } from "@/providers/JellyfinProvider"; +import { getPrimaryImageUrl } from "@/utils/jellyfin/image/getPrimaryImageUrl"; + +interface Props { + artist: BaseItemDto; + size?: number; +} + +const IMAGE_SIZE = 48; + +export const MusicArtistCard: React.FC = ({ artist }) => { + const [api] = useAtom(apiAtom); + const router = useRouter(); + + const imageUrl = useMemo( + () => getPrimaryImageUrl({ api, item: artist }), + [api, artist], + ); + + const handlePress = useCallback(() => { + router.push(`/music/artist/${artist.Id}`); + }, [router, artist.Id]); + + return ( + + + {imageUrl ? ( + + ) : ( + + ๐Ÿ‘ค + + )} + + + {artist.Name} + + + ); +}; diff --git a/components/music/MusicPlaybackEngine.tsx b/components/music/MusicPlaybackEngine.tsx new file mode 100644 index 00000000..ae1b07cd --- /dev/null +++ b/components/music/MusicPlaybackEngine.tsx @@ -0,0 +1,222 @@ +import { useEffect, useRef } from "react"; +import TrackPlayer, { + Event, + type PlaybackActiveTrackChangedEvent, + State, + useActiveTrack, + usePlaybackState, + useProgress, +} from "react-native-track-player"; +import { + audioStorageEvents, + deleteTrack, + getLocalPath, +} from "@/providers/AudioStorage"; +import { useMusicPlayer } from "@/providers/MusicPlayerProvider"; + +export const MusicPlaybackEngine: React.FC = () => { + const { position, duration } = useProgress(1000); + const playbackState = usePlaybackState(); + const activeTrack = useActiveTrack(); + const { + setProgress, + setDuration, + setIsPlaying, + reportProgress, + onTrackEnd, + syncFromTrackPlayer, + triggerLookahead, + } = useMusicPlayer(); + + const lastReportedProgressRef = useRef(0); + + // Sync progress from TrackPlayer to our state + useEffect(() => { + if (position > 0) { + setProgress(position); + } + }, [position, setProgress]); + + // Sync duration from TrackPlayer to our state + useEffect(() => { + if (duration > 0) { + setDuration(duration); + } + }, [duration, setDuration]); + + // Sync playback state from TrackPlayer to our state + useEffect(() => { + const isPlaying = playbackState.state === State.Playing; + setIsPlaying(isPlaying); + }, [playbackState.state, setIsPlaying]); + + // Sync active track changes + useEffect(() => { + if (activeTrack) { + syncFromTrackPlayer(); + } + }, [activeTrack?.id, syncFromTrackPlayer]); + + // Report progress every ~10 seconds + useEffect(() => { + if ( + Math.floor(position) - Math.floor(lastReportedProgressRef.current) >= + 10 + ) { + lastReportedProgressRef.current = position; + reportProgress(); + } + }, [position, reportProgress]); + + // Listen for track changes (native -> JS) + // This triggers look-ahead caching, checks for cached versions, and handles track end + useEffect(() => { + const subscription = + TrackPlayer.addEventListener( + Event.PlaybackActiveTrackChanged, + async (event) => { + // Trigger look-ahead caching when a new track starts playing + if (event.track) { + triggerLookahead(); + + // Check if there's a cached version we should use instead + const trackId = event.track.id; + const currentUrl = event.track.url as string; + + // Only check if currently using a remote URL + if (trackId && currentUrl && !currentUrl.startsWith("file://")) { + const cachedPath = getLocalPath(trackId); + if (cachedPath) { + console.log( + `[AudioCache] Switching to cached version for ${trackId}`, + ); + try { + // Load the cached version, preserving position if any + const currentIndex = await TrackPlayer.getActiveTrackIndex(); + if (currentIndex !== undefined && currentIndex >= 0) { + const queue = await TrackPlayer.getQueue(); + const track = queue[currentIndex]; + // Remove and re-add with cached URL + await TrackPlayer.remove(currentIndex); + await TrackPlayer.add( + { ...track, url: cachedPath }, + currentIndex, + ); + await TrackPlayer.skip(currentIndex); + await TrackPlayer.play(); + } + } catch (error) { + console.warn( + "[AudioCache] Failed to switch to cached version:", + error, + ); + } + } + } + } + + // If there's no next track and the previous track ended, call onTrackEnd + if (event.lastTrack && !event.track) { + onTrackEnd(); + } + }, + ); + + return () => subscription.remove(); + }, [onTrackEnd, triggerLookahead]); + + // Listen for audio cache download completion and update queue URLs + useEffect(() => { + const onComplete = async ({ + itemId, + localPath, + }: { + itemId: string; + localPath: string; + }) => { + console.log(`[AudioCache] Track ${itemId} cached successfully`); + + try { + const queue = await TrackPlayer.getQueue(); + const currentIndex = await TrackPlayer.getActiveTrackIndex(); + + // Find the track in the queue + const trackIndex = queue.findIndex((t) => t.id === itemId); + + // Only update if track is in queue and not currently playing + if (trackIndex >= 0 && trackIndex !== currentIndex) { + const track = queue[trackIndex]; + const localUrl = localPath.startsWith("file://") + ? localPath + : `file://${localPath}`; + + // Skip if already using local URL + if (track.url === localUrl) return; + + console.log( + `[AudioCache] Updating queue track ${trackIndex} to use cached file`, + ); + + // Remove old track and insert updated one at same position + await TrackPlayer.remove(trackIndex); + await TrackPlayer.add({ ...track, url: localUrl }, trackIndex); + } + } catch (error) { + console.warn("[AudioCache] Failed to update queue:", error); + } + }; + + audioStorageEvents.on("complete", onComplete); + return () => { + audioStorageEvents.off("complete", onComplete); + }; + }, []); + + // Listen for playback errors (corrupted cache files) + useEffect(() => { + const subscription = TrackPlayer.addEventListener( + Event.PlaybackError, + async (event) => { + const activeTrack = await TrackPlayer.getActiveTrack(); + if (!activeTrack?.url) return; + + // Only handle local file errors + const url = activeTrack.url as string; + if (!url.startsWith("file://")) return; + + console.warn( + `[MusicPlayer] Playback error for cached file: ${activeTrack.id}`, + event, + ); + + // Delete corrupted cache file + if (activeTrack.id) { + try { + await deleteTrack(activeTrack.id); + console.log( + `[MusicPlayer] Deleted corrupted cache file: ${activeTrack.id}`, + ); + } catch (error) { + console.warn( + "[MusicPlayer] Failed to delete corrupted file:", + error, + ); + } + } + + // Skip to next track + try { + await TrackPlayer.skipToNext(); + } catch { + // No next track available, stop playback + await TrackPlayer.stop(); + } + }, + ); + + return () => subscription.remove(); + }, []); + + // No visual component needed - TrackPlayer is headless + return null; +}; diff --git a/components/music/MusicPlaylistCard.tsx b/components/music/MusicPlaylistCard.tsx new file mode 100644 index 00000000..50671715 --- /dev/null +++ b/components/music/MusicPlaylistCard.tsx @@ -0,0 +1,117 @@ +import { Ionicons } from "@expo/vector-icons"; +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { getItemsApi } from "@jellyfin/sdk/lib/utils/api"; +import { useQuery } from "@tanstack/react-query"; +import { Image } from "expo-image"; +import { useAtom } from "jotai"; +import React, { useCallback, useMemo } from "react"; +import { TouchableOpacity, View } from "react-native"; +import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; +import { getLocalPath } from "@/providers/AudioStorage"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { getPrimaryImageUrl } from "@/utils/jellyfin/image/getPrimaryImageUrl"; + +interface Props { + playlist: BaseItemDto; + width?: number; +} + +const IMAGE_SIZE = 56; + +export const MusicPlaylistCard: React.FC = ({ playlist }) => { + const [api] = useAtom(apiAtom); + const [user] = useAtom(userAtom); + const router = useRouter(); + + const imageUrl = useMemo( + () => getPrimaryImageUrl({ api, item: playlist }), + [api, playlist], + ); + + // Fetch playlist tracks to check download status + const { data: tracks } = useQuery({ + queryKey: ["playlist-tracks-status", playlist.Id, user?.Id], + queryFn: async () => { + const response = await getItemsApi(api!).getItems({ + userId: user?.Id, + parentId: playlist.Id, + fields: ["MediaSources"], + }); + return response.data.Items || []; + }, + enabled: !!api && !!user?.Id && !!playlist.Id, + staleTime: 5 * 60 * 1000, // 5 minutes + }); + + // Calculate download status + const downloadStatus = useMemo(() => { + if (!tracks || tracks.length === 0) { + return { downloaded: 0, total: playlist.ChildCount || 0 }; + } + const downloaded = tracks.filter( + (track) => !!getLocalPath(track.Id), + ).length; + return { downloaded, total: tracks.length }; + }, [tracks, playlist.ChildCount]); + + const allDownloaded = + downloadStatus.total > 0 && + downloadStatus.downloaded === downloadStatus.total; + const hasDownloads = downloadStatus.downloaded > 0; + + const handlePress = useCallback(() => { + router.push(`/music/playlist/${playlist.Id}`); + }, [router, playlist.Id]); + + return ( + + + {imageUrl ? ( + + ) : ( + + ๐ŸŽถ + + )} + + + + {playlist.Name} + + + {playlist.ChildCount} tracks + + + {/* Download status indicator */} + {allDownloaded ? ( + + ) : hasDownloads ? ( + + {downloadStatus.downloaded}/{downloadStatus.total} + + ) : null} + + ); +}; diff --git a/components/music/MusicTrackItem.tsx b/components/music/MusicTrackItem.tsx new file mode 100644 index 00000000..a3f80efc --- /dev/null +++ b/components/music/MusicTrackItem.tsx @@ -0,0 +1,226 @@ +import { Ionicons } from "@expo/vector-icons"; +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { Image } from "expo-image"; +import { useAtom } from "jotai"; +import React, { useCallback, useEffect, useMemo, useState } from "react"; +import { ActivityIndicator, TouchableOpacity, View } from "react-native"; +import { Text } from "@/components/common/Text"; +import { AnimatedEqualizer } from "@/components/music/AnimatedEqualizer"; +import { useHaptic } from "@/hooks/useHaptic"; +import { useNetworkStatus } from "@/hooks/useNetworkStatus"; +import { + audioStorageEvents, + getLocalPath, + isCached, + isPermanentDownloading, + isPermanentlyDownloaded, +} from "@/providers/AudioStorage"; +import { apiAtom } from "@/providers/JellyfinProvider"; +import { useMusicPlayer } from "@/providers/MusicPlayerProvider"; +import { getPrimaryImageUrl } from "@/utils/jellyfin/image/getPrimaryImageUrl"; +import { formatDuration } from "@/utils/time"; + +interface Props { + track: BaseItemDto; + index?: number; + queue?: BaseItemDto[]; + showArtwork?: boolean; + onOptionsPress?: (track: BaseItemDto) => void; +} + +export const MusicTrackItem: React.FC = ({ + track, + index: _index, + queue, + showArtwork = true, + onOptionsPress, +}) => { + const [api] = useAtom(apiAtom); + const { playTrack, currentTrack, isPlaying, loadingTrackId } = + useMusicPlayer(); + const { isConnected, serverConnected } = useNetworkStatus(); + const haptic = useHaptic("light"); + + const imageUrl = useMemo(() => { + const albumId = track.AlbumId || track.ParentId; + if (albumId) { + return `${api?.basePath}/Items/${albumId}/Images/Primary?maxHeight=100&maxWidth=100`; + } + return getPrimaryImageUrl({ api, item: track }); + }, [api, track]); + + const isCurrentTrack = currentTrack?.Id === track.Id; + const isTrackLoading = loadingTrackId === track.Id; + + // Track download status with reactivity to completion events + const [downloadStatus, setDownloadStatus] = useState< + "none" | "downloading" | "downloaded" | "cached" + >(() => { + if (isPermanentlyDownloaded(track.Id)) return "downloaded"; + if (isPermanentDownloading(track.Id)) return "downloading"; + if (isCached(track.Id)) return "cached"; + return "none"; + }); + + // Listen for download completion/error events + useEffect(() => { + const onComplete = (event: { itemId: string; permanent: boolean }) => { + if (event.itemId === track.Id) { + setDownloadStatus(event.permanent ? "downloaded" : "cached"); + } + }; + const onError = (event: { itemId: string }) => { + if (event.itemId === track.Id) { + setDownloadStatus("none"); + } + }; + + audioStorageEvents.on("complete", onComplete); + audioStorageEvents.on("error", onError); + + return () => { + audioStorageEvents.off("complete", onComplete); + audioStorageEvents.off("error", onError); + }; + }, [track.Id]); + + // Re-check status when track changes (for list item recycling) + useEffect(() => { + if (isPermanentlyDownloaded(track.Id)) { + setDownloadStatus("downloaded"); + } else if (isPermanentDownloading(track.Id)) { + setDownloadStatus("downloading"); + } else if (isCached(track.Id)) { + setDownloadStatus("cached"); + } else { + setDownloadStatus("none"); + } + }, [track.Id]); + + const _isDownloaded = downloadStatus === "downloaded"; + // Check if available locally (either cached or permanently downloaded) + const isAvailableLocally = !!getLocalPath(track.Id); + // Consider offline if either no network connection OR server is unreachable + const isOffline = !isConnected || serverConnected === false; + const isUnavailableOffline = isOffline && !isAvailableLocally; + + const duration = useMemo(() => { + if (!track.RunTimeTicks) return ""; + return formatDuration(track.RunTimeTicks); + }, [track.RunTimeTicks]); + + const handlePress = useCallback(() => { + if (isUnavailableOffline) return; + playTrack(track, queue); + }, [playTrack, track, queue, isUnavailableOffline]); + + const handleLongPress = useCallback(() => { + onOptionsPress?.(track); + }, [onOptionsPress, track]); + + const handleOptionsPress = useCallback(() => { + haptic(); + onOptionsPress?.(track); + }, [haptic, onOptionsPress, track]); + + return ( + + {/* Album artwork */} + {showArtwork && ( + + {imageUrl ? ( + + ) : ( + + + + )} + {isTrackLoading && ( + + + + )} + + )} + + {/* Track info */} + + + {isCurrentTrack && isPlaying && } + + {track.Name} + + + + {track.Artists?.join(", ") || track.AlbumArtist} + + + + {/* Download/cache status indicator */} + {downloadStatus === "downloading" && ( + + )} + {downloadStatus === "downloaded" && ( + + )} + + {/* Duration */} + {duration} + + {/* Options button */} + {onOptionsPress && ( + + + + )} + + ); +}; diff --git a/components/music/PlaylistOptionsSheet.tsx b/components/music/PlaylistOptionsSheet.tsx new file mode 100644 index 00000000..ab2b3a24 --- /dev/null +++ b/components/music/PlaylistOptionsSheet.tsx @@ -0,0 +1,136 @@ +import { Ionicons } from "@expo/vector-icons"; +import { + BottomSheetBackdrop, + type BottomSheetBackdropProps, + BottomSheetModal, + BottomSheetView, +} from "@gorhom/bottom-sheet"; +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import React, { useCallback, useEffect, useMemo, useRef } from "react"; +import { useTranslation } from "react-i18next"; +import { Alert, StyleSheet, TouchableOpacity, View } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; +import { useDeletePlaylist } from "@/hooks/usePlaylistMutations"; + +interface Props { + open: boolean; + setOpen: (open: boolean) => void; + playlist: BaseItemDto | null; +} + +export const PlaylistOptionsSheet: React.FC = ({ + open, + setOpen, + playlist, +}) => { + const bottomSheetModalRef = useRef(null); + const router = useRouter(); + const insets = useSafeAreaInsets(); + const { t } = useTranslation(); + const deletePlaylist = useDeletePlaylist(); + + const snapPoints = useMemo(() => ["25%"], []); + + useEffect(() => { + if (open) bottomSheetModalRef.current?.present(); + else bottomSheetModalRef.current?.dismiss(); + }, [open]); + + const handleSheetChanges = useCallback( + (index: number) => { + if (index === -1) { + setOpen(false); + } + }, + [setOpen], + ); + + const renderBackdrop = useCallback( + (props: BottomSheetBackdropProps) => ( + + ), + [], + ); + + const handleDeletePlaylist = useCallback(() => { + if (!playlist?.Id) return; + + Alert.alert( + t("music.playlists.delete_playlist"), + t("music.playlists.delete_confirm", { name: playlist.Name }), + [ + { + text: t("common.cancel"), + style: "cancel", + }, + { + text: t("common.delete"), + style: "destructive", + onPress: () => { + deletePlaylist.mutate( + { playlistId: playlist.Id! }, + { + onSuccess: () => { + setOpen(false); + router.back(); + }, + }, + ); + }, + }, + ], + ); + }, [playlist, deletePlaylist, setOpen, router, t]); + + if (!playlist) return null; + + return ( + + + + + + + {t("music.playlists.delete_playlist")} + + + + + + ); +}; + +const _styles = StyleSheet.create({ + separator: { + height: StyleSheet.hairlineWidth, + backgroundColor: "#404040", + }, +}); diff --git a/components/music/PlaylistPickerSheet.tsx b/components/music/PlaylistPickerSheet.tsx new file mode 100644 index 00000000..6cd7dc1b --- /dev/null +++ b/components/music/PlaylistPickerSheet.tsx @@ -0,0 +1,262 @@ +import { Ionicons } from "@expo/vector-icons"; +import { + BottomSheetBackdrop, + type BottomSheetBackdropProps, + BottomSheetModal, + BottomSheetScrollView, +} from "@gorhom/bottom-sheet"; +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { getItemsApi } from "@jellyfin/sdk/lib/utils/api"; +import { useQuery } from "@tanstack/react-query"; +import { Image } from "expo-image"; +import { useAtom } from "jotai"; +import React, { + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from "react"; +import { useTranslation } from "react-i18next"; +import { + ActivityIndicator, + StyleSheet, + TouchableOpacity, + View, +} from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Input } from "@/components/common/Input"; +import { Text } from "@/components/common/Text"; +import { useAddToPlaylist } from "@/hooks/usePlaylistMutations"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; + +interface Props { + open: boolean; + setOpen: (open: boolean) => void; + trackToAdd: BaseItemDto | null; + onCreateNew: () => void; +} + +export const PlaylistPickerSheet: React.FC = ({ + open, + setOpen, + trackToAdd, + onCreateNew, +}) => { + const bottomSheetModalRef = useRef(null); + const [api] = useAtom(apiAtom); + const [user] = useAtom(userAtom); + const insets = useSafeAreaInsets(); + const { t } = useTranslation(); + const addToPlaylist = useAddToPlaylist(); + + const [search, setSearch] = useState(""); + const snapPoints = useMemo(() => ["75%"], []); + + // Fetch all playlists + const { data: playlists, isLoading } = useQuery({ + queryKey: ["music-playlists-picker", user?.Id], + queryFn: async () => { + if (!api || !user?.Id) return []; + + const response = await getItemsApi(api).getItems({ + userId: user.Id, + includeItemTypes: ["Playlist"], + sortBy: ["SortName"], + sortOrder: ["Ascending"], + recursive: true, + mediaTypes: ["Audio"], + }); + + return response.data.Items || []; + }, + enabled: Boolean(api && user?.Id && open), + }); + + const filteredPlaylists = useMemo(() => { + if (!playlists) return []; + if (!search) return playlists; + return playlists.filter((playlist) => + playlist.Name?.toLowerCase().includes(search.toLowerCase()), + ); + }, [playlists, search]); + + const showSearch = (playlists?.length || 0) > 10; + + useEffect(() => { + if (open) { + setSearch(""); + bottomSheetModalRef.current?.present(); + } else { + bottomSheetModalRef.current?.dismiss(); + } + }, [open]); + + const handleSheetChanges = useCallback( + (index: number) => { + if (index === -1) { + setOpen(false); + } + }, + [setOpen], + ); + + const renderBackdrop = useCallback( + (props: BottomSheetBackdropProps) => ( + + ), + [], + ); + + const handleSelectPlaylist = useCallback( + async (playlist: BaseItemDto) => { + if (!trackToAdd?.Id || !playlist.Id) return; + + await addToPlaylist.mutateAsync({ + playlistId: playlist.Id, + trackIds: [trackToAdd.Id], + playlistName: playlist.Name || undefined, + }); + + setOpen(false); + }, + [trackToAdd, addToPlaylist, setOpen], + ); + + const handleCreateNew = useCallback(() => { + setOpen(false); + setTimeout(() => { + onCreateNew(); + }, 300); + }, [onCreateNew, setOpen]); + + const getPlaylistImageUrl = useCallback( + (playlist: BaseItemDto) => { + if (!api) return null; + return `${api.basePath}/Items/${playlist.Id}/Images/Primary?maxHeight=100&maxWidth=100`; + }, + [api], + ); + + return ( + + + + {t("music.track_options.add_to_playlist")} + + {trackToAdd?.Name} + + {showSearch && ( + + )} + + {/* Create New Playlist Button */} + + + + + + {t("music.playlists.create_new")} + + + + {isLoading ? ( + + + + ) : filteredPlaylists.length === 0 ? ( + + + {search ? t("search.no_results") : t("music.no_playlists")} + + + ) : ( + + {filteredPlaylists.map((playlist, index) => ( + + handleSelectPlaylist(playlist)} + className='flex-row items-center px-4 py-3' + disabled={addToPlaylist.isPending} + > + + + + + + {playlist.Name} + + + {playlist.ChildCount} {t("music.tabs.tracks")} + + + {addToPlaylist.isPending && ( + + )} + + {index < filteredPlaylists.length - 1 && ( + + )} + + ))} + + )} + + + ); +}; + +const styles = StyleSheet.create({ + separator: { + height: StyleSheet.hairlineWidth, + backgroundColor: "#404040", + }, +}); diff --git a/components/music/PlaylistSortSheet.tsx b/components/music/PlaylistSortSheet.tsx new file mode 100644 index 00000000..07c8467c --- /dev/null +++ b/components/music/PlaylistSortSheet.tsx @@ -0,0 +1,173 @@ +import { Ionicons } from "@expo/vector-icons"; +import { + BottomSheetBackdrop, + type BottomSheetBackdropProps, + BottomSheetModal, + BottomSheetView, +} from "@gorhom/bottom-sheet"; +import React, { useCallback, useEffect, useMemo, useRef } from "react"; +import { useTranslation } from "react-i18next"; +import { StyleSheet, TouchableOpacity, View } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Text } from "@/components/common/Text"; + +export type PlaylistSortOption = "SortName" | "DateCreated"; + +export type PlaylistSortOrder = "Ascending" | "Descending"; + +interface Props { + open: boolean; + setOpen: (open: boolean) => void; + sortBy: PlaylistSortOption; + sortOrder: PlaylistSortOrder; + onSortChange: ( + sortBy: PlaylistSortOption, + sortOrder: PlaylistSortOrder, + ) => void; +} + +const SORT_OPTIONS: { key: PlaylistSortOption; label: string; icon: string }[] = + [ + { key: "SortName", label: "music.sort.alphabetical", icon: "text-outline" }, + { + key: "DateCreated", + label: "music.sort.date_created", + icon: "time-outline", + }, + ]; + +export const PlaylistSortSheet: React.FC = ({ + open, + setOpen, + sortBy, + sortOrder, + onSortChange, +}) => { + const bottomSheetModalRef = useRef(null); + const insets = useSafeAreaInsets(); + const { t } = useTranslation(); + + const snapPoints = useMemo(() => ["40%"], []); + + useEffect(() => { + if (open) bottomSheetModalRef.current?.present(); + else bottomSheetModalRef.current?.dismiss(); + }, [open]); + + const handleSheetChanges = useCallback( + (index: number) => { + if (index === -1) { + setOpen(false); + } + }, + [setOpen], + ); + + const renderBackdrop = useCallback( + (props: BottomSheetBackdropProps) => ( + + ), + [], + ); + + const handleSortSelect = useCallback( + (option: PlaylistSortOption) => { + // If selecting same option, toggle order; otherwise use sensible default + if (option === sortBy) { + onSortChange( + option, + sortOrder === "Ascending" ? "Descending" : "Ascending", + ); + } else { + // Default order based on sort type + const defaultOrder: PlaylistSortOrder = + option === "SortName" ? "Ascending" : "Descending"; + onSortChange(option, defaultOrder); + } + setOpen(false); + }, + [sortBy, sortOrder, onSortChange, setOpen], + ); + + return ( + + + + {t("music.sort.title")} + + + {SORT_OPTIONS.map((option, index) => { + const isSelected = sortBy === option.key; + return ( + + {index > 0 && } + handleSortSelect(option.key)} + className='flex-row items-center px-4 py-3.5' + > + + + {t(option.label)} + + {isSelected && ( + + + + + )} + + + ); + })} + + + + ); +}; + +const styles = StyleSheet.create({ + separator: { + height: StyleSheet.hairlineWidth, + backgroundColor: "#404040", + }, +}); diff --git a/components/music/TrackOptionsSheet.tsx b/components/music/TrackOptionsSheet.tsx new file mode 100644 index 00000000..b5de1379 --- /dev/null +++ b/components/music/TrackOptionsSheet.tsx @@ -0,0 +1,458 @@ +import { Ionicons } from "@expo/vector-icons"; +import { + BottomSheetBackdrop, + type BottomSheetBackdropProps, + BottomSheetModal, + BottomSheetView, +} from "@gorhom/bottom-sheet"; +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { Image } from "expo-image"; +import { useAtom } from "jotai"; +import React, { + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from "react"; +import { useTranslation } from "react-i18next"; +import { + ActivityIndicator, + StyleSheet, + TouchableOpacity, + View, +} from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; +import { useFavorite } from "@/hooks/useFavorite"; +import { + audioStorageEvents, + deleteTrack, + downloadTrack, + isCached, + isPermanentDownloading, + isPermanentlyDownloaded, +} from "@/providers/AudioStorage"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { useMusicPlayer } from "@/providers/MusicPlayerProvider"; +import { getAudioStreamUrl } from "@/utils/jellyfin/audio/getAudioStreamUrl"; +import { getPrimaryImageUrl } from "@/utils/jellyfin/image/getPrimaryImageUrl"; + +interface Props { + open: boolean; + setOpen: (open: boolean) => void; + track: BaseItemDto | null; + onAddToPlaylist: () => void; + playlistId?: string; + onRemoveFromPlaylist?: () => void; +} + +export const TrackOptionsSheet: React.FC = ({ + open, + setOpen, + track, + onAddToPlaylist, + playlistId, + onRemoveFromPlaylist, +}) => { + const bottomSheetModalRef = useRef(null); + const [api] = useAtom(apiAtom); + const [user] = useAtom(userAtom); + const router = useRouter(); + const { playNext, addToQueue } = useMusicPlayer(); + const insets = useSafeAreaInsets(); + const { t } = useTranslation(); + const [isDownloadingTrack, setIsDownloadingTrack] = useState(false); + // Counter to trigger re-evaluation of download status when storage changes + const [storageUpdateCounter, setStorageUpdateCounter] = useState(0); + + // Listen for storage events to update download status + useEffect(() => { + const handleComplete = (event: { itemId: string }) => { + if (event.itemId === track?.Id) { + setStorageUpdateCounter((c) => c + 1); + } + }; + + audioStorageEvents.on("complete", handleComplete); + return () => { + audioStorageEvents.off("complete", handleComplete); + }; + }, [track?.Id]); + + // Force re-evaluation of cache status when track changes + useEffect(() => { + setStorageUpdateCounter((c) => c + 1); + }, [track?.Id]); + + // Use a placeholder item for useFavorite when track is null + const { isFavorite, toggleFavorite } = useFavorite( + track ?? ({ Id: "", UserData: { IsFavorite: false } } as BaseItemDto), + ); + + // Check download status (storageUpdateCounter triggers re-evaluation when download completes) + const isAlreadyDownloaded = useMemo( + () => isPermanentlyDownloaded(track?.Id), + [track?.Id, storageUpdateCounter], + ); + const isOnlyCached = useMemo( + () => isCached(track?.Id), + [track?.Id, storageUpdateCounter], + ); + const isCurrentlyDownloading = useMemo( + () => isPermanentDownloading(track?.Id), + [track?.Id, storageUpdateCounter], + ); + + const imageUrl = useMemo(() => { + if (!track) return null; + const albumId = track.AlbumId || track.ParentId; + if (albumId) { + return `${api?.basePath}/Items/${albumId}/Images/Primary?maxHeight=200&maxWidth=200`; + } + return getPrimaryImageUrl({ api, item: track }); + }, [api, track]); + + useEffect(() => { + if (open) bottomSheetModalRef.current?.present(); + else bottomSheetModalRef.current?.dismiss(); + }, [open]); + + const handleSheetChanges = useCallback( + (index: number) => { + if (index === -1) { + setOpen(false); + } + }, + [setOpen], + ); + + const renderBackdrop = useCallback( + (props: BottomSheetBackdropProps) => ( + + ), + [], + ); + + const handlePlayNext = useCallback(() => { + if (track) { + playNext(track); + setOpen(false); + } + }, [track, playNext, setOpen]); + + const handleAddToQueue = useCallback(() => { + if (track) { + addToQueue(track); + setOpen(false); + } + }, [track, addToQueue, setOpen]); + + const handleAddToPlaylist = useCallback(() => { + setOpen(false); + setTimeout(() => { + onAddToPlaylist(); + }, 300); + }, [onAddToPlaylist, setOpen]); + + const handleRemoveFromPlaylist = useCallback(() => { + if (onRemoveFromPlaylist) { + onRemoveFromPlaylist(); + setOpen(false); + } + }, [onRemoveFromPlaylist, setOpen]); + + const handleDownload = useCallback(async () => { + if (!track?.Id || !api || !user?.Id || isAlreadyDownloaded) return; + + setIsDownloadingTrack(true); + try { + const result = await getAudioStreamUrl(api, user.Id, track.Id); + if (result?.url && !result.isTranscoding) { + await downloadTrack(track.Id, result.url, { + permanent: true, + container: result.mediaSource?.Container || undefined, + }); + } + } catch { + // Silent fail + } + setIsDownloadingTrack(false); + setOpen(false); + }, [track?.Id, api, user?.Id, isAlreadyDownloaded, setOpen]); + + const handleDelete = useCallback(async () => { + if (!track?.Id) return; + await deleteTrack(track.Id); + setStorageUpdateCounter((c) => c + 1); + setOpen(false); + }, [track?.Id, setOpen]); + + const handleGoToArtist = useCallback(() => { + const artistId = track?.ArtistItems?.[0]?.Id; + if (artistId) { + setOpen(false); + router.push(`/music/artist/${artistId}`); + } + }, [track?.ArtistItems, router, setOpen]); + + const handleGoToAlbum = useCallback(() => { + const albumId = track?.AlbumId || track?.ParentId; + if (albumId) { + setOpen(false); + router.push(`/music/album/${albumId}`); + } + }, [track?.AlbumId, track?.ParentId, router, setOpen]); + + const handleToggleFavorite = useCallback(() => { + if (track) { + toggleFavorite(); + setOpen(false); + } + }, [track, toggleFavorite, setOpen]); + + // Check if navigation options are available + const hasArtist = !!track?.ArtistItems?.[0]?.Id; + const hasAlbum = !!(track?.AlbumId || track?.ParentId); + + if (!track) return null; + + return ( + + + {/* Track Info Header */} + + + {imageUrl ? ( + + ) : ( + + + + )} + + + + {track.Name} + + + {track.Artists?.join(", ") || track.AlbumArtist} + + + + + {/* Playback Options */} + + + + + {t("music.track_options.play_next")} + + + + + + + + + {t("music.track_options.add_to_queue")} + + + + + {/* Library Options */} + + + + + {isFavorite + ? t("music.track_options.remove_from_favorites") + : t("music.track_options.add_to_favorites")} + + + + + + + + + {t("music.track_options.add_to_playlist")} + + + + {playlistId && ( + <> + + + + + {t("music.track_options.remove_from_playlist")} + + + + )} + + + + + {isCurrentlyDownloading || isDownloadingTrack ? ( + + ) : ( + + )} + + {isCurrentlyDownloading || isDownloadingTrack + ? t("music.track_options.downloading") + : isAlreadyDownloaded + ? t("music.track_options.downloaded") + : t("music.track_options.download")} + + + + {isOnlyCached && !isAlreadyDownloaded && ( + <> + + + + + {t("music.track_options.cached")} + + + + )} + + {(isAlreadyDownloaded || isOnlyCached) && ( + <> + + + + + {isAlreadyDownloaded + ? t("music.track_options.delete_download") + : t("music.track_options.delete_cache")} + + + + )} + + + {/* Navigation Options */} + {(hasArtist || hasAlbum) && ( + + {hasArtist && ( + <> + + + + {t("music.track_options.go_to_artist")} + + + {hasAlbum && } + + )} + + {hasAlbum && ( + + + + {t("music.track_options.go_to_album")} + + + )} + + )} + + + ); +}; + +const styles = StyleSheet.create({ + separator: { + height: StyleSheet.hairlineWidth, + backgroundColor: "#404040", + }, +}); diff --git a/components/music/index.ts b/components/music/index.ts new file mode 100644 index 00000000..3d0767ad --- /dev/null +++ b/components/music/index.ts @@ -0,0 +1,6 @@ +export * from "./MiniPlayerBar"; +export * from "./MusicAlbumCard"; +export * from "./MusicArtistCard"; +export * from "./MusicPlaybackEngine"; +export * from "./MusicPlaylistCard"; +export * from "./MusicTrackItem"; diff --git a/components/navigation/TabBarIcon.tsx b/components/navigation/TabBarIcon.tsx deleted file mode 100644 index a28bba84..00000000 --- a/components/navigation/TabBarIcon.tsx +++ /dev/null @@ -1,12 +0,0 @@ -// You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/ - -import type { IconProps } from "@expo/vector-icons/build/createIconSet"; -import Ionicons from "@expo/vector-icons/Ionicons"; -import type { ComponentProps } from "react"; - -export function TabBarIcon({ - style, - ...rest -}: IconProps["name"]>) { - return ; -} diff --git a/components/posters/EpisodePoster.tsx b/components/posters/EpisodePoster.tsx deleted file mode 100644 index af42989b..00000000 --- a/components/posters/EpisodePoster.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; -import { Image } from "expo-image"; -import { useAtom } from "jotai"; -import { useMemo, useState } from "react"; -import { View } from "react-native"; -import { WatchedIndicator } from "@/components/WatchedIndicator"; -import { apiAtom } from "@/providers/JellyfinProvider"; - -type MoviePosterProps = { - item: BaseItemDto; - showProgress?: boolean; -}; - -export const EpisodePoster: React.FC = ({ - item, - showProgress = false, -}) => { - const [api] = useAtom(apiAtom); - - const url = useMemo(() => { - if (item.Type === "Episode") { - return `${api?.basePath}/Items/${item.ParentBackdropItemId}/Images/Thumb?fillHeight=389&quality=80&tag=${item.ParentThumbImageTag}`; - } - }, [item]); - - const [progress, _setProgress] = useState( - item.UserData?.PlayedPercentage || 0, - ); - - const blurhash = useMemo(() => { - const key = item.ImageTags?.Primary as string; - return item.ImageBlurHashes?.Primary?.[key]; - }, [item]); - - return ( - - - - {showProgress && progress > 0 && ( - - )} - - ); -}; diff --git a/components/posters/ParentPoster.tsx b/components/posters/ParentPoster.tsx deleted file mode 100644 index 47b62e4c..00000000 --- a/components/posters/ParentPoster.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { Image } from "expo-image"; -import { useAtom } from "jotai"; -import { useMemo } from "react"; -import { View } from "react-native"; -import { apiAtom } from "@/providers/JellyfinProvider"; - -type PosterProps = { - id?: string; - showProgress?: boolean; -}; - -const ParentPoster: React.FC = ({ id }) => { - const [api] = useAtom(apiAtom); - - const url = useMemo( - () => `${api?.basePath}/Items/${id}/Images/Primary`, - [id], - ); - - if (!url || !id) - return ( - - ); - - return ( - - - - ); -}; - -export default ParentPoster; diff --git a/components/posters/JellyseerrPoster.tsx b/components/posters/SeerrPoster.tsx similarity index 84% rename from components/posters/JellyseerrPoster.tsx rename to components/posters/SeerrPoster.tsx index d7b1fcdb..399ac386 100644 --- a/components/posters/JellyseerrPoster.tsx +++ b/components/posters/SeerrPoster.tsx @@ -7,15 +7,15 @@ import Animated, { useSharedValue, withTiming, } from "react-native-reanimated"; -import { TouchableJellyseerrRouter } from "@/components/common/JellyseerrItemRouter"; +import { TouchableSeerrRouter } from "@/components/common/SeerrItemRouter"; import { Text } from "@/components/common/Text"; import { Tag, Tags } from "@/components/GenreTags"; -import { textShadowStyle } from "@/components/jellyseerr/discover/GenericSlideCard"; -import JellyseerrMediaIcon from "@/components/jellyseerr/JellyseerrMediaIcon"; -import JellyseerrStatusIcon from "@/components/jellyseerr/JellyseerrStatusIcon"; +import { textShadowStyle } from "@/components/seerr/discover/GenericSlideCard"; +import SeerrMediaIcon from "@/components/seerr/SeerrMediaIcon"; +import SeerrStatusIcon from "@/components/seerr/SeerrStatusIcon"; import { Colors } from "@/constants/Colors"; -import { useJellyseerr } from "@/hooks/useJellyseerr"; -import { useJellyseerrCanRequest } from "@/utils/_jellyseerr/useJellyseerrCanRequest"; +import { useSeerr } from "@/hooks/useSeerr"; +import { useSeerrCanRequest } from "@/utils/_seerr/useSeerrCanRequest"; import { MediaStatus } from "@/utils/jellyseerr/server/constants/media"; import type MediaRequest from "@/utils/jellyseerr/server/entity/MediaRequest"; import type { DownloadingItem } from "@/utils/jellyseerr/server/lib/downloadtracker"; @@ -34,13 +34,13 @@ interface Props extends ViewProps { mediaRequest?: MediaRequest; } -const JellyseerrPoster: React.FC = ({ +const SeerrPoster: React.FC = ({ item, horizontal, showDownloadInfo, mediaRequest, }) => { - const { jellyseerrApi, getTitle, getYear, getMediaType } = useJellyseerr(); + const { seerrApi, getTitle, getYear, getMediaType } = useSeerr(); const loadingOpacity = useSharedValue(1); const imageOpacity = useSharedValue(0); const { t } = useTranslation(); @@ -56,16 +56,13 @@ const JellyseerrPoster: React.FC = ({ const backdropSrc = useMemo( () => - jellyseerrApi?.imageProxy( - item?.backdropPath, - "w1920_and_h800_multi_faces", - ), - [item, jellyseerrApi, horizontal], + seerrApi?.imageProxy(item?.backdropPath, "w1920_and_h800_multi_faces"), + [item, seerrApi, horizontal], ); const posterSrc = useMemo( - () => jellyseerrApi?.imageProxy(item?.posterPath, "w300_and_h450_face"), - [item, jellyseerrApi, horizontal], + () => seerrApi?.imageProxy(item?.posterPath, "w300_and_h450_face"), + [item, seerrApi, horizontal], ); const title = useMemo(() => getTitle(item), [item]); @@ -75,7 +72,7 @@ const JellyseerrPoster: React.FC = ({ const size = useMemo(() => (horizontal ? "h-28" : "w-28"), [horizontal]); const ratio = useMemo(() => (horizontal ? "15/10" : "10/15"), [horizontal]); - const [canRequest] = useJellyseerrCanRequest(item); + const [canRequest] = useSeerrCanRequest(item); const is4k = useMemo(() => mediaRequest?.is4k === true, [mediaRequest]); @@ -109,7 +106,7 @@ const JellyseerrPoster: React.FC = ({ second, third, fourth, - t("home.settings.plugins.jellyseerr.plus_n_more", { n: rest.length }), + t("home.settings.plugins.seerr.plus_n_more", { n: rest.length }), ]; } return seasons; @@ -121,7 +118,7 @@ const JellyseerrPoster: React.FC = ({ }, [mediaRequest, is4k]); return ( - = ({ )} )} - - @@ -201,8 +198,8 @@ const JellyseerrPoster: React.FC = ({ {releaseYear || ""} - + ); }; -export default JellyseerrPoster; +export default SeerrPoster; diff --git a/components/search/DiscoverFilters.tsx b/components/search/DiscoverFilters.tsx index 2e844c88..7a3a2a60 100644 --- a/components/search/DiscoverFilters.tsx +++ b/components/search/DiscoverFilters.tsx @@ -1,19 +1,19 @@ import { Button, ContextMenu, Host, Picker } from "@expo/ui/swift-ui"; import { Platform, View } from "react-native"; import { FilterButton } from "@/components/filters/FilterButton"; -import { JellyseerrSearchSort } from "@/components/jellyseerr/JellyseerrIndexPage"; +import { SeerrSearchSort } from "@/components/seerr/SeerrIndexPage"; interface DiscoverFiltersProps { searchFilterId: string; orderFilterId: string; - jellyseerrOrderBy: JellyseerrSearchSort; - setJellyseerrOrderBy: (value: JellyseerrSearchSort) => void; - jellyseerrSortOrder: "asc" | "desc"; - setJellyseerrSortOrder: (value: "asc" | "desc") => void; + seerrOrderBy: SeerrSearchSort; + setSeerrOrderBy: (value: SeerrSearchSort) => void; + seerrSortOrder: "asc" | "desc"; + setSeerrSortOrder: (value: "asc" | "desc") => void; t: (key: string) => string; } -const sortOptions = Object.keys(JellyseerrSearchSort).filter((v) => +const sortOptions = Object.keys(SeerrSearchSort).filter((v) => Number.isNaN(Number(v)), ); @@ -22,10 +22,10 @@ const orderOptions = ["asc", "desc"] as const; export const DiscoverFilters: React.FC = ({ searchFilterId, orderFilterId, - jellyseerrOrderBy, - setJellyseerrOrderBy, - jellyseerrSortOrder, - setJellyseerrSortOrder, + seerrOrderBy, + setSeerrOrderBy, + seerrSortOrder, + setSeerrSortOrder, t, }) => { if (Platform.OS === "ios") { @@ -52,16 +52,16 @@ export const DiscoverFilters: React.FC = ({ - t(`home.settings.plugins.jellyseerr.order_by.${item}`), + t(`home.settings.plugins.seerr.order_by.${item}`), )} variant='menu' selectedIndex={sortOptions.indexOf( - jellyseerrOrderBy as unknown as string, + seerrOrderBy as unknown as string, )} onOptionSelected={(event: any) => { const index = event.nativeEvent.index; - setJellyseerrOrderBy( - sortOptions[index] as unknown as JellyseerrSearchSort, + setSeerrOrderBy( + sortOptions[index] as unknown as SeerrSearchSort, ); }} /> @@ -69,10 +69,10 @@ export const DiscoverFilters: React.FC = ({ label={t("library.filters.sort_order")} options={orderOptions.map((item) => t(`library.filters.${item}`))} variant='menu' - selectedIndex={orderOptions.indexOf(jellyseerrSortOrder)} + selectedIndex={orderOptions.indexOf(seerrSortOrder)} onOptionSelected={(event: any) => { const index = event.nativeEvent.index; - setJellyseerrSortOrder(orderOptions[index]); + setSeerrSortOrder(orderOptions[index]); }} /> @@ -86,17 +86,15 @@ export const DiscoverFilters: React.FC = ({ - Object.keys(JellyseerrSearchSort).filter((v) => - Number.isNaN(Number(v)), - ) + Object.keys(SeerrSearchSort).filter((v) => Number.isNaN(Number(v))) } - set={(value) => setJellyseerrOrderBy(value[0])} - values={[jellyseerrOrderBy]} + set={(value) => setSeerrOrderBy(value[0])} + values={[seerrOrderBy]} title={t("library.filters.sort_by")} renderItemLabel={(item) => - t(`home.settings.plugins.jellyseerr.order_by.${item}`) + t(`home.settings.plugins.seerr.order_by.${item}`) } disableSearch={true} /> @@ -104,8 +102,8 @@ export const DiscoverFilters: React.FC = ({ id={orderFilterId} queryKey='jellysearr_search' queryFn={async () => ["asc", "desc"]} - set={(value) => setJellyseerrSortOrder(value[0])} - values={[jellyseerrSortOrder]} + set={(value) => setSeerrSortOrder(value[0])} + values={[seerrSortOrder]} title={t("library.filters.sort_order")} renderItemLabel={(item) => t(`library.filters.${item}`)} disableSearch={true} diff --git a/components/jellyseerr/Cast.tsx b/components/seerr/Cast.tsx similarity index 88% rename from components/jellyseerr/Cast.tsx rename to components/seerr/Cast.tsx index 99440bd8..9063ac65 100644 --- a/components/jellyseerr/Cast.tsx +++ b/components/seerr/Cast.tsx @@ -3,7 +3,7 @@ import type React from "react"; import { useTranslation } from "react-i18next"; import { View, type ViewProps } from "react-native"; import { Text } from "@/components/common/Text"; -import PersonPoster from "@/components/jellyseerr/PersonPoster"; +import PersonPoster from "@/components/seerr/PersonPoster"; import type { MovieDetails } from "@/utils/jellyseerr/server/models/Movie"; import type { TvDetails } from "@/utils/jellyseerr/server/models/Tv"; @@ -15,9 +15,7 @@ const CastSlide: React.FC< details?.credits?.cast && details?.credits?.cast?.length > 0 && ( - - {t("jellyseerr.cast")} - + {t("seerr.cast")} = ({ const DetailFacts: React.FC< { details?: MovieDetails | TvDetails } & ViewProps > = ({ details, className, ...props }) => { - const { jellyseerrRegion: region, jellyseerrLocale: locale } = - useJellyseerr(); + const { seerrRegion: region, seerrLocale: locale } = useSeerr(); const { t } = useTranslation(); const releases = useMemo( @@ -132,21 +131,21 @@ const DetailFacts: React.FC< return ( details && ( - {t("jellyseerr.details")} + {t("seerr.details")} - + {details.keywords.some( (keyword) => keyword.id === ANIME_KEYWORD_ID, - ) && } + ) && } ( {r.type === 3 ? ( @@ -172,16 +171,13 @@ const DetailFacts: React.FC< ))} /> - - - - - + + + + + ( @@ -190,17 +186,17 @@ const DetailFacts: React.FC< ))} /> n.name, )} /> n.name)} /> s.name)} /> diff --git a/components/seerr/GridSkeleton.tsx b/components/seerr/GridSkeleton.tsx new file mode 100644 index 00000000..75431cd7 --- /dev/null +++ b/components/seerr/GridSkeleton.tsx @@ -0,0 +1,21 @@ +import { View } from "react-native"; + +interface Props { + index: number; +} +// Dev note might be a good idea to standardize skeletons across the app and have one "file" for it. +export const GridSkeleton: React.FC = ({ index }) => { + return ( + + + + + + + + ); +}; diff --git a/components/jellyseerr/ParallaxSlideShow.tsx b/components/seerr/ParallaxSlideShow.tsx similarity index 71% rename from components/jellyseerr/ParallaxSlideShow.tsx rename to components/seerr/ParallaxSlideShow.tsx index b4b75592..261da73d 100644 --- a/components/jellyseerr/ParallaxSlideShow.tsx +++ b/components/seerr/ParallaxSlideShow.tsx @@ -11,6 +11,7 @@ import { Animated, View, type ViewProps } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { Text } from "@/components/common/Text"; import { ParallaxScrollView } from "@/components/ParallaxPage"; +import { GridSkeleton } from "./GridSkeleton"; const ANIMATION_ENTER = 250; const ANIMATION_EXIT = 250; @@ -28,6 +29,7 @@ interface Props { renderItem: (item: T, index: number) => Render; keyExtractor: (item: T) => string; onEndReached?: (() => void) | null | undefined; + isLoading?: boolean; } const ParallaxSlideShow = ({ @@ -40,6 +42,7 @@ const ParallaxSlideShow = ({ renderItem, keyExtractor, onEndReached, + isLoading = false, }: PropsWithChildren & ViewProps>) => { const insets = useSafeAreaInsets(); @@ -124,27 +127,40 @@ const ParallaxSlideShow = ({ {MainContent?.()} - - - No results - - - } - contentInsetAdjustmentBehavior='automatic' - ListHeaderComponent={ + {isLoading ? ( + {listHeader} - } - nestedScrollEnabled - showsVerticalScrollIndicator={false} - //@ts-expect-error - renderItem={({ item, index }) => renderItem(item, index)} - keyExtractor={keyExtractor} - numColumns={3} - ItemSeparatorComponent={() => } - /> + + + {Array.from({ length: 9 }, (_, i) => ( + + ))} + + + + ) : ( + + + No results + + + } + contentInsetAdjustmentBehavior='automatic' + ListHeaderComponent={ + {listHeader} + } + nestedScrollEnabled + showsVerticalScrollIndicator={false} + //@ts-expect-error + renderItem={({ item, index }) => renderItem(item, index)} + keyExtractor={keyExtractor} + numColumns={3} + ItemSeparatorComponent={() => } + /> + )} diff --git a/components/jellyseerr/PersonPoster.tsx b/components/seerr/PersonPoster.tsx similarity index 73% rename from components/jellyseerr/PersonPoster.tsx rename to components/seerr/PersonPoster.tsx index 70e44d35..821cf52c 100644 --- a/components/jellyseerr/PersonPoster.tsx +++ b/components/seerr/PersonPoster.tsx @@ -1,9 +1,10 @@ -import { useRouter, useSegments } from "expo-router"; +import { useSegments } from "expo-router"; import type React from "react"; import { TouchableOpacity, View, type ViewProps } from "react-native"; import { Text } from "@/components/common/Text"; import Poster from "@/components/posters/Poster"; -import { useJellyseerr } from "@/hooks/useJellyseerr"; +import useRouter from "@/hooks/useAppRouter"; +import { useSeerr } from "@/hooks/useSeerr"; interface Props { id: string; @@ -19,7 +20,7 @@ const PersonPoster: React.FC = ({ subName, ...props }) => { - const { jellyseerrApi } = useJellyseerr(); + const { seerrApi } = useSeerr(); const router = useRouter(); const segments = useSegments(); const from = (segments as string[])[2] || "(home)"; @@ -27,14 +28,12 @@ const PersonPoster: React.FC = ({ if (from === "(home)" || from === "(search)" || from === "(libraries)") return ( - router.push(`/(auth)/(tabs)/${from}/jellyseerr/person/${id}`) - } + onPress={() => router.push(`/(auth)/(tabs)/${from}/seerr/person/${id}`)} > {name} {subName && {subName}} diff --git a/components/jellyseerr/RequestModal.tsx b/components/seerr/RequestModal.tsx similarity index 80% rename from components/jellyseerr/RequestModal.tsx rename to components/seerr/RequestModal.tsx index 5bc44177..53d23765 100644 --- a/components/jellyseerr/RequestModal.tsx +++ b/components/seerr/RequestModal.tsx @@ -12,7 +12,7 @@ import { View, type ViewProps } from "react-native"; import { Button } from "@/components/Button"; import { Text } from "@/components/common/Text"; import { PlatformDropdown } from "@/components/PlatformDropdown"; -import { useJellyseerr } from "@/hooks/useJellyseerr"; +import { useSeerr } from "@/hooks/useSeerr"; import type { QualityProfile, RootFolder, @@ -41,11 +41,11 @@ const RequestModal = forwardRef< { id, title, requestBody, type, isAnime = false, onRequested, onDismiss }, ref, ) => { - const { jellyseerrApi, jellyseerrUser, requestMedia } = useJellyseerr(); + const { seerrApi, seerrUser, requestMedia } = useSeerr(); const [requestOverrides, setRequestOverrides] = useState({ mediaId: Number(id), mediaType: type, - userId: jellyseerrUser?.id, + userId: seerrUser?.id, }); const [qualityProfileOpen, setQualityProfileOpen] = useState(false); @@ -65,18 +65,17 @@ const RequestModal = forwardRef< }, [onDismiss]); const { data: serviceSettings } = useQuery({ - queryKey: ["jellyseerr", "request", type, "service"], + queryKey: ["seerr", "request", type, "service"], queryFn: async () => - jellyseerrApi?.service(type === "movie" ? "radarr" : "sonarr"), - enabled: !!jellyseerrApi && !!jellyseerrUser, + seerrApi?.service(type === "movie" ? "radarr" : "sonarr"), + enabled: !!seerrApi && !!seerrUser, refetchOnMount: "always", }); const { data: users } = useQuery({ - queryKey: ["jellyseerr", "users"], - queryFn: async () => - jellyseerrApi?.user({ take: 1000, sort: "displayname" }), - enabled: !!jellyseerrApi && !!jellyseerrUser, + queryKey: ["seerr", "users"], + queryFn: async () => seerrApi?.user({ take: 1000, sort: "displayname" }), + enabled: !!seerrApi && !!seerrUser, refetchOnMount: "always", }); @@ -87,7 +86,7 @@ const RequestModal = forwardRef< const { data: defaultServiceDetails } = useQuery({ queryKey: [ - "jellyseerr", + "seerr", "request", type, "service", @@ -99,12 +98,12 @@ const RequestModal = forwardRef< ...prev, serverId: defaultService?.id, })); - return jellyseerrApi?.serviceDetails( + return seerrApi?.serviceDetails( type === "movie" ? "radarr" : "sonarr", defaultService!.id, ); }, - enabled: !!jellyseerrApi && !!jellyseerrUser && !!defaultService, + enabled: !!seerrApi && !!seerrUser && !!defaultService, refetchOnMount: "always", }); @@ -148,9 +147,9 @@ const RequestModal = forwardRef< return undefined; } if (requestBody.seasons.length > 1) { - return t("jellyseerr.season_all"); + return t("seerr.season_all"); } - return t("jellyseerr.season_number", { + return t("seerr.season_number", { season_number: requestBody.seasons[0], }); }, [requestBody?.seasons]); @@ -245,8 +244,7 @@ const RequestModal = forwardRef< type: "radio" as const, label: user.displayName, value: user.id.toString(), - selected: - (requestOverrides.userId || jellyseerrUser?.id) === user.id, + selected: (requestOverrides.userId || seerrUser?.id) === user.id, onPress: () => setRequestOverrides((prev) => ({ ...prev, @@ -255,7 +253,7 @@ const RequestModal = forwardRef< })) || [], }, ], - [users, jellyseerrUser, requestOverrides.userId], + [users, seerrUser, requestOverrides.userId], ); const request = useCallback(() => { @@ -268,7 +266,7 @@ const RequestModal = forwardRef< ...requestOverrides, }; - writeDebugLog("Sending Jellyseerr advanced request", body); + writeDebugLog("Sending Seerr advanced request", body); requestMedia( seasonTitle ? `${title}, ${seasonTitle}` : title, @@ -308,7 +306,7 @@ const RequestModal = forwardRef< - {t("jellyseerr.advanced")} + {t("seerr.advanced")} {seasonTitle && ( {seasonTitle} @@ -319,7 +317,7 @@ const RequestModal = forwardRef< <> - {t("jellyseerr.quality_profile")} + {t("seerr.quality_profile")} } - title={t("jellyseerr.quality_profile")} + title={t("seerr.quality_profile")} open={qualityProfileOpen} onOpenChange={setQualityProfileOpen} /> @@ -343,7 +341,7 @@ const RequestModal = forwardRef< - {t("jellyseerr.root_folder")} + {t("seerr.root_folder")} } - title={t("jellyseerr.root_folder")} + title={t("seerr.root_folder")} open={rootFolderOpen} onOpenChange={setRootFolderOpen} /> - - - {t("jellyseerr.tags")} - - - - {requestOverrides.tags - ? defaultServiceDetails.tags - .filter((t) => - requestOverrides.tags!.includes(t.id), - ) - .map((t) => t.label) - .join(", ") || - defaultTags.map((t) => t.label).join(", ") - : defaultTags.map((t) => t.label).join(", ")} - - - } - title={t("jellyseerr.tags")} - open={tagsOpen} - onOpenChange={setTagsOpen} - /> - + {defaultServiceDetails?.tags && + defaultServiceDetails.tags.length > 0 && ( + + + {t("seerr.tags")} + + + + {requestOverrides.tags + ? defaultServiceDetails.tags + .filter((t) => + requestOverrides.tags!.includes(t.id), + ) + .map((t) => t.label) + .join(", ") || + defaultTags.map((t) => t.label).join(", ") + : defaultTags.map((t) => t.label).join(", ")} + + + } + title={t("seerr.tags")} + open={tagsOpen} + onOpenChange={setTagsOpen} + /> + + )} - {t("jellyseerr.request_as")} + {t("seerr.request_as")} u.id === - (requestOverrides.userId || jellyseerrUser?.id), - )?.displayName || jellyseerrUser!.displayName} + (requestOverrides.userId || seerrUser?.id), + )?.displayName || seerrUser!.displayName} } - title={t("jellyseerr.request_as")} + title={t("seerr.request_as")} open={usersOpen} onOpenChange={setUsersOpen} /> @@ -427,7 +428,7 @@ const RequestModal = forwardRef< )} diff --git a/components/jellyseerr/JellyseerrIndexPage.tsx b/components/seerr/SeerrIndexPage.tsx similarity index 65% rename from components/jellyseerr/JellyseerrIndexPage.tsx rename to components/seerr/SeerrIndexPage.tsx index 42fd223b..6ef54fa6 100644 --- a/components/jellyseerr/JellyseerrIndexPage.tsx +++ b/components/seerr/SeerrIndexPage.tsx @@ -8,8 +8,8 @@ import { useSharedValue, withTiming, } from "react-native-reanimated"; -import Discover from "@/components/jellyseerr/discover/Discover"; -import { useJellyseerr } from "@/hooks/useJellyseerr"; +import Discover from "@/components/seerr/discover/Discover"; +import { useSeerr } from "@/hooks/useSeerr"; import { MediaType } from "@/utils/jellyseerr/server/constants/media"; import type { MovieResult, @@ -18,57 +18,57 @@ import type { } from "@/utils/jellyseerr/server/models/Search"; import { useReactNavigationQuery } from "@/utils/useReactNavigationQuery"; import { Text } from "../common/Text"; -import JellyseerrPoster from "../posters/JellyseerrPoster"; +import SeerrPoster from "../posters/SeerrPoster"; import { LoadingSkeleton } from "../search/LoadingSkeleton"; import { SearchItemWrapper } from "../search/SearchItemWrapper"; import PersonPoster from "./PersonPoster"; interface Props extends ViewProps { searchQuery: string; - sortType?: JellyseerrSearchSort; + sortType?: SeerrSearchSort; order?: "asc" | "desc"; } -export enum JellyseerrSearchSort { +export enum SeerrSearchSort { DEFAULT = 0, VOTE_COUNT_AND_AVERAGE = 1, POPULARITY = 2, } -export const JellyserrIndexPage: React.FC = ({ +export const SeerrIndexPage: React.FC = ({ searchQuery, sortType, order, }) => { - const { jellyseerrApi } = useJellyseerr(); + const { seerrApi } = useSeerr(); const opacity = useSharedValue(1); const { t } = useTranslation(); const { - data: jellyseerrDiscoverSettings, + data: seerrDiscoverSettings, isFetching: f1, isLoading: l1, } = useReactNavigationQuery({ - queryKey: ["search", "jellyseerr", "discoverSettings", searchQuery], - queryFn: async () => jellyseerrApi?.discoverSettings(), - enabled: !!jellyseerrApi && searchQuery.length === 0, + queryKey: ["search", "seerr", "discoverSettings", searchQuery], + queryFn: async () => seerrApi?.discoverSettings(), + enabled: !!seerrApi && searchQuery.length === 0, }); const { - data: jellyseerrResults, + data: seerrResults, isFetching: f2, isLoading: l2, } = useReactNavigationQuery({ - queryKey: ["search", "jellyseerr", "results", searchQuery], + queryKey: ["search", "seerr", "results", searchQuery], queryFn: async () => { const params = { query: new URLSearchParams(searchQuery || "").toString(), }; return await Promise.all([ - jellyseerrApi?.search({ ...params, page: 1 }), - jellyseerrApi?.search({ ...params, page: 2 }), - jellyseerrApi?.search({ ...params, page: 3 }), - jellyseerrApi?.search({ ...params, page: 4 }), + seerrApi?.search({ ...params, page: 1 }), + seerrApi?.search({ ...params, page: 2 }), + seerrApi?.search({ ...params, page: 3 }), + seerrApi?.search({ ...params, page: 4 }), ]).then((all) => uniqBy( all.flatMap((v) => v?.results || []), @@ -76,7 +76,7 @@ export const JellyserrIndexPage: React.FC = ({ ), ); }, - enabled: !!jellyseerrApi && searchQuery.length > 0, + enabled: !!seerrApi && searchQuery.length > 0, }); useAnimatedReaction( @@ -92,20 +92,20 @@ export const JellyserrIndexPage: React.FC = ({ const sortingType = useMemo(() => { if (!sortType) return; - switch (Number(JellyseerrSearchSort[sortType])) { - case JellyseerrSearchSort.VOTE_COUNT_AND_AVERAGE: + switch (Number(SeerrSearchSort[sortType])) { + case SeerrSearchSort.VOTE_COUNT_AND_AVERAGE: return ["voteCount", "voteAverage"]; - case JellyseerrSearchSort.POPULARITY: + case SeerrSearchSort.POPULARITY: return ["voteCount", "popularity"]; default: return undefined; } }, [sortType, order]); - const jellyseerrMovieResults = useMemo( + const seerrMovieResults = useMemo( () => orderBy( - jellyseerrResults?.filter( + seerrResults?.filter( (r) => r.mediaType === MediaType.MOVIE, ) as MovieResult[], sortingType || [ @@ -113,41 +113,37 @@ export const JellyserrIndexPage: React.FC = ({ ], order || "desc", ), - [jellyseerrResults, sortingType, order], + [seerrResults, sortingType, order], ); - const jellyseerrTvResults = useMemo( + const seerrTvResults = useMemo( () => orderBy( - jellyseerrResults?.filter( - (r) => r.mediaType === MediaType.TV, - ) as TvResult[], + seerrResults?.filter((r) => r.mediaType === MediaType.TV) as TvResult[], sortingType || [ (t) => t.name.toLowerCase() === searchQuery.toLowerCase(), ], order || "desc", ), - [jellyseerrResults, sortingType, order], + [seerrResults, sortingType, order], ); - const jellyseerrPersonResults = useMemo( + const seerrPersonResults = useMemo( () => orderBy( - jellyseerrResults?.filter( - (r) => r.mediaType === "person", - ) as PersonResult[], + seerrResults?.filter((r) => r.mediaType === "person") as PersonResult[], sortingType || [ (p) => p.name.toLowerCase() === searchQuery.toLowerCase(), ], order || "desc", ), - [jellyseerrResults, sortingType, order], + [seerrResults, sortingType, order], ); if (!searchQuery.length) return ( - + ); @@ -155,9 +151,9 @@ export const JellyserrIndexPage: React.FC = ({ - {!jellyseerrMovieResults?.length && - !jellyseerrTvResults?.length && - !jellyseerrPersonResults?.length && + {!seerrMovieResults?.length && + !seerrTvResults?.length && + !seerrPersonResults?.length && !f1 && !f2 && !l1 && @@ -175,21 +171,21 @@ export const JellyserrIndexPage: React.FC = ({ ( - + )} /> ( - + )} /> ( = ({ mediaType, className, ...props }) => { +const SeerrMediaIcon: React.FC<{ mediaType: "tv" | "movie" } & ViewProps> = ({ + mediaType, + className, + ...props +}) => { const style = useMemo( () => mediaType === MediaType.MOVIE @@ -29,4 +31,4 @@ const JellyseerrMediaIcon: React.FC< ); }; -export default JellyseerrMediaIcon; +export default SeerrMediaIcon; diff --git a/components/jellyseerr/JellyseerrStatusIcon.tsx b/components/seerr/SeerrStatusIcon.tsx similarity index 96% rename from components/jellyseerr/JellyseerrStatusIcon.tsx rename to components/seerr/SeerrStatusIcon.tsx index e9b37af5..414fea62 100644 --- a/components/jellyseerr/JellyseerrStatusIcon.tsx +++ b/components/seerr/SeerrStatusIcon.tsx @@ -9,7 +9,7 @@ interface Props { onPress?: () => void; } -const JellyseerrStatusIcon: React.FC = ({ +const SeerrStatusIcon: React.FC = ({ mediaStatus, showRequestIcon, onPress, @@ -74,4 +74,4 @@ const JellyseerrStatusIcon: React.FC = ({ ); }; -export default JellyseerrStatusIcon; +export default SeerrStatusIcon; diff --git a/components/jellyseerr/discover/CompanySlide.tsx b/components/seerr/discover/CompanySlide.tsx similarity index 70% rename from components/jellyseerr/discover/CompanySlide.tsx rename to components/seerr/discover/CompanySlide.tsx index 9643f48e..58e614fa 100644 --- a/components/jellyseerr/discover/CompanySlide.tsx +++ b/components/seerr/discover/CompanySlide.tsx @@ -1,10 +1,11 @@ -import { router, useSegments } from "expo-router"; +import { useSegments } from "expo-router"; import type React from "react"; import { useCallback } from "react"; import { TouchableOpacity, type ViewProps } from "react-native"; -import GenericSlideCard from "@/components/jellyseerr/discover/GenericSlideCard"; -import Slide, { type SlideProps } from "@/components/jellyseerr/discover/Slide"; -import { useJellyseerr } from "@/hooks/useJellyseerr"; +import GenericSlideCard from "@/components/seerr/discover/GenericSlideCard"; +import Slide, { type SlideProps } from "@/components/seerr/discover/Slide"; +import useRouter from "@/hooks/useAppRouter"; +import { useSeerr } from "@/hooks/useSeerr"; import { COMPANY_LOGO_IMAGE_FILTER, type Network, @@ -15,13 +16,14 @@ const CompanySlide: React.FC< { data: Network[] | Studio[] } & SlideProps & ViewProps > = ({ slide, data, ...props }) => { const segments = useSegments(); - const { jellyseerrApi } = useJellyseerr(); + const { seerrApi } = useSeerr(); + const router = useRouter(); const from = (segments as string[])[2] || "(home)"; const navigate = useCallback( ({ id, image, name }: Network | Studio) => router.push({ - pathname: `/(auth)/(tabs)/${from}/jellyseerr/company/${id}` as any, + pathname: `/(auth)/(tabs)/${from}/seerr/company/${id}` as any, params: { id, image, name, type: slide.type }, }), [slide], @@ -38,10 +40,7 @@ const CompanySlide: React.FC< )} diff --git a/components/jellyseerr/discover/Discover.tsx b/components/seerr/discover/Discover.tsx similarity index 87% rename from components/jellyseerr/discover/Discover.tsx rename to components/seerr/discover/Discover.tsx index 67e5bf3c..7a926eec 100644 --- a/components/jellyseerr/discover/Discover.tsx +++ b/components/seerr/discover/Discover.tsx @@ -2,10 +2,10 @@ import { sortBy } from "lodash"; import type React from "react"; import { useMemo } from "react"; import { View } from "react-native"; -import CompanySlide from "@/components/jellyseerr/discover/CompanySlide"; -import GenreSlide from "@/components/jellyseerr/discover/GenreSlide"; -import MovieTvSlide from "@/components/jellyseerr/discover/MovieTvSlide"; -import RecentRequestsSlide from "@/components/jellyseerr/discover/RecentRequestsSlide"; +import CompanySlide from "@/components/seerr/discover/CompanySlide"; +import GenreSlide from "@/components/seerr/discover/GenreSlide"; +import MovieTvSlide from "@/components/seerr/discover/MovieTvSlide"; +import RecentRequestsSlide from "@/components/seerr/discover/RecentRequestsSlide"; import { DiscoverSliderType } from "@/utils/jellyseerr/server/constants/discover"; import type DiscoverSlider from "@/utils/jellyseerr/server/entity/DiscoverSlider"; import { networks } from "@/utils/jellyseerr/src/components/Discover/NetworkSlider"; diff --git a/components/jellyseerr/discover/GenericSlideCard.tsx b/components/seerr/discover/GenericSlideCard.tsx similarity index 100% rename from components/jellyseerr/discover/GenericSlideCard.tsx rename to components/seerr/discover/GenericSlideCard.tsx diff --git a/components/jellyseerr/discover/GenreSlide.tsx b/components/seerr/discover/GenreSlide.tsx similarity index 74% rename from components/jellyseerr/discover/GenreSlide.tsx rename to components/seerr/discover/GenreSlide.tsx index 8edaf4c3..e65534d0 100644 --- a/components/jellyseerr/discover/GenreSlide.tsx +++ b/components/seerr/discover/GenreSlide.tsx @@ -1,39 +1,41 @@ import { useQuery } from "@tanstack/react-query"; -import { router, useSegments } from "expo-router"; +import { useSegments } from "expo-router"; import type React from "react"; import { useCallback } from "react"; import { TouchableOpacity, type ViewProps } from "react-native"; -import GenericSlideCard from "@/components/jellyseerr/discover/GenericSlideCard"; -import Slide, { type SlideProps } from "@/components/jellyseerr/discover/Slide"; -import { Endpoints, useJellyseerr } from "@/hooks/useJellyseerr"; +import GenericSlideCard from "@/components/seerr/discover/GenericSlideCard"; +import Slide, { type SlideProps } from "@/components/seerr/discover/Slide"; +import useRouter from "@/hooks/useAppRouter"; +import { Endpoints, useSeerr } from "@/hooks/useSeerr"; import { DiscoverSliderType } from "@/utils/jellyseerr/server/constants/discover"; import type { GenreSliderItem } from "@/utils/jellyseerr/server/interfaces/api/discoverInterfaces"; import { genreColorMap } from "@/utils/jellyseerr/src/components/Discover/constants"; const GenreSlide: React.FC = ({ slide, ...props }) => { const segments = useSegments(); - const { jellyseerrApi } = useJellyseerr(); + const { seerrApi } = useSeerr(); + const router = useRouter(); const from = (segments as string[])[2] || "(home)"; const navigate = useCallback( (genre: GenreSliderItem) => router.push({ - pathname: `/(auth)/(tabs)/${from}/jellyseerr/genre/${genre.id}` as any, + pathname: `/(auth)/(tabs)/${from}/seerr/genre/${genre.id}` as any, params: { type: slide.type, name: genre.name }, }), [slide], ); const { data } = useQuery({ - queryKey: ["jellyseerr", "discover", slide.type, slide.id], + queryKey: ["seerr", "discover", slide.type, slide.id], queryFn: async () => { - return jellyseerrApi?.getGenreSliders( + return seerrApi?.getGenreSliders( slide.type === DiscoverSliderType.MOVIE_GENRES ? Endpoints.MOVIE : Endpoints.TV, ); }, - enabled: !!jellyseerrApi, + enabled: !!seerrApi, }); return ( @@ -51,7 +53,7 @@ const GenreSlide: React.FC = ({ slide, ...props }) => { title={item.name} colors={["transparent", "transparent"]} contentFit={"cover"} - url={jellyseerrApi?.imageProxy( + url={seerrApi?.imageProxy( item.backdrops?.[0], `w780_filter(duotone,${ genreColorMap[item.id] ?? genreColorMap[0] diff --git a/components/jellyseerr/discover/MovieTvSlide.tsx b/components/seerr/discover/MovieTvSlide.tsx similarity index 76% rename from components/jellyseerr/discover/MovieTvSlide.tsx rename to components/seerr/discover/MovieTvSlide.tsx index a82f48a3..6291bab1 100644 --- a/components/jellyseerr/discover/MovieTvSlide.tsx +++ b/components/seerr/discover/MovieTvSlide.tsx @@ -3,23 +3,19 @@ import { uniqBy } from "lodash"; import type React from "react"; import { useMemo } from "react"; import type { ViewProps } from "react-native"; -import Slide, { type SlideProps } from "@/components/jellyseerr/discover/Slide"; -import JellyseerrPoster from "@/components/posters/JellyseerrPoster"; -import { - type DiscoverEndpoint, - Endpoints, - useJellyseerr, -} from "@/hooks/useJellyseerr"; +import SeerrPoster from "@/components/posters/SeerrPoster"; +import Slide, { type SlideProps } from "@/components/seerr/discover/Slide"; +import { type DiscoverEndpoint, Endpoints, useSeerr } from "@/hooks/useSeerr"; import { DiscoverSliderType } from "@/utils/jellyseerr/server/constants/discover"; const MovieTvSlide: React.FC = ({ slide, ...props }) => { - const { jellyseerrApi, isJellyseerrMovieOrTvResult } = useJellyseerr(); + const { seerrApi, isSeerrMovieOrTvResult } = useSeerr(); const { data, fetchNextPage, hasNextPage } = useInfiniteQuery({ - queryKey: ["jellyseerr", "discover", slide.id], + queryKey: ["seerr", "discover", slide.id], queryFn: async ({ pageParam }) => { let endpoint: DiscoverEndpoint | undefined; let params: any = { @@ -50,13 +46,13 @@ const MovieTvSlide: React.FC = ({ break; } - return endpoint ? jellyseerrApi?.discover(endpoint, params) : null; + return endpoint ? seerrApi?.discover(endpoint, params) : null; }, initialPageParam: 1, getNextPageParam: (lastPage, pages) => (lastPage?.page || pages?.findLast((p) => p?.results.length)?.page || 1) + 1, - enabled: !!jellyseerrApi, + enabled: !!seerrApi, staleTime: 0, }); @@ -65,9 +61,7 @@ const MovieTvSlide: React.FC = ({ uniqBy( data?.pages ?.filter((p) => p?.results.length) - .flatMap((p) => - p?.results.filter((r) => isJellyseerrMovieOrTvResult(r)), - ), + .flatMap((p) => p?.results.filter((r) => isSeerrMovieOrTvResult(r))), "id", ), [data], @@ -84,7 +78,7 @@ const MovieTvSlide: React.FC = ({ onEndReached={() => { if (hasNextPage) fetchNextPage(); }} - renderItem={(item) => } + renderItem={(item) => } /> ) ); diff --git a/components/jellyseerr/discover/RecentRequestsSlide.tsx b/components/seerr/discover/RecentRequestsSlide.tsx similarity index 70% rename from components/jellyseerr/discover/RecentRequestsSlide.tsx rename to components/seerr/discover/RecentRequestsSlide.tsx index 71b5fc21..12cdef40 100644 --- a/components/jellyseerr/discover/RecentRequestsSlide.tsx +++ b/components/seerr/discover/RecentRequestsSlide.tsx @@ -1,9 +1,9 @@ import { useQuery } from "@tanstack/react-query"; import type React from "react"; import type { ViewProps } from "react-native"; -import Slide, { type SlideProps } from "@/components/jellyseerr/discover/Slide"; -import JellyseerrPoster from "@/components/posters/JellyseerrPoster"; -import { useJellyseerr } from "@/hooks/useJellyseerr"; +import SeerrPoster from "@/components/posters/SeerrPoster"; +import Slide, { type SlideProps } from "@/components/seerr/discover/Slide"; +import { useSeerr } from "@/hooks/useSeerr"; import { MediaType } from "@/utils/jellyseerr/server/constants/media"; import type MediaRequest from "@/utils/jellyseerr/server/entity/MediaRequest"; import type { NonFunctionProperties } from "@/utils/jellyseerr/server/interfaces/api/common"; @@ -16,36 +16,36 @@ type ExtendedMediaRequest = NonFunctionProperties & { const RequestCard: React.FC<{ request: ExtendedMediaRequest }> = ({ request, }) => { - const { jellyseerrApi } = useJellyseerr(); + const { seerrApi } = useSeerr(); const { data: details } = useQuery({ queryKey: [ - "jellyseerr", + "seerr", "detail", request.media.mediaType, request.media.tmdbId, ], queryFn: async () => { return request.media.mediaType === MediaType.MOVIE - ? jellyseerrApi?.movieDetails(request.media.tmdbId) - : jellyseerrApi?.tvDetails(request.media.tmdbId); + ? seerrApi?.movieDetails(request.media.tmdbId) + : seerrApi?.tvDetails(request.media.tmdbId); }, - enabled: !!jellyseerrApi, + enabled: !!seerrApi, refetchOnMount: true, staleTime: 0, }); const { data: refreshedRequest } = useQuery({ - queryKey: ["jellyseerr", "requests", request.media.mediaType, request.id], - queryFn: async () => jellyseerrApi?.getRequest(request.id), - enabled: !!jellyseerrApi, + queryKey: ["seerr", "requests", request.media.mediaType, request.id], + queryFn: async () => seerrApi?.getRequest(request.id), + enabled: !!seerrApi, refetchOnMount: true, refetchInterval: 5000, staleTime: 0, }); return ( - = ({ slide, ...props }) => { - const { jellyseerrApi } = useJellyseerr(); + const { seerrApi } = useSeerr(); const { data: requests } = useQuery({ - queryKey: ["jellyseerr", "recent_requests"], - queryFn: async () => jellyseerrApi?.requests(), - enabled: !!jellyseerrApi, + queryKey: ["seerr", "recent_requests"], + queryFn: async () => seerrApi?.requests(), + enabled: !!seerrApi, refetchOnMount: true, staleTime: 0, }); diff --git a/components/jellyseerr/discover/Slide.tsx b/components/seerr/discover/Slide.tsx similarity index 100% rename from components/jellyseerr/discover/Slide.tsx rename to components/seerr/discover/Slide.tsx diff --git a/components/series/CastAndCrew.tsx b/components/series/CastAndCrew.tsx index 037206e9..359539dc 100644 --- a/components/series/CastAndCrew.tsx +++ b/components/series/CastAndCrew.tsx @@ -2,12 +2,17 @@ import type { BaseItemDto, BaseItemPerson, } from "@jellyfin/sdk/lib/generated-client/models"; -import { router, useSegments } from "expo-router"; +import { useSegments } from "expo-router"; import { useAtom } from "jotai"; import type React from "react"; import { useMemo } from "react"; import { useTranslation } from "react-i18next"; import { TouchableOpacity, View, type ViewProps } from "react-native"; +import useRouter from "@/hooks/useAppRouter"; + +// Matches `w-28` poster cards (approx 112px wide, 10/15 aspect ratio) + 2 lines of text. +const POSTER_CAROUSEL_HEIGHT = 220; + import { apiAtom } from "@/providers/JellyfinProvider"; import { getPrimaryImageUrl } from "@/utils/jellyfin/image/getPrimaryImageUrl"; import { HorizontalScroll } from "../common/HorizontalScroll"; @@ -23,6 +28,7 @@ export const CastAndCrew: React.FC = ({ item, loading, ...props }) => { const [api] = useAtom(apiAtom); const segments = useSegments(); const { t } = useTranslation(); + const router = useRouter(); const from = (segments as string[])[2]; const destinctPeople = useMemo(() => { @@ -50,7 +56,7 @@ export const CastAndCrew: React.FC = ({ item, loading, ...props }) => { i.Id?.toString() || ""} - height={247} + height={POSTER_CAROUSEL_HEIGHT} data={destinctPeople} renderItem={(i) => ( = ({ item, loading, ...props }) => { className='flex flex-col w-28' > - {i.Name} - {i.Role} + + {i.Name} + + + {i.Role} + )} /> diff --git a/components/series/CurrentSeries.tsx b/components/series/CurrentSeries.tsx index c3d0e0d9..3f9a5074 100644 --- a/components/series/CurrentSeries.tsx +++ b/components/series/CurrentSeries.tsx @@ -1,9 +1,13 @@ import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; -import { router } from "expo-router"; import { useAtom } from "jotai"; import type React from "react"; import { useTranslation } from "react-i18next"; import { TouchableOpacity, View, type ViewProps } from "react-native"; +import useRouter from "@/hooks/useAppRouter"; + +// Matches `w-28` poster cards (approx 112px wide, 10/15 aspect ratio) + 2 lines of text. +const POSTER_CAROUSEL_HEIGHT = 220; + import { apiAtom } from "@/providers/JellyfinProvider"; import { getPrimaryImageUrlById } from "@/utils/jellyfin/image/getPrimaryImageUrlById"; import { HorizontalScroll } from "../common/HorizontalScroll"; @@ -17,6 +21,7 @@ interface Props extends ViewProps { export const CurrentSeries: React.FC = ({ item, ...props }) => { const [api] = useAtom(apiAtom); const { t } = useTranslation(); + const router = useRouter(); return ( @@ -25,7 +30,7 @@ export const CurrentSeries: React.FC = ({ item, ...props }) => { ( = ({ item, ...props }) => { id={item?.Id} url={getPrimaryImageUrlById({ api, id: item?.ParentId })} /> - {item?.SeriesName} + {item?.SeriesName} )} /> diff --git a/components/series/EpisodeTitleHeader.tsx b/components/series/EpisodeTitleHeader.tsx index e9f2b1aa..fe473a92 100644 --- a/components/series/EpisodeTitleHeader.tsx +++ b/components/series/EpisodeTitleHeader.tsx @@ -1,7 +1,7 @@ import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; -import { useRouter } from "expo-router"; import { TouchableOpacity, View, type ViewProps } from "react-native"; import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; interface Props extends ViewProps { item: BaseItemDto; diff --git a/components/series/NextItemButton.tsx b/components/series/NextItemButton.tsx index a2aae63f..5d6497c3 100644 --- a/components/series/NextItemButton.tsx +++ b/components/series/NextItemButton.tsx @@ -2,9 +2,9 @@ import { Ionicons } from "@expo/vector-icons"; import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { getItemsApi } from "@jellyfin/sdk/lib/utils/api"; import { useQuery } from "@tanstack/react-query"; -import { useRouter } from "expo-router"; import { useAtom } from "jotai"; import { useMemo } from "react"; +import useRouter from "@/hooks/useAppRouter"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; import { Button } from "../Button"; diff --git a/components/series/SeasonDropdown.tsx b/components/series/SeasonDropdown.tsx index 5f6b64cd..b59b74a3 100644 --- a/components/series/SeasonDropdown.tsx +++ b/components/series/SeasonDropdown.tsx @@ -54,29 +54,28 @@ export const SeasonDropdown: React.FC = ({ [state, item, keys], ); + // Always use IndexNumber for Season objects (not keys.index which is for the item) const sortByIndex = (a: BaseItemDto, b: BaseItemDto) => - Number(a[keys.index]) - Number(b[keys.index]); + Number(a.IndexNumber) - Number(b.IndexNumber); const optionGroups = useMemo( () => [ { options: seasons?.sort(sortByIndex).map((season: any) => { - const title = - season[keys.title] || - season.Name || - `Season ${season.IndexNumber}`; + const title = season.Name || `Season ${season.IndexNumber}`; return { type: "radio" as const, label: title, value: season.Id || season.IndexNumber, - selected: Number(season[keys.index]) === Number(seasonIndex), + // Compare season's IndexNumber with the selected seasonIndex + selected: Number(season.IndexNumber) === Number(seasonIndex), onPress: () => onSelect(season), }; }) || [], }, ], - [seasons, keys, seasonIndex, onSelect], + [seasons, seasonIndex, onSelect], ); useEffect(() => { diff --git a/components/series/SeasonEpisodesCarousel.tsx b/components/series/SeasonEpisodesCarousel.tsx index add0e83e..bb87ef12 100644 --- a/components/series/SeasonEpisodesCarousel.tsx +++ b/components/series/SeasonEpisodesCarousel.tsx @@ -1,12 +1,14 @@ import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api"; import { useQuery } from "@tanstack/react-query"; -import { router } from "expo-router"; import { useAtom } from "jotai"; import { useEffect, useMemo, useRef } from "react"; import { TouchableOpacity, type ViewStyle } from "react-native"; +import useRouter from "@/hooks/useAppRouter"; import { useDownload } from "@/providers/DownloadProvider"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { useOfflineMode } from "@/providers/OfflineModeProvider"; +import { getDownloadedEpisodesBySeasonId } from "@/utils/downloads/offline-series"; import ContinueWatchingPoster from "../ContinueWatchingPoster"; import { HorizontalScroll, @@ -17,7 +19,6 @@ import { ItemCardText } from "../ItemCardText"; interface Props { item?: BaseItemDto | null; loading?: boolean; - isOffline?: boolean; style?: ViewStyle; containerStyle?: ViewStyle; } @@ -25,17 +26,14 @@ interface Props { export const SeasonEpisodesCarousel: React.FC = ({ item, loading, - isOffline, style, containerStyle, }) => { const [api] = useAtom(apiAtom); const [user] = useAtom(userAtom); + const isOffline = useOfflineMode(); + const router = useRouter(); const { getDownloadedItems } = useDownload(); - const downloadedFiles = useMemo( - () => getDownloadedItems(), - [getDownloadedItems], - ); const scrollRef = useRef(null); @@ -51,11 +49,7 @@ export const SeasonEpisodesCarousel: React.FC = ({ queryKey: ["episodes", seasonId, isOffline], queryFn: async () => { if (isOffline) { - return downloadedFiles - ?.filter( - (f) => f.item.Type === "Episode" && f.item.SeasonId === seasonId, - ) - .map((f) => f.item); + return getDownloadedEpisodesBySeasonId(getDownloadedItems(), seasonId!); } if (!api || !user?.Id || !item?.SeriesId) return []; const response = await getTvShowsApi(api).getEpisodes({ @@ -73,7 +67,7 @@ export const SeasonEpisodesCarousel: React.FC = ({ }); return response.data.Items as BaseItemDto[]; }, - enabled: !!api && !!user?.Id && !!seasonId, + enabled: !!seasonId && (isOffline || (!!api && !!user?.Id)), }); useEffect(() => { diff --git a/components/series/SeasonPicker.tsx b/components/series/SeasonPicker.tsx index f97f6c0e..01a81545 100644 --- a/components/series/SeasonPicker.tsx +++ b/components/series/SeasonPicker.tsx @@ -10,7 +10,13 @@ import { SeasonDropdown, type SeasonIndexState, } from "@/components/series/SeasonDropdown"; +import { useDownload } from "@/providers/DownloadProvider"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { useOfflineMode } from "@/providers/OfflineModeProvider"; +import { + buildOfflineSeasons, + getDownloadedEpisodesForSeason, +} from "@/utils/downloads/offline-series"; import { runtimeTicksToSeconds } from "@/utils/time"; import ContinueWatchingPoster from "../ContinueWatchingPoster"; import { Text } from "../common/Text"; @@ -31,6 +37,8 @@ export const SeasonPicker: React.FC = ({ item }) => { const [user] = useAtom(userAtom); const [seasonIndexState, setSeasonIndexState] = useAtom(seasonIndexAtom); const { t } = useTranslation(); + const isOffline = useOfflineMode(); + const { getDownloadedItems, downloadedItems } = useDownload(); const seasonIndex = useMemo( () => seasonIndexState[item.Id ?? ""], @@ -38,8 +46,12 @@ export const SeasonPicker: React.FC = ({ item }) => { ); const { data: seasons } = useQuery({ - queryKey: ["seasons", item.Id], + queryKey: ["seasons", item.Id, isOffline, downloadedItems.length], queryFn: async () => { + if (isOffline) { + return buildOfflineSeasons(getDownloadedItems(), item.Id!); + } + if (!api || !user?.Id || !item.Id) return []; const response = await api.axiosInstance.get( `${api.basePath}/Shows/${item.Id}/Seasons`, @@ -58,8 +70,8 @@ export const SeasonPicker: React.FC = ({ item }) => { return response.data.Items; }, - staleTime: 60, - enabled: !!api && !!user?.Id && !!item.Id, + staleTime: isOffline ? Infinity : 60, + enabled: isOffline || (!!api && !!user?.Id && !!item.Id), }); const selectedSeasonId: string | null = useMemo(() => { @@ -73,9 +85,33 @@ export const SeasonPicker: React.FC = ({ item }) => { return season.Id!; }, [seasons, seasonIndex]); + // For offline mode, we use season index number instead of ID + const selectedSeasonNumber = useMemo(() => { + if (!isOffline) return null; + const season = seasons?.find( + (s: BaseItemDto) => + s.IndexNumber === seasonIndex || s.Name === seasonIndex, + ); + return season?.IndexNumber ?? null; + }, [isOffline, seasons, seasonIndex]); + const { data: episodes, isPending } = useQuery({ - queryKey: ["episodes", item.Id, selectedSeasonId], + queryKey: [ + "episodes", + item.Id, + isOffline ? selectedSeasonNumber : selectedSeasonId, + isOffline, + downloadedItems.length, + ], queryFn: async () => { + if (isOffline) { + return getDownloadedEpisodesForSeason( + getDownloadedItems(), + item.Id!, + selectedSeasonNumber!, + ); + } + if (!api || !user?.Id || !item.Id || !selectedSeasonId) { return []; } @@ -85,7 +121,6 @@ export const SeasonPicker: React.FC = ({ item }) => { userId: user.Id, seasonId: selectedSeasonId, enableUserData: true, - // Note: Including trick play is necessary to enable trick play downloads fields: ["MediaSources", "MediaStreams", "Overview", "Trickplay"], }); @@ -97,7 +132,10 @@ export const SeasonPicker: React.FC = ({ item }) => { return res.data.Items; }, - enabled: !!api && !!user?.Id && !!item.Id && !!selectedSeasonId, + staleTime: isOffline ? Infinity : 0, + enabled: isOffline + ? !!item.Id && selectedSeasonNumber !== null + : !!api && !!user?.Id && !!item.Id && !!selectedSeasonId, }); // Used for height calculation @@ -127,7 +165,7 @@ export const SeasonPicker: React.FC = ({ item }) => { })); }} /> - {episodes?.length ? ( + {episodes?.length && !isOffline ? ( = ({ item }) => { {runtimeTicksToSeconds(e.RunTimeTicks)} - - - + {!isOffline && ( + + + + )} = ({ details, seasonNumber }) => { - const { jellyseerrApi } = useJellyseerr(); + const { seerrApi } = useSeerr(); const { data: seasonWithEpisodes, isLoading } = useQuery({ - queryKey: ["jellyseerr", details.id, "season", seasonNumber], - queryFn: async () => jellyseerrApi?.tvSeason(details.id, seasonNumber), + queryKey: ["seerr", details.id, "season", seasonNumber], + queryFn: async () => seerrApi?.tvSeason(details.id, seasonNumber), enabled: details.seasons.filter((s) => s.seasonNumber !== 0).length > 0, }); @@ -57,11 +57,7 @@ const JellyseerrSeasonEpisodes: React.FC<{ }; const RenderItem = ({ item }: any) => { - const { - jellyseerrApi, - jellyseerrRegion: region, - jellyseerrLocale: locale, - } = useJellyseerr(); + const { seerrApi, seerrRegion: region, seerrLocale: locale } = useSeerr(); const [imageError, setImageError] = useState(false); const upcomingAirDate = useMemo(() => { @@ -83,7 +79,7 @@ const RenderItem = ({ item }: any) => { key={item.id} id={item.id} source={{ - uri: jellyseerrApi?.imageProxy(item.stillPath), + uri: seerrApi?.imageProxy(item.stillPath), }} cachePolicy={"memory-disk"} contentFit='cover' @@ -131,7 +127,7 @@ const RenderItem = ({ item }: any) => { ); }; -const JellyseerrSeasons: React.FC<{ +const SeerrSeasons: React.FC<{ isLoading: boolean; details?: TvDetails; hasAdvancedRequest?: boolean; @@ -148,7 +144,7 @@ const JellyseerrSeasons: React.FC<{ hasAdvancedRequest, onAdvancedRequest, }) => { - const { jellyseerrApi, requestMedia } = useJellyseerr(); + const { seerrApi, requestMedia } = useSeerr(); const [seasonStates, setSeasonStates] = useState<{ [key: number]: boolean }>( {}, ); @@ -181,7 +177,7 @@ const JellyseerrSeasons: React.FC<{ ); const requestAll = useCallback(() => { - if (details && jellyseerrApi) { + if (details && seerrApi) { const body: MediaRequestBody = { mediaId: details.id, mediaType: MediaType.TV, @@ -198,7 +194,7 @@ const JellyseerrSeasons: React.FC<{ requestMedia(details.name, body, refetch); } }, [ - jellyseerrApi, + seerrApi, seasons, details, hasAdvancedRequest, @@ -210,15 +206,15 @@ const JellyseerrSeasons: React.FC<{ const promptRequestAll = useCallback( () => Alert.alert( - t("jellyseerr.confirm"), - t("jellyseerr.are_you_sure_you_want_to_request_all_seasons"), + t("seerr.confirm"), + t("seerr.are_you_sure_you_want_to_request_all_seasons"), [ { - text: t("jellyseerr.cancel"), + text: t("seerr.cancel"), style: "cancel", }, { - text: t("jellyseerr.yes"), + text: t("seerr.yes"), onPress: requestAll, }, ], @@ -301,10 +297,10 @@ const JellyseerrSeasons: React.FC<{ { const canRequest = season.status === MediaStatus.UNKNOWN; return ( - requestSeason(canRequest, season.seasonNumber) @@ -326,7 +322,7 @@ const JellyseerrSeasons: React.FC<{ {seasonStates?.[season.seasonNumber] && ( - { } /> + + + updateSettings({ mergeNextUpAndContinueWatching: value }) + } + /> + router.push("/settings/appearance/hide-libraries/page") @@ -57,6 +67,16 @@ export const AppearanceSettings: React.FC = () => { title={t("home.settings.other.hide_libraries")} showArrow /> + + + updateSettings({ hideRemoteSessionButton: value }) + } + /> + ); diff --git a/components/settings/AudioToggles.tsx b/components/settings/AudioToggles.tsx index ef7b42f3..93a267bd 100644 --- a/components/settings/AudioToggles.tsx +++ b/components/settings/AudioToggles.tsx @@ -3,7 +3,7 @@ import { useMemo } from "react"; import { useTranslation } from "react-i18next"; import { Platform, View, type ViewProps } from "react-native"; import { Switch } from "react-native-gesture-handler"; -import { useSettings } from "@/utils/atoms/settings"; +import { AudioTranscodeMode, useSettings } from "@/utils/atoms/settings"; import { Text } from "../common/Text"; import { ListGroup } from "../list/ListGroup"; import { ListItem } from "../list/ListItem"; @@ -54,6 +54,70 @@ export const AudioToggles: React.FC = ({ ...props }) => { ]; }, [cultures, settings?.defaultAudioLanguage, t, updateSettings]); + const audioTranscodeModeLabels: Record = { + [AudioTranscodeMode.Auto]: t("home.settings.audio.transcode_mode.auto"), + [AudioTranscodeMode.ForceStereo]: t( + "home.settings.audio.transcode_mode.stereo", + ), + [AudioTranscodeMode.Allow51]: t("home.settings.audio.transcode_mode.5_1"), + [AudioTranscodeMode.AllowAll]: t( + "home.settings.audio.transcode_mode.passthrough", + ), + }; + + const audioTranscodeModeOptions = useMemo( + () => [ + { + options: [ + { + type: "radio" as const, + label: t("home.settings.audio.transcode_mode.auto"), + value: AudioTranscodeMode.Auto, + selected: + settings?.audioTranscodeMode === AudioTranscodeMode.Auto || + !settings?.audioTranscodeMode, + onPress: () => + updateSettings({ audioTranscodeMode: AudioTranscodeMode.Auto }), + }, + { + type: "radio" as const, + label: t("home.settings.audio.transcode_mode.stereo"), + value: AudioTranscodeMode.ForceStereo, + selected: + settings?.audioTranscodeMode === AudioTranscodeMode.ForceStereo, + onPress: () => + updateSettings({ + audioTranscodeMode: AudioTranscodeMode.ForceStereo, + }), + }, + { + type: "radio" as const, + label: t("home.settings.audio.transcode_mode.5_1"), + value: AudioTranscodeMode.Allow51, + selected: + settings?.audioTranscodeMode === AudioTranscodeMode.Allow51, + onPress: () => + updateSettings({ + audioTranscodeMode: AudioTranscodeMode.Allow51, + }), + }, + { + type: "radio" as const, + label: t("home.settings.audio.transcode_mode.passthrough"), + value: AudioTranscodeMode.AllowAll, + selected: + settings?.audioTranscodeMode === AudioTranscodeMode.AllowAll, + onPress: () => + updateSettings({ + audioTranscodeMode: AudioTranscodeMode.AllowAll, + }), + }, + ], + }, + ], + [settings?.audioTranscodeMode, t, updateSettings], + ); + if (isTv) return null; if (!settings) return null; @@ -98,6 +162,31 @@ export const AudioToggles: React.FC = ({ ...props }) => { title={t("home.settings.audio.language")} /> + + + + { + audioTranscodeModeLabels[ + settings?.audioTranscodeMode || AudioTranscodeMode.Auto + ] + } + + + + } + title={t("home.settings.audio.transcode_mode.title")} + /> + ); diff --git a/components/settings/Dashboard.tsx b/components/settings/Dashboard.tsx deleted file mode 100644 index 768c6e0b..00000000 --- a/components/settings/Dashboard.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { useRouter } from "expo-router"; -import { useTranslation } from "react-i18next"; -import { View } from "react-native"; -import { useSessions, type useSessionsProps } from "@/hooks/useSessions"; -import { useSettings } from "@/utils/atoms/settings"; -import { ListGroup } from "../list/ListGroup"; -import { ListItem } from "../list/ListItem"; - -export const Dashboard = () => { - const { settings } = useSettings(); - const { sessions = [] } = useSessions({} as useSessionsProps); - const router = useRouter(); - - const { t } = useTranslation(); - - if (!settings) return null; - return ( - - - router.push("/settings/dashboard/sessions")} - title={t("home.settings.dashboard.sessions_title")} - showArrow - /> - - - ); -}; diff --git a/components/settings/DisabledSetting.tsx b/components/settings/DisabledSetting.tsx index 04e24f86..2775331b 100644 --- a/components/settings/DisabledSetting.tsx +++ b/components/settings/DisabledSetting.tsx @@ -11,12 +11,12 @@ const DisabledSetting: React.FC< }} > + {children} {disabled && showText && ( - - {text ?? "Currently disabled by admin."} + + {text ?? "Disabled by admin"} )} - {children} ); diff --git a/components/settings/DownloadSettings.tsx b/components/settings/DownloadSettings.tsx deleted file mode 100644 index 3a0017ac..00000000 --- a/components/settings/DownloadSettings.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function DownloadSettings() { - return null; -} diff --git a/components/settings/DownloadSettings.tv.tsx b/components/settings/DownloadSettings.tv.tsx deleted file mode 100644 index 3a0017ac..00000000 --- a/components/settings/DownloadSettings.tv.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function DownloadSettings() { - return null; -} diff --git a/components/settings/GestureControls.tsx b/components/settings/GestureControls.tsx index 55aadaa1..b9c39ef4 100644 --- a/components/settings/GestureControls.tsx +++ b/components/settings/GestureControls.tsx @@ -19,7 +19,9 @@ export const GestureControls: React.FC = ({ ...props }) => { () => pluginSettings?.enableHorizontalSwipeSkip?.locked === true && pluginSettings?.enableLeftSideBrightnessSwipe?.locked === true && - pluginSettings?.enableRightSideVolumeSwipe?.locked === true, + pluginSettings?.enableRightSideVolumeSwipe?.locked === true && + pluginSettings?.hideVolumeSlider?.locked === true && + pluginSettings?.hideBrightnessSlider?.locked === true, [pluginSettings], ); @@ -77,6 +79,38 @@ export const GestureControls: React.FC = ({ ...props }) => { } /> + + + + updateSettings({ hideVolumeSlider }) + } + /> + + + + + updateSettings({ hideBrightnessSlider }) + } + /> + ); diff --git a/components/settings/Jellyseerr.tsx b/components/settings/Jellyseerr.tsx deleted file mode 100644 index 470d40a2..00000000 --- a/components/settings/Jellyseerr.tsx +++ /dev/null @@ -1,181 +0,0 @@ -import { useMutation } from "@tanstack/react-query"; -import { useAtom } from "jotai"; -import { useState } from "react"; -import { useTranslation } from "react-i18next"; -import { View } from "react-native"; -import { toast } from "sonner-native"; -import { JellyseerrApi, useJellyseerr } from "@/hooks/useJellyseerr"; -import { userAtom } from "@/providers/JellyfinProvider"; -import { useSettings } from "@/utils/atoms/settings"; -import { Button } from "../Button"; -import { Input } from "../common/Input"; -import { Text } from "../common/Text"; -import { ListGroup } from "../list/ListGroup"; -import { ListItem } from "../list/ListItem"; - -export const JellyseerrSettings = () => { - const { jellyseerrUser, setJellyseerrUser, clearAllJellyseerData } = - useJellyseerr(); - - const { t } = useTranslation(); - - const [user] = useAtom(userAtom); - const { settings, updateSettings } = useSettings(); - - const [jellyseerrPassword, setJellyseerrPassword] = useState< - string | undefined - >(undefined); - - const [jellyseerrServerUrl, setjellyseerrServerUrl] = useState< - string | undefined - >(settings?.jellyseerrServerUrl || undefined); - - const loginToJellyseerrMutation = useMutation({ - mutationFn: async () => { - if (!jellyseerrServerUrl && !settings?.jellyseerrServerUrl) - throw new Error("Missing server url"); - if (!user?.Name) - throw new Error("Missing required information for login"); - const jellyseerrTempApi = new JellyseerrApi( - jellyseerrServerUrl || settings.jellyseerrServerUrl || "", - ); - const testResult = await jellyseerrTempApi.test(); - if (!testResult.isValid) throw new Error("Invalid server url"); - return jellyseerrTempApi.login(user.Name, jellyseerrPassword || ""); - }, - onSuccess: (user) => { - setJellyseerrUser(user); - updateSettings({ jellyseerrServerUrl }); - }, - onError: () => { - toast.error(t("jellyseerr.failed_to_login")); - }, - onSettled: () => { - setJellyseerrPassword(undefined); - }, - }); - - const clearData = () => { - clearAllJellyseerData().finally(() => { - setJellyseerrUser(undefined); - setJellyseerrPassword(undefined); - setjellyseerrServerUrl(undefined); - }); - }; - - return ( - - - {jellyseerrUser ? ( - <> - - - - - - - - - - - - - ) : ( - - - {t("home.settings.plugins.jellyseerr.jellyseerr_warning")} - - - {t("home.settings.plugins.jellyseerr.server_url")} - - - - {t("home.settings.plugins.jellyseerr.server_url_hint")} - - - - - - {t("home.settings.plugins.jellyseerr.password")} - - - - - - )} - - - ); -}; diff --git a/components/settings/KefinTweaks.tsx b/components/settings/KefinTweaks.tsx new file mode 100644 index 00000000..228b4692 --- /dev/null +++ b/components/settings/KefinTweaks.tsx @@ -0,0 +1,33 @@ +import { useTranslation } from "react-i18next"; +import { Switch, Text, View } from "react-native"; +import { useSettings } from "@/utils/atoms/settings"; + +export const KefinTweaksSettings = () => { + const { settings, updateSettings } = useSettings(); + const { t } = useTranslation(); + + const isEnabled = settings?.useKefinTweaks ?? false; + + return ( + + + + {t("home.settings.plugins.kefinTweaks.watchlist_enabler")} + + + + + {isEnabled ? t("Watchlist On") : t("Watchlist Off")} + + + updateSettings({ useKefinTweaks: value })} + trackColor={{ false: "#555", true: "purple" }} + thumbColor={isEnabled ? "#fff" : "#ccc"} + /> + + + + ); +}; diff --git a/components/settings/LibraryOptionsSheet.tsx b/components/settings/LibraryOptionsSheet.tsx index c84989b5..e02e22fa 100644 --- a/components/settings/LibraryOptionsSheet.tsx +++ b/components/settings/LibraryOptionsSheet.tsx @@ -229,7 +229,7 @@ export const LibraryOptionsSheet: React.FC = ({ /> - + string; +} + +function StatusDisplay({ + currentSSID, + isUsingLocalUrl, + t, +}: StatusDisplayProps): React.ReactElement { + const wifiStatus = currentSSID ?? t("home.settings.network.not_connected"); + const urlType = isUsingLocalUrl + ? t("home.settings.network.local") + : t("home.settings.network.remote"); + const urlTypeColor = isUsingLocalUrl ? "text-green-500" : "text-blue-500"; + + return ( + + + + {t("home.settings.network.current_wifi")} + + {wifiStatus} + + + + {t("home.settings.network.using_url")} + + {urlType} + + + ); +} + +export function LocalNetworkSettings(): React.ReactElement | null { + const { t } = useTranslation(); + const { permissionStatus, requestPermission } = useWifiSSID(); + const { isUsingLocalUrl, currentSSID, refreshUrlState } = useServerUrl(); + + const remoteUrl = storage.getString("serverUrl"); + const [config, setConfig] = useState(DEFAULT_CONFIG); + + useEffect(() => { + if (remoteUrl) { + const existingConfig = getServerLocalConfig(remoteUrl); + if (existingConfig) { + setConfig(existingConfig); + } + } + }, [remoteUrl]); + + const saveConfig = useCallback( + (newConfig: LocalNetworkConfig) => { + if (!remoteUrl) return; + setConfig(newConfig); + updateServerLocalConfig(remoteUrl, newConfig); + // Trigger URL re-evaluation after config change + refreshUrlState(); + }, + [remoteUrl, refreshUrlState], + ); + + const handleToggleEnabled = useCallback( + async (enabled: boolean) => { + if (enabled && permissionStatus !== "granted") { + const granted = await requestPermission(); + if (!granted) { + toast.error(t("home.settings.network.permission_denied")); + return; + } + } + saveConfig({ ...config, enabled }); + }, + [config, permissionStatus, requestPermission, saveConfig, t], + ); + + const handleLocalUrlChange = useCallback( + (localUrl: string) => { + saveConfig({ ...config, localUrl }); + }, + [config, saveConfig], + ); + + const handleAddCurrentNetwork = useCallback(() => { + if (!currentSSID) { + toast.error(t("home.settings.network.no_wifi_connected")); + return; + } + if (config.homeWifiSSIDs.includes(currentSSID)) { + toast.info(t("home.settings.network.network_already_added")); + return; + } + saveConfig({ + ...config, + homeWifiSSIDs: [...config.homeWifiSSIDs, currentSSID], + }); + toast.success(t("home.settings.network.network_added")); + }, [config, currentSSID, saveConfig, t]); + + const handleRemoveNetwork = useCallback( + (ssidToRemove: string) => { + saveConfig({ + ...config, + homeWifiSSIDs: config.homeWifiSSIDs.filter((s) => s !== ssidToRemove), + }); + }, + [config, saveConfig], + ); + + if (!remoteUrl) return null; + + const addNetworkButtonText = currentSSID + ? t("home.settings.network.add_current_network", { ssid: currentSSID }) + : t("home.settings.network.not_connected_to_wifi"); + + return ( + + + + + + + + {config.enabled && ( + + + {t("home.settings.network.local_url_hint")} + + } + > + + + + + + + {config.homeWifiSSIDs.map((wifiSSID) => ( + + handleRemoveNetwork(wifiSSID)} + hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }} + > + + + + ))} + {config.homeWifiSSIDs.length === 0 && ( + + )} + + + + + + + + + )} + + {permissionStatus === "denied" && ( + + + {t("home.settings.network.permission_denied_explanation")} + + + )} + + ); +} diff --git a/components/settings/MediaContext.tsx b/components/settings/MediaContext.tsx index c6c7856e..67bcf8ea 100644 --- a/components/settings/MediaContext.tsx +++ b/components/settings/MediaContext.tsx @@ -4,9 +4,10 @@ import type { UserDto, } from "@jellyfin/sdk/lib/generated-client/models"; import { getLocalizationApi, getUserApi } from "@jellyfin/sdk/lib/utils/api"; -import { useQuery, useQueryClient } from "@tanstack/react-query"; +import { useQuery } from "@tanstack/react-query"; import { useAtomValue } from "jotai"; import { createContext, type ReactNode, useContext, useEffect } from "react"; +import { useNetworkAwareQueryClient } from "@/hooks/useNetworkAwareQueryClient"; import { apiAtom } from "@/providers/JellyfinProvider"; import { type Settings, useSettings } from "@/utils/atoms/settings"; @@ -30,7 +31,7 @@ export const useMedia = () => { export const MediaProvider = ({ children }: { children: ReactNode }) => { const { settings, updateSettings } = useSettings(); const api = useAtomValue(apiAtom); - const queryClient = useQueryClient(); + const queryClient = useNetworkAwareQueryClient(); const updateSetingsWrapper = (update: Partial) => { const updateUserConfiguration = async ( diff --git a/components/settings/MpvSubtitleSettings.tsx b/components/settings/MpvSubtitleSettings.tsx new file mode 100644 index 00000000..889eaf76 --- /dev/null +++ b/components/settings/MpvSubtitleSettings.tsx @@ -0,0 +1,135 @@ +import { Ionicons } from "@expo/vector-icons"; +import { useMemo } from "react"; +import { useTranslation } from "react-i18next"; +import { Platform, View, type ViewProps } from "react-native"; +import { Stepper } from "@/components/inputs/Stepper"; +import { Text } from "../common/Text"; +import { ListGroup } from "../list/ListGroup"; +import { ListItem } from "../list/ListItem"; +import { PlatformDropdown } from "../PlatformDropdown"; +import { useMedia } from "./MediaContext"; + +interface Props extends ViewProps {} + +type AlignX = "left" | "center" | "right"; +type AlignY = "top" | "center" | "bottom"; + +export const MpvSubtitleSettings: React.FC = ({ ...props }) => { + const isTv = Platform.isTV; + const media = useMedia(); + const { settings, updateSettings } = media; + const { t } = useTranslation(); + + const alignXOptions: AlignX[] = ["left", "center", "right"]; + const alignYOptions: AlignY[] = ["top", "center", "bottom"]; + + const alignXLabels: Record = { + left: t("player.alignment_left"), + center: t("player.alignment_center"), + right: t("player.alignment_right"), + }; + + const alignYLabels: Record = { + top: t("player.alignment_top"), + center: t("player.alignment_center"), + bottom: t("player.alignment_bottom"), + }; + + const alignXOptionGroups = useMemo(() => { + const options = alignXOptions.map((align) => ({ + type: "radio" as const, + label: alignXLabels[align], + value: align, + selected: align === (settings?.mpvSubtitleAlignX ?? "center"), + onPress: () => updateSettings({ mpvSubtitleAlignX: align }), + })); + return [{ options }]; + }, [settings?.mpvSubtitleAlignX, updateSettings]); + + const alignYOptionGroups = useMemo(() => { + const options = alignYOptions.map((align) => ({ + type: "radio" as const, + label: alignYLabels[align], + value: align, + selected: align === (settings?.mpvSubtitleAlignY ?? "bottom"), + onPress: () => updateSettings({ mpvSubtitleAlignY: align }), + })); + return [{ options }]; + }, [settings?.mpvSubtitleAlignY, updateSettings]); + + if (isTv) return null; + if (!settings) return null; + + return ( + + + {t("player.mpv_subtitle_settings_description")} + + } + > + + + updateSettings({ mpvSubtitleScale: Math.round(value * 10) / 10 }) + } + /> + + + + updateSettings({ mpvSubtitleMarginY: value })} + /> + + + + + + {alignXLabels[settings?.mpvSubtitleAlignX ?? "center"]} + + + + } + title={t("player.horizontal_alignment")} + /> + + + + + + {alignYLabels[settings?.mpvSubtitleAlignY ?? "bottom"]} + + + + } + title={t("player.vertical_alignment")} + /> + + + + ); +}; diff --git a/components/settings/OtherSettings.tsx b/components/settings/OtherSettings.tsx index 452edab0..fcca2498 100644 --- a/components/settings/OtherSettings.tsx +++ b/components/settings/OtherSettings.tsx @@ -1,5 +1,4 @@ import { Ionicons } from "@expo/vector-icons"; -import { useRouter } from "expo-router"; import { TFunction } from "i18next"; import type React from "react"; import { useMemo } from "react"; @@ -8,6 +7,7 @@ import { Linking, Switch, View } from "react-native"; import { BITRATES } from "@/components/BitrateSelector"; import { PlatformDropdown } from "@/components/PlatformDropdown"; import DisabledSetting from "@/components/settings/DisabledSetting"; +import useRouter from "@/hooks/useAppRouter"; import * as ScreenOrientation from "@/packages/expo-screen-orientation"; import { ScreenOrientationEnum, useSettings } from "@/utils/atoms/settings"; import { Text } from "../common/Text"; @@ -141,36 +141,6 @@ export const OtherSettings: React.FC = () => { /> - {/* {(Platform.OS === "ios" || Platform.isTVOS)&& ( - - t(`home.settings.other.video_players.${VideoPlayer[item]}`)} - title={ - - - {t(`home.settings.other.video_players.${VideoPlayer[settings.defaultPlayer]}`)} - - - - } - label={t("home.settings.other.orientation")} - onSelected={(defaultPlayer) => - updateSettings({ defaultPlayer }) - } - /> - - )} */} - { const orientations = [ ScreenOrientation.OrientationLock.DEFAULT, ScreenOrientation.OrientationLock.PORTRAIT_UP, + ScreenOrientation.OrientationLock.LANDSCAPE, ScreenOrientation.OrientationLock.LANDSCAPE_LEFT, ScreenOrientation.OrientationLock.LANDSCAPE_RIGHT, ]; @@ -38,6 +40,8 @@ export const PlaybackControlsSettings: React.FC = () => { "home.settings.other.orientations.DEFAULT", [ScreenOrientation.OrientationLock.PORTRAIT_UP]: "home.settings.other.orientations.PORTRAIT_UP", + [ScreenOrientation.OrientationLock.LANDSCAPE]: + "home.settings.other.orientations.LANDSCAPE", [ScreenOrientation.OrientationLock.LANDSCAPE_LEFT]: "home.settings.other.orientations.LANDSCAPE_LEFT", [ScreenOrientation.OrientationLock.LANDSCAPE_RIGHT]: @@ -92,6 +96,21 @@ export const PlaybackControlsSettings: React.FC = () => { [settings?.maxAutoPlayEpisodeCount?.key, t, updateSettings], ); + const playbackSpeedOptions = useMemo( + () => [ + { + options: PLAYBACK_SPEEDS.map((speed) => ({ + type: "radio" as const, + label: speed.label, + value: speed.value, + selected: speed.value === settings?.defaultPlaybackSpeed, + onPress: () => updateSettings({ defaultPlaybackSpeed: speed.value }), + })), + }, + ], + [settings?.defaultPlaybackSpeed, updateSettings], + ); + if (!settings) return null; return ( @@ -158,6 +177,30 @@ export const PlaybackControlsSettings: React.FC = () => { /> + + + + {PLAYBACK_SPEEDS.find( + (s) => s.value === settings.defaultPlaybackSpeed, + )?.label ?? "1x"} + + + + } + title={t("home.settings.other.default_playback_speed")} + /> + + { /> - + + + updateSettings({ autoPlayNextEpisode }) + } + /> + + + { className='mb-4' > router.push("/settings/plugins/jellyseerr/page")} - title={"Jellyseerr"} + onPress={() => router.push("/settings/plugins/seerr/page")} + title={"Seerr"} + showArrow + /> + router.push("/settings/plugins/streamystats/page")} + title={"Streamystats"} showArrow /> router.push("/settings/plugins/marlin-search/page")} - title='Marlin Search' + title={"Marlin Search"} + showArrow + /> + router.push("/settings/plugins/kefinTweaks/page")} + title={"KefinTweaks"} showArrow /> diff --git a/components/settings/QuickConnect.tsx b/components/settings/QuickConnect.tsx index d0cbf85e..725e7e6f 100644 --- a/components/settings/QuickConnect.tsx +++ b/components/settings/QuickConnect.tsx @@ -7,7 +7,7 @@ import { import { getQuickConnectApi } from "@jellyfin/sdk/lib/utils/api"; import { useAtom } from "jotai"; import type React from "react"; -import { useCallback, useRef, useState } from "react"; +import { useCallback, useMemo, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; import { Alert, Platform, View, type ViewProps } from "react-native"; import { useHaptic } from "@/hooks/useHaptic"; @@ -28,6 +28,11 @@ export const QuickConnect: React.FC = ({ ...props }) => { const bottomSheetModalRef = useRef(null); const successHapticFeedback = useHaptic("success"); const errorHapticFeedback = useHaptic("error"); + const snapPoints = useMemo( + () => (Platform.OS === "android" ? ["100%"] : ["40%"]), + [], + ); + const isAndroid = Platform.OS === "android"; const { t } = useTranslation(); @@ -92,7 +97,7 @@ export const QuickConnect: React.FC = ({ ...props }) => { = ({ ...props }) => { backgroundColor: "#171717", }} backdropComponent={renderBackdrop} - keyboardBehavior='interactive' + keyboardBehavior={isAndroid ? "fillParent" : "interactive"} keyboardBlurBehavior='restore' android_keyboardInputMode='adjustResize' + topInset={isAndroid ? 0 : undefined} > diff --git a/components/settings/Seerr.tsx b/components/settings/Seerr.tsx new file mode 100644 index 00000000..1ad87e7f --- /dev/null +++ b/components/settings/Seerr.tsx @@ -0,0 +1,174 @@ +import { useMutation } from "@tanstack/react-query"; +import { useAtom } from "jotai"; +import { useState } from "react"; +import { useTranslation } from "react-i18next"; +import { View } from "react-native"; +import { toast } from "sonner-native"; +import { SeerrApi, useSeerr } from "@/hooks/useSeerr"; +import { userAtom } from "@/providers/JellyfinProvider"; +import { useSettings } from "@/utils/atoms/settings"; +import { Button } from "../Button"; +import { Input } from "../common/Input"; +import { Text } from "../common/Text"; +import { ListGroup } from "../list/ListGroup"; +import { ListItem } from "../list/ListItem"; + +export const SeerrSettings = () => { + const { seerrUser, setSeerrUser, clearAllSeerrData } = useSeerr(); + + const { t } = useTranslation(); + + const [user] = useAtom(userAtom); + const { settings, updateSettings } = useSettings(); + + const [seerrPassword, setSeerrPassword] = useState( + undefined, + ); + + const [seerrServerUrl, setSeerrServerUrl] = useState( + settings?.seerrServerUrl || undefined, + ); + + const loginToSeerrMutation = useMutation({ + mutationFn: async () => { + if (!seerrServerUrl && !settings?.seerrServerUrl) + throw new Error("Missing server url"); + if (!user?.Name) + throw new Error("Missing required information for login"); + const seerrTempApi = new SeerrApi( + seerrServerUrl || settings.seerrServerUrl || "", + ); + const testResult = await seerrTempApi.test(); + if (!testResult.isValid) throw new Error("Invalid server url"); + return seerrTempApi.login(user.Name, seerrPassword || ""); + }, + onSuccess: (user) => { + setSeerrUser(user); + updateSettings({ seerrServerUrl }); + }, + onError: () => { + toast.error(t("seerr.failed_to_login")); + }, + onSettled: () => { + setSeerrPassword(undefined); + }, + }); + + const clearData = () => { + clearAllSeerrData().finally(() => { + setSeerrUser(undefined); + setSeerrPassword(undefined); + setSeerrServerUrl(undefined); + }); + }; + + return ( + + + {seerrUser ? ( + <> + + + + + + + + + + + + + ) : ( + + + {t("home.settings.plugins.seerr.seerr_warning")} + + + {t("home.settings.plugins.seerr.server_url")} + + + + {t("home.settings.plugins.seerr.server_url_hint")} + + + + + + {t("home.settings.plugins.seerr.password")} + + + + + + )} + + + ); +}; diff --git a/components/settings/SubtitleToggles.tsx b/components/settings/SubtitleToggles.tsx index 5a6bfee3..526cb862 100644 --- a/components/settings/SubtitleToggles.tsx +++ b/components/settings/SubtitleToggles.tsx @@ -5,12 +5,6 @@ import { useTranslation } from "react-i18next"; import { Platform, View, type ViewProps } from "react-native"; import { Switch } from "react-native-gesture-handler"; import { Stepper } from "@/components/inputs/Stepper"; -import { - OUTLINE_THICKNESS, - type OutlineThickness, - VLC_COLORS, - type VLCColor, -} from "@/constants/SubtitleConstants"; import { useSettings } from "@/utils/atoms/settings"; import { Text } from "../common/Text"; import { ListGroup } from "../list/ListGroup"; @@ -92,84 +86,6 @@ export const SubtitleToggles: React.FC = ({ ...props }) => { ]; }, [settings?.subtitleMode, t, updateSettings]); - const textColorOptionGroups = useMemo(() => { - const colors = Object.keys(VLC_COLORS) as VLCColor[]; - const options = colors.map((color) => ({ - type: "radio" as const, - label: t(`home.settings.subtitles.colors.${color}`), - value: color, - selected: (settings?.vlcTextColor || "White") === color, - onPress: () => updateSettings({ vlcTextColor: color }), - })); - - return [{ options }]; - }, [settings?.vlcTextColor, t, updateSettings]); - - const backgroundColorOptionGroups = useMemo(() => { - const colors = Object.keys(VLC_COLORS) as VLCColor[]; - const options = colors.map((color) => ({ - type: "radio" as const, - label: t(`home.settings.subtitles.colors.${color}`), - value: color, - selected: (settings?.vlcBackgroundColor || "Black") === color, - onPress: () => updateSettings({ vlcBackgroundColor: color }), - })); - - return [{ options }]; - }, [settings?.vlcBackgroundColor, t, updateSettings]); - - const outlineColorOptionGroups = useMemo(() => { - const colors = Object.keys(VLC_COLORS) as VLCColor[]; - const options = colors.map((color) => ({ - type: "radio" as const, - label: t(`home.settings.subtitles.colors.${color}`), - value: color, - selected: (settings?.vlcOutlineColor || "Black") === color, - onPress: () => updateSettings({ vlcOutlineColor: color }), - })); - - return [{ options }]; - }, [settings?.vlcOutlineColor, t, updateSettings]); - - const outlineThicknessOptionGroups = useMemo(() => { - const thicknesses = Object.keys(OUTLINE_THICKNESS) as OutlineThickness[]; - const options = thicknesses.map((thickness) => ({ - type: "radio" as const, - label: t(`home.settings.subtitles.thickness.${thickness}`), - value: thickness, - selected: (settings?.vlcOutlineThickness || "Normal") === thickness, - onPress: () => updateSettings({ vlcOutlineThickness: thickness }), - })); - - return [{ options }]; - }, [settings?.vlcOutlineThickness, t, updateSettings]); - - const backgroundOpacityOptionGroups = useMemo(() => { - const opacities = [0, 32, 64, 96, 128, 160, 192, 224, 255]; - const options = opacities.map((opacity) => ({ - type: "radio" as const, - label: `${Math.round((opacity / 255) * 100)}%`, - value: opacity, - selected: (settings?.vlcBackgroundOpacity ?? 128) === opacity, - onPress: () => updateSettings({ vlcBackgroundOpacity: opacity }), - })); - - return [{ options }]; - }, [settings?.vlcBackgroundOpacity, updateSettings]); - - const outlineOpacityOptionGroups = useMemo(() => { - const opacities = [0, 32, 64, 96, 128, 160, 192, 224, 255]; - const options = opacities.map((opacity) => ({ - type: "radio" as const, - label: `${Math.round((opacity / 255) * 100)}%`, - value: opacity, - selected: (settings?.vlcOutlineOpacity ?? 255) === opacity, - onPress: () => updateSettings({ vlcOutlineOpacity: opacity }), - })); - - return [{ options }]; - }, [settings?.vlcOutlineOpacity, updateSettings]); - if (isTv) return null; if (!settings) return null; @@ -244,130 +160,14 @@ export const SubtitleToggles: React.FC = ({ ...props }) => { disabled={pluginSettings?.subtitleSize?.locked} > updateSettings({ subtitleSize })} - /> - - - - - {t( - `home.settings.subtitles.colors.${settings?.vlcTextColor || "White"}`, - )} - - - + step={0.1} + min={0.3} + max={1.5} + onUpdate={(value) => + updateSettings({ subtitleSize: Math.round(value * 100) }) } - title={t("home.settings.subtitles.text_color")} - /> - - - - - {t( - `home.settings.subtitles.colors.${settings?.vlcBackgroundColor || "Black"}`, - )} - - - - } - title={t("home.settings.subtitles.background_color")} - /> - - - - - {t( - `home.settings.subtitles.colors.${settings?.vlcOutlineColor || "Black"}`, - )} - - - - } - title={t("home.settings.subtitles.outline_color")} - /> - - - - - {t( - `home.settings.subtitles.thickness.${settings?.vlcOutlineThickness || "Normal"}`, - )} - - - - } - title={t("home.settings.subtitles.outline_thickness")} - /> - - - - {`${Math.round(((settings?.vlcBackgroundOpacity ?? 128) / 255) * 100)}%`} - - - } - title={t("home.settings.subtitles.background_opacity")} - /> - - - - {`${Math.round(((settings?.vlcOutlineOpacity ?? 255) / 255) * 100)}%`} - - - } - title={t("home.settings.subtitles.outline_opacity")} - /> - - - updateSettings({ vlcIsBold: value })} /> diff --git a/components/stacks/NestedTabPageStack.tsx b/components/stacks/NestedTabPageStack.tsx index 87f92db6..db0f9b96 100644 --- a/components/stacks/NestedTabPageStack.tsx +++ b/components/stacks/NestedTabPageStack.tsx @@ -19,7 +19,14 @@ export const commonScreenOptions: ICommonScreenOptions = { headerLeft: () => , }; -const routes = ["persons/[personId]", "items/page", "series/[id]"]; +const routes = [ + "persons/[personId]", + "items/page", + "series/[id]", + "music/album/[albumId]", + "music/artist/[artistId]", + "music/playlist/[playlistId]", +]; export const nestedTabPageScreenOptions: Record = Object.fromEntries(routes.map((route) => [route, commonScreenOptions])); diff --git a/components/video-player/controls/BottomControls.tsx b/components/video-player/controls/BottomControls.tsx index a2652d70..51abf68c 100644 --- a/components/video-player/controls/BottomControls.tsx +++ b/components/video-player/controls/BottomControls.tsx @@ -18,9 +18,9 @@ interface BottomControlsProps { showRemoteBubble: boolean; currentTime: number; remainingTime: number; - isVlc: boolean; showSkipButton: boolean; showSkipCreditButton: boolean; + hasContentAfterCredits: boolean; skipIntro: () => void; skipCredit: () => void; nextItem?: BaseItemDto | null; @@ -66,9 +66,9 @@ export const BottomControls: FC = ({ showRemoteBubble, currentTime, remainingTime, - isVlc, showSkipButton, showSkipCreditButton, + hasContentAfterCredits, skipIntro, skipCredit, nextItem, @@ -96,11 +96,13 @@ export const BottomControls: FC = ({ style={[ { position: "absolute", - right: settings?.safeAreaInControlsEnabled ? insets.right : 0, - left: settings?.safeAreaInControlsEnabled ? insets.left : 0, - bottom: settings?.safeAreaInControlsEnabled - ? Math.max(insets.bottom - 17, 0) - : 0, + right: + (settings?.safeAreaInControlsEnabled ?? true) ? insets.right : 0, + left: (settings?.safeAreaInControlsEnabled ?? true) ? insets.left : 0, + bottom: + (settings?.safeAreaInControlsEnabled ?? true) + ? Math.max(insets.bottom - 17, 0) + : 0, }, ]} className={"flex flex-col px-2"} @@ -136,26 +138,32 @@ export const BottomControls: FC = ({ onPress={skipIntro} buttonText='Skip Intro' /> + {/* Smart Skip Credits behavior: + - Show "Skip Credits" if there's content after credits OR no next episode + - Show "Next Episode" if credits extend to video end AND next episode exists */} - {(settings.maxAutoPlayEpisodeCount.value === -1 || - settings.autoPlayEpisodeCount < - settings.maxAutoPlayEpisodeCount.value) && ( - - )} + {settings.autoPlayNextEpisode !== false && + (settings.maxAutoPlayEpisodeCount.value === -1 || + settings.autoPlayEpisodeCount < + settings.maxAutoPlayEpisodeCount.value) && ( + + )} = ({ diff --git a/components/video-player/controls/BrightnessSlider.tsx b/components/video-player/controls/BrightnessSlider.tsx index db92bd10..eab17bca 100644 --- a/components/video-player/controls/BrightnessSlider.tsx +++ b/components/video-player/controls/BrightnessSlider.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef } from "react"; +import { useEffect, useRef, useState } from "react"; import { Platform, StyleSheet, View } from "react-native"; import { Slider } from "react-native-awesome-slider"; import { useSharedValue } from "react-native-reanimated"; @@ -16,10 +16,19 @@ const BrightnessSlider = () => { const max = useSharedValue(100); const isUserInteracting = useRef(false); const lastKnownBrightness = useRef(50); + const brightnessSupportedRef = useRef(true); + const [brightnessSupported, setBrightnessSupported] = useState(true); // Update brightness from device const updateBrightnessFromDevice = async () => { - if (isTv || !Brightness || isUserInteracting.current) return; + // Check ref (not state) to avoid stale closure in setInterval + if ( + isTv || + !Brightness || + isUserInteracting.current || + !brightnessSupportedRef.current + ) + return; try { const currentBrightness = await Brightness.getBrightnessAsync(); @@ -31,7 +40,10 @@ const BrightnessSlider = () => { lastKnownBrightness.current = brightnessPercent; } } catch (error) { - console.error("Error fetching brightness:", error); + console.warn("Brightness not supported on this device:", error); + // Update both ref (stops interval) and state (triggers re-render to hide) + brightnessSupportedRef.current = false; + setBrightnessSupported(false); } }; @@ -66,7 +78,7 @@ const BrightnessSlider = () => { }, 100); }; - if (isTv) return null; + if (isTv || !brightnessSupported) return null; return ( diff --git a/components/video-player/controls/CenterControls.tsx b/components/video-player/controls/CenterControls.tsx index 47659746..76ce4bed 100644 --- a/components/video-player/controls/CenterControls.tsx +++ b/components/video-player/controls/CenterControls.tsx @@ -38,8 +38,8 @@ export const CenterControls: FC = ({ style={{ position: "absolute", top: "50%", - left: settings?.safeAreaInControlsEnabled ? insets.left : 0, - right: settings?.safeAreaInControlsEnabled ? insets.right : 0, + left: (settings?.safeAreaInControlsEnabled ?? true) ? insets.left : 0, + right: (settings?.safeAreaInControlsEnabled ?? true) ? insets.right : 0, flexDirection: "row", justifyContent: "space-between", alignItems: "center", @@ -48,17 +48,19 @@ export const CenterControls: FC = ({ }} pointerEvents={showControls ? "box-none" : "none"} > - - - + {!settings?.hideBrightnessSlider && ( + + + + )} {!Platform.isTV && ( @@ -135,18 +137,20 @@ export const CenterControls: FC = ({ )} - - - + {!settings?.hideVolumeSlider && ( + + + + )} ); }; diff --git a/components/video-player/controls/ContinueWatchingOverlay.tsx b/components/video-player/controls/ContinueWatchingOverlay.tsx index 4c353dee..26f82484 100644 --- a/components/video-player/controls/ContinueWatchingOverlay.tsx +++ b/components/video-player/controls/ContinueWatchingOverlay.tsx @@ -1,9 +1,9 @@ -import { useRouter } from "expo-router"; import { t } from "i18next"; import React from "react"; import { View } from "react-native"; import { Button } from "@/components/Button"; import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; import { useSettings } from "@/utils/atoms/settings"; export interface ContinueWatchingOverlayProps { @@ -23,7 +23,7 @@ const ContinueWatchingOverlay: React.FC = ({ settings.maxAutoPlayEpisodeCount.value ? ( diff --git a/components/video-player/controls/Controls.tsx b/components/video-player/controls/Controls.tsx index fb62fcef..1407c218 100644 --- a/components/video-player/controls/Controls.tsx +++ b/components/video-player/controls/Controls.tsx @@ -3,17 +3,9 @@ import type { BaseItemDto, MediaSourceInfo, } from "@jellyfin/sdk/lib/generated-client"; -import { useLocalSearchParams, useRouter } from "expo-router"; -import { - type Dispatch, - type FC, - type MutableRefObject, - type SetStateAction, - useCallback, - useEffect, - useState, -} from "react"; -import { useWindowDimensions } from "react-native"; +import { useLocalSearchParams } from "expo-router"; +import { type FC, useCallback, useEffect, useState } from "react"; +import { StyleSheet, useWindowDimensions, View } from "react-native"; import Animated, { Easing, type SharedValue, @@ -23,20 +15,20 @@ import Animated, { withTiming, } from "react-native-reanimated"; import ContinueWatchingOverlay from "@/components/video-player/controls/ContinueWatchingOverlay"; +import useRouter from "@/hooks/useAppRouter"; import { useCreditSkipper } from "@/hooks/useCreditSkipper"; import { useHaptic } from "@/hooks/useHaptic"; import { useIntroSkipper } from "@/hooks/useIntroSkipper"; import { usePlaybackManager } from "@/hooks/usePlaybackManager"; import { useTrickplay } from "@/hooks/useTrickplay"; -import type { TrackInfo, VlcPlayerViewRef } from "@/modules/VlcPlayer.types"; import { DownloadedItem } from "@/providers/Downloads/types"; +import { useOfflineMode } from "@/providers/OfflineModeProvider"; import { useSettings } from "@/utils/atoms/settings"; import { getDefaultPlaySettings } from "@/utils/jellyfin/getDefaultPlaySettings"; import { ticksToMs } from "@/utils/time"; import { BottomControls } from "./BottomControls"; import { CenterControls } from "./CenterControls"; import { CONTROLS_CONSTANTS } from "./constants"; -import { ControlProvider } from "./contexts/ControlContext"; import { EpisodeList } from "./EpisodeList"; import { GestureOverlay } from "./GestureOverlay"; import { HeaderControls } from "./HeaderControls"; @@ -44,44 +36,32 @@ import { useRemoteControl } from "./hooks/useRemoteControl"; import { useVideoNavigation } from "./hooks/useVideoNavigation"; import { useVideoSlider } from "./hooks/useVideoSlider"; import { useVideoTime } from "./hooks/useVideoTime"; -import { type ScaleFactor } from "./ScaleFactorSelector"; import { useControlsTimeout } from "./useControlsTimeout"; -import { type AspectRatio } from "./VideoScalingModeSelector"; +import { PlaybackSpeedScope } from "./utils/playback-speed-settings"; interface Props { item: BaseItemDto; - videoRef: MutableRefObject; isPlaying: boolean; isSeeking: SharedValue; cacheProgress: SharedValue; progress: SharedValue; isBuffering: boolean; showControls: boolean; - enableTrickplay?: boolean; togglePlay: () => void; setShowControls: (shown: boolean) => void; - offline?: boolean; - isVideoLoaded?: boolean; mediaSource?: MediaSourceInfo | null; seek: (ticks: number) => void; startPictureInPicture?: () => Promise; play: () => void; pause: () => void; - getAudioTracks?: (() => Promise) | (() => TrackInfo[]); - getSubtitleTracks?: (() => Promise) | (() => TrackInfo[]); - setSubtitleURL?: (url: string, customName: string) => void; - setSubtitleTrack?: (index: number) => void; - setAudioTrack?: (index: number) => void; - setVideoAspectRatio?: (aspectRatio: string | null) => Promise; - setVideoScaleFactor?: (scaleFactor: number) => Promise; - aspectRatio?: AspectRatio; - scaleFactor?: ScaleFactor; - setAspectRatio?: Dispatch>; - setScaleFactor?: Dispatch>; - isVlc?: boolean; + isZoomedToFill?: boolean; + onZoomToggle?: () => void; api?: Api | null; downloadedFiles?: DownloadedItem[]; + // Playback speed props + playbackSpeed?: number; + setPlaybackSpeed?: (speed: number, scope: PlaybackSpeedScope) => void; } export const Controls: FC = ({ @@ -99,23 +79,14 @@ export const Controls: FC = ({ showControls, setShowControls, mediaSource, - isVideoLoaded, - getAudioTracks, - getSubtitleTracks, - setSubtitleURL, - setSubtitleTrack, - setAudioTrack, - setVideoAspectRatio, - setVideoScaleFactor, - aspectRatio = "default", - scaleFactor = 1.0, - setAspectRatio, - setScaleFactor, - offline = false, - isVlc = false, + isZoomedToFill = false, + onZoomToggle, api = null, downloadedFiles = undefined, + playbackSpeed = 1.0, + setPlaybackSpeed, }) => { + const offline = useOfflineMode(); const { settings, updateSettings } = useSettings(); const router = useRouter(); const lightHapticFeedback = useHaptic("light"); @@ -137,7 +108,9 @@ export const Controls: FC = ({ } = useTrickplay(item); const min = useSharedValue(0); - const max = useSharedValue(item.RunTimeTicks || 0); + // Regular value for use during render (avoids Reanimated warning) + const maxMs = ticksToMs(item.RunTimeTicks || 0); + const max = useSharedValue(maxMs); // Animation values for controls const controlsOpacity = useSharedValue(showControls ? 1 : 0); @@ -194,17 +167,13 @@ export const Controls: FC = ({ zIndex: 10, })); - // Initialize progress values + // Initialize progress values - MPV uses milliseconds useEffect(() => { if (item) { - progress.value = isVlc - ? ticksToMs(item?.UserData?.PlaybackPositionTicks) - : item?.UserData?.PlaybackPositionTicks || 0; - max.value = isVlc - ? ticksToMs(item.RunTimeTicks || 0) - : item.RunTimeTicks || 0; + progress.value = ticksToMs(item?.UserData?.PlaybackPositionTicks); + max.value = ticksToMs(item.RunTimeTicks || 0); } - }, [item, isVlc, progress, max]); + }, [item, progress, max]); // Navigation hooks const { @@ -215,7 +184,6 @@ export const Controls: FC = ({ } = useVideoNavigation({ progress, isPlaying, - isVlc, seek, play, }); @@ -225,7 +193,6 @@ export const Controls: FC = ({ progress, max, isSeeking, - isVlc, }); const toggleControls = useCallback(() => { @@ -248,7 +215,6 @@ export const Controls: FC = ({ progress, min, max, - isVlc, showControls, isPlaying, seek, @@ -273,7 +239,6 @@ export const Controls: FC = ({ progress, isSeeking, isPlaying, - isVlc, seek, play, pause, @@ -302,9 +267,8 @@ export const Controls: FC = ({ : current.actual; } else { // When not scrubbing, only update if progress changed significantly (1 second) - const progressUnit = isVlc - ? CONTROLS_CONSTANTS.PROGRESS_UNIT_MS - : CONTROLS_CONSTANTS.PROGRESS_UNIT_TICKS; + // MPV uses milliseconds + const progressUnit = CONTROLS_CONSTANTS.PROGRESS_UNIT_MS; const progressDiff = Math.abs(current.actual - effectiveProgress.value); if (progressDiff >= progressUnit) { effectiveProgress.value = current.actual; @@ -325,22 +289,22 @@ export const Controls: FC = ({ currentTime, seek, play, - isVlc, offline, api, downloadedFiles, ); - const { showSkipCreditButton, skipCredit } = useCreditSkipper( - item.Id!, - currentTime, - seek, - play, - isVlc, - offline, - api, - downloadedFiles, - ); + const { showSkipCreditButton, skipCredit, hasContentAfterCredits } = + useCreditSkipper( + item.Id!, + currentTime, + seek, + play, + offline, + api, + downloadedFiles, + maxMs, + ); const goToItemCommon = useCallback( (item: BaseItemDto) => { @@ -359,12 +323,10 @@ export const Controls: FC = ({ mediaSource: newMediaSource, audioIndex: defaultAudioIndex, subtitleIndex: defaultSubtitleIndex, - } = getDefaultPlaySettings( - item, - settings, - previousIndexes, - mediaSource ?? undefined, - ); + } = getDefaultPlaySettings(item, settings, { + indexes: previousIndexes, + source: mediaSource ?? undefined, + }); const queryParams = new URLSearchParams({ ...(offline && { offline: "true" }), @@ -377,8 +339,6 @@ export const Controls: FC = ({ item.UserData?.PlaybackPositionTicks?.toString() ?? "", }).toString(); - console.log("queryParams", queryParams); - router.replace(`player/direct-player?${queryParams}` as any); }, [settings, subtitleIndex, audioIndex, mediaSource, bitrateValue, router], @@ -469,6 +429,7 @@ export const Controls: FC = ({ episodeView, onHideControls: hideControls, timeout: CONTROLS_CONSTANTS.TIMEOUT, + disabled: true, }); const switchOnEpisodeMode = useCallback(() => { @@ -479,11 +440,7 @@ export const Controls: FC = ({ }, [isPlaying, togglePlay]); return ( - + {episodeView ? ( = ({ goToNextItem={goToNextItem} previousItem={previousItem} nextItem={nextItem} - getAudioTracks={getAudioTracks} - getSubtitleTracks={getSubtitleTracks} - setAudioTrack={setAudioTrack} - setSubtitleTrack={setSubtitleTrack} - setSubtitleURL={setSubtitleURL} - aspectRatio={aspectRatio} - scaleFactor={scaleFactor} - setAspectRatio={setAspectRatio} - setScaleFactor={setScaleFactor} - setVideoAspectRatio={setVideoAspectRatio} - setVideoScaleFactor={setVideoScaleFactor} + isZoomedToFill={isZoomedToFill} + onZoomToggle={onZoomToggle} + playbackSpeed={playbackSpeed} + setPlaybackSpeed={setPlaybackSpeed} /> = ({ showRemoteBubble={showRemoteBubble} currentTime={currentTime} remainingTime={remainingTime} - isVlc={isVlc} showSkipButton={showSkipButton} showSkipCreditButton={showSkipCreditButton} + hasContentAfterCredits={hasContentAfterCredits} skipIntro={skipIntro} skipCredit={skipCredit} nextItem={nextItem} @@ -582,6 +532,16 @@ export const Controls: FC = ({ {settings.maxAutoPlayEpisodeCount.value !== -1 && ( )} - + ); }; + +const styles = StyleSheet.create({ + controlsContainer: { + position: "absolute", + top: 0, + left: 0, + right: 0, + bottom: 0, + }, +}); diff --git a/components/video-player/controls/EpisodeList.tsx b/components/video-player/controls/EpisodeList.tsx index a7d6c5bc..35a23535 100644 --- a/components/video-player/controls/EpisodeList.tsx +++ b/components/video-player/controls/EpisodeList.tsx @@ -2,11 +2,10 @@ import { Ionicons } from "@expo/vector-icons"; import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api"; import { useQuery, useQueryClient } from "@tanstack/react-query"; -import { useGlobalSearchParams } from "expo-router"; import { atom, useAtom } from "jotai"; import { useEffect, useMemo, useRef } from "react"; import { TouchableOpacity, View } from "react-native"; -import { SafeAreaView } from "react-native-safe-area-context"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; import ContinueWatchingPoster from "@/components/ContinueWatchingPoster"; import { HorizontalScroll, @@ -19,10 +18,16 @@ import { type SeasonIndexState, } from "@/components/series/SeasonDropdown"; import { useDownload } from "@/providers/DownloadProvider"; -import type { DownloadedItem } from "@/providers/Downloads/types"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { useOfflineMode } from "@/providers/OfflineModeProvider"; +import { useSettings } from "@/utils/atoms/settings"; +import { + getDownloadedEpisodesForSeason, + getDownloadedSeasonNumbers, +} from "@/utils/downloads/offline-series"; import { getUserItemData } from "@/utils/jellyfin/user-library/getUserItemData"; import { runtimeTicksToSeconds } from "@/utils/time"; +import { HEADER_LAYOUT, ICON_SIZES } from "./constants"; type Props = { item: BaseItemDto; @@ -40,10 +45,9 @@ export const EpisodeList: React.FC = ({ item, close, goToItem }) => { const scrollToIndex = (index: number) => { scrollViewRef.current?.scrollToIndex(index, 100); }; - const { offline } = useGlobalSearchParams<{ - offline: string; - }>(); - const isOffline = offline === "true"; + const isOffline = useOfflineMode(); + const { settings } = useSettings(); + const insets = useSafeAreaInsets(); // Set the initial season index useEffect(() => { @@ -56,10 +60,6 @@ export const EpisodeList: React.FC = ({ item, close, goToItem }) => { }, []); const { getDownloadedItems } = useDownload(); - const downloadedFiles = useMemo( - () => getDownloadedItems(), - [getDownloadedItems], - ); const seasonIndex = seasonIndexState[item.ParentId ?? ""]; @@ -68,15 +68,9 @@ export const EpisodeList: React.FC = ({ item, close, goToItem }) => { queryFn: async () => { if (isOffline) { if (!item.SeriesId) return []; - const seriesEpisodes = downloadedFiles?.filter( - (f: DownloadedItem) => f.item.SeriesId === item.SeriesId, - ); - const seasonNumbers = Array.from( - new Set( - seriesEpisodes - ?.map((f: DownloadedItem) => f.item.ParentIndexNumber) - .filter(Boolean), - ), + const seasonNumbers = getDownloadedSeasonNumbers( + getDownloadedItems(), + item.SeriesId, ); // Create fake season objects return seasonNumbers.map((seasonNumber) => ({ @@ -117,14 +111,12 @@ export const EpisodeList: React.FC = ({ item, close, goToItem }) => { queryKey: ["episodes", item.SeriesId, selectedSeasonId], queryFn: async () => { if (isOffline) { - if (!item.SeriesId) return []; - return downloadedFiles - ?.filter( - (f: DownloadedItem) => - f.item.SeriesId === item.SeriesId && - f.item.ParentIndexNumber === seasonIndex, - ) - .map((f: DownloadedItem) => f.item); + if (!item.SeriesId || typeof seasonIndex !== "number") return []; + return getDownloadedEpisodesForSeason( + getDownloadedItems(), + item.SeriesId, + seasonIndex, + ); } if (!api || !user?.Id || !item.Id || !selectedSeasonId) return []; const res = await getTvShowsApi(api).getEpisodes({ @@ -153,6 +145,9 @@ export const EpisodeList: React.FC = ({ item, close, goToItem }) => { const queryClient = useQueryClient(); useEffect(() => { + // Don't prefetch when offline - data is already local + if (isOffline) return; + for (const e of episodes || []) { queryClient.prefetchQuery({ queryKey: ["item", e.Id], @@ -168,7 +163,7 @@ export const EpisodeList: React.FC = ({ item, close, goToItem }) => { staleTime: 60 * 5 * 1000, }); } - }, [episodes]); + }, [episodes, isOffline]); // Scroll to the current item when episodes are fetched useEffect(() => { @@ -181,15 +176,24 @@ export const EpisodeList: React.FC = ({ item, close, goToItem }) => { }, [episodes, item.Id]); return ( - - + {seasons && seasons.length > 0 && !episodesLoading && episodes && ( = ({ item, close, goToItem }) => { onPress={async () => { close(); }} - className='aspect-square flex flex-col bg-neutral-800/90 rounded-xl items-center justify-center p-2 ml-auto' + className='aspect-square flex flex-col rounded-xl items-center justify-center p-2 ml-auto' > - + @@ -274,6 +278,6 @@ export const EpisodeList: React.FC = ({ item, close, goToItem }) => { showsHorizontalScrollIndicator={false} /> )} - + ); }; diff --git a/components/video-player/controls/HeaderControls.tsx b/components/video-player/controls/HeaderControls.tsx index d8e4dcfe..11f3d360 100644 --- a/components/video-player/controls/HeaderControls.tsx +++ b/components/video-player/controls/HeaderControls.tsx @@ -3,25 +3,18 @@ import type { BaseItemDto, MediaSourceInfo, } from "@jellyfin/sdk/lib/generated-client"; -import { useRouter } from "expo-router"; -import { type Dispatch, type FC, type SetStateAction } from "react"; -import { - Platform, - TouchableOpacity, - useWindowDimensions, - View, -} from "react-native"; +import { type FC, useCallback, useState } from "react"; +import { Platform, TouchableOpacity, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; +import useRouter from "@/hooks/useAppRouter"; import { useHaptic } from "@/hooks/useHaptic"; -import { useSettings, VideoPlayer } from "@/utils/atoms/settings"; -import { ICON_SIZES } from "./constants"; -import { VideoProvider } from "./contexts/VideoContext"; +import { useOrientation } from "@/hooks/useOrientation"; +import { OrientationLock } from "@/packages/expo-screen-orientation"; +import { useSettings } from "@/utils/atoms/settings"; +import { HEADER_LAYOUT, ICON_SIZES } from "./constants"; import DropdownView from "./dropdown/DropdownView"; -import { type ScaleFactor, ScaleFactorSelector } from "./ScaleFactorSelector"; -import { - type AspectRatio, - AspectRatioSelector, -} from "./VideoScalingModeSelector"; +import { PlaybackSpeedScope } from "./utils/playback-speed-settings"; +import { ZoomToggle } from "./ZoomToggle"; interface HeaderControlsProps { item: BaseItemDto; @@ -34,17 +27,11 @@ interface HeaderControlsProps { goToNextItem: (options: { isAutoPlay?: boolean }) => void; previousItem?: BaseItemDto | null; nextItem?: BaseItemDto | null; - getAudioTracks?: (() => Promise) | (() => any[]); - getSubtitleTracks?: (() => Promise) | (() => any[]); - setAudioTrack?: (index: number) => void; - setSubtitleTrack?: (index: number) => void; - setSubtitleURL?: (url: string, customName: string) => void; - aspectRatio?: AspectRatio; - scaleFactor?: ScaleFactor; - setAspectRatio?: Dispatch>; - setScaleFactor?: Dispatch>; - setVideoAspectRatio?: (aspectRatio: string | null) => Promise; - setVideoScaleFactor?: (scaleFactor: number) => Promise; + isZoomedToFill?: boolean; + onZoomToggle?: () => void; + // Playback speed props + playbackSpeed?: number; + setPlaybackSpeed?: (speed: number, scope: PlaybackSpeedScope) => void; } export const HeaderControls: FC = ({ @@ -58,90 +45,102 @@ export const HeaderControls: FC = ({ goToNextItem, previousItem, nextItem, - getAudioTracks, - getSubtitleTracks, - setAudioTrack, - setSubtitleTrack, - setSubtitleURL, - aspectRatio = "default", - scaleFactor = 1.0, - setAspectRatio, - setScaleFactor, - setVideoAspectRatio, - setVideoScaleFactor, + isZoomedToFill = false, + onZoomToggle, + playbackSpeed = 1.0, + setPlaybackSpeed, }) => { const { settings } = useSettings(); const router = useRouter(); const insets = useSafeAreaInsets(); - const { width: screenWidth } = useWindowDimensions(); const lightHapticFeedback = useHaptic("light"); - - const handleAspectRatioChange = async (newRatio: AspectRatio) => { - if (!setAspectRatio || !setVideoAspectRatio) return; - - setAspectRatio(newRatio); - const aspectRatioString = newRatio === "default" ? null : newRatio; - await setVideoAspectRatio(aspectRatioString); - }; - - const handleScaleFactorChange = async (newScale: ScaleFactor) => { - if (!setScaleFactor || !setVideoScaleFactor) return; - - setScaleFactor(newScale); - await setVideoScaleFactor(newScale); - }; + const { orientation, lockOrientation } = useOrientation(); + const [isTogglingOrientation, setIsTogglingOrientation] = useState(false); const onClose = async () => { lightHapticFeedback(); router.back(); }; + const toggleOrientation = useCallback(async () => { + if (isTogglingOrientation) return; + + setIsTogglingOrientation(true); + lightHapticFeedback(); + + try { + const isPortrait = + orientation === OrientationLock.PORTRAIT_UP || + orientation === OrientationLock.PORTRAIT_DOWN; + + await lockOrientation( + isPortrait ? OrientationLock.LANDSCAPE : OrientationLock.PORTRAIT_UP, + ); + } finally { + setIsTogglingOrientation(false); + } + }, [ + orientation, + lockOrientation, + isTogglingOrientation, + lightHapticFeedback, + ]); + return ( {!Platform.isTV && (!offline || !mediaSource?.TranscodingUrl) && ( - - - - - + + + )} - {!Platform.isTV && - (settings.defaultPlayer === VideoPlayer.VLC_4 || - Platform.OS === "android") && ( - - - - )} + {!Platform.isTV && ( + + + + )} + {!Platform.isTV && startPictureInPicture && ( + + + + )} {item?.Type === "Episode" && ( = ({ /> )} - - {})} + disabled={!onZoomToggle} /> void; - disabled?: boolean; -} - -interface ScaleFactorOption { - id: ScaleFactor; - label: string; - description: string; -} - -const SCALE_FACTOR_OPTIONS: ScaleFactorOption[] = [ - { - id: 1.0, - label: "1.0x", - description: "Original size", - }, - { - id: 1.1, - label: "1.1x", - description: "10% larger", - }, - { - id: 1.2, - label: "1.2x", - description: "20% larger", - }, - { - id: 1.3, - label: "1.3x", - description: "30% larger", - }, - { - id: 1.4, - label: "1.4x", - description: "40% larger", - }, - { - id: 1.5, - label: "1.5x", - description: "50% larger", - }, - { - id: 1.6, - label: "1.6x", - description: "60% larger", - }, - { - id: 1.7, - label: "1.7x", - description: "70% larger", - }, - { - id: 1.8, - label: "1.8x", - description: "80% larger", - }, - { - id: 1.9, - label: "1.9x", - description: "90% larger", - }, - { - id: 2.0, - label: "2.0x", - description: "Double size", - }, -]; - -export const ScaleFactorSelector: React.FC = ({ - currentScale, - onScaleChange, - disabled = false, -}) => { - const lightHapticFeedback = useHaptic("light"); - - const handleScaleSelect = (scale: ScaleFactor) => { - onScaleChange(scale); - lightHapticFeedback(); - }; - - const optionGroups = useMemo(() => { - return [ - { - options: SCALE_FACTOR_OPTIONS.map((option) => ({ - type: "radio" as const, - label: option.label, - value: option.id, - selected: option.id === currentScale, - onPress: () => handleScaleSelect(option.id), - disabled, - })), - }, - ]; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [currentScale, disabled]); - - const trigger = useMemo( - () => ( - - - - ), - [disabled], - ); - - // Hide on TV platforms - if (Platform.isTV) return null; - - return ( - - ); -}; diff --git a/components/video-player/controls/TimeDisplay.tsx b/components/video-player/controls/TimeDisplay.tsx index 37ba755b..3f8cfd69 100644 --- a/components/video-player/controls/TimeDisplay.tsx +++ b/components/video-player/controls/TimeDisplay.tsx @@ -6,18 +6,20 @@ import { formatTimeString } from "@/utils/time"; interface TimeDisplayProps { currentTime: number; remainingTime: number; - isVlc: boolean; } +/** + * Displays current time and remaining time. + * MPV player uses milliseconds for time values. + */ export const TimeDisplay: FC = ({ currentTime, remainingTime, - isVlc, }) => { const getFinishTime = () => { const now = new Date(); - const remainingMs = isVlc ? remainingTime : remainingTime * 1000; - const finishTime = new Date(now.getTime() + remainingMs); + // remainingTime is in ms + const finishTime = new Date(now.getTime() + remainingTime); return finishTime.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", @@ -28,11 +30,11 @@ export const TimeDisplay: FC = ({ return ( - {formatTimeString(currentTime, isVlc ? "ms" : "s")} + {formatTimeString(currentTime, "ms")} - -{formatTimeString(remainingTime, isVlc ? "ms" : "s")} + -{formatTimeString(remainingTime, "ms")} ends at {getFinishTime()} diff --git a/components/video-player/controls/VideoScalingModeSelector.tsx b/components/video-player/controls/VideoScalingModeSelector.tsx deleted file mode 100644 index 2608f04d..00000000 --- a/components/video-player/controls/VideoScalingModeSelector.tsx +++ /dev/null @@ -1,105 +0,0 @@ -import { Ionicons } from "@expo/vector-icons"; -import React, { useMemo } from "react"; -import { Platform, View } from "react-native"; -import { - type OptionGroup, - PlatformDropdown, -} from "@/components/PlatformDropdown"; -import { useHaptic } from "@/hooks/useHaptic"; - -export type AspectRatio = "default" | "16:9" | "4:3" | "1:1" | "21:9"; - -interface AspectRatioSelectorProps { - currentRatio: AspectRatio; - onRatioChange: (ratio: AspectRatio) => void; - disabled?: boolean; -} - -interface AspectRatioOption { - id: AspectRatio; - label: string; - description: string; -} - -const ASPECT_RATIO_OPTIONS: AspectRatioOption[] = [ - { - id: "default", - label: "Original", - description: "Use video's original aspect ratio", - }, - { - id: "16:9", - label: "16:9", - description: "Widescreen (most common)", - }, - { - id: "4:3", - label: "4:3", - description: "Traditional TV format", - }, - { - id: "1:1", - label: "1:1", - description: "Square format", - }, - { - id: "21:9", - label: "21:9", - description: "Ultra-wide cinematic", - }, -]; - -export const AspectRatioSelector: React.FC = ({ - currentRatio, - onRatioChange, - disabled = false, -}) => { - const lightHapticFeedback = useHaptic("light"); - - const handleRatioSelect = (ratio: AspectRatio) => { - onRatioChange(ratio); - lightHapticFeedback(); - }; - - const optionGroups = useMemo(() => { - return [ - { - options: ASPECT_RATIO_OPTIONS.map((option) => ({ - type: "radio" as const, - label: option.label, - value: option.id, - selected: option.id === currentRatio, - onPress: () => handleRatioSelect(option.id), - disabled, - })), - }, - ]; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [currentRatio, disabled]); - - const trigger = useMemo( - () => ( - - - - ), - [disabled], - ); - - // Hide on TV platforms - if (Platform.isTV) return null; - - return ( - - ); -}; diff --git a/components/video-player/controls/ZoomToggle.tsx b/components/video-player/controls/ZoomToggle.tsx new file mode 100644 index 00000000..ede70401 --- /dev/null +++ b/components/video-player/controls/ZoomToggle.tsx @@ -0,0 +1,44 @@ +import { Ionicons } from "@expo/vector-icons"; +import React from "react"; +import { Platform, TouchableOpacity, View } from "react-native"; +import { useHaptic } from "@/hooks/useHaptic"; +import { ICON_SIZES } from "./constants"; + +interface ZoomToggleProps { + isZoomedToFill: boolean; + onToggle: () => void; + disabled?: boolean; +} + +export const ZoomToggle: React.FC = ({ + isZoomedToFill, + onToggle, + disabled = false, +}) => { + const lightHapticFeedback = useHaptic("light"); + + const handlePress = () => { + if (disabled) return; + lightHapticFeedback(); + onToggle(); + }; + + // Hide on TV platforms + if (Platform.isTV) return null; + + return ( + + + + + + ); +}; diff --git a/components/video-player/controls/constants.ts b/components/video-player/controls/constants.ts index afe57070..dc735cf9 100644 --- a/components/video-player/controls/constants.ts +++ b/components/video-player/controls/constants.ts @@ -15,3 +15,7 @@ export const ICON_SIZES = { HEADER: 24, CENTER: 50, } as const; + +export const HEADER_LAYOUT = { + CONTAINER_PADDING: 8, // p-2 = 8px (matches HeaderControls) +} as const; diff --git a/components/video-player/controls/contexts/ControlContext.tsx b/components/video-player/controls/contexts/ControlContext.tsx deleted file mode 100644 index c13211c9..00000000 --- a/components/video-player/controls/contexts/ControlContext.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import type { - BaseItemDto, - MediaSourceInfo, -} from "@jellyfin/sdk/lib/generated-client"; -import type React from "react"; -import { createContext, type ReactNode, useContext } from "react"; - -interface ControlContextProps { - item: BaseItemDto; - mediaSource: MediaSourceInfo | null | undefined; - isVideoLoaded: boolean | undefined; -} - -const ControlContext = createContext( - undefined, -); - -interface ControlProviderProps { - children: ReactNode; - item: BaseItemDto; - mediaSource: MediaSourceInfo | null | undefined; - isVideoLoaded: boolean | undefined; -} - -export const ControlProvider: React.FC = ({ - children, - item, - mediaSource, - isVideoLoaded, -}) => { - return ( - - {children} - - ); -}; - -export const useControlContext = () => { - const context = useContext(ControlContext); - if (context === undefined) { - throw new Error("useControlContext must be used within a ControlProvider"); - } - return context; -}; diff --git a/components/video-player/controls/contexts/PlayerContext.tsx b/components/video-player/controls/contexts/PlayerContext.tsx new file mode 100644 index 00000000..e3c87b78 --- /dev/null +++ b/components/video-player/controls/contexts/PlayerContext.tsx @@ -0,0 +1,118 @@ +import type { + BaseItemDto, + MediaSourceInfo, +} from "@jellyfin/sdk/lib/generated-client"; +import React, { + createContext, + type MutableRefObject, + type ReactNode, + useContext, + useMemo, +} from "react"; +import type { MpvPlayerViewRef } from "@/modules"; +import type { DownloadedItem } from "@/providers/Downloads/types"; + +interface PlayerContextProps { + playerRef: MutableRefObject; + item: BaseItemDto; + mediaSource: MediaSourceInfo | null | undefined; + isVideoLoaded: boolean; + tracksReady: boolean; + downloadedItem: DownloadedItem | null; +} + +const PlayerContext = createContext(undefined); + +interface PlayerProviderProps { + children: ReactNode; + playerRef: MutableRefObject; + item: BaseItemDto; + mediaSource: MediaSourceInfo | null | undefined; + isVideoLoaded: boolean; + tracksReady: boolean; + downloadedItem?: DownloadedItem | null; +} + +export const PlayerProvider: React.FC = ({ + children, + playerRef, + item, + mediaSource, + isVideoLoaded, + tracksReady, + downloadedItem = null, +}) => { + const value = useMemo( + () => ({ + playerRef, + item, + mediaSource, + isVideoLoaded, + tracksReady, + downloadedItem, + }), + [playerRef, item, mediaSource, isVideoLoaded, tracksReady, downloadedItem], + ); + + return ( + {children} + ); +}; + +// Core context hook +export const usePlayerContext = () => { + const context = useContext(PlayerContext); + if (!context) + throw new Error("usePlayerContext must be used within PlayerProvider"); + return context; +}; + +// Player controls hook - MPV player only +export const usePlayerControls = () => { + const { playerRef } = usePlayerContext(); + + return { + // Subtitle controls + getSubtitleTracks: async () => { + return playerRef.current?.getSubtitleTracks?.() ?? null; + }, + setSubtitleTrack: (trackId: number) => { + playerRef.current?.setSubtitleTrack?.(trackId); + }, + disableSubtitles: () => { + playerRef.current?.disableSubtitles?.(); + }, + addSubtitleFile: (url: string, select = true) => { + playerRef.current?.addSubtitleFile?.(url, select); + }, + + // Audio controls + getAudioTracks: async () => { + return playerRef.current?.getAudioTracks?.() ?? null; + }, + setAudioTrack: (trackId: number) => { + playerRef.current?.setAudioTrack?.(trackId); + }, + + // Playback controls + play: () => playerRef.current?.play?.(), + pause: () => playerRef.current?.pause?.(), + seekTo: (position: number) => playerRef.current?.seekTo?.(position), + seekBy: (offset: number) => playerRef.current?.seekBy?.(offset), + setSpeed: (speed: number) => playerRef.current?.setSpeed?.(speed), + + // Subtitle positioning + setSubtitleScale: (scale: number) => + playerRef.current?.setSubtitleScale?.(scale), + setSubtitlePosition: (position: number) => + playerRef.current?.setSubtitlePosition?.(position), + setSubtitleMarginY: (margin: number) => + playerRef.current?.setSubtitleMarginY?.(margin), + setSubtitleFontSize: (size: number) => + playerRef.current?.setSubtitleFontSize?.(size), + + // PiP + startPictureInPicture: () => playerRef.current?.startPictureInPicture?.(), + stopPictureInPicture: () => playerRef.current?.stopPictureInPicture?.(), + }; +}; diff --git a/components/video-player/controls/contexts/VideoContext.tsx b/components/video-player/controls/contexts/VideoContext.tsx index ed7fa1e0..ec9ca995 100644 --- a/components/video-player/controls/contexts/VideoContext.tsx +++ b/components/video-player/controls/contexts/VideoContext.tsx @@ -1,5 +1,53 @@ +/** + * VideoContext.tsx + * + * Manages subtitle and audio track state for the video player UI. + * + * ============================================================================ + * ARCHITECTURE + * ============================================================================ + * + * - Jellyfin is source of truth for subtitle list (embedded + external) + * - MPV only knows about: + * - Embedded subs it finds in the video stream + * - External subs we explicitly add via addSubtitleFile() + * - UI shows Jellyfin's complete list + * - On selection: either select embedded track or load external URL + * + * ============================================================================ + * INDEX TYPES + * ============================================================================ + * + * 1. SERVER INDEX (sub.Index / track.index) + * - Jellyfin's server-side stream index + * - Used to report playback state to Jellyfin server + * - Value of -1 means disabled/none + * + * 2. MPV INDEX (track.mpvIndex) + * - MPV's internal track ID + * - MPV orders tracks as: [all embedded, then all external] + * - IDs: 1..embeddedCount for embedded, embeddedCount+1.. for external + * - Value of -1 means track needs replacePlayer() (e.g., burned-in sub) + * + * ============================================================================ + * SUBTITLE HANDLING + * ============================================================================ + * + * Embedded (DeliveryMethod.Embed): + * - Already in MPV's track list + * - Select via setSubtitleTrack(mpvId) + * + * External (DeliveryMethod.External): + * - Loaded into MPV on video start + * - Select via setSubtitleTrack(embeddedCount + externalPosition + 1) + * + * Image-based during transcoding: + * - Burned into video by Jellyfin, not in MPV + * - Requires replacePlayer() to change + */ + import { SubtitleDeliveryMethod } from "@jellyfin/sdk/lib/generated-client"; -import { router, useLocalSearchParams } from "expo-router"; +import { useLocalSearchParams } from "expo-router"; import type React from "react"; import { createContext, @@ -9,52 +57,30 @@ import { useMemo, useState, } from "react"; -import type { TrackInfo } from "@/modules/VlcPlayer.types"; +import useRouter from "@/hooks/useAppRouter"; +import type { MpvAudioTrack } from "@/modules"; +import { useOfflineMode } from "@/providers/OfflineModeProvider"; +import { isImageBasedSubtitle } from "@/utils/jellyfin/subtitleUtils"; import type { Track } from "../types"; -import { useControlContext } from "./ControlContext"; +import { usePlayerContext, usePlayerControls } from "./PlayerContext"; interface VideoContextProps { - audioTracks: Track[] | null; subtitleTracks: Track[] | null; - setAudioTrack: ((index: number) => void) | undefined; - setSubtitleTrack: ((index: number) => void) | undefined; - setSubtitleURL: ((url: string, customName: string) => void) | undefined; + audioTracks: Track[] | null; } const VideoContext = createContext(undefined); -interface VideoProviderProps { - children: ReactNode; - getAudioTracks: - | (() => Promise) - | (() => TrackInfo[]) - | undefined; - getSubtitleTracks: - | (() => Promise) - | (() => TrackInfo[]) - | undefined; - setAudioTrack: ((index: number) => void) | undefined; - setSubtitleTrack: ((index: number) => void) | undefined; - setSubtitleURL: ((url: string, customName: string) => void) | undefined; -} - -export const VideoProvider: React.FC = ({ +export const VideoProvider: React.FC<{ children: ReactNode }> = ({ children, - getSubtitleTracks, - getAudioTracks, - setSubtitleTrack, - setSubtitleURL, - setAudioTrack, }) => { - const [audioTracks, setAudioTracks] = useState(null); const [subtitleTracks, setSubtitleTracks] = useState(null); + const [audioTracks, setAudioTracks] = useState(null); - const ControlContext = useControlContext(); - const isVideoLoaded = ControlContext?.isVideoLoaded; - const mediaSource = ControlContext?.mediaSource; - - const allSubs = - mediaSource?.MediaStreams?.filter((s) => s.Type === "Subtitle") || []; + const { tracksReady, mediaSource, downloadedItem } = usePlayerContext(); + const playerControls = usePlayerControls(); + const offline = useOfflineMode(); + const router = useRouter(); const { itemId, audioIndex, bitrateValue, subtitleIndex, playbackPosition } = useLocalSearchParams<{ @@ -66,185 +92,270 @@ export const VideoProvider: React.FC = ({ playbackPosition: string; }>(); - const onTextBasedSubtitle = useMemo(() => { - return ( - allSubs.find( - (s) => - s.Index?.toString() === subtitleIndex && - (s.DeliveryMethod === SubtitleDeliveryMethod.Embed || - s.DeliveryMethod === SubtitleDeliveryMethod.Hls || - s.DeliveryMethod === SubtitleDeliveryMethod.External), - ) || subtitleIndex === "-1" + const allSubs = + mediaSource?.MediaStreams?.filter((s) => s.Type === "Subtitle") || []; + const allAudio = + mediaSource?.MediaStreams?.filter((s) => s.Type === "Audio") || []; + + const isTranscoding = Boolean(mediaSource?.TranscodingUrl); + + /** + * Check if the currently selected subtitle is image-based. + * Used to determine if we need to refresh the player when changing subs. + */ + const isCurrentSubImageBased = useMemo(() => { + if (subtitleIndex === "-1") return false; + const currentSub = allSubs.find( + (s) => s.Index?.toString() === subtitleIndex, ); + return currentSub ? isImageBasedSubtitle(currentSub) : false; }, [allSubs, subtitleIndex]); - const setPlayerParams = ({ - chosenAudioIndex = audioIndex, - chosenSubtitleIndex = subtitleIndex, - }: { - chosenAudioIndex?: string; - chosenSubtitleIndex?: string; + /** + * Refresh the player with new parameters. + * This triggers Jellyfin to re-process the stream (e.g., burn in image subs). + */ + const replacePlayer = (params: { + audioIndex?: string; + subtitleIndex?: string; }) => { - console.log("chosenSubtitleIndex", chosenSubtitleIndex); const queryParams = new URLSearchParams({ itemId: itemId ?? "", - audioIndex: chosenAudioIndex, - subtitleIndex: chosenSubtitleIndex, + audioIndex: params.audioIndex ?? audioIndex, + subtitleIndex: params.subtitleIndex ?? subtitleIndex, mediaSourceId: mediaSource?.Id ?? "", bitrateValue: bitrateValue, playbackPosition: playbackPosition, }).toString(); - router.replace(`player/direct-player?${queryParams}` as any); }; - const setTrackParams = ( - type: "audio" | "subtitle", - index: number, - serverIndex: number, - ) => { - const setTrack = type === "audio" ? setAudioTrack : setSubtitleTrack; - const paramKey = type === "audio" ? "audioIndex" : "subtitleIndex"; - - // If we're transcoding and we're going from a image based subtitle - // to a text based subtitle, we need to change the player params. - - const shouldChangePlayerParams = - type === "subtitle" && - mediaSource?.TranscodingUrl && - !onTextBasedSubtitle; - - console.log("Set player params", index, serverIndex); - if (shouldChangePlayerParams) { - setPlayerParams({ - chosenSubtitleIndex: serverIndex.toString(), - }); - return; - } - setTrack?.(serverIndex); - router.setParams({ - [paramKey]: serverIndex.toString(), - }); - }; - + // Fetch tracks when ready useEffect(() => { + if (!tracksReady) return; + const fetchTracks = async () => { - if (getSubtitleTracks) { - let subtitleData: TrackInfo[] | null = null; - try { - subtitleData = await getSubtitleTracks(); - } catch (error) { - console.log("[VideoContext] Failed to get subtitle tracks:", error); - return; - } - // Only FOR VLC 3, If we're transcoding, we need to reverse the subtitle data, because VLC reverses the HLS subtitles. - if ( - mediaSource?.TranscodingUrl && - subtitleData && - subtitleData.length > 1 - ) { - subtitleData = [subtitleData[0], ...subtitleData.slice(1).reverse()]; - } + // Check if this is offline transcoded content + // For transcoded offline content, only ONE audio track exists in the file + const isOfflineTranscoded = + offline && downloadedItem?.userData?.isTranscoded === true; - let embedSubIndex = 1; - const processedSubs: Track[] = allSubs?.map((sub) => { - /** A boolean value determining if we should increment the embedSubIndex, currently only Embed and Hls subtitles are automatically added into VLC Player */ - const shouldIncrement = - sub.DeliveryMethod === SubtitleDeliveryMethod.Embed || - sub.DeliveryMethod === SubtitleDeliveryMethod.Hls || - sub.DeliveryMethod === SubtitleDeliveryMethod.External; - /** The index of subtitle inside VLC Player Itself */ - const vlcIndex = subtitleData?.at(embedSubIndex)?.index ?? -1; - if (shouldIncrement) embedSubIndex++; - return { - name: sub.DisplayTitle || "Undefined Subtitle", - index: sub.Index ?? -1, - setTrack: () => - shouldIncrement - ? setTrackParams("subtitle", vlcIndex, sub.Index ?? -1) - : setPlayerParams({ - chosenSubtitleIndex: sub.Index?.toString(), - }), - }; - }); - - // Step 3: Restore the original order - const subtitles: Track[] = processedSubs.sort( - (a, b) => a.index - b.index, + if (isOfflineTranscoded) { + // Build single audio track entry - only the downloaded track exists + const downloadedAudioIndex = downloadedItem.userData.audioStreamIndex; + const downloadedTrack = allAudio.find( + (a) => a.Index === downloadedAudioIndex, ); - // Add a "Disable Subtitles" option - subtitles.unshift({ + if (downloadedTrack) { + const audio: Track[] = [ + { + name: downloadedTrack.DisplayTitle || "Audio", + index: downloadedTrack.Index ?? 0, + mpvIndex: 1, // Only track in file (MPV uses 1-based indexing) + setTrack: () => { + // Track is already selected (only one available) + router.setParams({ audioIndex: String(downloadedTrack.Index) }); + }, + }, + ]; + setAudioTracks(audio); + } else { + // Fallback: show no audio tracks if the stored track wasn't found + setAudioTracks([]); + } + + // For subtitles in transcoded offline content: + // - Text-based subs may still be embedded + // - Image-based subs were burned in during transcoding + const downloadedSubtitleIndex = + downloadedItem.userData.subtitleStreamIndex; + const subs: Track[] = []; + + // Add "Disable" option + subs.push({ name: "Disable", index: -1, - setTrack: () => - !mediaSource?.TranscodingUrl || onTextBasedSubtitle - ? setTrackParams("subtitle", -1, -1) - : setPlayerParams({ chosenSubtitleIndex: "-1" }), - }); - setSubtitleTracks(subtitles); - } - if (getAudioTracks) { - let audioData: TrackInfo[] | null = null; - try { - audioData = await getAudioTracks(); - } catch (error) { - console.log("[VideoContext] Failed to get audio tracks:", error); - return; - } - const allAudio = - mediaSource?.MediaStreams?.filter((s) => s.Type === "Audio") || []; - const audioTracks: Track[] = allAudio?.map((audio, idx) => { - if (!mediaSource?.TranscodingUrl) { - const vlcIndex = audioData?.at(idx + 1)?.index ?? -1; - return { - name: audio.DisplayTitle ?? "Undefined Audio", - index: audio.Index ?? -1, - setTrack: () => - setTrackParams("audio", vlcIndex, audio.Index ?? -1), - }; - } - return { - name: audio.DisplayTitle ?? "Undefined Audio", - index: audio.Index ?? -1, - setTrack: () => - setPlayerParams({ chosenAudioIndex: audio.Index?.toString() }), - }; + mpvIndex: -1, + setTrack: () => { + playerControls.setSubtitleTrack(-1); + router.setParams({ subtitleIndex: "-1" }); + }, }); - // Add a "Disable Audio" option if its not transcoding. - if (!mediaSource?.TranscodingUrl) { - audioTracks.unshift({ - name: "Disable", - index: -1, - setTrack: () => setTrackParams("audio", -1, -1), - }); + // For text-based subs, they should still be available in the file + let subIdx = 1; + for (const sub of allSubs) { + if (sub.IsTextSubtitleStream) { + subs.push({ + name: sub.DisplayTitle || "Unknown", + index: sub.Index ?? -1, + mpvIndex: subIdx, + setTrack: () => { + playerControls.setSubtitleTrack(subIdx); + router.setParams({ subtitleIndex: String(sub.Index) }); + }, + }); + subIdx++; + } else if (sub.Index === downloadedSubtitleIndex) { + // This image-based sub was burned in - show it but indicate it's active + subs.push({ + name: `${sub.DisplayTitle || "Unknown"} (burned in)`, + index: sub.Index ?? -1, + mpvIndex: -1, // Can't be changed + setTrack: () => { + // Already burned in, just update params + router.setParams({ subtitleIndex: String(sub.Index) }); + }, + }); + } } - setAudioTracks(audioTracks); + + setSubtitleTracks(subs.sort((a, b) => a.index - b.index)); + return; } + + // MPV track handling + const audioData = await playerControls.getAudioTracks().catch(() => null); + const playerAudio = (audioData as MpvAudioTrack[]) ?? []; + + // Separate embedded vs external subtitles from Jellyfin's list + // MPV orders tracks as: [all embedded, then all external] + const embeddedSubs = allSubs.filter( + (s) => s.DeliveryMethod === SubtitleDeliveryMethod.Embed, + ); + const externalSubs = allSubs.filter( + (s) => s.DeliveryMethod === SubtitleDeliveryMethod.External, + ); + + // Count embedded subs that will be in MPV + // (excludes image-based subs during transcoding as they're burned in) + const embeddedInPlayer = embeddedSubs.filter( + (s) => !isTranscoding || !isImageBasedSubtitle(s), + ); + + const subs: Track[] = []; + + // Process all Jellyfin subtitles + for (const sub of allSubs) { + const isEmbedded = sub.DeliveryMethod === SubtitleDeliveryMethod.Embed; + const isExternal = + sub.DeliveryMethod === SubtitleDeliveryMethod.External; + + // For image-based subs during transcoding, need to refresh player + if (isTranscoding && isImageBasedSubtitle(sub)) { + subs.push({ + name: sub.DisplayTitle || "Unknown", + index: sub.Index ?? -1, + mpvIndex: -1, + setTrack: () => { + replacePlayer({ subtitleIndex: String(sub.Index) }); + }, + }); + continue; + } + + // Calculate MPV track ID based on type + // MPV IDs: [1..embeddedCount] for embedded, [embeddedCount+1..] for external + let mpvId = -1; + + if (isEmbedded) { + // Find position among embedded subs that are in player + const embeddedPosition = embeddedInPlayer.findIndex( + (s) => s.Index === sub.Index, + ); + if (embeddedPosition !== -1) { + mpvId = embeddedPosition + 1; // 1-based ID + } + } else if (isExternal) { + // Find position among external subs, offset by embedded count + const externalPosition = externalSubs.findIndex( + (s) => s.Index === sub.Index, + ); + if (externalPosition !== -1) { + mpvId = embeddedInPlayer.length + externalPosition + 1; + } + } + + subs.push({ + name: sub.DisplayTitle || "Unknown", + index: sub.Index ?? -1, + mpvIndex: mpvId, + setTrack: () => { + // Transcoding + switching to/from image-based sub + if ( + isTranscoding && + (isImageBasedSubtitle(sub) || isCurrentSubImageBased) + ) { + replacePlayer({ subtitleIndex: String(sub.Index) }); + return; + } + + // Direct switch in player + if (mpvId !== -1) { + playerControls.setSubtitleTrack(mpvId); + router.setParams({ subtitleIndex: String(sub.Index) }); + return; + } + + // Fallback - refresh player + replacePlayer({ subtitleIndex: String(sub.Index) }); + }, + }); + } + + // Add "Disable" option at the beginning + subs.unshift({ + name: "Disable", + index: -1, + mpvIndex: -1, + setTrack: () => { + if (isTranscoding && isCurrentSubImageBased) { + replacePlayer({ subtitleIndex: "-1" }); + } else { + playerControls.setSubtitleTrack(-1); + router.setParams({ subtitleIndex: "-1" }); + } + }, + }); + + // Process audio tracks + const audio: Track[] = allAudio.map((a, idx) => { + const playerTrack = playerAudio[idx]; + const mpvId = playerTrack?.id ?? idx + 1; + + return { + name: a.DisplayTitle || "Unknown", + index: a.Index ?? -1, + mpvIndex: mpvId, + setTrack: () => { + if (isTranscoding) { + replacePlayer({ audioIndex: String(a.Index) }); + return; + } + playerControls.setAudioTrack(mpvId); + router.setParams({ audioIndex: String(a.Index) }); + }, + }; + }); + + setSubtitleTracks(subs.sort((a, b) => a.index - b.index)); + setAudioTracks(audio); }; + fetchTracks(); - }, [isVideoLoaded, getAudioTracks, getSubtitleTracks]); + }, [tracksReady, mediaSource, offline, downloadedItem]); return ( - + {children} ); }; export const useVideoContext = () => { - const context = useContext(VideoContext); - if (context === undefined) { - throw new Error("useVideoContext must be used within a VideoProvider"); - } - return context; + const ctx = useContext(VideoContext); + if (!ctx) + throw new Error("useVideoContext must be used within VideoProvider"); + return ctx; }; diff --git a/components/video-player/controls/dropdown/DropdownView.tsx b/components/video-player/controls/dropdown/DropdownView.tsx index e1332e43..5d550218 100644 --- a/components/video-player/controls/dropdown/DropdownView.tsx +++ b/components/video-player/controls/dropdown/DropdownView.tsx @@ -1,26 +1,50 @@ import { Ionicons } from "@expo/vector-icons"; -import { useLocalSearchParams, useRouter } from "expo-router"; +import { useLocalSearchParams } from "expo-router"; import { useCallback, useMemo, useRef } from "react"; +import { useTranslation } from "react-i18next"; import { Platform, View } from "react-native"; import { BITRATES } from "@/components/BitrateSelector"; import { type OptionGroup, PlatformDropdown, } from "@/components/PlatformDropdown"; -import { useControlContext } from "../contexts/ControlContext"; +import { PLAYBACK_SPEEDS } from "@/components/PlaybackSpeedSelector"; +import useRouter from "@/hooks/useAppRouter"; +import { useOfflineMode } from "@/providers/OfflineModeProvider"; +import { useSettings } from "@/utils/atoms/settings"; +import { usePlayerContext } from "../contexts/PlayerContext"; import { useVideoContext } from "../contexts/VideoContext"; +import { PlaybackSpeedScope } from "../utils/playback-speed-settings"; -const DropdownView = () => { - const videoContext = useVideoContext(); - const { subtitleTracks, audioTracks } = videoContext; - const ControlContext = useControlContext(); - const [item, mediaSource] = [ - ControlContext?.item, - ControlContext?.mediaSource, - ]; +// Subtitle size presets (stored as scale * 100, so 1.0 = 100) +const SUBTITLE_SIZE_PRESETS = [ + { label: "0.5", value: 50 }, + { label: "0.6", value: 60 }, + { label: "0.7", value: 70 }, + { label: "0.8", value: 80 }, + { label: "0.9", value: 90 }, + { label: "1.0", value: 100 }, + { label: "1.1", value: 110 }, + { label: "1.2", value: 120 }, +] as const; + +interface DropdownViewProps { + playbackSpeed?: number; + setPlaybackSpeed?: (speed: number, scope: PlaybackSpeedScope) => void; +} + +const DropdownView = ({ + playbackSpeed = 1.0, + setPlaybackSpeed, +}: DropdownViewProps) => { + const { subtitleTracks, audioTracks } = useVideoContext(); + const { item, mediaSource } = usePlayerContext(); + const { settings, updateSettings } = useSettings(); const router = useRouter(); + const isOffline = useOfflineMode(); + const { t } = useTranslation(); - const { subtitleIndex, audioIndex, bitrateValue, playbackPosition, offline } = + const { subtitleIndex, audioIndex, bitrateValue, playbackPosition } = useLocalSearchParams<{ itemId: string; audioIndex: string; @@ -28,15 +52,12 @@ const DropdownView = () => { mediaSourceId: string; bitrateValue: string; playbackPosition: string; - offline: string; }>(); // Use ref to track playbackPosition without causing re-renders const playbackPositionRef = useRef(playbackPosition); playbackPositionRef.current = playbackPosition; - const isOffline = offline === "true"; - // Stabilize IDs to prevent unnecessary recalculations const itemIdRef = useRef(item.Id); const mediaSourceIdRef = useRef(mediaSource?.Id); @@ -100,6 +121,18 @@ const DropdownView = () => { onPress: () => sub.setTrack(), })), }); + + // Subtitle Size Section + groups.push({ + title: "Subtitle Size", + options: SUBTITLE_SIZE_PRESETS.map((preset) => ({ + type: "radio" as const, + label: preset.label, + value: preset.value.toString(), + selected: settings.subtitleSize === preset.value, + onPress: () => updateSettings({ subtitleSize: preset.value }), + })), + }); } // Audio Section @@ -116,6 +149,20 @@ const DropdownView = () => { }); } + // Speed Section + if (setPlaybackSpeed) { + groups.push({ + title: "Speed", + options: PLAYBACK_SPEEDS.map((speed) => ({ + type: "radio" as const, + label: speed.label, + value: speed.value.toString(), + selected: playbackSpeed === speed.value, + onPress: () => setPlaybackSpeed(speed.value, PlaybackSpeedScope.All), + })), + }); + } + return groups; // eslint-disable-next-line react-hooks/exhaustive-deps }, [ @@ -126,6 +173,10 @@ const DropdownView = () => { audioTracksKey, subtitleIndex, audioIndex, + settings.subtitleSize, + updateSettings, + playbackSpeed, + setPlaybackSpeed, // Note: subtitleTracks and audioTracks are intentionally excluded // because we use subtitleTracksKey and audioTracksKey for stability ]); @@ -145,9 +196,10 @@ const DropdownView = () => { return ( ; min: SharedValue; max: SharedValue; - isVlc: boolean; showControls: boolean; isPlaying: boolean; seek: (value: number) => void; @@ -34,11 +33,14 @@ interface UseRemoteControlProps { handleSeekBackward: (seconds: number) => void; } +/** + * Hook to manage TV remote control interactions. + * MPV player uses milliseconds for time values. + */ export function useRemoteControl({ progress, min, max, - isVlc, showControls, isPlaying, seek, @@ -61,21 +63,18 @@ export function useRemoteControl({ const longPressTimeoutRef = useRef | null>( null, ); - const SCRUB_INTERVAL = isVlc - ? CONTROLS_CONSTANTS.SCRUB_INTERVAL_MS - : CONTROLS_CONSTANTS.SCRUB_INTERVAL_TICKS; + // MPV uses ms + const SCRUB_INTERVAL = CONTROLS_CONSTANTS.SCRUB_INTERVAL_MS; - const updateTime = useCallback( - (progressValue: number) => { - const progressInTicks = isVlc ? msToTicks(progressValue) : progressValue; - const progressInSeconds = Math.floor(ticksToSeconds(progressInTicks)); - const hours = Math.floor(progressInSeconds / 3600); - const minutes = Math.floor((progressInSeconds % 3600) / 60); - const seconds = progressInSeconds % 60; - setTime({ hours, minutes, seconds }); - }, - [isVlc], - ); + const updateTime = useCallback((progressValue: number) => { + // Convert ms to ticks for calculation + const progressInTicks = msToTicks(progressValue); + const progressInSeconds = Math.floor(ticksToSeconds(progressInTicks)); + const hours = Math.floor(progressInSeconds / 3600); + const minutes = Math.floor((progressInSeconds % 3600) / 60); + const seconds = progressInSeconds % 60; + setTime({ hours, minutes, seconds }); + }, []); // TV remote control handling (no-op on non-TV platforms) useTVEventHandler((evt) => { @@ -102,7 +101,8 @@ export function useRemoteControl({ Math.min(max.value, base + direction * SCRUB_INTERVAL), ); remoteScrubProgress.value = updated; - const progressInTicks = isVlc ? msToTicks(updated) : updated; + // Convert ms to ticks for trickplay + const progressInTicks = msToTicks(updated); calculateTrickplayUrl(progressInTicks); updateTime(updated); break; @@ -111,9 +111,8 @@ export function useRemoteControl({ if (isRemoteScrubbing.value && remoteScrubProgress.value != null) { progress.value = remoteScrubProgress.value; - const seekTarget = isVlc - ? Math.max(0, remoteScrubProgress.value) - : Math.max(0, ticksToSeconds(remoteScrubProgress.value)); + // MPV uses ms, seek expects ms + const seekTarget = Math.max(0, remoteScrubProgress.value); seek(seekTarget); if (isPlaying) play(); diff --git a/components/video-player/controls/hooks/useVideoNavigation.ts b/components/video-player/controls/hooks/useVideoNavigation.ts index 0573d6e4..5468c790 100644 --- a/components/video-player/controls/hooks/useVideoNavigation.ts +++ b/components/video-player/controls/hooks/useVideoNavigation.ts @@ -3,20 +3,22 @@ import type { SharedValue } from "react-native-reanimated"; import { useHaptic } from "@/hooks/useHaptic"; import { useSettings } from "@/utils/atoms/settings"; import { writeToLog } from "@/utils/log"; -import { secondsToMs, ticksToSeconds } from "@/utils/time"; +import { secondsToMs } from "@/utils/time"; interface UseVideoNavigationProps { progress: SharedValue; isPlaying: boolean; - isVlc: boolean; seek: (value: number) => void; play: () => void; } +/** + * Hook to manage video navigation (seeking forward/backward). + * MPV player uses milliseconds for time values. + */ export function useVideoNavigation({ progress, isPlaying, - isVlc, seek, play, }: UseVideoNavigationProps) { @@ -30,16 +32,15 @@ export function useVideoNavigation({ try { const curr = progress.value; if (curr !== undefined) { - const newTime = isVlc - ? Math.max(0, curr - secondsToMs(seconds)) - : Math.max(0, ticksToSeconds(curr) - seconds); + // MPV uses ms + const newTime = Math.max(0, curr - secondsToMs(seconds)); seek(newTime); } } catch (error) { writeToLog("ERROR", "Error seeking video backwards", error); } }, - [isPlaying, isVlc, seek, progress], + [isPlaying, seek, progress], ); const handleSeekForward = useCallback( @@ -48,16 +49,15 @@ export function useVideoNavigation({ try { const curr = progress.value; if (curr !== undefined) { - const newTime = isVlc - ? curr + secondsToMs(seconds) - : ticksToSeconds(curr) + seconds; + // MPV uses ms + const newTime = curr + secondsToMs(seconds); seek(Math.max(0, newTime)); } } catch (error) { writeToLog("ERROR", "Error seeking video forwards", error); } }, - [isPlaying, isVlc, seek, progress], + [isPlaying, seek, progress], ); const handleSkipBackward = useCallback(async () => { @@ -69,9 +69,11 @@ export function useVideoNavigation({ try { const curr = progress.value; if (curr !== undefined) { - const newTime = isVlc - ? Math.max(0, curr - secondsToMs(settings.rewindSkipTime)) - : Math.max(0, ticksToSeconds(curr) - settings.rewindSkipTime); + // MPV uses ms + const newTime = Math.max( + 0, + curr - secondsToMs(settings.rewindSkipTime), + ); seek(newTime); if (wasPlayingRef.current) { play(); @@ -80,7 +82,7 @@ export function useVideoNavigation({ } catch (error) { writeToLog("ERROR", "Error seeking video backwards", error); } - }, [settings, isPlaying, isVlc, play, seek, progress, lightHapticFeedback]); + }, [settings, isPlaying, play, seek, progress, lightHapticFeedback]); const handleSkipForward = useCallback(async () => { if (!settings?.forwardSkipTime) { @@ -91,9 +93,8 @@ export function useVideoNavigation({ try { const curr = progress.value; if (curr !== undefined) { - const newTime = isVlc - ? curr + secondsToMs(settings.forwardSkipTime) - : ticksToSeconds(curr) + settings.forwardSkipTime; + // MPV uses ms + const newTime = curr + secondsToMs(settings.forwardSkipTime); seek(Math.max(0, newTime)); if (wasPlayingRef.current) { play(); @@ -102,7 +103,7 @@ export function useVideoNavigation({ } catch (error) { writeToLog("ERROR", "Error seeking video forwards", error); } - }, [settings, isPlaying, isVlc, play, seek, progress, lightHapticFeedback]); + }, [settings, isPlaying, play, seek, progress, lightHapticFeedback]); return { handleSeekBackward, diff --git a/components/video-player/controls/hooks/useVideoSlider.ts b/components/video-player/controls/hooks/useVideoSlider.ts index 85072954..dfc1164b 100644 --- a/components/video-player/controls/hooks/useVideoSlider.ts +++ b/components/video-player/controls/hooks/useVideoSlider.ts @@ -8,7 +8,6 @@ interface UseVideoSliderProps { progress: SharedValue; isSeeking: SharedValue; isPlaying: boolean; - isVlc: boolean; seek: (value: number) => void; play: () => void; pause: () => void; @@ -16,11 +15,14 @@ interface UseVideoSliderProps { showControls: boolean; } +/** + * Hook to manage video slider interactions. + * MPV player uses milliseconds for time values. + */ export function useVideoSlider({ progress, isSeeking, isPlaying, - isVlc, seek, play, pause, @@ -62,21 +64,20 @@ export function useVideoSlider({ setIsSliding(false); isSeeking.value = false; progress.value = value; - const seekValue = Math.max( - 0, - Math.floor(isVlc ? value : ticksToSeconds(value)), - ); + // MPV uses ms, seek expects ms + const seekValue = Math.max(0, Math.floor(value)); seek(seekValue); if (wasPlayingRef.current) { play(); } }, - [isVlc, seek, play, progress, isSeeking], + [seek, play, progress, isSeeking], ); const handleSliderChange = useCallback( debounce((value: number) => { - const progressInTicks = isVlc ? msToTicks(value) : value; + // Convert ms to ticks for trickplay + const progressInTicks = msToTicks(value); calculateTrickplayUrl(progressInTicks); const progressInSeconds = Math.floor(ticksToSeconds(progressInTicks)); const hours = Math.floor(progressInSeconds / 3600); @@ -84,7 +85,7 @@ export function useVideoSlider({ const seconds = progressInSeconds % 60; setTime({ hours, minutes, seconds }); }, CONTROLS_CONSTANTS.SLIDER_DEBOUNCE_MS), - [isVlc, calculateTrickplayUrl], + [calculateTrickplayUrl], ); return { diff --git a/components/video-player/controls/hooks/useVideoTime.ts b/components/video-player/controls/hooks/useVideoTime.ts index bb0fa77d..ad680081 100644 --- a/components/video-player/controls/hooks/useVideoTime.ts +++ b/components/video-player/controls/hooks/useVideoTime.ts @@ -4,21 +4,18 @@ import { type SharedValue, useAnimatedReaction, } from "react-native-reanimated"; -import { ticksToSeconds } from "@/utils/time"; interface UseVideoTimeProps { progress: SharedValue; max: SharedValue; isSeeking: SharedValue; - isVlc: boolean; } -export function useVideoTime({ - progress, - max, - isSeeking, - isVlc, -}: UseVideoTimeProps) { +/** + * Hook to manage video time display. + * MPV player uses milliseconds for time values. + */ +export function useVideoTime({ progress, max, isSeeking }: UseVideoTimeProps) { const [currentTime, setCurrentTime] = useState(0); const [remainingTime, setRemainingTime] = useState(Number.POSITIVE_INFINITY); @@ -27,19 +24,16 @@ export function useVideoTime({ const updateTimes = useCallback( (currentProgress: number, maxValue: number) => { - const current = isVlc ? currentProgress : ticksToSeconds(currentProgress); - const remaining = isVlc - ? maxValue - currentProgress - : ticksToSeconds(maxValue - currentProgress); + // MPV uses milliseconds + const current = currentProgress; + const remaining = maxValue - currentProgress; // Only update state if the displayed time actually changed (avoid sub-second updates) - const currentSeconds = Math.floor(current / (isVlc ? 1000 : 1)); - const remainingSeconds = Math.floor(remaining / (isVlc ? 1000 : 1)); - const lastCurrentSeconds = Math.floor( - lastCurrentTimeRef.current / (isVlc ? 1000 : 1), - ); + const currentSeconds = Math.floor(current / 1000); + const remainingSeconds = Math.floor(remaining / 1000); + const lastCurrentSeconds = Math.floor(lastCurrentTimeRef.current / 1000); const lastRemainingSeconds = Math.floor( - lastRemainingTimeRef.current / (isVlc ? 1000 : 1), + lastRemainingTimeRef.current / 1000, ); if ( @@ -52,7 +46,7 @@ export function useVideoTime({ lastRemainingTimeRef.current = remaining; } }, - [isVlc], + [], ); useAnimatedReaction( diff --git a/components/video-player/controls/hooks/useVolumeAndBrightness.ts b/components/video-player/controls/hooks/useVolumeAndBrightness.ts index 2863949b..c3ad0fa7 100644 --- a/components/video-player/controls/hooks/useVolumeAndBrightness.ts +++ b/components/video-player/controls/hooks/useVolumeAndBrightness.ts @@ -34,6 +34,7 @@ export const useVolumeAndBrightness = ({ const initialVolume = useRef(null); const initialBrightness = useRef(null); const dragStartY = useRef(null); + const brightnessSupported = useRef(true); const startVolumeDrag = useCallback(async (startY: number) => { if (Platform.isTV || !VolumeManager) return; @@ -88,20 +89,26 @@ export const useVolumeAndBrightness = ({ }, []); const startBrightnessDrag = useCallback(async (startY: number) => { - if (Platform.isTV || !Brightness) return; + if (Platform.isTV || !Brightness || !brightnessSupported.current) return; try { const brightness = await Brightness.getBrightnessAsync(); initialBrightness.current = brightness; dragStartY.current = startY; } catch (error) { - console.error("Error starting brightness drag:", error); + console.warn("Brightness not supported on this device:", error); + brightnessSupported.current = false; } }, []); const updateBrightnessDrag = useCallback( async (deltaY: number) => { - if (Platform.isTV || !Brightness || initialBrightness.current === null) + if ( + Platform.isTV || + !Brightness || + initialBrightness.current === null || + !brightnessSupported.current + ) return; try { @@ -118,7 +125,8 @@ export const useVolumeAndBrightness = ({ const brightnessPercent = Math.round(newBrightness * 100); onBrightnessChange?.(brightnessPercent); } catch (error) { - console.error("Error updating brightness:", error); + console.warn("Brightness not supported on this device:", error); + brightnessSupported.current = false; } }, [onBrightnessChange], diff --git a/components/video-player/controls/types.ts b/components/video-player/controls/types.ts index f6c0e00a..5ec03edd 100644 --- a/components/video-player/controls/types.ts +++ b/components/video-player/controls/types.ts @@ -20,6 +20,7 @@ type TranscodedSubtitle = { type Track = { name: string; index: number; + mpvIndex?: number; setTrack: () => void; }; diff --git a/components/video-player/controls/useControlsTimeout.ts b/components/video-player/controls/useControlsTimeout.ts index 80d41af2..9bbd8138 100644 --- a/components/video-player/controls/useControlsTimeout.ts +++ b/components/video-player/controls/useControlsTimeout.ts @@ -1,4 +1,4 @@ -import { useEffect, useRef } from "react"; +import { useCallback, useEffect, useRef } from "react"; interface UseControlsTimeoutProps { showControls: boolean; @@ -6,6 +6,7 @@ interface UseControlsTimeoutProps { episodeView: boolean; onHideControls: () => void; timeout?: number; + disabled?: boolean; } export const useControlsTimeout = ({ @@ -14,6 +15,7 @@ export const useControlsTimeout = ({ episodeView, onHideControls, timeout = 10000, + disabled = false, }: UseControlsTimeoutProps) => { const controlsTimeoutRef = useRef | null>(null); @@ -23,7 +25,7 @@ export const useControlsTimeout = ({ clearTimeout(controlsTimeoutRef.current); } - if (showControls && !isSliding && !episodeView) { + if (!disabled && showControls && !isSliding && !episodeView) { controlsTimeoutRef.current = setTimeout(() => { onHideControls(); }, timeout); @@ -37,18 +39,18 @@ export const useControlsTimeout = ({ clearTimeout(controlsTimeoutRef.current); } }; - }, [showControls, isSliding, episodeView, timeout, onHideControls]); + }, [showControls, isSliding, episodeView, timeout, onHideControls, disabled]); - const handleControlsInteraction = () => { - if (showControls) { - if (controlsTimeoutRef.current) { - clearTimeout(controlsTimeoutRef.current); - } - controlsTimeoutRef.current = setTimeout(() => { - onHideControls(); - }, timeout); + const handleControlsInteraction = useCallback(() => { + if (disabled || !showControls) return; + + if (controlsTimeoutRef.current) { + clearTimeout(controlsTimeoutRef.current); } - }; + controlsTimeoutRef.current = setTimeout(() => { + onHideControls(); + }, timeout); + }, [disabled, showControls, onHideControls, timeout]); return { handleControlsInteraction, diff --git a/components/video-player/controls/utils/playback-speed-settings.ts b/components/video-player/controls/utils/playback-speed-settings.ts new file mode 100644 index 00000000..772737f9 --- /dev/null +++ b/components/video-player/controls/utils/playback-speed-settings.ts @@ -0,0 +1,98 @@ +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; +import type { Settings } from "@/utils/atoms/settings"; + +export enum PlaybackSpeedScope { + Media = "media", + Show = "show", + All = "all", +} + +interface ClearConflictingSettingsResult { + readonly updatedPerMedia: Settings["playbackSpeedPerMedia"]; + readonly updatedPerShow: Settings["playbackSpeedPerShow"]; +} + +/** + * Clears conflicting playback speed settings based on the selected scope. + * + * When setting a playback speed at a certain scope, this function removes + * any more specific settings that would override the new setting: + * - "all" scope: clears both media-specific and show-specific settings + * - "media" scope: clears show-specific settings + * - "show" scope: clears media-specific settings + */ +export const clearConflictingSettings = ( + scope: PlaybackSpeedScope, + item: BaseItemDto | undefined, + perMedia: Settings["playbackSpeedPerMedia"], + perShow: Settings["playbackSpeedPerShow"], +): ClearConflictingSettingsResult => { + const updatedPerMedia = { ...perMedia }; + const updatedPerShow = { ...perShow }; + + if (scope === "all") { + // Clear both media-specific and show-specific settings + if (item?.Id && updatedPerMedia[item.Id] !== undefined) { + delete updatedPerMedia[item.Id]; + } + if (item?.SeriesId && updatedPerShow[item.SeriesId] !== undefined) { + delete updatedPerShow[item.SeriesId]; + } + } else if (scope === "media") { + // Clear show-specific setting only + if (item?.SeriesId && updatedPerShow[item.SeriesId] !== undefined) { + delete updatedPerShow[item.SeriesId]; + } + } else if (scope === "show") { + // Clear media-specific setting only + if (item?.Id && updatedPerMedia[item.Id] !== undefined) { + delete updatedPerMedia[item.Id]; + } + } + + return { updatedPerMedia, updatedPerShow }; +}; + +/** + * Updates playback speed settings based on the selected scope and speed. + * + * This function handles both clearing conflicting settings and updating + * the appropriate setting based on the scope: + * - "all": updates the default playback speed + * - "media": sets a speed for the specific media item + * - "show": sets a speed for the entire show + */ +export const updatePlaybackSpeedSettings = ( + speed: number, + scope: PlaybackSpeedScope, + item: BaseItemDto | undefined, + settings: Settings, + updateSettings: (updates: Partial) => void, +): void => { + const { updatedPerMedia, updatedPerShow } = clearConflictingSettings( + scope, + item, + settings.playbackSpeedPerMedia, + settings.playbackSpeedPerShow, + ); + + if (scope === "all") { + updateSettings({ + defaultPlaybackSpeed: speed, + playbackSpeedPerMedia: updatedPerMedia, + playbackSpeedPerShow: updatedPerShow, + }); + } else if (scope === "media" && item?.Id) { + updatedPerMedia[item.Id] = speed; + updateSettings({ + playbackSpeedPerMedia: updatedPerMedia, + playbackSpeedPerShow: updatedPerShow, + }); + } else if (scope === "show" && item?.SeriesId) { + updatedPerShow[item.SeriesId] = speed; + updateSettings({ + playbackSpeedPerShow: updatedPerShow, + playbackSpeedPerMedia: updatedPerMedia, + }); + } +}; diff --git a/components/vlc/VideoDebugInfo.tsx b/components/vlc/VideoDebugInfo.tsx deleted file mode 100644 index 40b74b6d..00000000 --- a/components/vlc/VideoDebugInfo.tsx +++ /dev/null @@ -1,94 +0,0 @@ -import type React from "react"; -import { useEffect, useState } from "react"; -import { useTranslation } from "react-i18next"; -import { TouchableOpacity, View, type ViewProps } from "react-native"; -import { useSafeAreaInsets } from "react-native-safe-area-context"; -import type { TrackInfo, VlcPlayerViewRef } from "@/modules/VlcPlayer.types"; -import { Text } from "../common/Text"; - -interface Props extends ViewProps { - playerRef: React.RefObject; -} - -export const VideoDebugInfo: React.FC = ({ playerRef, ...props }) => { - const [audioTracks, setAudioTracks] = useState(null); - const [subtitleTracks, setSubtitleTracks] = useState( - null, - ); - - useEffect(() => { - const fetchTracks = async () => { - if (playerRef.current) { - try { - const audio = await playerRef.current.getAudioTracks(); - const subtitles = await playerRef.current.getSubtitleTracks(); - setAudioTracks(audio); - setSubtitleTracks(subtitles); - } catch (error) { - console.log("[VideoDebugInfo] Failed to fetch tracks:", error); - } - } - }; - - fetchTracks(); - }, [playerRef]); - - const insets = useSafeAreaInsets(); - - const { t } = useTranslation(); - - return ( - - {t("player.playback_state")} - {t("player.audio_tracks")} - {audioTracks?.map((track, index) => ( - - {track.name} ({t("player.index")} {track.index}) - - ))} - {t("player.subtitles_tracks")} - {subtitleTracks?.map((track, index) => ( - - {track.name} ({t("player.index")} {track.index}) - - ))} - { - if (playerRef.current) { - playerRef.current - .getAudioTracks() - .then(setAudioTracks) - .catch((err) => { - console.log( - "[VideoDebugInfo] Failed to get audio tracks:", - err, - ); - }); - playerRef.current - .getSubtitleTracks() - .then(setSubtitleTracks) - .catch((err) => { - console.log( - "[VideoDebugInfo] Failed to get subtitle tracks:", - err, - ); - }); - } - }} - > - - {t("player.refresh_tracks")} - - - - ); -}; diff --git a/components/watchlists/WatchlistSheet.tsx b/components/watchlists/WatchlistSheet.tsx new file mode 100644 index 00000000..9d585909 --- /dev/null +++ b/components/watchlists/WatchlistSheet.tsx @@ -0,0 +1,318 @@ +import { Ionicons } from "@expo/vector-icons"; +import { + BottomSheetBackdrop, + type BottomSheetBackdropProps, + BottomSheetModal, + BottomSheetView, +} from "@gorhom/bottom-sheet"; +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import React, { + forwardRef, + useCallback, + useImperativeHandle, + useMemo, + useRef, +} from "react"; +import { useTranslation } from "react-i18next"; +import { + ActivityIndicator, + StyleSheet, + TouchableOpacity, + View, +} from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; +import { Text } from "@/components/common/Text"; +import useRouter from "@/hooks/useAppRouter"; +import { + useAddToWatchlist, + useRemoveFromWatchlist, +} from "@/hooks/useWatchlistMutations"; +import { + useItemInWatchlists, + useMyWatchlistsQuery, +} from "@/hooks/useWatchlists"; +import type { StreamystatsWatchlist } from "@/utils/streamystats/types"; + +export interface WatchlistSheetRef { + open: (item: BaseItemDto) => void; + close: () => void; +} + +interface WatchlistRowProps { + watchlist: StreamystatsWatchlist; + isInWatchlist: boolean; + isCompatible: boolean; + onToggle: () => void; + isLoading: boolean; +} + +const WatchlistRow: React.FC = ({ + watchlist, + isInWatchlist, + isCompatible, + onToggle, + isLoading, +}) => { + const disabled = !isCompatible && !isInWatchlist; + + return ( + + + + + {watchlist.name} + + {watchlist.allowedItemType && ( + + + {watchlist.allowedItemType} + + + )} + + {watchlist.description && ( + + {watchlist.description} + + )} + + {watchlist.itemCount ?? 0} items + + + + {isLoading ? ( + + ) : isInWatchlist ? ( + + ) : isCompatible ? ( + + ) : ( + + )} + + + ); +}; + +interface WatchlistSheetContentProps { + item: BaseItemDto; + onClose: () => void; +} + +const WatchlistSheetContent: React.FC = ({ + item, + onClose, +}) => { + const { t } = useTranslation(); + const router = useRouter(); + const insets = useSafeAreaInsets(); + + const { data: myWatchlists, isLoading: watchlistsLoading } = + useMyWatchlistsQuery(); + const { data: watchlistsContainingItem, isLoading: checkingLoading } = + useItemInWatchlists(item.Id); + + const addToWatchlist = useAddToWatchlist(); + const removeFromWatchlist = useRemoveFromWatchlist(); + + const isLoading = watchlistsLoading || checkingLoading; + + // Sort watchlists: ones containing item first, then compatible ones, then incompatible + const sortedWatchlists = useMemo(() => { + if (!myWatchlists) return []; + + return [...myWatchlists].sort((a, b) => { + const aInWatchlist = watchlistsContainingItem?.includes(a.id) ?? false; + const bInWatchlist = watchlistsContainingItem?.includes(b.id) ?? false; + + const aCompatible = !a.allowedItemType || a.allowedItemType === item.Type; + const bCompatible = !b.allowedItemType || b.allowedItemType === item.Type; + + // Items in watchlist first + if (aInWatchlist && !bInWatchlist) return -1; + if (!aInWatchlist && bInWatchlist) return 1; + + // Then compatible items + if (aCompatible && !bCompatible) return -1; + if (!aCompatible && bCompatible) return 1; + + // Then alphabetically + return a.name.localeCompare(b.name); + }); + }, [myWatchlists, watchlistsContainingItem, item.Type]); + + const handleToggle = useCallback( + async (watchlist: StreamystatsWatchlist) => { + if (!item.Id) return; + + const isInWatchlist = watchlistsContainingItem?.includes(watchlist.id); + + if (isInWatchlist) { + await removeFromWatchlist.mutateAsync({ + watchlistId: watchlist.id, + itemId: item.Id, + watchlistName: watchlist.name, + }); + } else { + await addToWatchlist.mutateAsync({ + watchlistId: watchlist.id, + itemId: item.Id, + watchlistName: watchlist.name, + }); + } + }, + [item.Id, watchlistsContainingItem, addToWatchlist, removeFromWatchlist], + ); + + const handleCreateNew = useCallback(() => { + onClose(); + router.push("/(auth)/(tabs)/(watchlists)/create"); + }, [onClose, router]); + + const isItemCompatible = useCallback( + (watchlist: StreamystatsWatchlist) => { + if (!watchlist.allowedItemType) return true; + return watchlist.allowedItemType === item.Type; + }, + [item.Type], + ); + + if (isLoading) { + return ( + + + {t("watchlists.loading")} + + ); + } + + return ( + + {/* Header */} + + + {t("watchlists.select_watchlist")} + + + {item.Name} + + + + {/* Watchlist List */} + {sortedWatchlists.length === 0 ? ( + + + + {t("watchlists.empty_title")} + + + {t("watchlists.empty_description")} + + + ) : ( + + {sortedWatchlists.map((watchlist, index) => ( + + handleToggle(watchlist)} + isLoading={ + addToWatchlist.isPending || removeFromWatchlist.isPending + } + /> + {index < sortedWatchlists.length - 1 && ( + + )} + + ))} + + )} + + {/* Create New Button */} + + + + {t("watchlists.create_new")} + + + + ); +}; + +export const WatchlistSheet = forwardRef( + (_props, ref) => { + const bottomSheetModalRef = useRef(null); + const [currentItem, setCurrentItem] = React.useState( + null, + ); + const insets = useSafeAreaInsets(); + + useImperativeHandle(ref, () => ({ + open: (item: BaseItemDto) => { + setCurrentItem(item); + bottomSheetModalRef.current?.present(); + }, + close: () => { + bottomSheetModalRef.current?.dismiss(); + }, + })); + + const handleClose = useCallback(() => { + bottomSheetModalRef.current?.dismiss(); + }, []); + + const renderBackdrop = useCallback( + (props: BottomSheetBackdropProps) => ( + + ), + [], + ); + + return ( + + + {currentItem && ( + + )} + + + ); + }, +); diff --git a/constants/Languages.ts b/constants/Languages.ts deleted file mode 100644 index 8014e380..00000000 --- a/constants/Languages.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { DefaultLanguageOption } from "@/utils/atoms/settings"; - -export const LANGUAGES: DefaultLanguageOption[] = [ - { label: "English", value: "eng" }, - { label: "Spanish", value: "spa" }, - { label: "Chinese (Mandarin)", value: "cmn" }, - { label: "Hindi", value: "hin" }, - { label: "Arabic", value: "ara" }, - { label: "French", value: "fra" }, - { label: "Russian", value: "rus" }, - { label: "Portuguese", value: "por" }, - { label: "Japanese", value: "jpn" }, - { label: "German", value: "deu" }, - { label: "Italian", value: "ita" }, - { label: "Korean", value: "kor" }, - { label: "Turkish", value: "tur" }, - { label: "Dutch", value: "nld" }, - { label: "Polish", value: "pol" }, - { label: "Vietnamese", value: "vie" }, - { label: "Thai", value: "tha" }, - { label: "Indonesian", value: "ind" }, - { label: "Greek", value: "ell" }, - { label: "Swedish", value: "swe" }, - { label: "Danish", value: "dan" }, - { label: "Norwegian", value: "nor" }, - { label: "Finnish", value: "fin" }, - { label: "Czech", value: "ces" }, - { label: "Hungarian", value: "hun" }, - { label: "Romanian", value: "ron" }, - { label: "Ukrainian", value: "ukr" }, - { label: "Hebrew", value: "heb" }, - { label: "Bengali", value: "ben" }, - { label: "Punjabi", value: "pan" }, - { label: "Tagalog", value: "tgl" }, - { label: "Swahili", value: "swa" }, - { label: "Malay", value: "msa" }, - { label: "Persian", value: "fas" }, - { label: "Urdu", value: "urd" }, -]; diff --git a/constants/SubtitleConstants.ts b/constants/SubtitleConstants.ts deleted file mode 100644 index 7fc7a8e6..00000000 --- a/constants/SubtitleConstants.ts +++ /dev/null @@ -1,45 +0,0 @@ -export type VLCColor = - | "Black" - | "Gray" - | "Silver" - | "White" - | "Maroon" - | "Red" - | "Fuchsia" - | "Yellow" - | "Olive" - | "Green" - | "Teal" - | "Lime" - | "Purple" - | "Navy" - | "Blue" - | "Aqua"; - -export type OutlineThickness = "None" | "Thin" | "Normal" | "Thick"; - -export const VLC_COLORS: Record = { - Black: 0, - Gray: 8421504, - Silver: 12632256, - White: 16777215, - Maroon: 8388608, - Red: 16711680, - Fuchsia: 16711935, - Yellow: 16776960, - Olive: 8421376, - Green: 32768, - Teal: 32896, - Lime: 65280, - Purple: 8388736, - Navy: 128, - Blue: 255, - Aqua: 65535, -}; - -export const OUTLINE_THICKNESS: Record = { - None: 0, - Thin: 2, - Normal: 4, - Thick: 6, -}; diff --git a/constants/Values.ts b/constants/Values.ts deleted file mode 100644 index 4c3e4d81..00000000 --- a/constants/Values.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Platform } from "react-native"; - -export const TAB_HEIGHT = Platform.OS === "android" ? 58 : 74; diff --git a/crowdin.yml b/crowdin.yml index 38b86bcd..b5d27968 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,12 +1,10 @@ -"project_id_env": "CROWDIN_PROJECT_ID" -"api_token_env": "CROWDIN_PERSONAL_TOKEN" -"base_path": "." - -"preserve_hierarchy": true - -"files": [ - { - "source": "translations/en.json", - "translation": "translations/%two_letters_code%.json" - } -] \ No newline at end of file +project_id_env: CROWDIN_PROJECT_ID +api_token_env: CROWDIN_PERSONAL_TOKEN +base_path: . +preserve_hierarchy: 1 +files: + - source: translations/en.json + translation: translations/%two_letters_code%.json + skip_untranslated_strings: false + skip_untranslated_files: false + export_only_approved: false diff --git a/docs/jellyfin-openapi-stable.json b/docs/jellyfin-openapi-stable.json new file mode 100644 index 00000000..728a442b --- /dev/null +++ b/docs/jellyfin-openapi-stable.json @@ -0,0 +1,69435 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Jellyfin API", + "version": "10.11.5", + "x-jellyfin-version": "10.11.5" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/System/ActivityLog/Entries": { + "get": { + "tags": [ + "ActivityLog" + ], + "summary": "Gets activity log entries.", + "operationId": "GetLogEntries", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minDate", + "in": "query", + "description": "Optional. The minimum date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasUserId", + "in": "query", + "description": "Optional. Filter log entries if it has user id, or not.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Activity log returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActivityLogEntryQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ActivityLogEntryQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ActivityLogEntryQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Auth/Keys": { + "get": { + "tags": [ + "ApiKey" + ], + "summary": "Get all keys.", + "operationId": "GetKeys", + "responses": { + "200": { + "description": "Api keys retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationInfoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationInfoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationInfoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "ApiKey" + ], + "summary": "Create a new api key.", + "operationId": "CreateKey", + "parameters": [ + { + "name": "app", + "in": "query", + "description": "Name of the app using the authentication key.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Api key created." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Auth/Keys/{key}": { + "delete": { + "tags": [ + "ApiKey" + ], + "summary": "Remove an api key.", + "operationId": "RevokeKey", + "parameters": [ + { + "name": "key", + "in": "path", + "description": "The access token to delete.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Api key deleted." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Artists": { + "get": { + "tags": [ + "Artists" + ], + "summary": "Gets all artists from a given item, folder, or the entire library.", + "operationId": "GetArtists", + "parameters": [ + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Artists returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{name}": { + "get": { + "tags": [ + "Artists" + ], + "summary": "Gets an artist by name.", + "operationId": "GetArtistByName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Artist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/AlbumArtists": { + "get": { + "tags": [ + "Artists" + ], + "summary": "Gets all album artists from a given item, folder, or the entire library.", + "operationId": "GetAlbumArtists", + "parameters": [ + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Album artists returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/stream": { + "get": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "GetAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The audio container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "HeadAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The audio container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Audio/{itemId}/stream.{container}": { + "get": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "GetAudioStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The audio container.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Audio" + ], + "summary": "Gets an audio stream.", + "operationId": "HeadAudioStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The audio container.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Backup": { + "get": { + "tags": [ + "Backup" + ], + "summary": "Gets a list of all currently present backups in the backup directory.", + "operationId": "ListBackups", + "responses": { + "200": { + "description": "Backups available.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BackupManifestDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BackupManifestDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BackupManifestDto" + } + } + } + } + }, + "403": { + "description": "User does not have permission to retrieve information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Backup/Create": { + "post": { + "tags": [ + "Backup" + ], + "summary": "Creates a new Backup.", + "operationId": "CreateBackup", + "requestBody": { + "description": "The backup options.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupOptionsDto" + } + ], + "description": "Defines the optional contents of the backup archive." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupOptionsDto" + } + ], + "description": "Defines the optional contents of the backup archive." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupOptionsDto" + } + ], + "description": "Defines the optional contents of the backup archive." + } + } + } + }, + "responses": { + "200": { + "description": "Backup created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BackupManifestDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BackupManifestDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BackupManifestDto" + } + } + } + }, + "403": { + "description": "User does not have permission to retrieve information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Backup/Manifest": { + "get": { + "tags": [ + "Backup" + ], + "summary": "Gets the descriptor from an existing archive is present.", + "operationId": "GetBackup", + "parameters": [ + { + "name": "path", + "in": "query", + "description": "The data to start a restore process.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Backup archive manifest.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BackupManifestDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BackupManifestDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BackupManifestDto" + } + } + } + }, + "204": { + "description": "Not a valid jellyfin Archive." + }, + "404": { + "description": "Not a valid path.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User does not have permission to retrieve information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Backup/Restore": { + "post": { + "tags": [ + "Backup" + ], + "summary": "Restores to a backup by restarting the server and applying the backup.", + "operationId": "StartRestoreBackup", + "requestBody": { + "description": "The data to start a restore process.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupRestoreRequestDto" + } + ], + "description": "Defines properties used to start a restore process." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupRestoreRequestDto" + } + ], + "description": "Defines properties used to start a restore process." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupRestoreRequestDto" + } + ], + "description": "Defines properties used to start a restore process." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Backup restore started." + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User does not have permission to retrieve information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Branding/Configuration": { + "get": { + "tags": [ + "Branding" + ], + "summary": "Gets branding configuration.", + "operationId": "GetBrandingOptions", + "responses": { + "200": { + "description": "Branding configuration returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BrandingOptionsDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BrandingOptionsDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BrandingOptionsDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Branding/Css": { + "get": { + "tags": [ + "Branding" + ], + "summary": "Gets branding css.", + "operationId": "GetBrandingCss", + "responses": { + "200": { + "description": "Branding css returned.", + "content": { + "text/css": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "204": { + "description": "No branding css configured." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Branding/Css.css": { + "get": { + "tags": [ + "Branding" + ], + "summary": "Gets branding css.", + "operationId": "GetBrandingCss_2", + "responses": { + "200": { + "description": "Branding css returned.", + "content": { + "text/css": { + "schema": { + "type": "string" + } + }, + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "204": { + "description": "No branding css configured." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Channels": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Gets available channels.", + "operationId": "GetChannels", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User Id to filter by. Use System.Guid.Empty to not filter by user.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "supportsLatestItems", + "in": "query", + "description": "Optional. Filter by channels that support getting latest items.", + "schema": { + "type": "boolean" + } + }, + { + "name": "supportsMediaDeletion", + "in": "query", + "description": "Optional. Filter by channels that support media deletion.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional. Filter by channels that are favorite.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Channels returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/{channelId}/Features": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Get channel features.", + "operationId": "GetChannelFeatures", + "parameters": [ + { + "name": "channelId", + "in": "path", + "description": "Channel id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Channel features returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChannelFeatures" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelFeatures" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/{channelId}/Items": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Get channel items.", + "operationId": "GetChannelItems", + "parameters": [ + { + "name": "channelId", + "in": "path", + "description": "Channel Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "folderId", + "in": "query", + "description": "Optional. Folder Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Channel items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/Features": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Get all channel features.", + "operationId": "GetAllChannelFeatures", + "responses": { + "200": { + "description": "All channel features returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelFeatures" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Channels/Items/Latest": { + "get": { + "tags": [ + "Channels" + ], + "summary": "Gets latest channel items.", + "operationId": "GetLatestChannelItems", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "channelIds", + "in": "query", + "description": "Optional. Specify one or more channel id's, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "200": { + "description": "Latest channel items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/ClientLog/Document": { + "post": { + "tags": [ + "ClientLog" + ], + "summary": "Upload a document.", + "operationId": "LogFile", + "requestBody": { + "content": { + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "200": { + "description": "Document saved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientLogDocumentResponseDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ClientLogDocumentResponseDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ClientLogDocumentResponseDto" + } + } + } + }, + "403": { + "description": "Event logging disabled.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "413": { + "description": "Upload size too large.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Collections": { + "post": { + "tags": [ + "Collection" + ], + "summary": "Creates a new collection.", + "operationId": "CreateCollection", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the collection.", + "schema": { + "type": "string" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item Ids to add to the collection.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Create the collection within a specific folder.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isLocked", + "in": "query", + "description": "Whether or not to lock the new collection.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Collection created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionCreationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/CollectionCreationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/CollectionCreationResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "CollectionManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Collections/{collectionId}/Items": { + "post": { + "tags": [ + "Collection" + ], + "summary": "Adds items to a collection.", + "operationId": "AddToCollection", + "parameters": [ + { + "name": "collectionId", + "in": "path", + "description": "The collection id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item ids, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Items added to collection." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "CollectionManagement", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Collection" + ], + "summary": "Removes items from a collection.", + "operationId": "RemoveFromCollection", + "parameters": [ + { + "name": "collectionId", + "in": "path", + "description": "The collection id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item ids, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Items removed from collection." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "CollectionManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Configuration": { + "get": { + "tags": [ + "Configuration" + ], + "summary": "Gets application configuration.", + "operationId": "GetConfiguration", + "responses": { + "200": { + "description": "Application configuration returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServerConfiguration" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ServerConfiguration" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ServerConfiguration" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Configuration" + ], + "summary": "Updates application configuration.", + "operationId": "UpdateConfiguration", + "requestBody": { + "description": "Configuration.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServerConfiguration" + } + ], + "description": "Represents the server configuration." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServerConfiguration" + } + ], + "description": "Represents the server configuration." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ServerConfiguration" + } + ], + "description": "Represents the server configuration." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Configuration updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Configuration/{key}": { + "get": { + "tags": [ + "Configuration" + ], + "summary": "Gets a named configuration.", + "operationId": "GetNamedConfiguration", + "parameters": [ + { + "name": "key", + "in": "path", + "description": "Configuration key.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Configuration returned.", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Configuration" + ], + "summary": "Updates named configuration.", + "operationId": "UpdateNamedConfiguration", + "parameters": [ + { + "name": "key", + "in": "path", + "description": "Configuration key.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Configuration.", + "content": { + "application/json": { + "schema": { } + }, + "text/json": { + "schema": { } + }, + "application/*+json": { + "schema": { } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Named configuration updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Configuration/Branding": { + "post": { + "tags": [ + "Configuration" + ], + "summary": "Updates branding configuration.", + "operationId": "UpdateBrandingConfiguration", + "requestBody": { + "description": "Branding configuration.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BrandingOptionsDto" + } + ], + "description": "The branding options DTO for API use.\r\nThis DTO excludes SplashscreenLocation to prevent it from being updated via API." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BrandingOptionsDto" + } + ], + "description": "The branding options DTO for API use.\r\nThis DTO excludes SplashscreenLocation to prevent it from being updated via API." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BrandingOptionsDto" + } + ], + "description": "The branding options DTO for API use.\r\nThis DTO excludes SplashscreenLocation to prevent it from being updated via API." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Branding configuration updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Configuration/MetadataOptions/Default": { + "get": { + "tags": [ + "Configuration" + ], + "summary": "Gets a default MetadataOptions object.", + "operationId": "GetDefaultMetadataOptions", + "responses": { + "200": { + "description": "Metadata options returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataOptions" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataOptions" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataOptions" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/web/ConfigurationPage": { + "get": { + "tags": [ + "Dashboard" + ], + "summary": "Gets a dashboard configuration page.", + "operationId": "GetDashboardConfigurationPage", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the page.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "ConfigurationPage returned.", + "content": { + "text/html": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "application/x-javascript": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Plugin configuration page not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/web/ConfigurationPages": { + "get": { + "tags": [ + "Dashboard" + ], + "summary": "Gets the configuration pages.", + "operationId": "GetConfigurationPages", + "parameters": [ + { + "name": "enableInMainMenu", + "in": "query", + "description": "Whether to enable in the main menu.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "ConfigurationPages returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigurationPageInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigurationPageInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConfigurationPageInfo" + } + } + } + } + }, + "404": { + "description": "Server still loading.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Devices": { + "get": { + "tags": [ + "Devices" + ], + "summary": "Get Devices.", + "operationId": "GetDevices", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Gets or sets the user identifier.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Devices retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "Devices" + ], + "summary": "Deletes a device.", + "operationId": "DeleteDevice", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Device deleted." + }, + "404": { + "description": "Device not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Devices/Info": { + "get": { + "tags": [ + "Devices" + ], + "summary": "Get info for a device.", + "operationId": "GetDeviceInfo", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Device info retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceInfoDto" + } + } + } + }, + "404": { + "description": "Device not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Devices/Options": { + "get": { + "tags": [ + "Devices" + ], + "summary": "Get options for a device.", + "operationId": "GetDeviceOptions", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Device options retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + } + } + }, + "404": { + "description": "Device not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Devices" + ], + "summary": "Update device options.", + "operationId": "UpdateDeviceOptions", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Device Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Device Options.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + ], + "description": "A dto representing custom options for a device." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + ], + "description": "A dto representing custom options for a device." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceOptionsDto" + } + ], + "description": "A dto representing custom options for a device." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Device options updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/DisplayPreferences/{displayPreferencesId}": { + "get": { + "tags": [ + "DisplayPreferences" + ], + "summary": "Get Display Preferences.", + "operationId": "GetDisplayPreferences", + "parameters": [ + { + "name": "displayPreferencesId", + "in": "path", + "description": "Display preferences id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "client", + "in": "query", + "description": "Client.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Display preferences retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "DisplayPreferences" + ], + "summary": "Update Display Preferences.", + "operationId": "UpdateDisplayPreferences", + "parameters": [ + { + "name": "displayPreferencesId", + "in": "path", + "description": "Display preferences id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "client", + "in": "query", + "description": "Client.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "New Display Preferences object.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + ], + "description": "Defines the display preferences for any item that supports them (usually Folders)." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + ], + "description": "Defines the display preferences for any item that supports them (usually Folders)." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DisplayPreferencesDto" + } + ], + "description": "Defines the display preferences for any item that supports them (usually Folders)." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Display preferences updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/hls1/{playlistId}/{segmentId}.{container}": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video stream using HTTP live streaming.", + "operationId": "GetHlsAudioSegment", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "runtimeTicks", + "in": "query", + "description": "The position of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "actualSegmentLengthTicks", + "in": "query", + "description": "The length of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/main.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets an audio stream using HTTP live streaming.", + "operationId": "GetVariantHlsAudioPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/master.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets an audio hls playlist stream.", + "operationId": "GetMasterHlsAudioPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "head": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets an audio hls playlist stream.", + "operationId": "HeadMasterHlsAudioPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video stream using HTTP live streaming.", + "operationId": "GetHlsVideoSegment", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "runtimeTicks", + "in": "query", + "description": "The position of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "actualSegmentLengthTicks", + "in": "query", + "description": "The length of the requested segment in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The desired segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/live.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a hls live stream.", + "operationId": "GetLiveHlsStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The audio container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The max width.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The max height.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableSubtitlesInManifest", + "in": "query", + "description": "Optional. Whether to enable subtitles in the manifest.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Hls live stream retrieved.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/main.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video stream using HTTP live streaming.", + "operationId": "GetVariantHlsVideoPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/master.m3u8": { + "get": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video hls playlist stream.", + "operationId": "GetMasterHlsVideoPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableTrickplay", + "in": "query", + "description": "Enable trickplay image playlists being added to master playlist.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "head": { + "tags": [ + "DynamicHls" + ], + "summary": "Gets a video hls playlist stream.", + "operationId": "HeadMasterHlsVideoPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAdaptiveBitrateStreaming", + "in": "query", + "description": "Enable adaptive bitrate streaming.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableTrickplay", + "in": "query", + "description": "Enable trickplay image playlists being added to master playlist.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Whether to always burn in subtitles when transcoding.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/DefaultDirectoryBrowser": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Get Default directory browser.", + "operationId": "GetDefaultDirectoryBrowser", + "responses": { + "200": { + "description": "Default directory browser returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultDirectoryBrowserInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/DefaultDirectoryBrowserInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/DefaultDirectoryBrowserInfoDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/DirectoryContents": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets the contents of a given directory in the file system.", + "operationId": "GetDirectoryContents", + "parameters": [ + { + "name": "path", + "in": "query", + "description": "The path.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "includeFiles", + "in": "query", + "description": "An optional filter to include or exclude files from the results. true/false.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "includeDirectories", + "in": "query", + "description": "An optional filter to include or exclude folders from the results. true/false.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Directory contents returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/Drives": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets available drives from the server's file system.", + "operationId": "GetDrives", + "responses": { + "200": { + "description": "List of entries returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/NetworkShares": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets network paths.", + "operationId": "GetNetworkShares", + "responses": { + "200": { + "description": "Empty array returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemEntryInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/ParentPath": { + "get": { + "tags": [ + "Environment" + ], + "summary": "Gets the parent path of a given path.", + "operationId": "GetParentPath", + "parameters": [ + { + "name": "path", + "in": "query", + "description": "The path.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Environment/ValidatePath": { + "post": { + "tags": [ + "Environment" + ], + "summary": "Validates path.", + "operationId": "ValidatePath", + "requestBody": { + "description": "Validate request object.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatePathDto" + } + ], + "description": "Validate path object." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatePathDto" + } + ], + "description": "Validate path object." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ValidatePathDto" + } + ], + "description": "Validate path object." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Path validated." + }, + "404": { + "description": "Path not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Filters": { + "get": { + "tags": [ + "Filter" + ], + "summary": "Gets legacy query filters.", + "operationId": "GetQueryFiltersLegacy", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Parent id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional. Filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + } + ], + "responses": { + "200": { + "description": "Legacy filters retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryFiltersLegacy" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFiltersLegacy" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFiltersLegacy" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Filters2": { + "get": { + "tags": [ + "Filter" + ], + "summary": "Gets query filters.", + "operationId": "GetQueryFilters", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isAiring", + "in": "query", + "description": "Optional. Is item airing.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Is item movie.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Is item sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Is item kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Is item news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Is item series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "recursive", + "in": "query", + "description": "Optional. Search recursive.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Filters retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryFilters" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFilters" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QueryFilters" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Genres": { + "get": { + "tags": [ + "Genres" + ], + "summary": "Gets all genres from a given item, folder, or the entire library.", + "operationId": "GetGenres", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Include total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Genres returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Genres/{genreName}": { + "get": { + "tags": [ + "Genres" + ], + "summary": "Gets a genre, by name.", + "operationId": "GetGenre", + "parameters": [ + { + "name": "genreName", + "in": "path", + "description": "The genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Genres returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/hls/{segmentId}/stream.aac": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets the specified audio segment for an audio item.", + "operationId": "GetHlsAudioSegmentLegacyAac", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls audio segment returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Audio/{itemId}/hls/{segmentId}/stream.mp3": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets the specified audio segment for an audio item.", + "operationId": "GetHlsAudioSegmentLegacyMp3", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls audio segment returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Videos/{itemId}/hls/{playlistId}/{segmentId}.{segmentContainer}": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets a hls video segment.", + "operationId": "GetHlsVideoSegmentLegacy", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentId", + "in": "path", + "description": "The segment id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "path", + "description": "The segment container.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls video segment returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Hls segment not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Videos/{itemId}/hls/{playlistId}/stream.m3u8": { + "get": { + "tags": [ + "HlsSegment" + ], + "summary": "Gets a hls video playlist.", + "operationId": "GetHlsPlaylistLegacy", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The video id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Hls video playlist returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/ActiveEncodings": { + "delete": { + "tags": [ + "HlsSegment" + ], + "summary": "Stops an active encoding.", + "operationId": "StopEncodingProcess", + "parameters": [ + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Encoding stopped successfully." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get artist image by name.", + "operationId": "GetArtistImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Artist name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get artist image by name.", + "operationId": "HeadArtistImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Artist name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Branding/Splashscreen": { + "get": { + "tags": [ + "Image" + ], + "summary": "Generates or gets the splashscreen.", + "operationId": "GetSplashscreen", + "parameters": [ + { + "name": "tag", + "in": "query", + "description": "Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + } + ], + "responses": { + "200": { + "description": "Splashscreen returned successfully.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "post": { + "tags": [ + "Image" + ], + "summary": "Uploads a custom splashscreen.\r\nThe body is expected to the image contents base64 encoded.", + "operationId": "UploadCustomSplashscreen", + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Successfully uploaded new splashscreen." + }, + "400": { + "description": "Error reading MimeType from uploaded image.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User does not have permission to upload splashscreen..", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete a custom splashscreen.", + "operationId": "DeleteCustomSplashscreen", + "responses": { + "204": { + "description": "Successfully deleted the custom splashscreen." + }, + "403": { + "description": "User does not have permission to delete splashscreen.." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Genres/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "GetGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "HeadGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Genres/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "GetGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get genre image by name.", + "operationId": "HeadGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Items/{itemId}/Images": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get item image infos.", + "operationId": "GetItemImageInfos", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item images returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Images/{imageType}": { + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete an item's image.", + "operationId": "DeleteItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "The image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Image deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Image" + ], + "summary": "Set item image.", + "operationId": "SetItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + } + ], + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Image saved." + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "get": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "GetItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "HeadItemImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Items/{itemId}/Images/{imageType}/{imageIndex}": { + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete an item's image.", + "operationId": "DeleteItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "The image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Image deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Image" + ], + "summary": "Set item image.", + "operationId": "SetItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "(Unused) Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Image saved." + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "get": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "GetItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "HeadItemImageByIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "GetItemImage2", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "path", + "description": "The maximum image width to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "path", + "description": "The maximum image height to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "path", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "path", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "required": true, + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ], + "description": "Enum ImageOutputFormat." + } + }, + { + "name": "percentPlayed", + "in": "path", + "description": "Optional. Percent to render for the percent played overlay.", + "required": true, + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "path", + "description": "Optional. Unplayed count overlay to render.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Gets the item's image.", + "operationId": "HeadItemImage2", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "maxWidth", + "in": "path", + "description": "The maximum image width to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "path", + "description": "The maximum image height to return.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "path", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "path", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "required": true, + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ], + "description": "Enum ImageOutputFormat." + } + }, + { + "name": "percentPlayed", + "in": "path", + "description": "Optional. Percent to render for the percent played overlay.", + "required": true, + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "path", + "description": "Optional. Unplayed count overlay to render.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Items/{itemId}/Images/{imageType}/{imageIndex}/Index": { + "post": { + "tags": [ + "Image" + ], + "summary": "Updates the index for an item image.", + "operationId": "UpdateItemImageIndex", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Old image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "newIndex", + "in": "query", + "description": "New image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Image index updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/MusicGenres/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "GetMusicGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "HeadMusicGenreImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/MusicGenres/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "GetMusicGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get music genre image by name.", + "operationId": "HeadMusicGenreImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Music genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Persons/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "GetPersonImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "HeadPersonImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Persons/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "GetPersonImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get person image by name.", + "operationId": "HeadPersonImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Studios/{name}/Images/{imageType}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "GetStudioImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "HeadStudioImage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + }, + { + "name": "imageIndex", + "in": "query", + "description": "Image index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Studios/{name}/Images/{imageType}/{imageIndex}": { + "get": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "GetStudioImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get studio image by name.", + "operationId": "HeadStudioImageByIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "imageType", + "in": "path", + "description": "Image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageIndex", + "in": "path", + "description": "Image index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "The maximum image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "The maximum image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "percentPlayed", + "in": "query", + "description": "Optional. Percent to render for the percent played overlay.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "unplayedCount", + "in": "query", + "description": "Optional. Unplayed count overlay to render.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "width", + "in": "query", + "description": "The fixed image width to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "The fixed image height to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "quality", + "in": "query", + "description": "Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillWidth", + "in": "query", + "description": "Width of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fillHeight", + "in": "query", + "description": "Height of box to fill.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "blur", + "in": "query", + "description": "Optional. Blur image.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "backgroundColor", + "in": "query", + "description": "Optional. Apply a background color for transparent images.", + "schema": { + "type": "string" + } + }, + { + "name": "foregroundLayer", + "in": "query", + "description": "Optional. Apply a foreground layer on top of the image.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/UserImage": { + "post": { + "tags": [ + "Image" + ], + "summary": "Sets the user image.", + "operationId": "PostUserImage", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "204": { + "description": "Image updated." + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User does not have permission to delete the image.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Image" + ], + "summary": "Delete the user's image.", + "operationId": "DeleteUserImage", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Image deleted." + }, + "403": { + "description": "User does not have permission to delete the image.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "get": { + "tags": [ + "Image" + ], + "summary": "Get user profile image.", + "operationId": "GetUserImage", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "400": { + "description": "User id not provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Image" + ], + "summary": "Get user profile image.", + "operationId": "HeadUserImage", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "tag", + "in": "query", + "description": "Optional. Supply the cache tag from the item object to receive strong caching headers.", + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "Determines the output format of the image - original,gif,jpg,png.", + "schema": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageFormat" + } + ] + } + } + ], + "responses": { + "200": { + "description": "Image stream returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "400": { + "description": "User id not provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Albums/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given album.", + "operationId": "GetInstantMixFromAlbum", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given artist.", + "operationId": "GetInstantMixFromArtists", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given artist.", + "operationId": "GetInstantMixFromArtists2", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given item.", + "operationId": "GetInstantMixFromItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres/{name}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given genre.", + "operationId": "GetInstantMixFromMusicGenreByName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given genre.", + "operationId": "GetInstantMixFromMusicGenreById", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given playlist.", + "operationId": "GetInstantMixFromPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Songs/{itemId}/InstantMix": { + "get": { + "tags": [ + "InstantMix" + ], + "summary": "Creates an instant playlist based on a given song.", + "operationId": "GetInstantMixFromSong", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Instant playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ExternalIdInfos": { + "get": { + "tags": [ + "ItemLookup" + ], + "summary": "Get the item's external id info.", + "operationId": "GetExternalIdInfos", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "External id info retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Apply/{itemId}": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Applies search criteria to an item and refreshes metadata.", + "operationId": "ApplySearchCriteria", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "replaceAllImages", + "in": "query", + "description": "Optional. Whether or not to replace all images. Default: True.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "requestBody": { + "description": "The remote search result.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Item metadata refreshed." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Book": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get book remote search.", + "operationId": "GetBookRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Book remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/BoxSet": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get box set remote search.", + "operationId": "GetBoxSetRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Box set remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Movie": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get movie remote search.", + "operationId": "GetMovieRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Movie remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/MusicAlbum": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get music album remote search.", + "operationId": "GetMusicAlbumRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Music album remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/MusicArtist": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get music artist remote search.", + "operationId": "GetMusicArtistRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Music artist remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/MusicVideo": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get music video remote search.", + "operationId": "GetMusicVideoRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Music video remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Person": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get person remote search.", + "operationId": "GetPersonRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Person remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Series": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get series remote search.", + "operationId": "GetSeriesRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Series remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/RemoteSearch/Trailer": { + "post": { + "tags": [ + "ItemLookup" + ], + "summary": "Get trailer remote search.", + "operationId": "GetTrailerRemoteSearchResults", + "requestBody": { + "description": "Remote search query.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfoRemoteSearchQuery" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfoRemoteSearchQuery" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfoRemoteSearchQuery" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Trailer remote search executed.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Refresh": { + "post": { + "tags": [ + "ItemRefresh" + ], + "summary": "Refreshes metadata for an item.", + "operationId": "RefreshItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "metadataRefreshMode", + "in": "query", + "description": "(Optional) Specifies the metadata refresh mode.", + "schema": { + "enum": [ + "None", + "ValidationOnly", + "Default", + "FullRefresh" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MetadataRefreshMode" + } + ], + "default": "None" + } + }, + { + "name": "imageRefreshMode", + "in": "query", + "description": "(Optional) Specifies the image refresh mode.", + "schema": { + "enum": [ + "None", + "ValidationOnly", + "Default", + "FullRefresh" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MetadataRefreshMode" + } + ], + "default": "None" + } + }, + { + "name": "replaceAllMetadata", + "in": "query", + "description": "(Optional) Determines if metadata should be replaced. Only applicable if mode is FullRefresh.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "replaceAllImages", + "in": "query", + "description": "(Optional) Determines if images should be replaced. Only applicable if mode is FullRefresh.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "regenerateTrickplay", + "in": "query", + "description": "(Optional) Determines if trickplay images should be replaced. Only applicable if mode is FullRefresh.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Item metadata refresh queued." + }, + "404": { + "description": "Item to refresh not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Items": { + "get": { + "tags": [ + "Items" + ], + "summary": "Gets items based on a query.", + "operationId": "GetItems", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id supplied as query parameter; this is required when not using an API key.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "maxOfficialRating", + "in": "query", + "description": "Optional filter by maximum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "hasThemeSong", + "in": "query", + "description": "Optional filter by items with theme songs.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasThemeVideo", + "in": "query", + "description": "Optional filter by items with theme videos.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSubtitles", + "in": "query", + "description": "Optional filter by items with subtitles.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSpecialFeature", + "in": "query", + "description": "Optional filter by items with special features.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTrailer", + "in": "query", + "description": "Optional filter by items with trailers.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "indexNumber", + "in": "query", + "description": "Optional filter by index number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "parentIndexNumber", + "in": "query", + "description": "Optional filter by parent index number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "hasParentalRating", + "in": "query", + "description": "Optional filter by items that have or do not have a parental rating.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isHd", + "in": "query", + "description": "Optional filter by items that are HD or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "is4K", + "in": "query", + "description": "Optional filter by items that are 4K or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "locationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "excludeLocationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isUnaired", + "in": "query", + "description": "Optional filter by items that are unaired episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minCriticRating", + "in": "query", + "description": "Optional filter by minimum critic rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minPremiereDate", + "in": "query", + "description": "Optional. The minimum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSaved", + "in": "query", + "description": "Optional. The minimum last saved date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSavedForUser", + "in": "query", + "description": "Optional. The minimum last saved date for the current user. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "maxPremiereDate", + "in": "query", + "description": "Optional. The maximum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasOverview", + "in": "query", + "description": "Optional filter by items that have an overview or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasImdbId", + "in": "query", + "description": "Optional filter by items that have an IMDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTmdbId", + "in": "query", + "description": "Optional filter by items that have a TMDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTvdbId", + "in": "query", + "description": "Optional filter by items that have a TVDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional filter for live tv movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional filter for live tv series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional filter for live tv news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional filter for live tv kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional filter for live tv sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "excludeItemIds", + "in": "query", + "description": "Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "recursive", + "in": "query", + "description": "When searching within folders, this determines whether or not the search will be recursive. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Filter based on a search term.", + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "imageTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "isPlayed", + "in": "query", + "description": "Optional filter by items that are played, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "artists", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "artistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albumArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified album artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "contributingArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified contributing artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albums", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "albumIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "ids", + "in": "query", + "description": "Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "videoTypes", + "in": "query", + "description": "Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VideoType" + } + } + }, + { + "name": "minOfficialRating", + "in": "query", + "description": "Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "isLocked", + "in": "query", + "description": "Optional filter by items that are locked.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isPlaceHolder", + "in": "query", + "description": "Optional filter by items that are placeholders.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasOfficialRating", + "in": "query", + "description": "Optional filter by items that have official ratings.", + "schema": { + "type": "boolean" + } + }, + { + "name": "collapseBoxSetItems", + "in": "query", + "description": "Whether or not to hide items behind their boxsets.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minWidth", + "in": "query", + "description": "Optional. Filter by the minimum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minHeight", + "in": "query", + "description": "Optional. Filter by the minimum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. Filter by the maximum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. Filter by the maximum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "is3D", + "in": "query", + "description": "Optional filter by items that are 3D, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesStatus", + "in": "query", + "description": "Optional filter by Series Status. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SeriesStatus" + } + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Enable the total record count.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Library" + ], + "summary": "Deletes items from the library and filesystem.", + "operationId": "DeleteItems", + "parameters": [ + { + "name": "ids", + "in": "query", + "description": "The item ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Items deleted." + }, + "401": { + "description": "Unauthorized access.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserItems/{itemId}/UserData": { + "get": { + "tags": [ + "Items" + ], + "summary": "Get Item User Data.", + "operationId": "GetItemUserData", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "return item user data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "404": { + "description": "Item is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Items" + ], + "summary": "Update Item User Data.", + "operationId": "UpdateItemUserData", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "New user data object.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserItemDataDto" + } + ], + "description": "This is used by the api to get information about a item user data." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserItemDataDto" + } + ], + "description": "This is used by the api to get information about a item user data." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserItemDataDto" + } + ], + "description": "This is used by the api to get information about a item user data." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "return updated user item data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "404": { + "description": "Item is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserItems/Resume": { + "get": { + "tags": [ + "Items" + ], + "summary": "Gets items based on a query.", + "operationId": "GetResumeItems", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "The start index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "The item limit.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional. Filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Enable the total record count.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "excludeActiveSessions", + "in": "query", + "description": "Optional. Whether to exclude the currently active sessions.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}": { + "post": { + "tags": [ + "ItemUpdate" + ], + "summary": "Updates an item.", + "operationId": "UpdateItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The new item properties.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Item updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "Library" + ], + "summary": "Deletes an item from the library and filesystem.", + "operationId": "DeleteItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Item deleted." + }, + "401": { + "description": "Unauthorized access.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets an item from a user's library.", + "operationId": "GetItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ContentType": { + "post": { + "tags": [ + "ItemUpdate" + ], + "summary": "Updates an item's content type.", + "operationId": "UpdateItemContentType", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "contentType", + "in": "query", + "description": "The content type of the item.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Item content type updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Items/{itemId}/MetadataEditor": { + "get": { + "tags": [ + "ItemUpdate" + ], + "summary": "Gets metadata editor info for an item.", + "operationId": "GetMetadataEditorInfo", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item metadata editor returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataEditorInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataEditorInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/MetadataEditorInfo" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Albums/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarAlbums", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Artists/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarArtists", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Ancestors": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets all parents of an item.", + "operationId": "GetAncestors", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item parents returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/CriticReviews": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets critic review for an item.", + "operationId": "GetCriticReviews", + "parameters": [ + { + "name": "itemId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Critic reviews returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Download": { + "get": { + "tags": [ + "Library" + ], + "summary": "Downloads item media.", + "operationId": "GetDownload", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Media downloaded.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "Download", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/File": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get the original file of an item.", + "operationId": "GetFile", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "File stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarItems", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ThemeMedia": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get theme songs and videos for an item.", + "operationId": "GetThemeMedia", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "inheritFromParent", + "in": "query", + "description": "Optional. Determines whether or not parent items should be searched for theme media.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + } + ], + "responses": { + "200": { + "description": "Theme songs and videos returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AllThemeMediaResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AllThemeMediaResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AllThemeMediaResult" + } + } + } + }, + "404": { + "description": "Item not found." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ThemeSongs": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get theme songs for an item.", + "operationId": "GetThemeSongs", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "inheritFromParent", + "in": "query", + "description": "Optional. Determines whether or not parent items should be searched for theme media.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + } + ], + "responses": { + "200": { + "description": "Theme songs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/ThemeVideos": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get theme videos for an item.", + "operationId": "GetThemeVideos", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "inheritFromParent", + "in": "query", + "description": "Optional. Determines whether or not parent items should be searched for theme media.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + } + ], + "responses": { + "200": { + "description": "Theme videos returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ThemeMediaResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Counts": { + "get": { + "tags": [ + "Library" + ], + "summary": "Get item counts.", + "operationId": "GetItemCounts", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Get counts from a specific user's library.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional. Get counts of favorite items.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Item counts returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ItemCounts" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ItemCounts" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ItemCounts" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Libraries/AvailableOptions": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets the library options info.", + "operationId": "GetLibraryOptionsInfo", + "parameters": [ + { + "name": "libraryContentType", + "in": "query", + "description": "Library content type.", + "schema": { + "enum": [ + "unknown", + "movies", + "tvshows", + "music", + "musicvideos", + "trailers", + "homevideos", + "boxsets", + "books", + "photos", + "livetv", + "playlists", + "folders" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionType" + } + ] + } + }, + { + "name": "isNewLibrary", + "in": "query", + "description": "Whether this is a new library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Library options info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LibraryOptionsResultDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LibraryOptionsResultDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LibraryOptionsResultDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/Media/Updated": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new movies have been added by an external source.", + "operationId": "PostUpdatedMedia", + "requestBody": { + "description": "The update paths.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaUpdateInfoDto" + } + ], + "description": "Media Update Info Dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaUpdateInfoDto" + } + ], + "description": "Media Update Info Dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaUpdateInfoDto" + } + ], + "description": "Media Update Info Dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Report success." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/MediaFolders": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets all user media folders.", + "operationId": "GetMediaFolders", + "parameters": [ + { + "name": "isHidden", + "in": "query", + "description": "Optional. Filter by folders that are marked hidden, or not.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Media folders returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Library/Movies/Added": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new movies have been added by an external source.", + "operationId": "PostAddedMovies", + "parameters": [ + { + "name": "tmdbId", + "in": "query", + "description": "The tmdbId.", + "schema": { + "type": "string" + } + }, + { + "name": "imdbId", + "in": "query", + "description": "The imdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/Movies/Updated": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new movies have been added by an external source.", + "operationId": "PostUpdatedMovies", + "parameters": [ + { + "name": "tmdbId", + "in": "query", + "description": "The tmdbId.", + "schema": { + "type": "string" + } + }, + { + "name": "imdbId", + "in": "query", + "description": "The imdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/PhysicalPaths": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets a list of physical paths from virtual folders.", + "operationId": "GetPhysicalPaths", + "responses": { + "200": { + "description": "Physical paths returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Library/Refresh": { + "post": { + "tags": [ + "Library" + ], + "summary": "Starts a library scan.", + "operationId": "RefreshLibrary", + "responses": { + "204": { + "description": "Library scan started." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Library/Series/Added": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new episodes of a series have been added by an external source.", + "operationId": "PostAddedSeries", + "parameters": [ + { + "name": "tvdbId", + "in": "query", + "description": "The tvdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/Series/Updated": { + "post": { + "tags": [ + "Library" + ], + "summary": "Reports that new episodes of a series have been added by an external source.", + "operationId": "PostUpdatedSeries", + "parameters": [ + { + "name": "tvdbId", + "in": "query", + "description": "The tvdbId.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Report success." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Movies/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarMovies", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarShows", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Trailers/{itemId}/Similar": { + "get": { + "tags": [ + "Library" + ], + "summary": "Gets similar items.", + "operationId": "GetSimilarTrailers", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Exclude artist ids.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + } + ], + "responses": { + "200": { + "description": "Similar items returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders": { + "get": { + "tags": [ + "LibraryStructure" + ], + "summary": "Gets all virtual folders.", + "operationId": "GetVirtualFolders", + "responses": { + "200": { + "description": "Virtual folders retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualFolderInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualFolderInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VirtualFolderInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Adds a virtual folder.", + "operationId": "AddVirtualFolder", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the virtual folder.", + "schema": { + "type": "string" + } + }, + { + "name": "collectionType", + "in": "query", + "description": "The type of the collection.", + "schema": { + "enum": [ + "movies", + "tvshows", + "music", + "musicvideos", + "homevideos", + "boxsets", + "books", + "mixed" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionTypeOptions" + } + ] + } + }, + { + "name": "paths", + "in": "query", + "description": "The paths of the virtual folder.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "The library options.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AddVirtualFolderDto" + } + ], + "description": "Add virtual folder dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AddVirtualFolderDto" + } + ], + "description": "Add virtual folder dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AddVirtualFolderDto" + } + ], + "description": "Add virtual folder dto." + } + } + } + }, + "responses": { + "204": { + "description": "Folder added." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LibraryStructure" + ], + "summary": "Removes a virtual folder.", + "operationId": "RemoveVirtualFolder", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the folder.", + "schema": { + "type": "string" + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Folder removed." + }, + "404": { + "description": "Folder not found." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders/LibraryOptions": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Update library options.", + "operationId": "UpdateLibraryOptions", + "requestBody": { + "description": "The library name and options.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateLibraryOptionsDto" + } + ], + "description": "Update library options dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateLibraryOptionsDto" + } + ], + "description": "Update library options dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateLibraryOptionsDto" + } + ], + "description": "Update library options dto." + } + } + } + }, + "responses": { + "204": { + "description": "Library updated." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders/Name": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Renames a virtual folder.", + "operationId": "RenameVirtualFolder", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the virtual folder.", + "schema": { + "type": "string" + } + }, + { + "name": "newName", + "in": "query", + "description": "The new name.", + "schema": { + "type": "string" + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Folder renamed." + }, + "404": { + "description": "Library doesn't exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "409": { + "description": "Library already exists.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders/Paths": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Add a media path to a library.", + "operationId": "AddMediaPath", + "parameters": [ + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "The media path dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathDto" + } + ], + "description": "Media Path dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathDto" + } + ], + "description": "Media Path dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathDto" + } + ], + "description": "Media Path dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Media path added." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LibraryStructure" + ], + "summary": "Remove a media path.", + "operationId": "RemoveMediaPath", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the library.", + "schema": { + "type": "string" + } + }, + { + "name": "path", + "in": "query", + "description": "The path to remove.", + "schema": { + "type": "string" + } + }, + { + "name": "refreshLibrary", + "in": "query", + "description": "Whether to refresh the library.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Media path removed." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Library/VirtualFolders/Paths/Update": { + "post": { + "tags": [ + "LibraryStructure" + ], + "summary": "Updates a media path.", + "operationId": "UpdateMediaPath", + "requestBody": { + "description": "The name of the library and path infos.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateMediaPathRequestDto" + } + ], + "description": "Update library options dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateMediaPathRequestDto" + } + ], + "description": "Update library options dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateMediaPathRequestDto" + } + ], + "description": "Update library options dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Media path updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ChannelMappingOptions": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get channel mapping options.", + "operationId": "GetChannelMappingOptions", + "parameters": [ + { + "name": "providerId", + "in": "query", + "description": "Provider id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Channel mapping options returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChannelMappingOptionsDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelMappingOptionsDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ChannelMappingOptionsDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ChannelMappings": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Set channel mappings.", + "operationId": "SetChannelMapping", + "requestBody": { + "description": "The set channel mapping dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetChannelMappingDto" + } + ], + "description": "Set channel mapping dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetChannelMappingDto" + } + ], + "description": "Set channel mapping dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetChannelMappingDto" + } + ], + "description": "Set channel mapping dto." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Created channel mapping returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TunerChannelMapping" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerChannelMapping" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerChannelMapping" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Channels": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv channels.", + "operationId": "GetLiveTvChannels", + "parameters": [ + { + "name": "type", + "in": "query", + "description": "Optional. Filter by channel type.", + "schema": { + "enum": [ + "TV", + "Radio" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ChannelType" + } + ] + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional. Filter by channels that are favorites, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isLiked", + "in": "query", + "description": "Optional. Filter by channels that are liked, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isDisliked", + "in": "query", + "description": "Optional. Filter by channels that are disliked, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "\"Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Key to sort by.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort order.", + "schema": { + "enum": [ + "Ascending", + "Descending" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SortOrder" + } + ] + } + }, + { + "name": "enableFavoriteSorting", + "in": "query", + "description": "Optional. Incorporate favorite and like status into channel sorting.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "addCurrentProgram", + "in": "query", + "description": "Optional. Adds current program info to each channel.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Available live tv channels returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Channels/{channelId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv channel.", + "operationId": "GetChannel", + "parameters": [ + { + "name": "channelId", + "in": "path", + "description": "Channel id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Live tv channel returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/GuideInfo": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get guide info.", + "operationId": "GetGuideInfo", + "responses": { + "200": { + "description": "Guide info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GuideInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/GuideInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/GuideInfo" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Info": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv services.", + "operationId": "GetLiveTvInfo", + "responses": { + "200": { + "description": "Available live tv services returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiveTvInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveTvInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveTvInfo" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ListingProviders": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Adds a listings provider.", + "operationId": "AddListingProvider", + "parameters": [ + { + "name": "pw", + "in": "query", + "description": "Password.", + "schema": { + "type": "string" + } + }, + { + "name": "validateListings", + "in": "query", + "description": "Validate listings.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "validateLogin", + "in": "query", + "description": "Validate login.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "description": "New listings info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Created listings provider returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Delete listing provider.", + "operationId": "DeleteListingProvider", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Listing provider id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Listing provider deleted." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ListingProviders/Default": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets default listings provider info.", + "operationId": "GetDefaultListingProvider", + "responses": { + "200": { + "description": "Default listings provider info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ListingsProviderInfo" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ListingProviders/Lineups": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available lineups.", + "operationId": "GetLineups", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Provider id.", + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "query", + "description": "Provider type.", + "schema": { + "type": "string" + } + }, + { + "name": "location", + "in": "query", + "description": "Location.", + "schema": { + "type": "string" + } + }, + { + "name": "country", + "in": "query", + "description": "Country.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Available lineups returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/ListingProviders/SchedulesDirect/Countries": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available countries.", + "operationId": "GetSchedulesDirectCountries", + "responses": { + "200": { + "description": "Available countries returned.", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/LiveRecordings/{recordingId}/stream": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv recording stream.", + "operationId": "GetLiveRecordingFile", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "Recording id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Recording stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Recording not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/LiveTv/LiveStreamFiles/{streamId}/stream.{container}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv channel stream.", + "operationId": "GetLiveStreamFile", + "parameters": [ + { + "name": "streamId", + "in": "path", + "description": "Stream id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "container", + "in": "path", + "description": "Container type.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Stream not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/LiveTv/Programs": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv epgs.", + "operationId": "GetLiveTvPrograms", + "parameters": [ + { + "name": "channelIds", + "in": "query", + "description": "The channels to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "minStartDate", + "in": "query", + "description": "Optional. The minimum premiere start date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasAired", + "in": "query", + "description": "Optional. Filter by programs that have completed airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isAiring", + "in": "query", + "description": "Optional. Filter by programs that are currently airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "maxStartDate", + "in": "query", + "description": "Optional. The maximum premiere start date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minEndDate", + "in": "query", + "description": "Optional. The minimum premiere end date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "maxEndDate", + "in": "query", + "description": "Optional. The maximum premiere end date.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "genres", + "in": "query", + "description": "The genres to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "The genre ids to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by series timer id.", + "schema": { + "type": "string" + } + }, + { + "name": "librarySeriesId", + "in": "query", + "description": "Optional. Filter by library series id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Retrieve total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Live tv epgs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Gets available live tv epgs.", + "operationId": "GetPrograms", + "requestBody": { + "description": "Request body.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GetProgramsDto" + } + ], + "description": "Get programs dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GetProgramsDto" + } + ], + "description": "Get programs dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GetProgramsDto" + } + ], + "description": "Get programs dto." + } + } + } + }, + "responses": { + "200": { + "description": "Live tv epgs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Programs/{programId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv program.", + "operationId": "GetProgram", + "parameters": [ + { + "name": "programId", + "in": "path", + "description": "Program id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Program returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Programs/Recommended": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets recommended live tv epgs.", + "operationId": "GetRecommendedPrograms", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. filter by user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "isAiring", + "in": "query", + "description": "Optional. Filter by programs that are currently airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasAired", + "in": "query", + "description": "Optional. Filter by programs that have completed airing, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "The genres to return guide information for.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Retrieve total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Recommended epgs returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv recordings.", + "operationId": "GetRecordings", + "parameters": [ + { + "name": "channelId", + "in": "query", + "description": "Optional. Filter by channel id.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "status", + "in": "query", + "description": "Optional. Filter by recording status.", + "schema": { + "enum": [ + "New", + "InProgress", + "Completed", + "Cancelled", + "ConflictedOk", + "ConflictedNotOk", + "Error" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RecordingStatus" + } + ] + } + }, + { + "name": "isInProgress", + "in": "query", + "description": "Optional. Filter by recordings that are in progress, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by recordings belonging to a series timer.", + "schema": { + "type": "string" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional. Filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional. Filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional. Filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional. Filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional. Filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isLibraryItem", + "in": "query", + "description": "Optional. Filter for is library item.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Return total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Live tv recordings returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/{recordingId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv recording.", + "operationId": "GetRecording", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "Recording id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Recording returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Deletes a live tv recording.", + "operationId": "DeleteRecording", + "parameters": [ + { + "name": "recordingId", + "in": "path", + "description": "Recording id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Recording deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/Folders": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets recording folders.", + "operationId": "GetRecordingFolders", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Recording folders returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/Groups": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv recording groups.", + "operationId": "GetRecordingGroups", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Recording groups returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/Groups/{groupId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get recording group.", + "operationId": "GetRecordingGroup", + "parameters": [ + { + "name": "groupId", + "in": "path", + "description": "Group id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Recordings/Series": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv recording series.", + "operationId": "GetRecordingsSeries", + "parameters": [ + { + "name": "channelId", + "in": "query", + "description": "Optional. Filter by channel id.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "groupId", + "in": "query", + "description": "Optional. Filter by recording group.", + "schema": { + "type": "string" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "status", + "in": "query", + "description": "Optional. Filter by recording status.", + "schema": { + "enum": [ + "New", + "InProgress", + "Completed", + "Cancelled", + "ConflictedOk", + "ConflictedNotOk", + "Error" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RecordingStatus" + } + ] + } + }, + { + "name": "isInProgress", + "in": "query", + "description": "Optional. Filter by recordings that are in progress, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by recordings belonging to a series timer.", + "schema": { + "type": "string" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Return total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Live tv recordings returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/SeriesTimers": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets live tv series timers.", + "operationId": "GetSeriesTimers", + "parameters": [ + { + "name": "sortBy", + "in": "query", + "description": "Optional. Sort by SortName or Priority.", + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Optional. Sort in Ascending or Descending order.", + "schema": { + "enum": [ + "Ascending", + "Descending" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SortOrder" + } + ] + } + } + ], + "responses": { + "200": { + "description": "Timers returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Creates a live tv series timer.", + "operationId": "CreateSeriesTimer", + "requestBody": { + "description": "New series timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + } + } + }, + "responses": { + "204": { + "description": "Series timer info created." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/SeriesTimers/{timerId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a live tv series timer.", + "operationId": "GetSeriesTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Series timer returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + } + } + }, + "404": { + "description": "Series timer not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Cancels a live tv series timer.", + "operationId": "CancelSeriesTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Timer cancelled." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Updates a live tv series timer.", + "operationId": "UpdateSeriesTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "New series timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + ], + "description": "Class SeriesTimerInfoDto." + } + } + } + }, + "responses": { + "204": { + "description": "Series timer updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Timers": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets the live tv timers.", + "operationId": "GetTimers", + "parameters": [ + { + "name": "channelId", + "in": "query", + "description": "Optional. Filter by channel id.", + "schema": { + "type": "string" + } + }, + { + "name": "seriesTimerId", + "in": "query", + "description": "Optional. Filter by timers belonging to a series timer.", + "schema": { + "type": "string" + } + }, + { + "name": "isActive", + "in": "query", + "description": "Optional. Filter by timers that are active.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isScheduled", + "in": "query", + "description": "Optional. Filter by timers that are scheduled.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Creates a live tv timer.", + "operationId": "CreateTimer", + "requestBody": { + "description": "New timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + } + } + }, + "responses": { + "204": { + "description": "Timer created." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Timers/{timerId}": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets a timer.", + "operationId": "GetTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Timer returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TimerInfoDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Cancels a live tv timer.", + "operationId": "CancelTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Timer deleted." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Updates a live tv timer.", + "operationId": "UpdateTimer", + "parameters": [ + { + "name": "timerId", + "in": "path", + "description": "Timer id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "New timer info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerInfoDto" + } + ] + } + } + } + }, + "responses": { + "204": { + "description": "Timer updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Timers/Defaults": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Gets the default values for a new timer.", + "operationId": "GetDefaultTimer", + "parameters": [ + { + "name": "programId", + "in": "query", + "description": "Optional. To attach default values based on a program.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Default values returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/TunerHosts": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Adds a tuner host.", + "operationId": "AddTunerHost", + "requestBody": { + "description": "New tuner host.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TunerHostInfo" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TunerHostInfo" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/TunerHostInfo" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Created tuner host returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TunerHostInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerHostInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "LiveTv" + ], + "summary": "Deletes a tuner host.", + "operationId": "DeleteTunerHost", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Tuner host id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Tuner host deleted." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/TunerHosts/Types": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Get tuner host types.", + "operationId": "GetTunerHostTypes", + "responses": { + "200": { + "description": "Tuner host types returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Tuners/{tunerId}/Reset": { + "post": { + "tags": [ + "LiveTv" + ], + "summary": "Resets a tv tuner.", + "operationId": "ResetTuner", + "parameters": [ + { + "name": "tunerId", + "in": "path", + "description": "Tuner id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Tuner reset." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Tuners/Discover": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Discover tuners.", + "operationId": "DiscoverTuners", + "parameters": [ + { + "name": "newDevicesOnly", + "in": "query", + "description": "Only discover new tuners.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Tuners returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveTv/Tuners/Discvover": { + "get": { + "tags": [ + "LiveTv" + ], + "summary": "Discover tuners.", + "operationId": "DiscvoverTuners", + "parameters": [ + { + "name": "newDevicesOnly", + "in": "query", + "description": "Only discover new tuners.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Tuners returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LiveTvManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Localization/Countries": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets known countries.", + "operationId": "GetCountries", + "responses": { + "200": { + "description": "Known countries returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Localization/Cultures": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets known cultures.", + "operationId": "GetCultures", + "responses": { + "200": { + "description": "Known cultures returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Localization/Options": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets localization options.", + "operationId": "GetLocalizationOptions", + "responses": { + "200": { + "description": "Localization options returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocalizationOption" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocalizationOption" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocalizationOption" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Localization/ParentalRatings": { + "get": { + "tags": [ + "Localization" + ], + "summary": "Gets known parental ratings.", + "operationId": "GetParentalRatings", + "responses": { + "200": { + "description": "Known parental ratings returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrDefault", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/Lyrics": { + "get": { + "tags": [ + "Lyrics" + ], + "summary": "Gets an item's lyrics.", + "operationId": "GetLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Lyrics returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + } + } + }, + "404": { + "description": "Something went wrong. No Lyrics will be returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Lyrics" + ], + "summary": "Upload an external lyric file.", + "operationId": "UploadLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item the lyric belongs to.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fileName", + "in": "query", + "description": "Name of the file being uploaded.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "responses": { + "200": { + "description": "Lyrics uploaded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + } + } + }, + "400": { + "description": "Error processing upload.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Lyrics" + ], + "summary": "Deletes an external lyric file.", + "operationId": "DeleteLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Lyric deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/RemoteSearch/Lyrics": { + "get": { + "tags": [ + "Lyrics" + ], + "summary": "Search remote lyrics.", + "operationId": "SearchRemoteLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Lyrics retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteLyricInfoDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteLyricInfoDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteLyricInfoDto" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/RemoteSearch/Lyrics/{lyricId}": { + "post": { + "tags": [ + "Lyrics" + ], + "summary": "Downloads a remote lyric.", + "operationId": "DownloadRemoteLyrics", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "lyricId", + "in": "path", + "description": "The lyric id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Lyric downloaded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Providers/Lyrics/{lyricId}": { + "get": { + "tags": [ + "Lyrics" + ], + "summary": "Gets the remote lyrics.", + "operationId": "GetRemoteLyrics", + "parameters": [ + { + "name": "lyricId", + "in": "path", + "description": "The remote provider item id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LyricDto" + } + } + } + }, + "404": { + "description": "Lyric not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LyricManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/PlaybackInfo": { + "get": { + "tags": [ + "MediaInfo" + ], + "summary": "Gets live playback media info for an item.", + "operationId": "GetPlaybackInfo", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Playback info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "MediaInfo" + ], + "summary": "Gets live playback media info for an item.", + "description": "For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.\r\nQuery parameters are obsolete.", + "operationId": "GetPostedPlaybackInfo", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "The maximum streaming bitrate.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "The start time in ticks.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "The maximum number of audio channels.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media source id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The livestream id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "autoOpenLiveStream", + "in": "query", + "description": "Whether to auto open the livestream.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "enableDirectPlay", + "in": "query", + "description": "Whether to enable direct play. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "enableDirectStream", + "in": "query", + "description": "Whether to enable direct stream. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "enableTranscoding", + "in": "query", + "description": "Whether to enable transcoding. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether to allow to copy the video stream. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether to allow to copy the audio stream. Default: true.", + "deprecated": true, + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "description": "The playback info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackInfoDto" + } + ], + "description": "Playback info dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackInfoDto" + } + ], + "description": "Playback info dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackInfoDto" + } + ], + "description": "Playback info dto." + } + } + } + }, + "responses": { + "200": { + "description": "Playback info returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaybackInfoResponse" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveStreams/Close": { + "post": { + "tags": [ + "MediaInfo" + ], + "summary": "Closes a media source.", + "operationId": "CloseLiveStream", + "parameters": [ + { + "name": "liveStreamId", + "in": "query", + "description": "The livestream id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Livestream closed." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/LiveStreams/Open": { + "post": { + "tags": [ + "MediaInfo" + ], + "summary": "Opens a media source.", + "operationId": "OpenLiveStream", + "parameters": [ + { + "name": "openToken", + "in": "query", + "description": "The open token.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "The start time in ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "The maximum number of audio channels.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableDirectPlay", + "in": "query", + "description": "Whether to enable direct play. Default: true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableDirectStream", + "in": "query", + "description": "Whether to enable direct stream. Default: true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "alwaysBurnInSubtitleWhenTranscoding", + "in": "query", + "description": "Always burn-in subtitle when transcoding.", + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "description": "The open live stream dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenLiveStreamDto" + } + ], + "description": "Open live stream dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenLiveStreamDto" + } + ], + "description": "Open live stream dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenLiveStreamDto" + } + ], + "description": "Open live stream dto." + } + } + } + }, + "responses": { + "200": { + "description": "Media source opened.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiveStreamResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveStreamResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/LiveStreamResponse" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playback/BitrateTest": { + "get": { + "tags": [ + "MediaInfo" + ], + "summary": "Tests the network with a request with the size of the bitrate.", + "operationId": "GetBitrateTestBytes", + "parameters": [ + { + "name": "size", + "in": "query", + "description": "The bitrate. Defaults to 102400.", + "schema": { + "maximum": 100000000, + "minimum": 1, + "type": "integer", + "format": "int32", + "default": 102400 + } + } + ], + "responses": { + "200": { + "description": "Test buffer returned.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MediaSegments/{itemId}": { + "get": { + "tags": [ + "MediaSegments" + ], + "summary": "Gets all media segments based on an itemId.", + "operationId": "GetItemSegments", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The ItemId.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeSegmentTypes", + "in": "query", + "description": "Optional filter of requested segment types.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaSegmentType" + } + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MediaSegmentDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/MediaSegmentDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/MediaSegmentDtoQueryResult" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Movies/Recommendations": { + "get": { + "tags": [ + "Movies" + ], + "summary": "Gets movie recommendations.", + "operationId": "GetMovieRecommendations", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. The fields to return.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "categoryLimit", + "in": "query", + "description": "The max number of categories to return.", + "schema": { + "type": "integer", + "format": "int32", + "default": 5 + } + }, + { + "name": "itemLimit", + "in": "query", + "description": "The max number of items to return per category.", + "schema": { + "type": "integer", + "format": "int32", + "default": 8 + } + } + ], + "responses": { + "200": { + "description": "Movie recommendations returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecommendationDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecommendationDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecommendationDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres": { + "get": { + "tags": [ + "MusicGenres" + ], + "summary": "Gets all music genres from a given item, folder, or the entire library.", + "operationId": "GetMusicGenres", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Include total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Music genres returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/MusicGenres/{genreName}": { + "get": { + "tags": [ + "MusicGenres" + ], + "summary": "Gets a music genre, by name.", + "operationId": "GetMusicGenre", + "parameters": [ + { + "name": "genreName", + "in": "path", + "description": "The genre name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Packages": { + "get": { + "tags": [ + "Package" + ], + "summary": "Gets available packages.", + "operationId": "GetPackages", + "responses": { + "200": { + "description": "Available packages returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PackageInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PackageInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PackageInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Packages/{name}": { + "get": { + "tags": [ + "Package" + ], + "summary": "Gets a package by name or assembly GUID.", + "operationId": "GetPackageInfo", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the package.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "assemblyGuid", + "in": "query", + "description": "The GUID of the associated assembly.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Package retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PackageInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PackageInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PackageInfo" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Packages/Installed/{name}": { + "post": { + "tags": [ + "Package" + ], + "summary": "Installs a package.", + "operationId": "InstallPackage", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Package name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "assemblyGuid", + "in": "query", + "description": "GUID of the associated assembly.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "query", + "description": "Optional version. Defaults to latest version.", + "schema": { + "type": "string" + } + }, + { + "name": "repositoryUrl", + "in": "query", + "description": "Optional. Specify the repository to install from.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Package found." + }, + "404": { + "description": "Package not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Packages/Installing/{packageId}": { + "delete": { + "tags": [ + "Package" + ], + "summary": "Cancels a package installation.", + "operationId": "CancelPackageInstallation", + "parameters": [ + { + "name": "packageId", + "in": "path", + "description": "Installation Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Installation cancelled." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Repositories": { + "get": { + "tags": [ + "Package" + ], + "summary": "Gets all package repositories.", + "operationId": "GetRepositories", + "responses": { + "200": { + "description": "Package repositories returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Package" + ], + "summary": "Sets the enabled and existing package repositories.", + "operationId": "SetRepositories", + "requestBody": { + "description": "The list of package repositories.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Package repositories saved." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Persons": { + "get": { + "tags": [ + "Persons" + ], + "summary": "Gets all persons.", + "operationId": "GetPersons", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term.", + "schema": { + "type": "string" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not. userId is required.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "excludePersonTypes", + "in": "query", + "description": "Optional. If specified results will be filtered to exclude those containing the specified PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified results will be filtered to include only those containing the specified PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "appearsInItemId", + "in": "query", + "description": "Optional. If specified, person results will be filtered on items related to said persons.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Persons returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Persons/{name}": { + "get": { + "tags": [ + "Persons" + ], + "summary": "Get person by name.", + "operationId": "GetPerson", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Person name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Person returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "404": { + "description": "Person not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Creates a new playlist.", + "description": "For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.\r\nQuery parameters are obsolete.", + "operationId": "CreatePlaylist", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The playlist name.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "ids", + "in": "query", + "description": "The item ids.", + "deprecated": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaType", + "in": "query", + "description": "The media type.", + "deprecated": true, + "schema": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaType" + } + ] + } + } + ], + "requestBody": { + "description": "The create playlist payload.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreatePlaylistDto" + } + ], + "description": "Create new playlist dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreatePlaylistDto" + } + ], + "description": "Create new playlist dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreatePlaylistDto" + } + ], + "description": "Create new playlist dto." + } + } + } + }, + "responses": { + "200": { + "description": "Playlist created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaylistCreationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistCreationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistCreationResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Updates a playlist.", + "operationId": "UpdatePlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistDto id.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistDto" + } + ], + "description": "Update existing playlist dto. Fields set to `null` will not be updated and keep their current values." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistDto" + } + ], + "description": "Update existing playlist dto. Fields set to `null` will not be updated and keep their current values." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistDto" + } + ], + "description": "Update existing playlist dto. Fields set to `null` will not be updated and keep their current values." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Playlist updated." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "get": { + "tags": [ + "Playlists" + ], + "summary": "Get a playlist.", + "operationId": "GetPlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "The playlist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaylistDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistDto" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}/Items": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Adds items to a playlist.", + "operationId": "AddItemToPlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ids", + "in": "query", + "description": "Item id, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "The userId.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Items added to playlist." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playlists" + ], + "summary": "Removes items from a playlist.", + "operationId": "RemoveItemFromPlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "entryIds", + "in": "query", + "description": "The item ids, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "204": { + "description": "Items removed." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "get": { + "tags": [ + "Playlists" + ], + "summary": "Gets the original items of a playlist.", + "operationId": "GetPlaylistItems", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + } + ], + "responses": { + "200": { + "description": "Original playlist returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}/Items/{itemId}/Move/{newIndex}": { + "post": { + "tags": [ + "Playlists" + ], + "summary": "Moves a playlist item.", + "operationId": "MoveItem", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "newIndex", + "in": "path", + "description": "The new index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Item moved to new index." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}/Users": { + "get": { + "tags": [ + "Playlists" + ], + "summary": "Get a playlist's users.", + "operationId": "GetPlaylistUsers", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Found shares.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + } + } + } + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Playlists/{playlistId}/Users/{userId}": { + "get": { + "tags": [ + "Playlists" + ], + "summary": "Get a playlist user.", + "operationId": "GetPlaylistUser", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "User permission found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + } + } + } + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Playlists" + ], + "summary": "Modify a user of a playlist's users.", + "operationId": "UpdatePlaylistUser", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistUserDto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistUserDto" + } + ], + "description": "Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistUserDto" + } + ], + "description": "Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdatePlaylistUserDto" + } + ], + "description": "Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User's permissions modified." + }, + "403": { + "description": "Access forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Playlist not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playlists" + ], + "summary": "Remove a user from a playlist's users.", + "operationId": "RemoveUserFromPlaylist", + "parameters": [ + { + "name": "playlistId", + "in": "path", + "description": "The playlist id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User permissions removed from playlist." + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "No playlist or user permissions found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized access." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/PlayingItems/{itemId}": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports that a session has begun playing an item.", + "operationId": "OnPlaybackStart", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The id of the MediaSource.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "playMethod", + "in": "query", + "description": "The play method.", + "schema": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ] + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "canSeek", + "in": "query", + "description": "Indicates if the client can seek.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Play start recorded." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playstate" + ], + "summary": "Reports that a session has stopped playing an item.", + "operationId": "OnPlaybackStopped", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The id of the MediaSource.", + "schema": { + "type": "string" + } + }, + { + "name": "nextMediaType", + "in": "query", + "description": "The next media type that will play.", + "schema": { + "type": "string" + } + }, + { + "name": "positionTicks", + "in": "query", + "description": "Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Playback stop recorded." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/PlayingItems/{itemId}/Progress": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports a session's playback progress.", + "operationId": "OnPlaybackProgress", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The id of the MediaSource.", + "schema": { + "type": "string" + } + }, + { + "name": "positionTicks", + "in": "query", + "description": "Optional. The current position, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "The audio stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "The subtitle stream index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "volumeLevel", + "in": "query", + "description": "Scale of 0-100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "playMethod", + "in": "query", + "description": "The play method.", + "schema": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ] + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "repeatMode", + "in": "query", + "description": "The repeat mode.", + "schema": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ] + } + }, + { + "name": "isPaused", + "in": "query", + "description": "Indicates if the player is paused.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "isMuted", + "in": "query", + "description": "Indicates if the player is muted.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "204": { + "description": "Play progress recorded." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports playback has started within a session.", + "operationId": "ReportPlaybackStart", + "requestBody": { + "description": "The playback start info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStartInfo" + } + ], + "description": "Class PlaybackStartInfo." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStartInfo" + } + ], + "description": "Class PlaybackStartInfo." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStartInfo" + } + ], + "description": "Class PlaybackStartInfo." + } + } + } + }, + "responses": { + "204": { + "description": "Playback start recorded." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing/Ping": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Pings a playback session.", + "operationId": "PingPlaybackSession", + "parameters": [ + { + "name": "playSessionId", + "in": "query", + "description": "Playback session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Playback session pinged." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing/Progress": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports playback progress within a session.", + "operationId": "ReportPlaybackProgress", + "requestBody": { + "description": "The playback progress info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackProgressInfo" + } + ], + "description": "Class PlaybackProgressInfo." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackProgressInfo" + } + ], + "description": "Class PlaybackProgressInfo." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackProgressInfo" + } + ], + "description": "Class PlaybackProgressInfo." + } + } + } + }, + "responses": { + "204": { + "description": "Playback progress recorded." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Playing/Stopped": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Reports playback has stopped within a session.", + "operationId": "ReportPlaybackStopped", + "requestBody": { + "description": "The playback stop info.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStopInfo" + } + ], + "description": "Class PlaybackStopInfo." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStopInfo" + } + ], + "description": "Class PlaybackStopInfo." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackStopInfo" + } + ], + "description": "Class PlaybackStopInfo." + } + } + } + }, + "responses": { + "204": { + "description": "Playback stop recorded." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserPlayedItems/{itemId}": { + "post": { + "tags": [ + "Playstate" + ], + "summary": "Marks an item as played for user.", + "operationId": "MarkPlayedItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "datePlayed", + "in": "query", + "description": "Optional. The date the item was played.", + "schema": { + "type": "string", + "format": "date-time" + } + } + ], + "responses": { + "200": { + "description": "Item marked as played.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Playstate" + ], + "summary": "Marks an item as unplayed for user.", + "operationId": "MarkUnplayedItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item marked as unplayed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Plugins": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Gets a list of currently installed plugins.", + "operationId": "GetPlugins", + "responses": { + "200": { + "description": "Installed plugins returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PluginInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}": { + "delete": { + "tags": [ + "Plugins" + ], + "summary": "Uninstalls a plugin.", + "operationId": "UninstallPlugin", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Plugin uninstalled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": true, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}": { + "delete": { + "tags": [ + "Plugins" + ], + "summary": "Uninstalls a plugin by version.", + "operationId": "UninstallPluginByVersion", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Plugin uninstalled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}/Disable": { + "post": { + "tags": [ + "Plugins" + ], + "summary": "Disable a plugin.", + "operationId": "DisablePlugin", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Plugin disabled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}/Enable": { + "post": { + "tags": [ + "Plugins" + ], + "summary": "Enables a disabled plugin.", + "operationId": "EnablePlugin", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Plugin enabled." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/{version}/Image": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Gets a plugin's image.", + "operationId": "GetPluginImage", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "version", + "in": "path", + "description": "Plugin version.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Plugin image returned.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/Configuration": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Gets plugin configuration.", + "operationId": "GetPluginConfiguration", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Plugin configuration returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BasePluginConfiguration" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BasePluginConfiguration" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BasePluginConfiguration" + } + } + } + }, + "404": { + "description": "Plugin not found or plugin configuration not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "post": { + "tags": [ + "Plugins" + ], + "summary": "Updates plugin configuration.", + "description": "Accepts plugin configuration as JSON body.", + "operationId": "UpdatePluginConfiguration", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Plugin configuration updated." + }, + "404": { + "description": "Plugin not found or plugin does not have configuration.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Plugins/{pluginId}/Manifest": { + "post": { + "tags": [ + "Plugins" + ], + "summary": "Gets a plugin's manifest.", + "operationId": "GetPluginManifest", + "parameters": [ + { + "name": "pluginId", + "in": "path", + "description": "Plugin id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Plugin manifest returned." + }, + "404": { + "description": "Plugin not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/QuickConnect/Authorize": { + "post": { + "tags": [ + "QuickConnect" + ], + "summary": "Authorizes a pending quick connect request.", + "operationId": "AuthorizeQuickConnect", + "parameters": [ + { + "name": "code", + "in": "query", + "description": "Quick connect code to authorize.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user the authorize. Access to the requested user is required.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Quick connect result authorized successfully.", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "boolean" + } + } + } + }, + "403": { + "description": "Unknown user id.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/QuickConnect/Connect": { + "get": { + "tags": [ + "QuickConnect" + ], + "summary": "Attempts to retrieve authentication information.", + "operationId": "GetQuickConnectState", + "parameters": [ + { + "name": "secret", + "in": "query", + "description": "Secret previously returned from the Initiate endpoint.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Quick connect result returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + } + } + }, + "404": { + "description": "Unknown quick connect secret.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/QuickConnect/Enabled": { + "get": { + "tags": [ + "QuickConnect" + ], + "summary": "Gets the current quick connect state.", + "operationId": "GetQuickConnectEnabled", + "responses": { + "200": { + "description": "Quick connect state returned.", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "boolean" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "boolean" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/QuickConnect/Initiate": { + "post": { + "tags": [ + "QuickConnect" + ], + "summary": "Initiate a new quick connect request.", + "operationId": "InitiateQuickConnect", + "responses": { + "200": { + "description": "Quick connect request successfully created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/QuickConnectResult" + } + } + } + }, + "401": { + "description": "Quick connect is not active on this server." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Items/{itemId}/RemoteImages": { + "get": { + "tags": [ + "RemoteImage" + ], + "summary": "Gets available remote images for an item.", + "operationId": "GetRemoteImages", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "type", + "in": "query", + "description": "The image type.", + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ] + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "providerName", + "in": "query", + "description": "Optional. The image provider to use.", + "schema": { + "type": "string" + } + }, + { + "name": "includeAllLanguages", + "in": "query", + "description": "Optional. Include all languages.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Remote Images returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemoteImageResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/RemoteImageResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/RemoteImageResult" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteImages/Download": { + "post": { + "tags": [ + "RemoteImage" + ], + "summary": "Downloads a remote image for an item.", + "operationId": "DownloadRemoteImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "type", + "in": "query", + "description": "The image type.", + "required": true, + "schema": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Enum ImageType." + } + }, + { + "name": "imageUrl", + "in": "query", + "description": "The image url.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Remote image downloaded." + }, + "404": { + "description": "Remote image not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteImages/Providers": { + "get": { + "tags": [ + "RemoteImage" + ], + "summary": "Gets available remote image providers for an item.", + "operationId": "GetRemoteImageProviders", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "Item Id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Returned remote image providers.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageProviderInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageProviderInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageProviderInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/ScheduledTasks": { + "get": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Get tasks.", + "operationId": "GetTasks", + "parameters": [ + { + "name": "isHidden", + "in": "query", + "description": "Optional filter tasks that are hidden, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isEnabled", + "in": "query", + "description": "Optional filter tasks that are enabled, or not.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Scheduled tasks retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/ScheduledTasks/{taskId}": { + "get": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Get task by id.", + "operationId": "GetTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Task retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaskInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/TaskInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/TaskInfo" + } + } + } + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/ScheduledTasks/{taskId}/Triggers": { + "post": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Update specified task triggers.", + "operationId": "UpdateTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Triggers.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + } + } + }, + "text/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + } + } + }, + "application/*+json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + } + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Task triggers updated." + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/ScheduledTasks/Running/{taskId}": { + "post": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Start specified task.", + "operationId": "StartTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Task started." + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + }, + "delete": { + "tags": [ + "ScheduledTasks" + ], + "summary": "Stop specified task.", + "operationId": "StopTask", + "parameters": [ + { + "name": "taskId", + "in": "path", + "description": "Task Id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Task stopped." + }, + "404": { + "description": "Task not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Search/Hints": { + "get": { + "tags": [ + "Search" + ], + "summary": "Gets the search hint result.", + "operationId": "GetSearchHints", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Supply a user id to search within a user's library or omit to search all.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "The search term to filter on.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "If specified, only results with the specified item types are returned. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "If specified, results with these item types are filtered out. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "If specified, only results with the specified media types are returned. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "If specified, only children of the parent are returned.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional filter for movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional filter for series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional filter for news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional filter for kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional filter for sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "includePeople", + "in": "query", + "description": "Optional filter whether to include people.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeMedia", + "in": "query", + "description": "Optional filter whether to include media.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeGenres", + "in": "query", + "description": "Optional filter whether to include genres.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeStudios", + "in": "query", + "description": "Optional filter whether to include studios.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "includeArtists", + "in": "query", + "description": "Optional filter whether to include artists.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Search hint returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchHintResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SearchHintResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SearchHintResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Auth/PasswordResetProviders": { + "get": { + "tags": [ + "Session" + ], + "summary": "Get all password reset providers.", + "operationId": "GetPasswordResetProviders", + "responses": { + "200": { + "description": "Password reset providers retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Auth/Providers": { + "get": { + "tags": [ + "Session" + ], + "summary": "Get all auth providers.", + "operationId": "GetAuthProviders", + "responses": { + "200": { + "description": "Auth providers retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Sessions": { + "get": { + "tags": [ + "Session" + ], + "summary": "Gets a list of sessions.", + "operationId": "GetSessions", + "parameters": [ + { + "name": "controllableByUserId", + "in": "query", + "description": "Filter by sessions that a given user is allowed to remote control.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "Filter by device Id.", + "schema": { + "type": "string" + } + }, + { + "name": "activeWithinSeconds", + "in": "query", + "description": "Optional. Filter by sessions that were active in the last n seconds.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "List of sessions returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfoDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfoDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfoDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Command": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a full general command to a client.", + "operationId": "SendFullGeneralCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The MediaBrowser.Model.Session.GeneralCommand.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Full general command sent to session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Command/{command}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a general command to a client.", + "operationId": "SendGeneralCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "command", + "in": "path", + "description": "The command to send.", + "required": true, + "schema": { + "enum": [ + "MoveUp", + "MoveDown", + "MoveLeft", + "MoveRight", + "PageUp", + "PageDown", + "PreviousLetter", + "NextLetter", + "ToggleOsd", + "ToggleContextMenu", + "Select", + "Back", + "TakeScreenshot", + "SendKey", + "SendString", + "GoHome", + "GoToSettings", + "VolumeUp", + "VolumeDown", + "Mute", + "Unmute", + "ToggleMute", + "SetVolume", + "SetAudioStreamIndex", + "SetSubtitleStreamIndex", + "ToggleFullscreen", + "DisplayContent", + "GoToSearch", + "DisplayMessage", + "SetRepeatMode", + "ChannelUp", + "ChannelDown", + "Guide", + "ToggleStats", + "PlayMediaSource", + "PlayTrailers", + "SetShuffleQueue", + "PlayState", + "PlayNext", + "ToggleOsdMenu", + "Play", + "SetMaxStreamingBitrate", + "SetPlaybackOrder" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommandType" + } + ], + "description": "This exists simply to identify a set of known commands." + } + } + ], + "responses": { + "204": { + "description": "General command sent to session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Message": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a command to a client to display a message to the user.", + "operationId": "SendMessageCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and TimeoutMs.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MessageCommand" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MessageCommand" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MessageCommand" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Message sent." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Playing": { + "post": { + "tags": [ + "Session" + ], + "summary": "Instructs a session to play an item.", + "operationId": "Play", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "playCommand", + "in": "query", + "description": "The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now.", + "required": true, + "schema": { + "enum": [ + "PlayNow", + "PlayNext", + "PlayLast", + "PlayInstantMix", + "PlayShuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayCommand" + } + ], + "description": "Enum PlayCommand." + } + }, + { + "name": "itemIds", + "in": "query", + "description": "The ids of the items to play, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "startPositionTicks", + "in": "query", + "description": "The starting position of the first item.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "Optional. The media source id.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to play.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to play.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The start index.", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Instruction sent to session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Playing/{command}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a playstate command to a client.", + "operationId": "SendPlaystateCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "command", + "in": "path", + "description": "The MediaBrowser.Model.Session.PlaystateCommand.", + "required": true, + "schema": { + "enum": [ + "Stop", + "Pause", + "Unpause", + "NextTrack", + "PreviousTrack", + "Seek", + "Rewind", + "FastForward", + "PlayPause" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaystateCommand" + } + ], + "description": "Enum PlaystateCommand." + } + }, + { + "name": "seekPositionTicks", + "in": "query", + "description": "The optional position ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "controllingUserId", + "in": "query", + "description": "The optional controlling user id.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Playstate command sent to session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/System/{command}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Issues a system command to a client.", + "operationId": "SendSystemCommand", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "command", + "in": "path", + "description": "The command to send.", + "required": true, + "schema": { + "enum": [ + "MoveUp", + "MoveDown", + "MoveLeft", + "MoveRight", + "PageUp", + "PageDown", + "PreviousLetter", + "NextLetter", + "ToggleOsd", + "ToggleContextMenu", + "Select", + "Back", + "TakeScreenshot", + "SendKey", + "SendString", + "GoHome", + "GoToSettings", + "VolumeUp", + "VolumeDown", + "Mute", + "Unmute", + "ToggleMute", + "SetVolume", + "SetAudioStreamIndex", + "SetSubtitleStreamIndex", + "ToggleFullscreen", + "DisplayContent", + "GoToSearch", + "DisplayMessage", + "SetRepeatMode", + "ChannelUp", + "ChannelDown", + "Guide", + "ToggleStats", + "PlayMediaSource", + "PlayTrailers", + "SetShuffleQueue", + "PlayState", + "PlayNext", + "ToggleOsdMenu", + "Play", + "SetMaxStreamingBitrate", + "SetPlaybackOrder" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommandType" + } + ], + "description": "This exists simply to identify a set of known commands." + } + } + ], + "responses": { + "204": { + "description": "System command sent to session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/User/{userId}": { + "post": { + "tags": [ + "Session" + ], + "summary": "Adds an additional user to a session.", + "operationId": "AddUserToSession", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User added to session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "Session" + ], + "summary": "Removes an additional user from a session.", + "operationId": "RemoveUserFromSession", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User removed from session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/{sessionId}/Viewing": { + "post": { + "tags": [ + "Session" + ], + "summary": "Instructs a session to browse to an item or view.", + "operationId": "DisplayContent", + "parameters": [ + { + "name": "sessionId", + "in": "path", + "description": "The session Id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemType", + "in": "query", + "description": "The type of item to browse to.", + "required": true, + "schema": { + "enum": [ + "AggregateFolder", + "Audio", + "AudioBook", + "BasePluginFolder", + "Book", + "BoxSet", + "Channel", + "ChannelFolderItem", + "CollectionFolder", + "Episode", + "Folder", + "Genre", + "ManualPlaylistsFolder", + "Movie", + "LiveTvChannel", + "LiveTvProgram", + "MusicAlbum", + "MusicArtist", + "MusicGenre", + "MusicVideo", + "Person", + "Photo", + "PhotoAlbum", + "Playlist", + "PlaylistsFolder", + "Program", + "Recording", + "Season", + "Series", + "Studio", + "Trailer", + "TvChannel", + "TvProgram", + "UserRootFolder", + "UserView", + "Video", + "Year" + ], + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemKind" + } + ], + "description": "The base item kind." + } + }, + { + "name": "itemId", + "in": "query", + "description": "The Id of the item.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemName", + "in": "query", + "description": "The name of the item.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Instruction sent to session." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Capabilities": { + "post": { + "tags": [ + "Session" + ], + "summary": "Updates capabilities for a device.", + "operationId": "PostCapabilities", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The session id.", + "schema": { + "type": "string" + } + }, + { + "name": "playableMediaTypes", + "in": "query", + "description": "A list of playable media types, comma delimited. Audio, Video, Book, Photo.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "supportedCommands", + "in": "query", + "description": "A list of supported remote control commands, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneralCommandType" + } + } + }, + { + "name": "supportsMediaControl", + "in": "query", + "description": "Determines whether media can be played remotely..", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "supportsPersistentIdentifier", + "in": "query", + "description": "Determines whether the device supports a unique identifier.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "204": { + "description": "Capabilities posted." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Capabilities/Full": { + "post": { + "tags": [ + "Session" + ], + "summary": "Updates capabilities for a device.", + "operationId": "PostFullCapabilities", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "The session id.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The MediaBrowser.Model.Session.ClientCapabilities.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Client capabilities dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Client capabilities dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Client capabilities dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Capabilities updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Logout": { + "post": { + "tags": [ + "Session" + ], + "summary": "Reports that a session has ended.", + "operationId": "ReportSessionEnded", + "responses": { + "204": { + "description": "Session end reported to server." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Sessions/Viewing": { + "post": { + "tags": [ + "Session" + ], + "summary": "Reports that a session is viewing an item.", + "operationId": "ReportViewing", + "parameters": [ + { + "name": "sessionId", + "in": "query", + "description": "The session id.", + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Session reported to server." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/Complete": { + "post": { + "tags": [ + "Startup" + ], + "summary": "Completes the startup wizard.", + "operationId": "CompleteWizard", + "responses": { + "204": { + "description": "Startup wizard completed." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/Configuration": { + "get": { + "tags": [ + "Startup" + ], + "summary": "Gets the initial startup wizard configuration.", + "operationId": "GetStartupConfiguration", + "responses": { + "200": { + "description": "Initial startup wizard configuration retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Startup" + ], + "summary": "Sets the initial startup wizard configuration.", + "operationId": "UpdateInitialConfiguration", + "requestBody": { + "description": "The updated startup configuration.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + ], + "description": "The startup configuration DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + ], + "description": "The startup configuration DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupConfigurationDto" + } + ], + "description": "The startup configuration DTO." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Configuration saved." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/FirstUser": { + "get": { + "tags": [ + "Startup" + ], + "summary": "Gets the first user.", + "operationId": "GetFirstUser_2", + "responses": { + "200": { + "description": "Initial user retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/RemoteAccess": { + "post": { + "tags": [ + "Startup" + ], + "summary": "Sets remote access and UPnP.", + "operationId": "SetRemoteAccess", + "requestBody": { + "description": "The startup remote access dto.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupRemoteAccessDto" + } + ], + "description": "Startup remote access dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupRemoteAccessDto" + } + ], + "description": "Startup remote access dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupRemoteAccessDto" + } + ], + "description": "Startup remote access dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Configuration saved." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Startup/User": { + "get": { + "tags": [ + "Startup" + ], + "summary": "Gets the first user.", + "operationId": "GetFirstUser", + "responses": { + "200": { + "description": "Initial user retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/StartupUserDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "Startup" + ], + "summary": "Sets the user name and password.", + "operationId": "UpdateStartupUser", + "requestBody": { + "description": "The DTO containing username and password.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupUserDto" + } + ], + "description": "The startup user DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupUserDto" + } + ], + "description": "The startup user DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/StartupUserDto" + } + ], + "description": "The startup user DTO." + } + } + } + }, + "responses": { + "204": { + "description": "Updated user name and password." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrElevated", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Studios": { + "get": { + "tags": [ + "Studios" + ], + "summary": "Gets all studios from a given item, folder, or the entire library.", + "operationId": "GetStudios", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Search term.", + "schema": { + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Total record count.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Studios returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Studios/{name}": { + "get": { + "tags": [ + "Studios" + ], + "summary": "Gets a studio by name.", + "operationId": "GetStudio", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Studio name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Studio returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/FallbackFont/Fonts": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets a list of available fallback font files.", + "operationId": "GetFallbackFontList", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FontFile" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FontFile" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FontFile" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/FallbackFont/Fonts/{name}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets a fallback font file.", + "operationId": "GetFallbackFont", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the fallback font file to get.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Fallback font file retrieved.", + "content": { + "font/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteSearch/Subtitles/{language}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Search remote subtitles.", + "operationId": "SearchRemoteSubtitles", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "language", + "in": "path", + "description": "The language of the subtitles.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "isPerfectMatch", + "in": "query", + "description": "Optional. Only show subtitles which are a perfect match.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Subtitles retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSubtitleInfo" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSubtitleInfo" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSubtitleInfo" + } + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SubtitleManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/RemoteSearch/Subtitles/{subtitleId}": { + "post": { + "tags": [ + "Subtitle" + ], + "summary": "Downloads a remote subtitle.", + "operationId": "DownloadRemoteSubtitles", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "subtitleId", + "in": "path", + "description": "The subtitle id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Subtitle downloaded." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SubtitleManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Providers/Subtitles/Subtitles/{subtitleId}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets the remote subtitles.", + "operationId": "GetRemoteSubtitles", + "parameters": [ + { + "name": "subtitleId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "text/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SubtitleManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/subtitles.m3u8": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets an HLS subtitle playlist.", + "operationId": "GetSubtitlePlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "index", + "in": "path", + "description": "The subtitle stream index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "path", + "description": "The media source id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The subtitle segment length.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Subtitle playlist retrieved.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/Subtitles": { + "post": { + "tags": [ + "Subtitle" + ], + "summary": "Upload an external subtitle file.", + "operationId": "UploadSubtitle", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item the subtitle belongs to.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The request body.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UploadSubtitleDto" + } + ], + "description": "Upload subtitles dto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UploadSubtitleDto" + } + ], + "description": "Upload subtitles dto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UploadSubtitleDto" + } + ], + "description": "Upload subtitles dto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Subtitle uploaded." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SubtitleManagement", + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/Subtitles/{index}": { + "delete": { + "tags": [ + "Subtitle" + ], + "summary": "Deletes an external subtitle file.", + "operationId": "DeleteSubtitle", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "index", + "in": "path", + "description": "The index of the subtitle file.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "204": { + "description": "Subtitle deleted." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/{routeStartPositionTicks}/Stream.{routeFormat}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets subtitles in a specified format.", + "operationId": "GetSubtitleWithTicks", + "parameters": [ + { + "name": "routeItemId", + "in": "path", + "description": "The (route) item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "routeMediaSourceId", + "in": "path", + "description": "The (route) media source id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "routeIndex", + "in": "path", + "description": "The (route) subtitle stream index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "routeStartPositionTicks", + "in": "path", + "description": "The (route) start position of the subtitle in ticks.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "routeFormat", + "in": "path", + "description": "The (route) format of the returned subtitle.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media source id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "index", + "in": "query", + "description": "The subtitle stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startPositionTicks", + "in": "query", + "description": "The start position of the subtitle in ticks.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "format", + "in": "query", + "description": "The format of the returned subtitle.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "endPositionTicks", + "in": "query", + "description": "Optional. The end position of the subtitle in ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Optional. Whether to copy the timestamps.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "addVttTimeMap", + "in": "query", + "description": "Optional. Whether to add a VTT time map.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "text/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/Stream.{routeFormat}": { + "get": { + "tags": [ + "Subtitle" + ], + "summary": "Gets subtitles in a specified format.", + "operationId": "GetSubtitle", + "parameters": [ + { + "name": "routeItemId", + "in": "path", + "description": "The (route) item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "routeMediaSourceId", + "in": "path", + "description": "The (route) media source id.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "routeIndex", + "in": "path", + "description": "The (route) subtitle stream index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "routeFormat", + "in": "path", + "description": "The (route) format of the returned subtitle.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "itemId", + "in": "query", + "description": "The item id.", + "deprecated": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media source id.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "index", + "in": "query", + "description": "The subtitle stream index.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "format", + "in": "query", + "description": "The format of the returned subtitle.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "endPositionTicks", + "in": "query", + "description": "Optional. The end position of the subtitle in ticks.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Optional. Whether to copy the timestamps.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "addVttTimeMap", + "in": "query", + "description": "Optional. Whether to add a VTT time map.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "startPositionTicks", + "in": "query", + "description": "The start position of the subtitle in ticks.", + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "File returned.", + "content": { + "text/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Items/Suggestions": { + "get": { + "tags": [ + "Suggestions" + ], + "summary": "Gets suggestions.", + "operationId": "GetSuggestions", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaType", + "in": "query", + "description": "The media types.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "type", + "in": "query", + "description": "The type.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The start index.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The limit.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Whether to enable the total record count.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Suggestions returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/{id}": { + "get": { + "tags": [ + "SyncPlay" + ], + "summary": "Gets a SyncPlay group by id.", + "operationId": "SyncPlayGetGroup", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The id of the group.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Group returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GroupInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/GroupInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayJoinGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Buffering": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Notify SyncPlay group that member is buffering.", + "operationId": "SyncPlayBuffering", + "requestBody": { + "description": "The player status.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BufferRequestDto" + } + ], + "description": "Class BufferRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BufferRequestDto" + } + ], + "description": "Class BufferRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/BufferRequestDto" + } + ], + "description": "Class BufferRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Group state update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Join": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Join an existing SyncPlay group.", + "operationId": "SyncPlayJoinGroup", + "requestBody": { + "description": "The group to join.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/JoinGroupRequestDto" + } + ], + "description": "Class JoinGroupRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/JoinGroupRequestDto" + } + ], + "description": "Class JoinGroupRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/JoinGroupRequestDto" + } + ], + "description": "Class JoinGroupRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Group join successful." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayJoinGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Leave": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Leave the joined SyncPlay group.", + "operationId": "SyncPlayLeaveGroup", + "responses": { + "204": { + "description": "Group leave successful." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/List": { + "get": { + "tags": [ + "SyncPlay" + ], + "summary": "Gets all SyncPlay groups.", + "operationId": "SyncPlayGetGroups", + "responses": { + "200": { + "description": "Groups returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayJoinGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/MovePlaylistItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to move an item in the playlist in SyncPlay group.", + "operationId": "SyncPlayMovePlaylistItem", + "requestBody": { + "description": "The new position for the item.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovePlaylistItemRequestDto" + } + ], + "description": "Class MovePlaylistItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovePlaylistItemRequestDto" + } + ], + "description": "Class MovePlaylistItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/MovePlaylistItemRequestDto" + } + ], + "description": "Class MovePlaylistItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/New": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Create a new SyncPlay group.", + "operationId": "SyncPlayCreateGroup", + "requestBody": { + "description": "The settings of the new group.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NewGroupRequestDto" + } + ], + "description": "Class NewGroupRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NewGroupRequestDto" + } + ], + "description": "Class NewGroupRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NewGroupRequestDto" + } + ], + "description": "Class NewGroupRequestDto." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GroupInfoDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/GroupInfoDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/GroupInfoDto" + } + } + } + }, + "204": { + "description": "New group created." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayCreateGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/NextItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request next item in SyncPlay group.", + "operationId": "SyncPlayNextItem", + "requestBody": { + "description": "The current item information.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NextItemRequestDto" + } + ], + "description": "Class NextItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NextItemRequestDto" + } + ], + "description": "Class NextItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/NextItemRequestDto" + } + ], + "description": "Class NextItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Next item update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Pause": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request pause in SyncPlay group.", + "operationId": "SyncPlayPause", + "responses": { + "204": { + "description": "Pause update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Ping": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Update session ping.", + "operationId": "SyncPlayPing", + "requestBody": { + "description": "The new ping.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PingRequestDto" + } + ], + "description": "Class PingRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PingRequestDto" + } + ], + "description": "Class PingRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PingRequestDto" + } + ], + "description": "Class PingRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Ping updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/PreviousItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request previous item in SyncPlay group.", + "operationId": "SyncPlayPreviousItem", + "requestBody": { + "description": "The current item information.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PreviousItemRequestDto" + } + ], + "description": "Class PreviousItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PreviousItemRequestDto" + } + ], + "description": "Class PreviousItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PreviousItemRequestDto" + } + ], + "description": "Class PreviousItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Previous item update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Queue": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to queue items to the playlist of a SyncPlay group.", + "operationId": "SyncPlayQueue", + "requestBody": { + "description": "The items to add.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QueueRequestDto" + } + ], + "description": "Class QueueRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QueueRequestDto" + } + ], + "description": "Class QueueRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QueueRequestDto" + } + ], + "description": "Class QueueRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Ready": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Notify SyncPlay group that member is ready for playback.", + "operationId": "SyncPlayReady", + "requestBody": { + "description": "The player status.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ReadyRequestDto" + } + ], + "description": "Class ReadyRequest." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ReadyRequestDto" + } + ], + "description": "Class ReadyRequest." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ReadyRequestDto" + } + ], + "description": "Class ReadyRequest." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Group state update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/RemoveFromPlaylist": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to remove items from the playlist in SyncPlay group.", + "operationId": "SyncPlayRemoveFromPlaylist", + "requestBody": { + "description": "The items to remove.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveFromPlaylistRequestDto" + } + ], + "description": "Class RemoveFromPlaylistRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveFromPlaylistRequestDto" + } + ], + "description": "Class RemoveFromPlaylistRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveFromPlaylistRequestDto" + } + ], + "description": "Class RemoveFromPlaylistRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Seek": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request seek in SyncPlay group.", + "operationId": "SyncPlaySeek", + "requestBody": { + "description": "The new playback position.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeekRequestDto" + } + ], + "description": "Class SeekRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeekRequestDto" + } + ], + "description": "Class SeekRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SeekRequestDto" + } + ], + "description": "Class SeekRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Seek update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetIgnoreWait": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request SyncPlay group to ignore member during group-wait.", + "operationId": "SyncPlaySetIgnoreWait", + "requestBody": { + "description": "The settings to set.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/IgnoreWaitRequestDto" + } + ], + "description": "Class IgnoreWaitRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/IgnoreWaitRequestDto" + } + ], + "description": "Class IgnoreWaitRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/IgnoreWaitRequestDto" + } + ], + "description": "Class IgnoreWaitRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Member state updated." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetNewQueue": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to set new playlist in SyncPlay group.", + "operationId": "SyncPlaySetNewQueue", + "requestBody": { + "description": "The new playlist to play in the group.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequestDto" + } + ], + "description": "Class PlayRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequestDto" + } + ], + "description": "Class PlayRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequestDto" + } + ], + "description": "Class PlayRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetPlaylistItem": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to change playlist item in SyncPlay group.", + "operationId": "SyncPlaySetPlaylistItem", + "requestBody": { + "description": "The new item to play.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetPlaylistItemRequestDto" + } + ], + "description": "Class SetPlaylistItemRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetPlaylistItemRequestDto" + } + ], + "description": "Class SetPlaylistItemRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetPlaylistItemRequestDto" + } + ], + "description": "Class SetPlaylistItemRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Queue update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetRepeatMode": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to set repeat mode in SyncPlay group.", + "operationId": "SyncPlaySetRepeatMode", + "requestBody": { + "description": "The new repeat mode.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetRepeatModeRequestDto" + } + ], + "description": "Class SetRepeatModeRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetRepeatModeRequestDto" + } + ], + "description": "Class SetRepeatModeRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetRepeatModeRequestDto" + } + ], + "description": "Class SetRepeatModeRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Play queue update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/SetShuffleMode": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request to set shuffle mode in SyncPlay group.", + "operationId": "SyncPlaySetShuffleMode", + "requestBody": { + "description": "The new shuffle mode.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetShuffleModeRequestDto" + } + ], + "description": "Class SetShuffleModeRequestDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetShuffleModeRequestDto" + } + ], + "description": "Class SetShuffleModeRequestDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SetShuffleModeRequestDto" + } + ], + "description": "Class SetShuffleModeRequestDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Play queue update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Stop": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request stop in SyncPlay group.", + "operationId": "SyncPlayStop", + "responses": { + "204": { + "description": "Stop update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/SyncPlay/Unpause": { + "post": { + "tags": [ + "SyncPlay" + ], + "summary": "Request unpause in SyncPlay group.", + "operationId": "SyncPlayUnpause", + "responses": { + "204": { + "description": "Unpause update sent to all group members." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "SyncPlayIsInGroup", + "SyncPlayHasAccess", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Endpoint": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets information about the request endpoint.", + "operationId": "GetEndpointInfo", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndPointInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/EndPointInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/EndPointInfo" + } + } + } + }, + "403": { + "description": "User does not have permission to get endpoint information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Info": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets information about the server.", + "operationId": "GetSystemInfo", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + }, + "403": { + "description": "User does not have permission to retrieve information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "FirstTimeSetupOrIgnoreParentalControl", + "DefaultAuthorization" + ] + } + ] + } + }, + "/System/Info/Public": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets public information about the server.", + "operationId": "GetPublicSystemInfo", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicSystemInfo" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PublicSystemInfo" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PublicSystemInfo" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/System/Info/Storage": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets information about the server.", + "operationId": "GetSystemStorage", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemStorageDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/SystemStorageDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/SystemStorageDto" + } + } + } + }, + "403": { + "description": "User does not have permission to retrieve information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/System/Logs": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets a list of available server log files.", + "operationId": "GetServerLogs", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogFile" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogFile" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogFile" + } + } + } + } + }, + "403": { + "description": "User does not have permission to get server logs.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/System/Logs/Log": { + "get": { + "tags": [ + "System" + ], + "summary": "Gets a log file.", + "operationId": "GetLogFile", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "The name of the log file to get.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Log file retrieved.", + "content": { + "text/plain": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "403": { + "description": "User does not have permission to get log files.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Could not find a log file with the name.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/System/Ping": { + "get": { + "tags": [ + "System" + ], + "summary": "Pings the system.", + "operationId": "GetPingSystem", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "post": { + "tags": [ + "System" + ], + "summary": "Pings the system.", + "operationId": "PostPingSystem", + "responses": { + "200": { + "description": "Information retrieved.", + "content": { + "application/json": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "string" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "string" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/System/Restart": { + "post": { + "tags": [ + "System" + ], + "summary": "Restarts the application.", + "operationId": "RestartApplication", + "responses": { + "204": { + "description": "Server restarted." + }, + "403": { + "description": "User does not have permission to restart server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "LocalAccessOrRequiresElevation" + ] + } + ] + } + }, + "/System/Shutdown": { + "post": { + "tags": [ + "System" + ], + "summary": "Shuts down the application.", + "operationId": "ShutdownApplication", + "responses": { + "204": { + "description": "Server shut down." + }, + "403": { + "description": "User does not have permission to shutdown server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/GetUtcTime": { + "get": { + "tags": [ + "TimeSync" + ], + "summary": "Gets the current UTC time.", + "operationId": "GetUtcTime", + "responses": { + "200": { + "description": "Time returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UtcTimeResponse" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UtcTimeResponse" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UtcTimeResponse" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Tmdb/ClientConfiguration": { + "get": { + "tags": [ + "Tmdb" + ], + "summary": "Gets the TMDb image configuration options.", + "operationId": "TmdbClientConfiguration", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigImageTypes" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Trailers": { + "get": { + "tags": [ + "Trailers" + ], + "summary": "Finds movies and trailers similar to a given trailer.", + "operationId": "GetTrailers", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id supplied as query parameter; this is required when not using an API key.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "maxOfficialRating", + "in": "query", + "description": "Optional filter by maximum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "hasThemeSong", + "in": "query", + "description": "Optional filter by items with theme songs.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasThemeVideo", + "in": "query", + "description": "Optional filter by items with theme videos.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSubtitles", + "in": "query", + "description": "Optional filter by items with subtitles.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasSpecialFeature", + "in": "query", + "description": "Optional filter by items with special features.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTrailer", + "in": "query", + "description": "Optional filter by items with trailers.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentIndexNumber", + "in": "query", + "description": "Optional filter by parent index number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "hasParentalRating", + "in": "query", + "description": "Optional filter by items that have or do not have a parental rating.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isHd", + "in": "query", + "description": "Optional filter by items that are HD or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "is4K", + "in": "query", + "description": "Optional filter by items that are 4K or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "locationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "excludeLocationTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationType" + } + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isUnaired", + "in": "query", + "description": "Optional filter by items that are unaired episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minCommunityRating", + "in": "query", + "description": "Optional filter by minimum community rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minCriticRating", + "in": "query", + "description": "Optional filter by minimum critic rating.", + "schema": { + "type": "number", + "format": "double" + } + }, + { + "name": "minPremiereDate", + "in": "query", + "description": "Optional. The minimum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSaved", + "in": "query", + "description": "Optional. The minimum last saved date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "minDateLastSavedForUser", + "in": "query", + "description": "Optional. The minimum last saved date for the current user. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "maxPremiereDate", + "in": "query", + "description": "Optional. The maximum premiere date. Format = ISO.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "hasOverview", + "in": "query", + "description": "Optional filter by items that have an overview or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasImdbId", + "in": "query", + "description": "Optional filter by items that have an IMDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTmdbId", + "in": "query", + "description": "Optional filter by items that have a TMDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasTvdbId", + "in": "query", + "description": "Optional filter by items that have a TVDb id or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMovie", + "in": "query", + "description": "Optional filter for live tv movies.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSeries", + "in": "query", + "description": "Optional filter for live tv series.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isNews", + "in": "query", + "description": "Optional filter for live tv news.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isKids", + "in": "query", + "description": "Optional filter for live tv kids.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isSports", + "in": "query", + "description": "Optional filter for live tv sports.", + "schema": { + "type": "boolean" + } + }, + { + "name": "excludeItemIds", + "in": "query", + "description": "Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "recursive", + "in": "query", + "description": "When searching within folders, this determines whether or not the search will be recursive. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "searchTerm", + "in": "query", + "description": "Optional. Filter based on a search term.", + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending, Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "filters", + "in": "query", + "description": "Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFilter" + } + } + }, + { + "name": "isFavorite", + "in": "query", + "description": "Optional filter by items that are marked as favorite, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "imageTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "isPlayed", + "in": "query", + "description": "Optional filter by items that are played, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "genres", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "officialRatings", + "in": "query", + "description": "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "tags", + "in": "query", + "description": "Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "years", + "in": "query", + "description": "Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional, include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "person", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person.", + "schema": { + "type": "string" + } + }, + { + "name": "personIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified person id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "personTypes", + "in": "query", + "description": "Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "studios", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "artists", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "excludeArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "artistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albumArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified album artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "contributingArtistIds", + "in": "query", + "description": "Optional. If specified, results will be filtered to include only those containing the specified contributing artist id.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "albums", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "albumIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "ids", + "in": "query", + "description": "Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "videoTypes", + "in": "query", + "description": "Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VideoType" + } + } + }, + { + "name": "minOfficialRating", + "in": "query", + "description": "Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).", + "schema": { + "type": "string" + } + }, + { + "name": "isLocked", + "in": "query", + "description": "Optional filter by items that are locked.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isPlaceHolder", + "in": "query", + "description": "Optional filter by items that are placeholders.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasOfficialRating", + "in": "query", + "description": "Optional filter by items that have official ratings.", + "schema": { + "type": "boolean" + } + }, + { + "name": "collapseBoxSetItems", + "in": "query", + "description": "Whether or not to hide items behind their boxsets.", + "schema": { + "type": "boolean" + } + }, + { + "name": "minWidth", + "in": "query", + "description": "Optional. Filter by the minimum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minHeight", + "in": "query", + "description": "Optional. Filter by the minimum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. Filter by the maximum width of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. Filter by the maximum height of the item.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "is3D", + "in": "query", + "description": "Optional filter by items that are 3D, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "seriesStatus", + "in": "query", + "description": "Optional filter by Series Status. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SeriesStatus" + } + } + }, + { + "name": "nameStartsWithOrGreater", + "in": "query", + "description": "Optional filter by items whose name is sorted equally or greater than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameStartsWith", + "in": "query", + "description": "Optional filter by items whose name is sorted equally than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "nameLessThan", + "in": "query", + "description": "Optional filter by items whose name is equally or lesser than a given input string.", + "schema": { + "type": "string" + } + }, + { + "name": "studioIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "genreIds", + "in": "query", + "description": "Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Optional. Enable the total record count.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/Trickplay/{width}/{index}.jpg": { + "get": { + "tags": [ + "Trickplay" + ], + "summary": "Gets a trickplay tile image.", + "operationId": "GetTrickplayTileImage", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "width", + "in": "path", + "description": "The width of a single tile.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "index", + "in": "path", + "description": "The index of the desired tile.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if using an alternate version.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Tile image not found at specified index.", + "content": { + "image/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/Trickplay/{width}/tiles.m3u8": { + "get": { + "tags": [ + "Trickplay" + ], + "summary": "Gets an image tiles playlist for trickplay.", + "operationId": "GetTrickplayHlsPlaylist", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "width", + "in": "path", + "description": "The width of a single tile.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if using an alternate version.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Tiles playlist returned.", + "content": { + "application/x-mpegURL": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/{seriesId}/Episodes": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets episodes for a tv season.", + "operationId": "GetEpisodes", + "parameters": [ + { + "name": "seriesId", + "in": "path", + "description": "The series id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "season", + "in": "query", + "description": "Optional filter by season number.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "seasonId", + "in": "query", + "description": "Optional. Filter by season id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional. Filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startItemId", + "in": "query", + "description": "Optional. Skip through the list until a given item is found.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional, include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional, the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "enum": [ + "Default", + "AiredEpisodeOrder", + "Album", + "AlbumArtist", + "Artist", + "DateCreated", + "OfficialRating", + "DatePlayed", + "PremiereDate", + "StartDate", + "SortName", + "Name", + "Random", + "Runtime", + "CommunityRating", + "ProductionYear", + "PlayCount", + "CriticRating", + "IsFolder", + "IsUnplayed", + "IsPlayed", + "SeriesSortName", + "VideoBitRate", + "AirTime", + "Studio", + "IsFavoriteOrLiked", + "DateLastContentAdded", + "SeriesDatePlayed", + "ParentIndexNumber", + "IndexNumber" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ItemSortBy" + } + ] + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/{seriesId}/Seasons": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets seasons for a tv series.", + "operationId": "GetSeasons", + "parameters": [ + { + "name": "seriesId", + "in": "path", + "description": "The series id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "isSpecialSeason", + "in": "query", + "description": "Optional. Filter by special season.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isMissing", + "in": "query", + "description": "Optional. Filter by items that are missing episodes or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "adjacentTo", + "in": "query", + "description": "Optional. Return items that are siblings of a supplied item.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/NextUp": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets a list of next up episodes.", + "operationId": "GetNextUp", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id of the user to get the next up episodes for.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "seriesId", + "in": "query", + "description": "Optional. Filter by series id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "nextUpDateCutoff", + "in": "query", + "description": "Optional. Starting date of shows to show in Next Up section.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "enableTotalRecordCount", + "in": "query", + "description": "Whether to enable the total records count. Defaults to true.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "disableFirstEpisode", + "in": "query", + "description": "Whether to disable sending the first episode in a series as next up.", + "deprecated": true, + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableResumable", + "in": "query", + "description": "Whether to include resumable episodes in next up results.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableRewatching", + "in": "query", + "description": "Whether to include watched episodes in next up results.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Shows/Upcoming": { + "get": { + "tags": [ + "TvShows" + ], + "summary": "Gets a list of upcoming episodes.", + "operationId": "GetUpcomingEpisodes", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id of the user to get the upcoming episodes for.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The record index to start at. All items with a lower index will be dropped from the results.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Optional. Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Audio/{itemId}/universal": { + "get": { + "tags": [ + "UniversalAudio" + ], + "summary": "Gets an audio stream.", + "operationId": "GetUniversalAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "Optional. The audio container.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. The audio codec to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "transcodingAudioChannels", + "in": "query", + "description": "Optional. The number of how many audio channels to transcode to.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "transcodingContainer", + "in": "query", + "description": "Optional. The container to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodingProtocol", + "in": "query", + "description": "Optional. The transcoding protocol.", + "schema": { + "enum": [ + "http", + "hls" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamProtocol" + } + ] + } + }, + { + "name": "maxAudioSampleRate", + "in": "query", + "description": "Optional. The maximum audio sample rate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableRemoteMedia", + "in": "query", + "description": "Optional. Whether to enable remote media.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableRedirection", + "in": "query", + "description": "Whether to enable redirection. Defaults to true.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "302": { + "description": "Redirected to remote audio stream." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "head": { + "tags": [ + "UniversalAudio" + ], + "summary": "Gets an audio stream.", + "operationId": "HeadUniversalAudioStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "Optional. The audio container.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. The audio codec to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "transcodingAudioChannels", + "in": "query", + "description": "Optional. The number of how many audio channels to transcode to.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxStreamingBitrate", + "in": "query", + "description": "Optional. The maximum streaming bitrate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "transcodingContainer", + "in": "query", + "description": "Optional. The container to transcode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodingProtocol", + "in": "query", + "description": "Optional. The transcoding protocol.", + "schema": { + "enum": [ + "http", + "hls" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamProtocol" + } + ] + } + }, + { + "name": "maxAudioSampleRate", + "in": "query", + "description": "Optional. The maximum audio sample rate.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableRemoteMedia", + "in": "query", + "description": "Optional. Whether to enable remote media.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "enableRedirection", + "in": "query", + "description": "Whether to enable redirection. Defaults to true.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Audio stream returned.", + "content": { + "audio/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "302": { + "description": "Redirected to remote audio stream." + }, + "404": { + "description": "Item not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets a list of users.", + "operationId": "GetUsers", + "parameters": [ + { + "name": "isHidden", + "in": "query", + "description": "Optional filter by IsHidden=true or false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "isDisabled", + "in": "query", + "description": "Optional filter by IsDisabled=true or false.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Users returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user.", + "operationId": "UpdateUser", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The updated user model.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User updated." + }, + "400": { + "description": "User information was not supplied.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User update forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/{userId}": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets a user by Id.", + "operationId": "GetUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "User returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + } + } + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "IgnoreParentalControl", + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "User" + ], + "summary": "Deletes a user.", + "operationId": "DeleteUser", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "User deleted." + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Users/{userId}/Policy": { + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user policy.", + "operationId": "UpdateUserPolicy", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The new user policy.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ] + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ] + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User policy updated." + }, + "400": { + "description": "User policy was not supplied.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "User policy update forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Users/AuthenticateByName": { + "post": { + "tags": [ + "User" + ], + "summary": "Authenticates a user by name.", + "operationId": "AuthenticateUserByName", + "requestBody": { + "description": "The M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) request.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AuthenticateUserByName" + } + ], + "description": "The authenticate user by name request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AuthenticateUserByName" + } + ], + "description": "The authenticate user by name request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/AuthenticateUserByName" + } + ], + "description": "The authenticate user by name request body." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "User authenticated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Users/AuthenticateWithQuickConnect": { + "post": { + "tags": [ + "User" + ], + "summary": "Authenticates a user with quick connect.", + "operationId": "AuthenticateWithQuickConnect", + "requestBody": { + "description": "The Jellyfin.Api.Models.UserDtos.QuickConnectDto request.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QuickConnectDto" + } + ], + "description": "The quick connect request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QuickConnectDto" + } + ], + "description": "The quick connect request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/QuickConnectDto" + } + ], + "description": "The quick connect request body." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "User authenticated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/AuthenticationResult" + } + } + } + }, + "400": { + "description": "Missing token." + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Users/Configuration": { + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user configuration.", + "operationId": "UpdateUserConfiguration", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The new user configuration.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Class UserConfiguration." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Class UserConfiguration." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Class UserConfiguration." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "User configuration updated." + }, + "403": { + "description": "User configuration update forbidden.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/ForgotPassword": { + "post": { + "tags": [ + "User" + ], + "summary": "Initiates the forgot password process for a local user.", + "operationId": "ForgotPassword", + "requestBody": { + "description": "The forgot password request containing the entered username.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordDto" + } + ], + "description": "Forgot Password request body DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordDto" + } + ], + "description": "Forgot Password request body DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordDto" + } + ], + "description": "Forgot Password request body DTO." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Password reset process started.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForgotPasswordResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ForgotPasswordResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ForgotPasswordResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Users/ForgotPassword/Pin": { + "post": { + "tags": [ + "User" + ], + "summary": "Redeems a forgot password pin.", + "operationId": "ForgotPasswordPin", + "requestBody": { + "description": "The forgot password pin request containing the entered pin.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordPinDto" + } + ], + "description": "Forgot Password Pin enter request body DTO." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordPinDto" + } + ], + "description": "Forgot Password Pin enter request body DTO." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordPinDto" + } + ], + "description": "Forgot Password Pin enter request body DTO." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Pin reset process started.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PinRedeemResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/PinRedeemResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/PinRedeemResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Users/Me": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets the user based on auth token.", + "operationId": "GetCurrentUser", + "responses": { + "200": { + "description": "User returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + } + } + }, + "400": { + "description": "Token is not owned by a user.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/New": { + "post": { + "tags": [ + "User" + ], + "summary": "Creates a user.", + "operationId": "CreateUserByName", + "requestBody": { + "description": "The create user by name request body.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreateUserByName" + } + ], + "description": "The create user by name request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreateUserByName" + } + ], + "description": "The create user by name request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreateUserByName" + } + ], + "description": "The create user by name request body." + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "User created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Users/Password": { + "post": { + "tags": [ + "User" + ], + "summary": "Updates a user's password.", + "operationId": "UpdateUserPassword", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "The user id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "description": "The M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Nullable{System.Guid},Jellyfin.Api.Models.UserDtos.UpdateUserPassword) request.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserPassword" + } + ], + "description": "The update user password request body." + } + }, + "text/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserPassword" + } + ], + "description": "The update user password request body." + } + }, + "application/*+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateUserPassword" + } + ], + "description": "The update user password request body." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Password successfully reset." + }, + "403": { + "description": "User is not allowed to update the password.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Users/Public": { + "get": { + "tags": [ + "User" + ], + "summary": "Gets a list of publicly visible users for display on a login screen.", + "operationId": "GetPublicUsers", + "responses": { + "200": { + "description": "Public users returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Items/{itemId}/Intros": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets intros to play before the main media item plays.", + "operationId": "GetIntros", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Intros returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/LocalTrailers": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets local trailers for an item.", + "operationId": "GetLocalTrailers", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "An Microsoft.AspNetCore.Mvc.OkResult containing the item's local trailers.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/{itemId}/SpecialFeatures": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets special features for an item.", + "operationId": "GetSpecialFeatures", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Special features returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Latest": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets latest media.", + "operationId": "GetLatestMedia", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "isPlayed", + "in": "query", + "description": "Filter by items that are played, or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. include image information in output.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. the max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "limit", + "in": "query", + "description": "Return item limit.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + } + }, + { + "name": "groupItems", + "in": "query", + "description": "Whether or not to group items into a parent container.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Latest media returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Items/Root": { + "get": { + "tags": [ + "UserLibrary" + ], + "summary": "Gets the root folder from a user's library.", + "operationId": "GetRootFolder", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Root folder returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserFavoriteItems/{itemId}": { + "post": { + "tags": [ + "UserLibrary" + ], + "summary": "Marks an item as a favorite.", + "operationId": "MarkFavoriteItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item marked as favorite.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "delete": { + "tags": [ + "UserLibrary" + ], + "summary": "Unmarks item as a favorite.", + "operationId": "UnmarkFavoriteItem", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Item unmarked as favorite.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserItems/{itemId}/Rating": { + "delete": { + "tags": [ + "UserLibrary" + ], + "summary": "Deletes a user's saved personal rating for an item.", + "operationId": "DeleteUserItemRating", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Personal rating removed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + }, + "post": { + "tags": [ + "UserLibrary" + ], + "summary": "Updates a user's rating for an item.", + "operationId": "UpdateUserItemRating", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "itemId", + "in": "path", + "description": "Item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "likes", + "in": "query", + "description": "Whether this M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Nullable{System.Guid},System.Guid,System.Nullable{System.Boolean}) is likes.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Item rating updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/UserItemDataDto" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserViews": { + "get": { + "tags": [ + "UserViews" + ], + "summary": "Get user views.", + "operationId": "GetUserViews", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeExternalContent", + "in": "query", + "description": "Whether or not to include external views such as channels or live tv.", + "schema": { + "type": "boolean" + } + }, + { + "name": "presetViews", + "in": "query", + "description": "Preset views.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollectionType" + } + } + }, + { + "name": "includeHidden", + "in": "query", + "description": "Whether or not to include hidden content.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "200": { + "description": "User views returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/UserViews/GroupingOptions": { + "get": { + "tags": [ + "UserViews" + ], + "summary": "Get user view grouping options.", + "operationId": "GetGroupingOptions", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "User id.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "User view grouping options returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpecialViewOptionDto" + } + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpecialViewOptionDto" + } + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpecialViewOptionDto" + } + } + } + } + }, + "404": { + "description": "User not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{videoId}/{mediaSourceId}/Attachments/{index}": { + "get": { + "tags": [ + "VideoAttachments" + ], + "summary": "Get video attachment.", + "operationId": "GetAttachment", + "parameters": [ + { + "name": "videoId", + "in": "path", + "description": "Video ID.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "mediaSourceId", + "in": "path", + "description": "Media Source ID.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "index", + "in": "path", + "description": "Attachment Index.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Attachment retrieved.", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Video or attachment not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Videos/{itemId}/AdditionalParts": { + "get": { + "tags": [ + "Videos" + ], + "summary": "Gets additional parts for a video.", + "operationId": "GetAdditionalPart", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Additional parts returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Videos/{itemId}/AlternateSources": { + "delete": { + "tags": [ + "Videos" + ], + "summary": "Removes alternate video sources.", + "operationId": "DeleteAlternateSources", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "Alternate sources deleted." + }, + "404": { + "description": "Video not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Videos/{itemId}/stream": { + "get": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "GetVideoStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "HeadVideoStream", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "query", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Videos/{itemId}/stream.{container}": { + "get": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "GetVideoStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + }, + "head": { + "tags": [ + "Videos" + ], + "summary": "Gets a video stream.", + "operationId": "HeadVideoStreamByContainer", + "parameters": [ + { + "name": "itemId", + "in": "path", + "description": "The item id.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "container", + "in": "path", + "description": "The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv.", + "required": true, + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "static", + "in": "query", + "description": "Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "params", + "in": "query", + "description": "The streaming parameters.", + "schema": { + "type": "string" + } + }, + { + "name": "tag", + "in": "query", + "description": "The tag.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "Optional. The dlna device profile id to utilize.", + "schema": { + "type": "string" + } + }, + { + "name": "playSessionId", + "in": "query", + "description": "The play session id.", + "schema": { + "type": "string" + } + }, + { + "name": "segmentContainer", + "in": "query", + "description": "The segment container.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "segmentLength", + "in": "query", + "description": "The segment length.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "minSegments", + "in": "query", + "description": "The minimum number of segments.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "The media version id, if playing an alternate version.", + "schema": { + "type": "string" + } + }, + { + "name": "deviceId", + "in": "query", + "description": "The device id of the client requesting. Used to stop encoding processes when needed.", + "schema": { + "type": "string" + } + }, + { + "name": "audioCodec", + "in": "query", + "description": "Optional. Specify an audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "enableAutoStreamCopy", + "in": "query", + "description": "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowVideoStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the video stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "allowAudioStreamCopy", + "in": "query", + "description": "Whether or not to allow copying of the audio stream url.", + "schema": { + "type": "boolean" + } + }, + { + "name": "breakOnNonKeyFrames", + "in": "query", + "description": "Optional. Whether to break on non key frames.", + "schema": { + "type": "boolean" + } + }, + { + "name": "audioSampleRate", + "in": "query", + "description": "Optional. Specify a specific audio sample rate, e.g. 44100.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioBitDepth", + "in": "query", + "description": "Optional. The maximum audio bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioBitRate", + "in": "query", + "description": "Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "audioChannels", + "in": "query", + "description": "Optional. Specify a specific number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxAudioChannels", + "in": "query", + "description": "Optional. Specify a maximum number of audio channels to encode to, e.g. 2.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "profile", + "in": "query", + "description": "Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high.", + "schema": { + "type": "string" + } + }, + { + "name": "level", + "in": "query", + "description": "Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1.", + "schema": { + "pattern": "-?[0-9]+(?:\\.[0-9]+)?", + "type": "string" + } + }, + { + "name": "framerate", + "in": "query", + "description": "Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "maxFramerate", + "in": "query", + "description": "Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements.", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "copyTimestamps", + "in": "query", + "description": "Whether or not to copy timestamps when transcoding with an offset. Defaults to false.", + "schema": { + "type": "boolean" + } + }, + { + "name": "startTimeTicks", + "in": "query", + "description": "Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "width", + "in": "query", + "description": "Optional. The fixed horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "height", + "in": "query", + "description": "Optional. The fixed vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxWidth", + "in": "query", + "description": "Optional. The maximum horizontal resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxHeight", + "in": "query", + "description": "Optional. The maximum vertical resolution of the encoded video.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoBitRate", + "in": "query", + "description": "Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to use. If omitted no subtitles will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleMethod", + "in": "query", + "description": "Optional. Specify the subtitle delivery method.", + "schema": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ] + } + }, + { + "name": "maxRefFrames", + "in": "query", + "description": "Optional.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "maxVideoBitDepth", + "in": "query", + "description": "Optional. The maximum video bit depth.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "requireAvc", + "in": "query", + "description": "Optional. Whether to require avc.", + "schema": { + "type": "boolean" + } + }, + { + "name": "deInterlace", + "in": "query", + "description": "Optional. Whether to deinterlace the video.", + "schema": { + "type": "boolean" + } + }, + { + "name": "requireNonAnamorphic", + "in": "query", + "description": "Optional. Whether to require a non anamorphic stream.", + "schema": { + "type": "boolean" + } + }, + { + "name": "transcodingMaxAudioChannels", + "in": "query", + "description": "Optional. The maximum number of audio channels to transcode.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "cpuCoreLimit", + "in": "query", + "description": "Optional. The limit of how many cpu cores to use.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "liveStreamId", + "in": "query", + "description": "The live stream id.", + "schema": { + "type": "string" + } + }, + { + "name": "enableMpegtsM2TsMode", + "in": "query", + "description": "Optional. Whether to enable the MpegtsM2Ts mode.", + "schema": { + "type": "boolean" + } + }, + { + "name": "videoCodec", + "in": "query", + "description": "Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "subtitleCodec", + "in": "query", + "description": "Optional. Specify a subtitle codec to encode to.", + "schema": { + "pattern": "^[a-zA-Z0-9\\-\\._,|]{0,40}$", + "type": "string" + } + }, + { + "name": "transcodeReasons", + "in": "query", + "description": "Optional. The transcoding reason.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to use. If omitted the first audio stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "videoStreamIndex", + "in": "query", + "description": "Optional. The index of the video stream to use. If omitted the first video stream will be used.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "context", + "in": "query", + "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.", + "schema": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ] + } + }, + { + "name": "streamOptions", + "in": "query", + "description": "Optional. The streaming options.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + { + "name": "enableAudioVbrEncoding", + "in": "query", + "description": "Optional. Whether to enable Audio Encoding.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Video stream returned.", + "content": { + "video/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + } + } + } + }, + "/Videos/MergeVersions": { + "post": { + "tags": [ + "Videos" + ], + "summary": "Merges videos into a single record.", + "operationId": "MergeVersions", + "parameters": [ + { + "name": "ids", + "in": "query", + "description": "Item id list. This allows multiple, comma delimited.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { + "204": { + "description": "Videos merged." + }, + "400": { + "description": "Supply at least 2 video ids.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "RequiresElevation" + ] + } + ] + } + }, + "/Years": { + "get": { + "tags": [ + "Years" + ], + "summary": "Get years.", + "operationId": "GetYears", + "parameters": [ + { + "name": "startIndex", + "in": "query", + "description": "Skips over a given number of items within the results. Use for paging.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional. The maximum number of records to return.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort Order - Ascending,Descending.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + } + } + }, + { + "name": "parentId", + "in": "query", + "description": "Specify this to localize the search to a specific item or folder. Omit to use the root.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "fields", + "in": "query", + "description": "Optional. Specify additional fields of information to return in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + } + } + }, + { + "name": "excludeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be excluded based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "includeItemTypes", + "in": "query", + "description": "Optional. If specified, results will be included based on item type. This allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemKind" + } + } + }, + { + "name": "mediaTypes", + "in": "query", + "description": "Optional. Filter by MediaType. Allows multiple, comma delimited.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + } + } + }, + { + "name": "enableUserData", + "in": "query", + "description": "Optional. Include user data.", + "schema": { + "type": "boolean" + } + }, + { + "name": "imageTypeLimit", + "in": "query", + "description": "Optional. The max number of images to return, per image type.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "enableImageTypes", + "in": "query", + "description": "Optional. The image types to include in the output.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + } + } + }, + { + "name": "userId", + "in": "query", + "description": "User Id.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "recursive", + "in": "query", + "description": "Search recursively.", + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "enableImages", + "in": "query", + "description": "Optional. Include image information in output.", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Year query returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDtoQueryResult" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + }, + "/Years/{year}": { + "get": { + "tags": [ + "Years" + ], + "summary": "Gets a year.", + "operationId": "GetYear", + "parameters": [ + { + "name": "year", + "in": "path", + "description": "The year.", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "userId", + "in": "query", + "description": "Optional. Filter by user id, and attach user data.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Year returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/BaseItemDto" + } + } + } + }, + "404": { + "description": "Year not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"CamelCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "application/json; profile=\"PascalCase\"": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "503": { + "description": "The server is currently starting or is temporarily not available.", + "headers": { + "Retry-After": { + "description": "A hint for when to retry the operation in full seconds.", + "allowEmptyValue": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "Message": { + "description": "A short plain-text reason why the server is not available.", + "allowEmptyValue": true, + "schema": { + "type": "string", + "format": "text" + } + } + }, + "content": { + "text/html": { } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "security": [ + { + "CustomAuthentication": [ + "DefaultAuthorization" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "AccessSchedule": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets the id of this instance.", + "format": "int32", + "readOnly": true + }, + "UserId": { + "type": "string", + "description": "Gets the id of the associated user.", + "format": "uuid" + }, + "DayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Everyday", + "Weekday", + "Weekend" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DynamicDayOfWeek" + } + ], + "description": "Gets or sets the day of week." + }, + "StartHour": { + "type": "number", + "description": "Gets or sets the start hour.", + "format": "double" + }, + "EndHour": { + "type": "number", + "description": "Gets or sets the end hour.", + "format": "double" + } + }, + "additionalProperties": false, + "description": "An entity representing a user's access schedule." + }, + "ActivityLogEntry": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets or sets the identifier.", + "format": "int64" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "Overview": { + "type": "string", + "description": "Gets or sets the overview.", + "nullable": true + }, + "ShortOverview": { + "type": "string", + "description": "Gets or sets the short overview.", + "nullable": true + }, + "Type": { + "type": "string", + "description": "Gets or sets the type." + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "nullable": true + }, + "Date": { + "type": "string", + "description": "Gets or sets the date.", + "format": "date-time" + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user identifier.", + "format": "uuid" + }, + "UserPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the user primary image tag.", + "nullable": true, + "deprecated": true + }, + "Severity": { + "enum": [ + "Trace", + "Debug", + "Information", + "Warning", + "Error", + "Critical", + "None" + ], + "allOf": [ + { + "$ref": "#/components/schemas/LogLevel" + } + ], + "description": "Gets or sets the log severity." + } + }, + "additionalProperties": false, + "description": "An activity log entry." + }, + "ActivityLogEntryMessage": { + "type": "object", + "properties": { + "Data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ActivityLogEntry" + }, + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ActivityLogEntry", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Activity log created message." + }, + "ActivityLogEntryQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ActivityLogEntry" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "ActivityLogEntryStartMessage": { + "type": "object", + "properties": { + "Data": { + "type": "string", + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ActivityLogEntryStart", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Activity log entry start message.\r\nData is the timing data encoded as \"$initialDelay,$interval\" in ms." + }, + "ActivityLogEntryStopMessage": { + "type": "object", + "properties": { + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ActivityLogEntryStop", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Activity log entry stop message." + }, + "AddVirtualFolderDto": { + "type": "object", + "properties": { + "LibraryOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryOptions" + } + ], + "description": "Gets or sets library options.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Add virtual folder dto." + }, + "AlbumInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "AlbumArtists": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the album artist." + }, + "ArtistProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the artist provider ids." + }, + "SongInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SongInfo" + } + } + }, + "additionalProperties": false + }, + "AlbumInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/AlbumInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "AllThemeMediaResult": { + "type": "object", + "properties": { + "ThemeVideosResult": { + "allOf": [ + { + "$ref": "#/components/schemas/ThemeMediaResult" + } + ], + "description": "Class ThemeMediaResult.", + "nullable": true + }, + "ThemeSongsResult": { + "allOf": [ + { + "$ref": "#/components/schemas/ThemeMediaResult" + } + ], + "description": "Class ThemeMediaResult.", + "nullable": true + }, + "SoundtrackSongsResult": { + "allOf": [ + { + "$ref": "#/components/schemas/ThemeMediaResult" + } + ], + "description": "Class ThemeMediaResult.", + "nullable": true + } + }, + "additionalProperties": false + }, + "ArtistInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "SongInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SongInfo" + } + } + }, + "additionalProperties": false + }, + "ArtistInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/ArtistInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "AudioSpatialFormat": { + "enum": [ + "None", + "DolbyAtmos", + "DTSX" + ], + "type": "string", + "description": "An enum representing formats of spatial audio." + }, + "AuthenticateUserByName": { + "type": "object", + "properties": { + "Username": { + "type": "string", + "description": "Gets or sets the username.", + "nullable": true + }, + "Pw": { + "type": "string", + "description": "Gets or sets the plain text password.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The authenticate user by name request body." + }, + "AuthenticationInfo": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets or sets the identifier.", + "format": "int64" + }, + "AccessToken": { + "type": "string", + "description": "Gets or sets the access token.", + "nullable": true + }, + "DeviceId": { + "type": "string", + "description": "Gets or sets the device identifier.", + "nullable": true + }, + "AppName": { + "type": "string", + "description": "Gets or sets the name of the application.", + "nullable": true + }, + "AppVersion": { + "type": "string", + "description": "Gets or sets the application version.", + "nullable": true + }, + "DeviceName": { + "type": "string", + "description": "Gets or sets the name of the device.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user identifier.", + "format": "uuid" + }, + "IsActive": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is active." + }, + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time" + }, + "DateRevoked": { + "type": "string", + "description": "Gets or sets the date revoked.", + "format": "date-time", + "nullable": true + }, + "DateLastActivity": { + "type": "string", + "format": "date-time" + }, + "UserName": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "AuthenticationInfoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AuthenticationInfo" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "AuthenticationResult": { + "type": "object", + "properties": { + "User": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto.", + "nullable": true + }, + "SessionInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/SessionInfoDto" + } + ], + "description": "Session info DTO.", + "nullable": true + }, + "AccessToken": { + "type": "string", + "description": "Gets or sets the access token.", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server id.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A class representing an authentication result." + }, + "BackupManifestDto": { + "type": "object", + "properties": { + "ServerVersion": { + "type": "string", + "description": "Gets or sets the jellyfin version this backup was created with." + }, + "BackupEngineVersion": { + "type": "string", + "description": "Gets or sets the backup engine version this backup was created with." + }, + "DateCreated": { + "type": "string", + "description": "Gets or sets the date this backup was created with.", + "format": "date-time" + }, + "Path": { + "type": "string", + "description": "Gets or sets the path to the backup on the system." + }, + "Options": { + "allOf": [ + { + "$ref": "#/components/schemas/BackupOptionsDto" + } + ], + "description": "Gets or sets the contents of the backup archive." + } + }, + "additionalProperties": false, + "description": "Manifest type for backups internal structure." + }, + "BackupOptionsDto": { + "type": "object", + "properties": { + "Metadata": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the archive contains the Metadata contents." + }, + "Trickplay": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the archive contains the Trickplay contents." + }, + "Subtitles": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the archive contains the Subtitle contents." + }, + "Database": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the archive contains the Database contents." + } + }, + "additionalProperties": false, + "description": "Defines the optional contents of the backup archive." + }, + "BackupRestoreRequestDto": { + "type": "object", + "properties": { + "ArchiveFileName": { + "type": "string", + "description": "Gets or Sets the name of the backup archive to restore from. Must be present in MediaBrowser.Common.Configuration.IApplicationPaths.BackupPath." + } + }, + "additionalProperties": false, + "description": "Defines properties used to start a restore process." + }, + "BaseItemDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "format": "uuid" + }, + "Etag": { + "type": "string", + "description": "Gets or sets the etag.", + "nullable": true + }, + "SourceType": { + "type": "string", + "description": "Gets or sets the type of the source.", + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item identifier.", + "nullable": true + }, + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time", + "nullable": true + }, + "DateLastMediaAdded": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "ExtraType": { + "enum": [ + "Unknown", + "Clip", + "Trailer", + "BehindTheScenes", + "DeletedScene", + "Interview", + "Scene", + "Sample", + "ThemeSong", + "ThemeVideo", + "Featurette", + "Short" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ExtraType" + } + ], + "nullable": true + }, + "AirsBeforeSeasonNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AirsAfterSeasonNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AirsBeforeEpisodeNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "CanDelete": { + "type": "boolean", + "nullable": true + }, + "CanDownload": { + "type": "boolean", + "nullable": true + }, + "HasLyrics": { + "type": "boolean", + "nullable": true + }, + "HasSubtitles": { + "type": "boolean", + "nullable": true + }, + "PreferredMetadataLanguage": { + "type": "string", + "nullable": true + }, + "PreferredMetadataCountryCode": { + "type": "string", + "nullable": true + }, + "Container": { + "type": "string", + "nullable": true + }, + "SortName": { + "type": "string", + "description": "Gets or sets the name of the sort.", + "nullable": true + }, + "ForcedSortName": { + "type": "string", + "nullable": true + }, + "Video3DFormat": { + "enum": [ + "HalfSideBySide", + "FullSideBySide", + "FullTopAndBottom", + "HalfTopAndBottom", + "MVC" + ], + "allOf": [ + { + "$ref": "#/components/schemas/Video3DFormat" + } + ], + "description": "Gets or sets the video3 D format.", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "description": "Gets or sets the premiere date.", + "format": "date-time", + "nullable": true + }, + "ExternalUrls": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalUrl" + }, + "description": "Gets or sets the external urls.", + "nullable": true + }, + "MediaSources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaSourceInfo" + }, + "description": "Gets or sets the media versions.", + "nullable": true + }, + "CriticRating": { + "type": "number", + "description": "Gets or sets the critic rating.", + "format": "float", + "nullable": true + }, + "ProductionLocations": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "EnableMediaSourceDisplay": { + "type": "boolean", + "nullable": true + }, + "OfficialRating": { + "type": "string", + "description": "Gets or sets the official rating.", + "nullable": true + }, + "CustomRating": { + "type": "string", + "description": "Gets or sets the custom rating.", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel identifier.", + "format": "uuid", + "nullable": true + }, + "ChannelName": { + "type": "string", + "nullable": true + }, + "Overview": { + "type": "string", + "description": "Gets or sets the overview.", + "nullable": true + }, + "Taglines": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the taglines.", + "nullable": true + }, + "Genres": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the genres.", + "nullable": true + }, + "CommunityRating": { + "type": "number", + "description": "Gets or sets the community rating.", + "format": "float", + "nullable": true + }, + "CumulativeRunTimeTicks": { + "type": "integer", + "description": "Gets or sets the cumulative run time ticks.", + "format": "int64", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "description": "Gets or sets the run time ticks.", + "format": "int64", + "nullable": true + }, + "PlayAccess": { + "enum": [ + "Full", + "None" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayAccess" + } + ], + "description": "Gets or sets the play access.", + "nullable": true + }, + "AspectRatio": { + "type": "string", + "description": "Gets or sets the aspect ratio.", + "nullable": true + }, + "ProductionYear": { + "type": "integer", + "description": "Gets or sets the production year.", + "format": "int32", + "nullable": true + }, + "IsPlaceHolder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is place holder.", + "nullable": true + }, + "Number": { + "type": "string", + "description": "Gets or sets the number.", + "nullable": true + }, + "ChannelNumber": { + "type": "string", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "description": "Gets or sets the index number.", + "format": "int32", + "nullable": true + }, + "IndexNumberEnd": { + "type": "integer", + "description": "Gets or sets the index number end.", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "description": "Gets or sets the parent index number.", + "format": "int32", + "nullable": true + }, + "RemoteTrailers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaUrl" + }, + "description": "Gets or sets the trailer urls.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "IsHD": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is HD.", + "nullable": true + }, + "IsFolder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is folder.", + "nullable": true + }, + "ParentId": { + "type": "string", + "description": "Gets or sets the parent id.", + "format": "uuid", + "nullable": true + }, + "Type": { + "enum": [ + "AggregateFolder", + "Audio", + "AudioBook", + "BasePluginFolder", + "Book", + "BoxSet", + "Channel", + "ChannelFolderItem", + "CollectionFolder", + "Episode", + "Folder", + "Genre", + "ManualPlaylistsFolder", + "Movie", + "LiveTvChannel", + "LiveTvProgram", + "MusicAlbum", + "MusicArtist", + "MusicGenre", + "MusicVideo", + "Person", + "Photo", + "PhotoAlbum", + "Playlist", + "PlaylistsFolder", + "Program", + "Recording", + "Season", + "Series", + "Studio", + "Trailer", + "TvChannel", + "TvProgram", + "UserRootFolder", + "UserView", + "Video", + "Year" + ], + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemKind" + } + ], + "description": "Gets or sets the type." + }, + "People": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemPerson" + }, + "description": "Gets or sets the people.", + "nullable": true + }, + "Studios": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "description": "Gets or sets the studios.", + "nullable": true + }, + "GenreItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "nullable": true + }, + "ParentLogoItemId": { + "type": "string", + "description": "Gets or sets whether the item has a logo, this will hold the Id of the Parent that has one.", + "format": "uuid", + "nullable": true + }, + "ParentBackdropItemId": { + "type": "string", + "description": "Gets or sets whether the item has any backdrops, this will hold the Id of the Parent that has one.", + "format": "uuid", + "nullable": true + }, + "ParentBackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the parent backdrop image tags.", + "nullable": true + }, + "LocalTrailerCount": { + "type": "integer", + "description": "Gets or sets the local trailer count.", + "format": "int32", + "nullable": true + }, + "UserData": { + "allOf": [ + { + "$ref": "#/components/schemas/UserItemDataDto" + } + ], + "description": "Gets or sets the user data for this item based on the user it's being requested for.", + "nullable": true + }, + "RecursiveItemCount": { + "type": "integer", + "description": "Gets or sets the recursive item count.", + "format": "int32", + "nullable": true + }, + "ChildCount": { + "type": "integer", + "description": "Gets or sets the child count.", + "format": "int32", + "nullable": true + }, + "SeriesName": { + "type": "string", + "description": "Gets or sets the name of the series.", + "nullable": true + }, + "SeriesId": { + "type": "string", + "description": "Gets or sets the series id.", + "format": "uuid", + "nullable": true + }, + "SeasonId": { + "type": "string", + "description": "Gets or sets the season identifier.", + "format": "uuid", + "nullable": true + }, + "SpecialFeatureCount": { + "type": "integer", + "description": "Gets or sets the special feature count.", + "format": "int32", + "nullable": true + }, + "DisplayPreferencesId": { + "type": "string", + "description": "Gets or sets the display preferences id.", + "nullable": true + }, + "Status": { + "type": "string", + "description": "Gets or sets the status.", + "nullable": true + }, + "AirTime": { + "type": "string", + "description": "Gets or sets the air time.", + "nullable": true + }, + "AirDays": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DayOfWeek" + }, + "description": "Gets or sets the air days.", + "nullable": true + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the tags.", + "nullable": true + }, + "PrimaryImageAspectRatio": { + "type": "number", + "description": "Gets or sets the primary image aspect ratio, after image enhancements.", + "format": "double", + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the artists.", + "nullable": true + }, + "ArtistItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "description": "Gets or sets the artist items.", + "nullable": true + }, + "Album": { + "type": "string", + "description": "Gets or sets the album.", + "nullable": true + }, + "CollectionType": { + "enum": [ + "unknown", + "movies", + "tvshows", + "music", + "musicvideos", + "trailers", + "homevideos", + "boxsets", + "books", + "photos", + "livetv", + "playlists", + "folders" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionType" + } + ], + "description": "Gets or sets the type of the collection.", + "nullable": true + }, + "DisplayOrder": { + "type": "string", + "description": "Gets or sets the display order.", + "nullable": true + }, + "AlbumId": { + "type": "string", + "description": "Gets or sets the album id.", + "format": "uuid", + "nullable": true + }, + "AlbumPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the album image tag.", + "nullable": true + }, + "SeriesPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the series primary image tag.", + "nullable": true + }, + "AlbumArtist": { + "type": "string", + "description": "Gets or sets the album artist.", + "nullable": true + }, + "AlbumArtists": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "description": "Gets or sets the album artists.", + "nullable": true + }, + "SeasonName": { + "type": "string", + "description": "Gets or sets the name of the season.", + "nullable": true + }, + "MediaStreams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaStream" + }, + "description": "Gets or sets the media streams.", + "nullable": true + }, + "VideoType": { + "enum": [ + "VideoFile", + "Iso", + "Dvd", + "BluRay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/VideoType" + } + ], + "description": "Gets or sets the type of the video.", + "nullable": true + }, + "PartCount": { + "type": "integer", + "description": "Gets or sets the part count.", + "format": "int32", + "nullable": true + }, + "MediaSourceCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ImageTags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Gets or sets the image tags.", + "nullable": true + }, + "BackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the backdrop image tags.", + "nullable": true + }, + "ScreenshotImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the screenshot image tags.", + "nullable": true + }, + "ParentLogoImageTag": { + "type": "string", + "description": "Gets or sets the parent logo image tag.", + "nullable": true + }, + "ParentArtItemId": { + "type": "string", + "description": "Gets or sets whether the item has fan art, this will hold the Id of the Parent that has one.", + "format": "uuid", + "nullable": true + }, + "ParentArtImageTag": { + "type": "string", + "description": "Gets or sets the parent art image tag.", + "nullable": true + }, + "SeriesThumbImageTag": { + "type": "string", + "description": "Gets or sets the series thumb image tag.", + "nullable": true + }, + "ImageBlurHashes": { + "type": "object", + "properties": { + "Primary": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Art": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Backdrop": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Banner": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Logo": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Thumb": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Disc": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Box": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Screenshot": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Menu": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Chapter": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "BoxRear": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Profile": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "Gets or sets the blurhashes for the image tags.\r\nMaps image type to dictionary mapping image tag to blurhash value.", + "nullable": true + }, + "SeriesStudio": { + "type": "string", + "description": "Gets or sets the series studio.", + "nullable": true + }, + "ParentThumbItemId": { + "type": "string", + "description": "Gets or sets the parent thumb item id.", + "format": "uuid", + "nullable": true + }, + "ParentThumbImageTag": { + "type": "string", + "description": "Gets or sets the parent thumb image tag.", + "nullable": true + }, + "ParentPrimaryImageItemId": { + "type": "string", + "description": "Gets or sets the parent primary image item identifier.", + "format": "uuid", + "nullable": true + }, + "ParentPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the parent primary image tag.", + "nullable": true + }, + "Chapters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChapterInfo" + }, + "description": "Gets or sets the chapters.", + "nullable": true + }, + "Trickplay": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/TrickplayInfoDto" + } + }, + "description": "Gets or sets the trickplay manifest.", + "nullable": true + }, + "LocationType": { + "enum": [ + "FileSystem", + "Remote", + "Virtual", + "Offline" + ], + "allOf": [ + { + "$ref": "#/components/schemas/LocationType" + } + ], + "description": "Gets or sets the type of the location.", + "nullable": true + }, + "IsoType": { + "enum": [ + "Dvd", + "BluRay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/IsoType" + } + ], + "description": "Gets or sets the type of the iso.", + "nullable": true + }, + "MediaType": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaType" + } + ], + "description": "Gets or sets the type of the media.", + "default": "Unknown" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date.", + "format": "date-time", + "nullable": true + }, + "LockedFields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetadataField" + }, + "description": "Gets or sets the locked fields.", + "nullable": true + }, + "TrailerCount": { + "type": "integer", + "description": "Gets or sets the trailer count.", + "format": "int32", + "nullable": true + }, + "MovieCount": { + "type": "integer", + "description": "Gets or sets the movie count.", + "format": "int32", + "nullable": true + }, + "SeriesCount": { + "type": "integer", + "description": "Gets or sets the series count.", + "format": "int32", + "nullable": true + }, + "ProgramCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "EpisodeCount": { + "type": "integer", + "description": "Gets or sets the episode count.", + "format": "int32", + "nullable": true + }, + "SongCount": { + "type": "integer", + "description": "Gets or sets the song count.", + "format": "int32", + "nullable": true + }, + "AlbumCount": { + "type": "integer", + "description": "Gets or sets the album count.", + "format": "int32", + "nullable": true + }, + "ArtistCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "MusicVideoCount": { + "type": "integer", + "description": "Gets or sets the music video count.", + "format": "int32", + "nullable": true + }, + "LockData": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [enable internet providers].", + "nullable": true + }, + "Width": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Height": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "CameraMake": { + "type": "string", + "nullable": true + }, + "CameraModel": { + "type": "string", + "nullable": true + }, + "Software": { + "type": "string", + "nullable": true + }, + "ExposureTime": { + "type": "number", + "format": "double", + "nullable": true + }, + "FocalLength": { + "type": "number", + "format": "double", + "nullable": true + }, + "ImageOrientation": { + "enum": [ + "TopLeft", + "TopRight", + "BottomRight", + "BottomLeft", + "LeftTop", + "RightTop", + "RightBottom", + "LeftBottom" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageOrientation" + } + ], + "nullable": true + }, + "Aperture": { + "type": "number", + "format": "double", + "nullable": true + }, + "ShutterSpeed": { + "type": "number", + "format": "double", + "nullable": true + }, + "Latitude": { + "type": "number", + "format": "double", + "nullable": true + }, + "Longitude": { + "type": "number", + "format": "double", + "nullable": true + }, + "Altitude": { + "type": "number", + "format": "double", + "nullable": true + }, + "IsoSpeedRating": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "SeriesTimerId": { + "type": "string", + "description": "Gets or sets the series timer identifier.", + "nullable": true + }, + "ProgramId": { + "type": "string", + "description": "Gets or sets the program identifier.", + "nullable": true + }, + "ChannelPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the channel primary image tag.", + "nullable": true + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date of the recording, in UTC.", + "format": "date-time", + "nullable": true + }, + "CompletionPercentage": { + "type": "number", + "description": "Gets or sets the completion percentage.", + "format": "double", + "nullable": true + }, + "IsRepeat": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is repeat.", + "nullable": true + }, + "EpisodeTitle": { + "type": "string", + "description": "Gets or sets the episode title.", + "nullable": true + }, + "ChannelType": { + "enum": [ + "TV", + "Radio" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ChannelType" + } + ], + "description": "Gets or sets the type of the channel.", + "nullable": true + }, + "Audio": { + "enum": [ + "Mono", + "Stereo", + "Dolby", + "DolbyDigital", + "Thx", + "Atmos" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ProgramAudio" + } + ], + "description": "Gets or sets the audio.", + "nullable": true + }, + "IsMovie": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is movie.", + "nullable": true + }, + "IsSports": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is sports.", + "nullable": true + }, + "IsSeries": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is series.", + "nullable": true + }, + "IsLive": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is live.", + "nullable": true + }, + "IsNews": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is news.", + "nullable": true + }, + "IsKids": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is kids.", + "nullable": true + }, + "IsPremiere": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is premiere.", + "nullable": true + }, + "TimerId": { + "type": "string", + "description": "Gets or sets the timer identifier.", + "nullable": true + }, + "NormalizationGain": { + "type": "number", + "description": "Gets or sets the gain required for audio normalization.", + "format": "float", + "nullable": true + }, + "CurrentProgram": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the current program.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This is strictly used as a data transfer object from the api layer.\r\nThis holds information about a BaseItem in a format that is convenient for the client." + }, + "BaseItemDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "BaseItemKind": { + "enum": [ + "AggregateFolder", + "Audio", + "AudioBook", + "BasePluginFolder", + "Book", + "BoxSet", + "Channel", + "ChannelFolderItem", + "CollectionFolder", + "Episode", + "Folder", + "Genre", + "ManualPlaylistsFolder", + "Movie", + "LiveTvChannel", + "LiveTvProgram", + "MusicAlbum", + "MusicArtist", + "MusicGenre", + "MusicVideo", + "Person", + "Photo", + "PhotoAlbum", + "Playlist", + "PlaylistsFolder", + "Program", + "Recording", + "Season", + "Series", + "Studio", + "Trailer", + "TvChannel", + "TvProgram", + "UserRootFolder", + "UserView", + "Video", + "Year" + ], + "type": "string", + "description": "The base item kind." + }, + "BaseItemPerson": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "format": "uuid" + }, + "Role": { + "type": "string", + "description": "Gets or sets the role.", + "nullable": true + }, + "Type": { + "enum": [ + "Unknown", + "Actor", + "Director", + "Composer", + "Writer", + "GuestStar", + "Producer", + "Conductor", + "Lyricist", + "Arranger", + "Engineer", + "Mixer", + "Remixer", + "Creator", + "Artist", + "AlbumArtist", + "Author", + "Illustrator", + "Penciller", + "Inker", + "Colorist", + "Letterer", + "CoverArtist", + "Editor", + "Translator" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PersonKind" + } + ], + "description": "Gets or sets the type.", + "default": "Unknown" + }, + "PrimaryImageTag": { + "type": "string", + "description": "Gets or sets the primary image tag.", + "nullable": true + }, + "ImageBlurHashes": { + "type": "object", + "properties": { + "Primary": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Art": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Backdrop": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Banner": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Logo": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Thumb": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Disc": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Box": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Screenshot": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Menu": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Chapter": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "BoxRear": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Profile": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "description": "Gets or sets the primary image blurhash.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This is used by the api to get information about a Person within a BaseItem." + }, + "BasePluginConfiguration": { + "type": "object", + "additionalProperties": false, + "description": "Class BasePluginConfiguration." + }, + "BookInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "SeriesName": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "BookInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/BookInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "BoxSetInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "BoxSetInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/BoxSetInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "BrandingOptionsDto": { + "type": "object", + "properties": { + "LoginDisclaimer": { + "type": "string", + "description": "Gets or sets the login disclaimer.", + "nullable": true + }, + "CustomCss": { + "type": "string", + "description": "Gets or sets the custom CSS.", + "nullable": true + }, + "SplashscreenEnabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable the splashscreen." + } + }, + "additionalProperties": false, + "description": "The branding options DTO for API use.\r\nThis DTO excludes SplashscreenLocation to prevent it from being updated via API." + }, + "BufferRequestDto": { + "type": "object", + "properties": { + "When": { + "type": "string", + "description": "Gets or sets when the request has been made by the client.", + "format": "date-time" + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64" + }, + "IsPlaying": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the client playback is unpaused." + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item identifier of the playing item.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class BufferRequestDto." + }, + "CastReceiverApplication": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the cast receiver application id." + }, + "Name": { + "type": "string", + "description": "Gets or sets the cast receiver application name." + } + }, + "additionalProperties": false, + "description": "The cast receiver application model." + }, + "ChannelFeatures": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "format": "uuid" + }, + "CanSearch": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can search." + }, + "MediaTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelMediaType" + }, + "description": "Gets or sets the media types." + }, + "ContentTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelMediaContentType" + }, + "description": "Gets or sets the content types." + }, + "MaxPageSize": { + "type": "integer", + "description": "Gets or sets the maximum number of records the channel allows retrieving at a time.", + "format": "int32", + "nullable": true + }, + "AutoRefreshLevels": { + "type": "integer", + "description": "Gets or sets the automatic refresh levels.", + "format": "int32", + "nullable": true + }, + "DefaultSortFields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelItemSortField" + }, + "description": "Gets or sets the default sort orders." + }, + "SupportsSortOrderToggle": { + "type": "boolean", + "description": "Gets or sets a value indicating whether a sort ascending/descending toggle is supported." + }, + "SupportsLatestMedia": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports latest media]." + }, + "CanFilter": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can filter." + }, + "SupportsContentDownloading": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports content downloading]." + } + }, + "additionalProperties": false + }, + "ChannelItemSortField": { + "enum": [ + "Name", + "CommunityRating", + "PremiereDate", + "DateCreated", + "Runtime", + "PlayCount", + "CommunityPlayCount" + ], + "type": "string" + }, + "ChannelMappingOptionsDto": { + "type": "object", + "properties": { + "TunerChannels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerChannelMapping" + }, + "description": "Gets or sets list of tuner channels." + }, + "ProviderChannels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameIdPair" + }, + "description": "Gets or sets list of provider channels." + }, + "Mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + }, + "description": "Gets or sets list of mappings." + }, + "ProviderName": { + "type": "string", + "description": "Gets or sets provider name.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Channel mapping options dto." + }, + "ChannelMediaContentType": { + "enum": [ + "Clip", + "Podcast", + "Trailer", + "Movie", + "Episode", + "Song", + "MovieExtra", + "TvExtra" + ], + "type": "string" + }, + "ChannelMediaType": { + "enum": [ + "Audio", + "Video", + "Photo" + ], + "type": "string" + }, + "ChannelType": { + "enum": [ + "TV", + "Radio" + ], + "type": "string", + "description": "Enum ChannelType." + }, + "ChapterInfo": { + "type": "object", + "properties": { + "StartPositionTicks": { + "type": "integer", + "description": "Gets or sets the start position ticks.", + "format": "int64" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "ImagePath": { + "type": "string", + "description": "Gets or sets the image path.", + "nullable": true + }, + "ImageDateModified": { + "type": "string", + "format": "date-time" + }, + "ImageTag": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class ChapterInfo." + }, + "ClientCapabilitiesDto": { + "type": "object", + "properties": { + "PlayableMediaTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + }, + "description": "Gets or sets the list of playable media types." + }, + "SupportedCommands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneralCommandType" + }, + "description": "Gets or sets the list of supported commands." + }, + "SupportsMediaControl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether session supports media control." + }, + "SupportsPersistentIdentifier": { + "type": "boolean", + "description": "Gets or sets a value indicating whether session supports a persistent identifier." + }, + "DeviceProfile": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "Gets or sets the device profile.", + "nullable": true + }, + "AppStoreUrl": { + "type": "string", + "description": "Gets or sets the app store url.", + "nullable": true + }, + "IconUrl": { + "type": "string", + "description": "Gets or sets the icon url.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Client capabilities dto." + }, + "ClientLogDocumentResponseDto": { + "type": "object", + "properties": { + "FileName": { + "type": "string", + "description": "Gets the resulting filename." + } + }, + "additionalProperties": false, + "description": "Client log document response dto." + }, + "CodecProfile": { + "type": "object", + "properties": { + "Type": { + "enum": [ + "Video", + "VideoAudio", + "Audio" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CodecType" + } + ], + "description": "Gets or sets the MediaBrowser.Model.Dlna.CodecType which this container must meet." + }, + "Conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "description": "Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition which this profile must meet." + }, + "ApplyConditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "description": "Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition to apply if this profile is met." + }, + "Codec": { + "type": "string", + "description": "Gets or sets the codec(s) that this profile applies to.", + "nullable": true + }, + "Container": { + "type": "string", + "description": "Gets or sets the container(s) which this profile will be applied to.", + "nullable": true + }, + "SubContainer": { + "type": "string", + "description": "Gets or sets the sub-container(s) which this profile will be applied to.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Dlna.CodecProfile." + }, + "CodecType": { + "enum": [ + "Video", + "VideoAudio", + "Audio" + ], + "type": "string" + }, + "CollectionCreationResult": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "CollectionType": { + "enum": [ + "unknown", + "movies", + "tvshows", + "music", + "musicvideos", + "trailers", + "homevideos", + "boxsets", + "books", + "photos", + "livetv", + "playlists", + "folders" + ], + "type": "string", + "description": "Collection type." + }, + "CollectionTypeOptions": { + "enum": [ + "movies", + "tvshows", + "music", + "musicvideos", + "homevideos", + "boxsets", + "books", + "mixed" + ], + "type": "string", + "description": "The collection type options." + }, + "ConfigImageTypes": { + "type": "object", + "properties": { + "BackdropSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "BaseUrl": { + "type": "string", + "nullable": true + }, + "LogoSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "PosterSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ProfileSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "SecureBaseUrl": { + "type": "string", + "nullable": true + }, + "StillSizes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "ConfigurationPageInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "EnableInMainMenu": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the configurations page is enabled in the main menu." + }, + "MenuSection": { + "type": "string", + "description": "Gets or sets the menu section.", + "nullable": true + }, + "MenuIcon": { + "type": "string", + "description": "Gets or sets the menu icon.", + "nullable": true + }, + "DisplayName": { + "type": "string", + "description": "Gets or sets the display name.", + "nullable": true + }, + "PluginId": { + "type": "string", + "description": "Gets or sets the plugin id.", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The configuration page info." + }, + "ContainerProfile": { + "type": "object", + "properties": { + "Type": { + "enum": [ + "Audio", + "Video", + "Photo", + "Subtitle", + "Lyric" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DlnaProfileType" + } + ], + "description": "Gets or sets the MediaBrowser.Model.Dlna.DlnaProfileType which this container must meet." + }, + "Conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "description": "Gets or sets the list of MediaBrowser.Model.Dlna.ProfileCondition which this container will be applied to." + }, + "Container": { + "type": "string", + "description": "Gets or sets the container(s) which this container must meet.", + "nullable": true + }, + "SubContainer": { + "type": "string", + "description": "Gets or sets the sub container(s) which this container must meet.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Dlna.ContainerProfile." + }, + "CountryInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "DisplayName": { + "type": "string", + "description": "Gets or sets the display name.", + "nullable": true + }, + "TwoLetterISORegionName": { + "type": "string", + "description": "Gets or sets the name of the two letter ISO region.", + "nullable": true + }, + "ThreeLetterISORegionName": { + "type": "string", + "description": "Gets or sets the name of the three letter ISO region.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class CountryInfo." + }, + "CreatePlaylistDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of the new playlist." + }, + "Ids": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets item ids to add to the playlist." + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid", + "nullable": true + }, + "MediaType": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaType" + } + ], + "description": "Gets or sets the media type.", + "nullable": true + }, + "Users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + }, + "description": "Gets or sets the playlist users." + }, + "IsPublic": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the playlist is public." + } + }, + "additionalProperties": false, + "description": "Create new playlist dto." + }, + "CreateUserByName": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the username." + }, + "Password": { + "type": "string", + "description": "Gets or sets the password.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The create user by name request body." + }, + "CultureDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name." + }, + "DisplayName": { + "type": "string", + "description": "Gets the display name." + }, + "TwoLetterISOLanguageName": { + "type": "string", + "description": "Gets the name of the two letter ISO language." + }, + "ThreeLetterISOLanguageName": { + "type": "string", + "description": "Gets the name of the three letter ISO language.", + "nullable": true, + "readOnly": true + }, + "ThreeLetterISOLanguageNames": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "description": "Class CultureDto." + }, + "CustomDatabaseOption": { + "type": "object", + "properties": { + "Key": { + "type": "string", + "description": "Gets or sets the key of the value." + }, + "Value": { + "type": "string", + "description": "Gets or sets the value." + } + }, + "additionalProperties": false, + "description": "The custom value option for custom database providers." + }, + "CustomDatabaseOptions": { + "type": "object", + "properties": { + "PluginName": { + "type": "string", + "description": "Gets or sets the Plugin name to search for database providers." + }, + "PluginAssembly": { + "type": "string", + "description": "Gets or sets the plugin assembly to search for providers." + }, + "ConnectionString": { + "type": "string", + "description": "Gets or sets the connection string for the custom database provider." + }, + "Options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomDatabaseOption" + }, + "description": "Gets or sets the list of extra options for the custom provider." + } + }, + "additionalProperties": false, + "description": "Defines the options for a custom database connector." + }, + "DatabaseConfigurationOptions": { + "type": "object", + "properties": { + "DatabaseType": { + "type": "string", + "description": "Gets or Sets the type of database jellyfin should use." + }, + "CustomProviderOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/CustomDatabaseOptions" + } + ], + "description": "Gets or sets the options required to use a custom database provider.", + "nullable": true + }, + "LockingBehavior": { + "enum": [ + "NoLock", + "Pessimistic", + "Optimistic" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DatabaseLockingBehaviorTypes" + } + ], + "description": "Gets or Sets the kind of locking behavior jellyfin should perform. Possible options are \"NoLock\", \"Pessimistic\", \"Optimistic\".\r\nDefaults to \"NoLock\"." + } + }, + "additionalProperties": false, + "description": "Options to configure jellyfins managed database." + }, + "DatabaseLockingBehaviorTypes": { + "enum": [ + "NoLock", + "Pessimistic", + "Optimistic" + ], + "type": "string", + "description": "Defines all possible methods for locking database access for concurrent queries." + }, + "DayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + "type": "string" + }, + "DayPattern": { + "enum": [ + "Daily", + "Weekdays", + "Weekends" + ], + "type": "string" + }, + "DefaultDirectoryBrowserInfoDto": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Default directory browser info." + }, + "DeinterlaceMethod": { + "enum": [ + "yadif", + "bwdif" + ], + "type": "string", + "description": "Enum containing deinterlace methods." + }, + "DeviceInfoDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "CustomName": { + "type": "string", + "description": "Gets or sets the custom name.", + "nullable": true + }, + "AccessToken": { + "type": "string", + "description": "Gets or sets the access token.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "nullable": true + }, + "LastUserName": { + "type": "string", + "description": "Gets or sets the last name of the user.", + "nullable": true + }, + "AppName": { + "type": "string", + "description": "Gets or sets the name of the application.", + "nullable": true + }, + "AppVersion": { + "type": "string", + "description": "Gets or sets the application version.", + "nullable": true + }, + "LastUserId": { + "type": "string", + "description": "Gets or sets the last user identifier.", + "format": "uuid", + "nullable": true + }, + "DateLastActivity": { + "type": "string", + "description": "Gets or sets the date last modified.", + "format": "date-time", + "nullable": true + }, + "Capabilities": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Gets or sets the capabilities." + }, + "IconUrl": { + "type": "string", + "description": "Gets or sets the icon URL.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A DTO representing device information." + }, + "DeviceInfoDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeviceInfoDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "DeviceOptionsDto": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Gets or sets the id.", + "format": "int32" + }, + "DeviceId": { + "type": "string", + "description": "Gets or sets the device id.", + "nullable": true + }, + "CustomName": { + "type": "string", + "description": "Gets or sets the custom name.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A dto representing custom options for a device." + }, + "DeviceProfile": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of this device profile. User profiles must have a unique name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the unique internal identifier.", + "format": "uuid", + "nullable": true + }, + "MaxStreamingBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for all streamed content.", + "format": "int32", + "nullable": true + }, + "MaxStaticBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for statically streamed content (= direct played files).", + "format": "int32", + "nullable": true + }, + "MusicStreamingTranscodingBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for transcoded music streams.", + "format": "int32", + "nullable": true + }, + "MaxStaticMusicBitrate": { + "type": "integer", + "description": "Gets or sets the maximum allowed bitrate for statically streamed (= direct played) music files.", + "format": "int32", + "nullable": true + }, + "DirectPlayProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DirectPlayProfile" + }, + "description": "Gets or sets the direct play profiles." + }, + "TranscodingProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TranscodingProfile" + }, + "description": "Gets or sets the transcoding profiles." + }, + "ContainerProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContainerProfile" + }, + "description": "Gets or sets the container profiles. Failing to meet these optional conditions causes transcoding to occur." + }, + "CodecProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CodecProfile" + }, + "description": "Gets or sets the codec profiles." + }, + "SubtitleProfiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubtitleProfile" + }, + "description": "Gets or sets the subtitle profiles." + } + }, + "additionalProperties": false, + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't." + }, + "DirectPlayProfile": { + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "Gets or sets the container." + }, + "AudioCodec": { + "type": "string", + "description": "Gets or sets the audio codec.", + "nullable": true + }, + "VideoCodec": { + "type": "string", + "description": "Gets or sets the video codec.", + "nullable": true + }, + "Type": { + "enum": [ + "Audio", + "Video", + "Photo", + "Subtitle", + "Lyric" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DlnaProfileType" + } + ], + "description": "Gets or sets the Dlna profile type." + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Dlna.DirectPlayProfile." + }, + "DisplayPreferencesDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the user id.", + "nullable": true + }, + "ViewType": { + "type": "string", + "description": "Gets or sets the type of the view.", + "nullable": true + }, + "SortBy": { + "type": "string", + "description": "Gets or sets the sort by.", + "nullable": true + }, + "IndexBy": { + "type": "string", + "description": "Gets or sets the index by.", + "nullable": true + }, + "RememberIndexing": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [remember indexing]." + }, + "PrimaryImageHeight": { + "type": "integer", + "description": "Gets or sets the height of the primary image.", + "format": "int32" + }, + "PrimaryImageWidth": { + "type": "integer", + "description": "Gets or sets the width of the primary image.", + "format": "int32" + }, + "CustomPrefs": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the custom prefs." + }, + "ScrollDirection": { + "enum": [ + "Horizontal", + "Vertical" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ScrollDirection" + } + ], + "description": "Gets or sets the scroll direction." + }, + "ShowBackdrop": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to show backdrops on this item." + }, + "RememberSorting": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [remember sorting]." + }, + "SortOrder": { + "enum": [ + "Ascending", + "Descending" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SortOrder" + } + ], + "description": "Gets or sets the sort order." + }, + "ShowSidebar": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [show sidebar]." + }, + "Client": { + "type": "string", + "description": "Gets or sets the client.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Defines the display preferences for any item that supports them (usually Folders)." + }, + "DlnaProfileType": { + "enum": [ + "Audio", + "Video", + "Photo", + "Subtitle", + "Lyric" + ], + "type": "string" + }, + "DownMixStereoAlgorithms": { + "enum": [ + "None", + "Dave750", + "NightmodeDialogue", + "Rfc7845", + "Ac4" + ], + "type": "string", + "description": "An enum representing an algorithm to downmix surround sound to stereo." + }, + "DynamicDayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Everyday", + "Weekday", + "Weekend" + ], + "type": "string", + "description": "An enum that represents a day of the week, weekdays, weekends, or all days." + }, + "EmbeddedSubtitleOptions": { + "enum": [ + "AllowAll", + "AllowText", + "AllowImage", + "AllowNone" + ], + "type": "string", + "description": "An enum representing the options to disable embedded subs." + }, + "EncoderPreset": { + "enum": [ + "auto", + "placebo", + "veryslow", + "slower", + "slow", + "medium", + "fast", + "faster", + "veryfast", + "superfast", + "ultrafast" + ], + "type": "string", + "description": "Enum containing encoder presets." + }, + "EncodingContext": { + "enum": [ + "Streaming", + "Static" + ], + "type": "string" + }, + "EncodingOptions": { + "type": "object", + "properties": { + "EncodingThreadCount": { + "type": "integer", + "description": "Gets or sets the thread count used for encoding.", + "format": "int32" + }, + "TranscodingTempPath": { + "type": "string", + "description": "Gets or sets the temporary transcoding path.", + "nullable": true + }, + "FallbackFontPath": { + "type": "string", + "description": "Gets or sets the path to the fallback font.", + "nullable": true + }, + "EnableFallbackFont": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to use the fallback font." + }, + "EnableAudioVbr": { + "type": "boolean", + "description": "Gets or sets a value indicating whether audio VBR is enabled." + }, + "DownMixAudioBoost": { + "type": "number", + "description": "Gets or sets the audio boost applied when downmixing audio.", + "format": "double" + }, + "DownMixStereoAlgorithm": { + "enum": [ + "None", + "Dave750", + "NightmodeDialogue", + "Rfc7845", + "Ac4" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DownMixStereoAlgorithms" + } + ], + "description": "Gets or sets the algorithm used for downmixing audio to stereo." + }, + "MaxMuxingQueueSize": { + "type": "integer", + "description": "Gets or sets the maximum size of the muxing queue.", + "format": "int32" + }, + "EnableThrottling": { + "type": "boolean", + "description": "Gets or sets a value indicating whether throttling is enabled." + }, + "ThrottleDelaySeconds": { + "type": "integer", + "description": "Gets or sets the delay after which throttling happens.", + "format": "int32" + }, + "EnableSegmentDeletion": { + "type": "boolean", + "description": "Gets or sets a value indicating whether segment deletion is enabled." + }, + "SegmentKeepSeconds": { + "type": "integer", + "description": "Gets or sets seconds for which segments should be kept before being deleted.", + "format": "int32" + }, + "HardwareAccelerationType": { + "enum": [ + "none", + "amf", + "qsv", + "nvenc", + "v4l2m2m", + "vaapi", + "videotoolbox", + "rkmpp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/HardwareAccelerationType" + } + ], + "description": "Gets or sets the hardware acceleration type." + }, + "EncoderAppPath": { + "type": "string", + "description": "Gets or sets the FFmpeg path as set by the user via the UI.", + "nullable": true + }, + "EncoderAppPathDisplay": { + "type": "string", + "description": "Gets or sets the current FFmpeg path being used by the system and displayed on the transcode page.", + "nullable": true + }, + "VaapiDevice": { + "type": "string", + "description": "Gets or sets the VA-API device.", + "nullable": true + }, + "QsvDevice": { + "type": "string", + "description": "Gets or sets the QSV device.", + "nullable": true + }, + "EnableTonemapping": { + "type": "boolean", + "description": "Gets or sets a value indicating whether tonemapping is enabled." + }, + "EnableVppTonemapping": { + "type": "boolean", + "description": "Gets or sets a value indicating whether VPP tonemapping is enabled." + }, + "EnableVideoToolboxTonemapping": { + "type": "boolean", + "description": "Gets or sets a value indicating whether videotoolbox tonemapping is enabled." + }, + "TonemappingAlgorithm": { + "enum": [ + "none", + "clip", + "linear", + "gamma", + "reinhard", + "hable", + "mobius", + "bt2390" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TonemappingAlgorithm" + } + ], + "description": "Gets or sets the tone-mapping algorithm." + }, + "TonemappingMode": { + "enum": [ + "auto", + "max", + "rgb", + "lum", + "itp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TonemappingMode" + } + ], + "description": "Gets or sets the tone-mapping mode." + }, + "TonemappingRange": { + "enum": [ + "auto", + "tv", + "pc" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TonemappingRange" + } + ], + "description": "Gets or sets the tone-mapping range." + }, + "TonemappingDesat": { + "type": "number", + "description": "Gets or sets the tone-mapping desaturation.", + "format": "double" + }, + "TonemappingPeak": { + "type": "number", + "description": "Gets or sets the tone-mapping peak.", + "format": "double" + }, + "TonemappingParam": { + "type": "number", + "description": "Gets or sets the tone-mapping parameters.", + "format": "double" + }, + "VppTonemappingBrightness": { + "type": "number", + "description": "Gets or sets the VPP tone-mapping brightness.", + "format": "double" + }, + "VppTonemappingContrast": { + "type": "number", + "description": "Gets or sets the VPP tone-mapping contrast.", + "format": "double" + }, + "H264Crf": { + "type": "integer", + "description": "Gets or sets the H264 CRF.", + "format": "int32" + }, + "H265Crf": { + "type": "integer", + "description": "Gets or sets the H265 CRF.", + "format": "int32" + }, + "EncoderPreset": { + "enum": [ + "auto", + "placebo", + "veryslow", + "slower", + "slow", + "medium", + "fast", + "faster", + "veryfast", + "superfast", + "ultrafast" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncoderPreset" + } + ], + "description": "Gets or sets the encoder preset.", + "nullable": true + }, + "DeinterlaceDoubleRate": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the framerate is doubled when deinterlacing." + }, + "DeinterlaceMethod": { + "enum": [ + "yadif", + "bwdif" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DeinterlaceMethod" + } + ], + "description": "Gets or sets the deinterlace method." + }, + "EnableDecodingColorDepth10Hevc": { + "type": "boolean", + "description": "Gets or sets a value indicating whether 10bit HEVC decoding is enabled." + }, + "EnableDecodingColorDepth10Vp9": { + "type": "boolean", + "description": "Gets or sets a value indicating whether 10bit VP9 decoding is enabled." + }, + "EnableDecodingColorDepth10HevcRext": { + "type": "boolean", + "description": "Gets or sets a value indicating whether 8/10bit HEVC RExt decoding is enabled." + }, + "EnableDecodingColorDepth12HevcRext": { + "type": "boolean", + "description": "Gets or sets a value indicating whether 12bit HEVC RExt decoding is enabled." + }, + "EnableEnhancedNvdecDecoder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the enhanced NVDEC is enabled." + }, + "PreferSystemNativeHwDecoder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the system native hardware decoder should be used." + }, + "EnableIntelLowPowerH264HwEncoder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the Intel H264 low-power hardware encoder should be used." + }, + "EnableIntelLowPowerHevcHwEncoder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the Intel HEVC low-power hardware encoder should be used." + }, + "EnableHardwareEncoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether hardware encoding is enabled." + }, + "AllowHevcEncoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether HEVC encoding is enabled." + }, + "AllowAv1Encoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether AV1 encoding is enabled." + }, + "EnableSubtitleExtraction": { + "type": "boolean", + "description": "Gets or sets a value indicating whether subtitle extraction is enabled." + }, + "HardwareDecodingCodecs": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the codecs hardware encoding is used for.", + "nullable": true + }, + "AllowOnDemandMetadataBasedKeyframeExtractionForExtensions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the file extensions on-demand metadata based keyframe extraction is enabled for.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class EncodingOptions." + }, + "EndPointInfo": { + "type": "object", + "properties": { + "IsLocal": { + "type": "boolean" + }, + "IsInNetwork": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "ExternalIdInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the display name of the external id provider (IE: IMDB, MusicBrainz, etc)." + }, + "Key": { + "type": "string", + "description": "Gets or sets the unique key for this id. This key should be unique across all providers." + }, + "Type": { + "enum": [ + "Album", + "AlbumArtist", + "Artist", + "BoxSet", + "Episode", + "Movie", + "OtherArtist", + "Person", + "ReleaseGroup", + "Season", + "Series", + "Track", + "Book", + "Recording" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ExternalIdMediaType" + } + ], + "description": "Gets or sets the specific media type for this id. This is used to distinguish between the different\r\nexternal id types for providers with multiple ids.\r\nA null value indicates there is no specific media type associated with the external id, or this is the\r\ndefault id for the external provider so there is no need to specify a type.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Represents the external id information for serialization to the client." + }, + "ExternalIdMediaType": { + "enum": [ + "Album", + "AlbumArtist", + "Artist", + "BoxSet", + "Episode", + "Movie", + "OtherArtist", + "Person", + "ReleaseGroup", + "Season", + "Series", + "Track", + "Book", + "Recording" + ], + "type": "string", + "description": "The specific media type of an MediaBrowser.Model.Providers.ExternalIdInfo." + }, + "ExternalUrl": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Url": { + "type": "string", + "description": "Gets or sets the type of the item.", + "nullable": true + } + }, + "additionalProperties": false + }, + "ExtraType": { + "enum": [ + "Unknown", + "Clip", + "Trailer", + "BehindTheScenes", + "DeletedScene", + "Interview", + "Scene", + "Sample", + "ThemeSong", + "ThemeVideo", + "Featurette", + "Short" + ], + "type": "string" + }, + "FileSystemEntryInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name." + }, + "Path": { + "type": "string", + "description": "Gets the path." + }, + "Type": { + "enum": [ + "File", + "Directory", + "NetworkComputer", + "NetworkShare" + ], + "allOf": [ + { + "$ref": "#/components/schemas/FileSystemEntryType" + } + ], + "description": "Gets the type." + } + }, + "additionalProperties": false, + "description": "Class FileSystemEntryInfo." + }, + "FileSystemEntryType": { + "enum": [ + "File", + "Directory", + "NetworkComputer", + "NetworkShare" + ], + "type": "string", + "description": "Enum FileSystemEntryType." + }, + "FolderStorageDto": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Gets the path of the folder in question." + }, + "FreeSpace": { + "type": "integer", + "description": "Gets the free space of the underlying storage device of the Jellyfin.Api.Models.SystemInfoDtos.FolderStorageDto.Path.", + "format": "int64" + }, + "UsedSpace": { + "type": "integer", + "description": "Gets the used space of the underlying storage device of the Jellyfin.Api.Models.SystemInfoDtos.FolderStorageDto.Path.", + "format": "int64" + }, + "StorageType": { + "type": "string", + "description": "Gets the kind of storage device of the Jellyfin.Api.Models.SystemInfoDtos.FolderStorageDto.Path.", + "nullable": true + }, + "DeviceId": { + "type": "string", + "description": "Gets the Device Identifier.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Contains information about a specific folder." + }, + "FontFile": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Size": { + "type": "integer", + "description": "Gets or sets the size.", + "format": "int64" + }, + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time" + }, + "DateModified": { + "type": "string", + "description": "Gets or sets the date modified.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class FontFile." + }, + "ForceKeepAliveMessage": { + "type": "object", + "properties": { + "Data": { + "type": "integer", + "description": "Gets or sets the data.", + "format": "int32" + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ForceKeepAlive", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Force keep alive websocket messages." + }, + "ForgotPasswordAction": { + "enum": [ + "ContactAdmin", + "PinCode", + "InNetworkRequired" + ], + "type": "string" + }, + "ForgotPasswordDto": { + "required": [ + "EnteredUsername" + ], + "type": "object", + "properties": { + "EnteredUsername": { + "type": "string", + "description": "Gets or sets the entered username to have its password reset." + } + }, + "additionalProperties": false, + "description": "Forgot Password request body DTO." + }, + "ForgotPasswordPinDto": { + "required": [ + "Pin" + ], + "type": "object", + "properties": { + "Pin": { + "type": "string", + "description": "Gets or sets the entered pin to have the password reset." + } + }, + "additionalProperties": false, + "description": "Forgot Password Pin enter request body DTO." + }, + "ForgotPasswordResult": { + "type": "object", + "properties": { + "Action": { + "enum": [ + "ContactAdmin", + "PinCode", + "InNetworkRequired" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ForgotPasswordAction" + } + ], + "description": "Gets or sets the action." + }, + "PinFile": { + "type": "string", + "description": "Gets or sets the pin file.", + "nullable": true + }, + "PinExpirationDate": { + "type": "string", + "description": "Gets or sets the pin expiration date.", + "format": "date-time", + "nullable": true + } + }, + "additionalProperties": false + }, + "GeneralCommand": { + "type": "object", + "properties": { + "Name": { + "enum": [ + "MoveUp", + "MoveDown", + "MoveLeft", + "MoveRight", + "PageUp", + "PageDown", + "PreviousLetter", + "NextLetter", + "ToggleOsd", + "ToggleContextMenu", + "Select", + "Back", + "TakeScreenshot", + "SendKey", + "SendString", + "GoHome", + "GoToSettings", + "VolumeUp", + "VolumeDown", + "Mute", + "Unmute", + "ToggleMute", + "SetVolume", + "SetAudioStreamIndex", + "SetSubtitleStreamIndex", + "ToggleFullscreen", + "DisplayContent", + "GoToSearch", + "DisplayMessage", + "SetRepeatMode", + "ChannelUp", + "ChannelDown", + "Guide", + "ToggleStats", + "PlayMediaSource", + "PlayTrailers", + "SetShuffleQueue", + "PlayState", + "PlayNext", + "ToggleOsdMenu", + "Play", + "SetMaxStreamingBitrate", + "SetPlaybackOrder" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommandType" + } + ], + "description": "This exists simply to identify a set of known commands." + }, + "ControllingUserId": { + "type": "string", + "format": "uuid" + }, + "Arguments": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "GeneralCommandMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/GeneralCommand" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "GeneralCommand", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "General command websocket message." + }, + "GeneralCommandType": { + "enum": [ + "MoveUp", + "MoveDown", + "MoveLeft", + "MoveRight", + "PageUp", + "PageDown", + "PreviousLetter", + "NextLetter", + "ToggleOsd", + "ToggleContextMenu", + "Select", + "Back", + "TakeScreenshot", + "SendKey", + "SendString", + "GoHome", + "GoToSettings", + "VolumeUp", + "VolumeDown", + "Mute", + "Unmute", + "ToggleMute", + "SetVolume", + "SetAudioStreamIndex", + "SetSubtitleStreamIndex", + "ToggleFullscreen", + "DisplayContent", + "GoToSearch", + "DisplayMessage", + "SetRepeatMode", + "ChannelUp", + "ChannelDown", + "Guide", + "ToggleStats", + "PlayMediaSource", + "PlayTrailers", + "SetShuffleQueue", + "PlayState", + "PlayNext", + "ToggleOsdMenu", + "Play", + "SetMaxStreamingBitrate", + "SetPlaybackOrder" + ], + "type": "string", + "description": "This exists simply to identify a set of known commands." + }, + "GetProgramsDto": { + "type": "object", + "properties": { + "ChannelIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the channels to return guide information for.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets optional. Filter by user id.", + "format": "uuid", + "nullable": true + }, + "MinStartDate": { + "type": "string", + "description": "Gets or sets the minimum premiere start date.", + "format": "date-time", + "nullable": true + }, + "HasAired": { + "type": "boolean", + "description": "Gets or sets filter by programs that have completed airing, or not.", + "nullable": true + }, + "IsAiring": { + "type": "boolean", + "description": "Gets or sets filter by programs that are currently airing, or not.", + "nullable": true + }, + "MaxStartDate": { + "type": "string", + "description": "Gets or sets the maximum premiere start date.", + "format": "date-time", + "nullable": true + }, + "MinEndDate": { + "type": "string", + "description": "Gets or sets the minimum premiere end date.", + "format": "date-time", + "nullable": true + }, + "MaxEndDate": { + "type": "string", + "description": "Gets or sets the maximum premiere end date.", + "format": "date-time", + "nullable": true + }, + "IsMovie": { + "type": "boolean", + "description": "Gets or sets filter for movies.", + "nullable": true + }, + "IsSeries": { + "type": "boolean", + "description": "Gets or sets filter for series.", + "nullable": true + }, + "IsNews": { + "type": "boolean", + "description": "Gets or sets filter for news.", + "nullable": true + }, + "IsKids": { + "type": "boolean", + "description": "Gets or sets filter for kids.", + "nullable": true + }, + "IsSports": { + "type": "boolean", + "description": "Gets or sets filter for sports.", + "nullable": true + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the record index to start at. All items with a lower index will be dropped from the results.", + "format": "int32", + "nullable": true + }, + "Limit": { + "type": "integer", + "description": "Gets or sets the maximum number of records to return.", + "format": "int32", + "nullable": true + }, + "SortBy": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemSortBy" + }, + "description": "Gets or sets specify one or more sort orders, comma delimited. Options: Name, StartDate.", + "nullable": true + }, + "SortOrder": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SortOrder" + }, + "description": "Gets or sets sort order.", + "nullable": true + }, + "Genres": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the genres to return guide information for.", + "nullable": true + }, + "GenreIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the genre ids to return guide information for.", + "nullable": true + }, + "EnableImages": { + "type": "boolean", + "description": "Gets or sets include image information in output.", + "nullable": true + }, + "EnableTotalRecordCount": { + "type": "boolean", + "description": "Gets or sets a value indicating whether retrieve total record count.", + "default": true + }, + "ImageTypeLimit": { + "type": "integer", + "description": "Gets or sets the max number of images to return, per image type.", + "format": "int32", + "nullable": true + }, + "EnableImageTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + }, + "description": "Gets or sets the image types to include in the output.", + "nullable": true + }, + "EnableUserData": { + "type": "boolean", + "description": "Gets or sets include user data.", + "nullable": true + }, + "SeriesTimerId": { + "type": "string", + "description": "Gets or sets filter by series timer id.", + "nullable": true + }, + "LibrarySeriesId": { + "type": "string", + "description": "Gets or sets filter by library series id.", + "format": "uuid", + "nullable": true + }, + "Fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemFields" + }, + "description": "Gets or sets specify additional fields of information to return in the output.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Get programs dto." + }, + "GroupInfoDto": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid" + }, + "GroupName": { + "type": "string", + "description": "Gets the group name." + }, + "State": { + "enum": [ + "Idle", + "Waiting", + "Paused", + "Playing" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupStateType" + } + ], + "description": "Gets the group state." + }, + "Participants": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets the participants." + }, + "LastUpdatedAt": { + "type": "string", + "description": "Gets the date when this DTO has been created.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class GroupInfoDto." + }, + "GroupQueueMode": { + "enum": [ + "Queue", + "QueueNext" + ], + "type": "string", + "description": "Enum GroupQueueMode." + }, + "GroupRepeatMode": { + "enum": [ + "RepeatOne", + "RepeatAll", + "RepeatNone" + ], + "type": "string", + "description": "Enum GroupRepeatMode." + }, + "GroupShuffleMode": { + "enum": [ + "Sorted", + "Shuffle" + ], + "type": "string", + "description": "Enum GroupShuffleMode." + }, + "GroupStateType": { + "enum": [ + "Idle", + "Waiting", + "Paused", + "Playing" + ], + "type": "string", + "description": "Enum GroupState." + }, + "GroupStateUpdate": { + "type": "object", + "properties": { + "State": { + "enum": [ + "Idle", + "Waiting", + "Paused", + "Playing" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupStateType" + } + ], + "description": "Gets the state of the group." + }, + "Reason": { + "enum": [ + "Play", + "SetPlaylistItem", + "RemoveFromPlaylist", + "MovePlaylistItem", + "Queue", + "Unpause", + "Pause", + "Stop", + "Seek", + "Buffer", + "Ready", + "NextItem", + "PreviousItem", + "SetRepeatMode", + "SetShuffleMode", + "Ping", + "IgnoreWait" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackRequestType" + } + ], + "description": "Gets the reason of the state change." + } + }, + "additionalProperties": false, + "description": "Class GroupStateUpdate." + }, + "GroupUpdate": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/SyncPlayGroupDoesNotExistUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayGroupJoinedUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayGroupLeftUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayLibraryAccessDeniedUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayNotInGroupUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayPlayQueueUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayStateUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayUserJoinedUpdate" + }, + { + "$ref": "#/components/schemas/SyncPlayUserLeftUpdate" + } + ], + "description": "Represents the list of possible group update types", + "discriminator": { + "propertyName": "Type", + "mapping": { + "GroupDoesNotExist": "#/components/schemas/SyncPlayGroupDoesNotExistUpdate", + "GroupJoined": "#/components/schemas/SyncPlayGroupJoinedUpdate", + "GroupLeft": "#/components/schemas/SyncPlayGroupLeftUpdate", + "LibraryAccessDenied": "#/components/schemas/SyncPlayLibraryAccessDeniedUpdate", + "NotInGroup": "#/components/schemas/SyncPlayNotInGroupUpdate", + "PlayQueue": "#/components/schemas/SyncPlayPlayQueueUpdate", + "StateUpdate": "#/components/schemas/SyncPlayStateUpdate", + "UserJoined": "#/components/schemas/SyncPlayUserJoinedUpdate", + "UserLeft": "#/components/schemas/SyncPlayUserLeftUpdate" + } + } + }, + "GroupUpdateType": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "type": "string", + "description": "Enum GroupUpdateType." + }, + "GuideInfo": { + "type": "object", + "properties": { + "StartDate": { + "type": "string", + "description": "Gets or sets the start date.", + "format": "date-time" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date.", + "format": "date-time" + } + }, + "additionalProperties": false + }, + "HardwareAccelerationType": { + "enum": [ + "none", + "amf", + "qsv", + "nvenc", + "v4l2m2m", + "vaapi", + "videotoolbox", + "rkmpp" + ], + "type": "string", + "description": "Enum containing hardware acceleration types." + }, + "IgnoreWaitRequestDto": { + "type": "object", + "properties": { + "IgnoreWait": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the client should be ignored." + } + }, + "additionalProperties": false, + "description": "Class IgnoreWaitRequestDto." + }, + "ImageFormat": { + "enum": [ + "Bmp", + "Gif", + "Jpg", + "Png", + "Webp", + "Svg" + ], + "type": "string", + "description": "Enum ImageOutputFormat." + }, + "ImageInfo": { + "type": "object", + "properties": { + "ImageType": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Gets or sets the type of the image." + }, + "ImageIndex": { + "type": "integer", + "description": "Gets or sets the index of the image.", + "format": "int32", + "nullable": true + }, + "ImageTag": { + "type": "string", + "description": "Gets or sets the image tag.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "BlurHash": { + "type": "string", + "description": "Gets or sets the blurhash.", + "nullable": true + }, + "Height": { + "type": "integer", + "description": "Gets or sets the height.", + "format": "int32", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the width.", + "format": "int32", + "nullable": true + }, + "Size": { + "type": "integer", + "description": "Gets or sets the size.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class ImageInfo." + }, + "ImageOption": { + "type": "object", + "properties": { + "Type": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Gets or sets the type." + }, + "Limit": { + "type": "integer", + "description": "Gets or sets the limit.", + "format": "int32" + }, + "MinWidth": { + "type": "integer", + "description": "Gets or sets the minimum width.", + "format": "int32" + } + }, + "additionalProperties": false + }, + "ImageOrientation": { + "enum": [ + "TopLeft", + "TopRight", + "BottomRight", + "BottomLeft", + "LeftTop", + "RightTop", + "RightBottom", + "LeftBottom" + ], + "type": "string" + }, + "ImageProviderInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name." + }, + "SupportedImages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + }, + "description": "Gets the supported image types." + } + }, + "additionalProperties": false, + "description": "Class ImageProviderInfo." + }, + "ImageResolution": { + "enum": [ + "MatchSource", + "P144", + "P240", + "P360", + "P480", + "P720", + "P1080", + "P1440", + "P2160" + ], + "type": "string", + "description": "Enum ImageResolution." + }, + "ImageSavingConvention": { + "enum": [ + "Legacy", + "Compatible" + ], + "type": "string" + }, + "ImageType": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "type": "string", + "description": "Enum ImageType." + }, + "InboundKeepAliveMessage": { + "type": "object", + "properties": { + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "KeepAlive", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Keep alive websocket messages." + }, + "InboundWebSocketMessage": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/ActivityLogEntryStartMessage" + }, + { + "$ref": "#/components/schemas/ActivityLogEntryStopMessage" + }, + { + "$ref": "#/components/schemas/InboundKeepAliveMessage" + }, + { + "$ref": "#/components/schemas/ScheduledTasksInfoStartMessage" + }, + { + "$ref": "#/components/schemas/ScheduledTasksInfoStopMessage" + }, + { + "$ref": "#/components/schemas/SessionsStartMessage" + }, + { + "$ref": "#/components/schemas/SessionsStopMessage" + } + ], + "description": "Represents the list of possible inbound websocket types", + "discriminator": { + "propertyName": "MessageType", + "mapping": { + "ActivityLogEntryStart": "#/components/schemas/ActivityLogEntryStartMessage", + "ActivityLogEntryStop": "#/components/schemas/ActivityLogEntryStopMessage", + "KeepAlive": "#/components/schemas/InboundKeepAliveMessage", + "ScheduledTasksInfoStart": "#/components/schemas/ScheduledTasksInfoStartMessage", + "ScheduledTasksInfoStop": "#/components/schemas/ScheduledTasksInfoStopMessage", + "SessionsStart": "#/components/schemas/SessionsStartMessage", + "SessionsStop": "#/components/schemas/SessionsStopMessage" + } + } + }, + "InstallationInfo": { + "type": "object", + "properties": { + "Guid": { + "type": "string", + "description": "Gets or sets the Id.", + "format": "uuid" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the version.", + "nullable": true + }, + "Changelog": { + "type": "string", + "description": "Gets or sets the changelog for this version.", + "nullable": true + }, + "SourceUrl": { + "type": "string", + "description": "Gets or sets the source URL.", + "nullable": true + }, + "Checksum": { + "type": "string", + "description": "Gets or sets a checksum for the binary.", + "nullable": true + }, + "PackageInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/PackageInfo" + } + ], + "description": "Gets or sets package information for the installation.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class InstallationInfo." + }, + "IPlugin": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets the name of the plugin.", + "nullable": true, + "readOnly": true + }, + "Description": { + "type": "string", + "description": "Gets the Description.", + "nullable": true, + "readOnly": true + }, + "Id": { + "type": "string", + "description": "Gets the unique id.", + "format": "uuid", + "readOnly": true + }, + "Version": { + "type": "string", + "description": "Gets the plugin version.", + "nullable": true, + "readOnly": true + }, + "AssemblyFilePath": { + "type": "string", + "description": "Gets the path to the assembly file.", + "nullable": true, + "readOnly": true + }, + "CanUninstall": { + "type": "boolean", + "description": "Gets a value indicating whether the plugin can be uninstalled.", + "readOnly": true + }, + "DataFolderPath": { + "type": "string", + "description": "Gets the full path to the data folder, where the plugin can store any miscellaneous files needed.", + "nullable": true, + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Common.Plugins.IPlugin." + }, + "IsoType": { + "enum": [ + "Dvd", + "BluRay" + ], + "type": "string", + "description": "Enum IsoType." + }, + "ItemCounts": { + "type": "object", + "properties": { + "MovieCount": { + "type": "integer", + "description": "Gets or sets the movie count.", + "format": "int32" + }, + "SeriesCount": { + "type": "integer", + "description": "Gets or sets the series count.", + "format": "int32" + }, + "EpisodeCount": { + "type": "integer", + "description": "Gets or sets the episode count.", + "format": "int32" + }, + "ArtistCount": { + "type": "integer", + "description": "Gets or sets the artist count.", + "format": "int32" + }, + "ProgramCount": { + "type": "integer", + "description": "Gets or sets the program count.", + "format": "int32" + }, + "TrailerCount": { + "type": "integer", + "description": "Gets or sets the trailer count.", + "format": "int32" + }, + "SongCount": { + "type": "integer", + "description": "Gets or sets the song count.", + "format": "int32" + }, + "AlbumCount": { + "type": "integer", + "description": "Gets or sets the album count.", + "format": "int32" + }, + "MusicVideoCount": { + "type": "integer", + "description": "Gets or sets the music video count.", + "format": "int32" + }, + "BoxSetCount": { + "type": "integer", + "description": "Gets or sets the box set count.", + "format": "int32" + }, + "BookCount": { + "type": "integer", + "description": "Gets or sets the book count.", + "format": "int32" + }, + "ItemCount": { + "type": "integer", + "description": "Gets or sets the item count.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class LibrarySummary." + }, + "ItemFields": { + "enum": [ + "AirTime", + "CanDelete", + "CanDownload", + "ChannelInfo", + "Chapters", + "Trickplay", + "ChildCount", + "CumulativeRunTimeTicks", + "CustomRating", + "DateCreated", + "DateLastMediaAdded", + "DisplayPreferencesId", + "Etag", + "ExternalUrls", + "Genres", + "ItemCounts", + "MediaSourceCount", + "MediaSources", + "OriginalTitle", + "Overview", + "ParentId", + "Path", + "People", + "PlayAccess", + "ProductionLocations", + "ProviderIds", + "PrimaryImageAspectRatio", + "RecursiveItemCount", + "Settings", + "SeriesStudio", + "SortName", + "SpecialEpisodeNumbers", + "Studios", + "Taglines", + "Tags", + "RemoteTrailers", + "MediaStreams", + "SeasonUserData", + "DateLastRefreshed", + "DateLastSaved", + "RefreshState", + "ChannelImage", + "EnableMediaSourceDisplay", + "Width", + "Height", + "ExtraIds", + "LocalTrailerCount", + "IsHD", + "SpecialFeatureCount" + ], + "type": "string", + "description": "Used to control the data that gets attached to DtoBaseItems." + }, + "ItemFilter": { + "enum": [ + "IsFolder", + "IsNotFolder", + "IsUnplayed", + "IsPlayed", + "IsFavorite", + "IsResumable", + "Likes", + "Dislikes", + "IsFavoriteOrLikes" + ], + "type": "string", + "description": "Enum ItemFilter." + }, + "ItemSortBy": { + "enum": [ + "Default", + "AiredEpisodeOrder", + "Album", + "AlbumArtist", + "Artist", + "DateCreated", + "OfficialRating", + "DatePlayed", + "PremiereDate", + "StartDate", + "SortName", + "Name", + "Random", + "Runtime", + "CommunityRating", + "ProductionYear", + "PlayCount", + "CriticRating", + "IsFolder", + "IsUnplayed", + "IsPlayed", + "SeriesSortName", + "VideoBitRate", + "AirTime", + "Studio", + "IsFavoriteOrLiked", + "DateLastContentAdded", + "SeriesDatePlayed", + "ParentIndexNumber", + "IndexNumber" + ], + "type": "string", + "description": "These represent sort orders." + }, + "JoinGroupRequestDto": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets or sets the group identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class JoinGroupRequestDto." + }, + "KeepUntil": { + "enum": [ + "UntilDeleted", + "UntilSpaceNeeded", + "UntilWatched", + "UntilDate" + ], + "type": "string" + }, + "LibraryChangedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryUpdateInfo" + } + ], + "description": "Class LibraryUpdateInfo.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "LibraryChanged", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Library changed message." + }, + "LibraryOptionInfoDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets name.", + "nullable": true + }, + "DefaultEnabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether default enabled." + } + }, + "additionalProperties": false, + "description": "Library option info dto." + }, + "LibraryOptions": { + "type": "object", + "properties": { + "Enabled": { + "type": "boolean" + }, + "EnablePhotos": { + "type": "boolean" + }, + "EnableRealtimeMonitor": { + "type": "boolean" + }, + "EnableLUFSScan": { + "type": "boolean" + }, + "EnableChapterImageExtraction": { + "type": "boolean" + }, + "ExtractChapterImagesDuringLibraryScan": { + "type": "boolean" + }, + "EnableTrickplayImageExtraction": { + "type": "boolean" + }, + "ExtractTrickplayImagesDuringLibraryScan": { + "type": "boolean" + }, + "PathInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaPathInfo" + } + }, + "SaveLocalMetadata": { + "type": "boolean" + }, + "EnableInternetProviders": { + "type": "boolean", + "deprecated": true + }, + "EnableAutomaticSeriesGrouping": { + "type": "boolean" + }, + "EnableEmbeddedTitles": { + "type": "boolean" + }, + "EnableEmbeddedExtrasTitles": { + "type": "boolean" + }, + "EnableEmbeddedEpisodeInfos": { + "type": "boolean" + }, + "AutomaticRefreshIntervalDays": { + "type": "integer", + "format": "int32" + }, + "PreferredMetadataLanguage": { + "type": "string", + "description": "Gets or sets the preferred metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "SeasonZeroDisplayName": { + "type": "string" + }, + "MetadataSavers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledLocalMetadataReaders": { + "type": "array", + "items": { + "type": "string" + } + }, + "LocalMetadataReaderOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledSubtitleFetchers": { + "type": "array", + "items": { + "type": "string" + } + }, + "SubtitleFetcherOrder": { + "type": "array", + "items": { + "type": "string" + } + }, + "DisabledMediaSegmentProviders": { + "type": "array", + "items": { + "type": "string" + } + }, + "MediaSegmentProviderOrder": { + "type": "array", + "items": { + "type": "string" + } + }, + "SkipSubtitlesIfEmbeddedSubtitlesPresent": { + "type": "boolean" + }, + "SkipSubtitlesIfAudioTrackMatches": { + "type": "boolean" + }, + "SubtitleDownloadLanguages": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "RequirePerfectSubtitleMatch": { + "type": "boolean" + }, + "SaveSubtitlesWithMedia": { + "type": "boolean" + }, + "SaveLyricsWithMedia": { + "type": "boolean", + "default": false + }, + "SaveTrickplayWithMedia": { + "type": "boolean", + "default": false + }, + "DisabledLyricFetchers": { + "type": "array", + "items": { + "type": "string" + } + }, + "LyricFetcherOrder": { + "type": "array", + "items": { + "type": "string" + } + }, + "PreferNonstandardArtistsTag": { + "type": "boolean", + "default": false + }, + "UseCustomTagDelimiters": { + "type": "boolean", + "default": false + }, + "CustomTagDelimiters": { + "type": "array", + "items": { + "type": "string" + } + }, + "DelimiterWhitelist": { + "type": "array", + "items": { + "type": "string" + } + }, + "AutomaticallyAddToCollection": { + "type": "boolean" + }, + "AllowEmbeddedSubtitles": { + "enum": [ + "AllowAll", + "AllowText", + "AllowImage", + "AllowNone" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EmbeddedSubtitleOptions" + } + ], + "description": "An enum representing the options to disable embedded subs." + }, + "TypeOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TypeOptions" + } + } + }, + "additionalProperties": false + }, + "LibraryOptionsResultDto": { + "type": "object", + "properties": { + "MetadataSavers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the metadata savers." + }, + "MetadataReaders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the metadata readers." + }, + "SubtitleFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the subtitle fetchers." + }, + "LyricFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the list of lyric fetchers." + }, + "MediaSegmentProviders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the list of MediaSegment Providers." + }, + "TypeOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryTypeOptionsDto" + }, + "description": "Gets or sets the type options." + } + }, + "additionalProperties": false, + "description": "Library options result dto." + }, + "LibraryStorageDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the Library Id.", + "format": "uuid" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name of the library." + }, + "Folders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FolderStorageDto" + }, + "description": "Gets or sets the storage informations about the folders used in a library." + } + }, + "additionalProperties": false, + "description": "Contains informations about a libraries storage informations." + }, + "LibraryTypeOptionsDto": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "description": "Gets or sets the type.", + "nullable": true + }, + "MetadataFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the metadata fetchers." + }, + "ImageFetchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryOptionInfoDto" + }, + "description": "Gets or sets the image fetchers." + }, + "SupportedImageTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageType" + }, + "description": "Gets or sets the supported image types." + }, + "DefaultImageOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageOption" + }, + "description": "Gets or sets the default image options." + } + }, + "additionalProperties": false, + "description": "Library type options dto." + }, + "LibraryUpdateInfo": { + "type": "object", + "properties": { + "FoldersAddedTo": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the folders added to." + }, + "FoldersRemovedFrom": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the folders removed from." + }, + "ItemsAdded": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the items added." + }, + "ItemsRemoved": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the items removed." + }, + "ItemsUpdated": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the items updated." + }, + "CollectionFolders": { + "type": "array", + "items": { + "type": "string" + } + }, + "IsEmpty": { + "type": "boolean", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Class LibraryUpdateInfo." + }, + "ListingsProviderInfo": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "Username": { + "type": "string", + "nullable": true + }, + "Password": { + "type": "string", + "nullable": true + }, + "ListingsId": { + "type": "string", + "nullable": true + }, + "ZipCode": { + "type": "string", + "nullable": true + }, + "Country": { + "type": "string", + "nullable": true + }, + "Path": { + "type": "string", + "nullable": true + }, + "EnabledTuners": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableAllTuners": { + "type": "boolean" + }, + "NewsCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "SportsCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "KidsCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "MovieCategories": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ChannelMappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + }, + "nullable": true + }, + "MoviePrefix": { + "type": "string", + "nullable": true + }, + "PreferredLanguage": { + "type": "string", + "nullable": true + }, + "UserAgent": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "LiveStreamResponse": { + "type": "object", + "properties": { + "MediaSource": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaSourceInfo" + } + ] + } + }, + "additionalProperties": false + }, + "LiveTvInfo": { + "type": "object", + "properties": { + "Services": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LiveTvServiceInfo" + }, + "description": "Gets or sets the services." + }, + "IsEnabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is enabled." + }, + "EnabledUsers": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the enabled users." + } + }, + "additionalProperties": false + }, + "LiveTvOptions": { + "type": "object", + "properties": { + "GuideDays": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "RecordingPath": { + "type": "string", + "nullable": true + }, + "MovieRecordingPath": { + "type": "string", + "nullable": true + }, + "SeriesRecordingPath": { + "type": "string", + "nullable": true + }, + "EnableRecordingSubfolders": { + "type": "boolean" + }, + "EnableOriginalAudioWithEncodedRecordings": { + "type": "boolean" + }, + "TunerHosts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TunerHostInfo" + }, + "nullable": true + }, + "ListingProviders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ListingsProviderInfo" + }, + "nullable": true + }, + "PrePaddingSeconds": { + "type": "integer", + "format": "int32" + }, + "PostPaddingSeconds": { + "type": "integer", + "format": "int32" + }, + "MediaLocationsCreated": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "RecordingPostProcessor": { + "type": "string", + "nullable": true + }, + "RecordingPostProcessorArguments": { + "type": "string", + "nullable": true + }, + "SaveRecordingNFO": { + "type": "boolean" + }, + "SaveRecordingImages": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "LiveTvServiceInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "HomePageUrl": { + "type": "string", + "description": "Gets or sets the home page URL.", + "nullable": true + }, + "Status": { + "enum": [ + "Ok", + "Unavailable" + ], + "allOf": [ + { + "$ref": "#/components/schemas/LiveTvServiceStatus" + } + ], + "description": "Gets or sets the status." + }, + "StatusMessage": { + "type": "string", + "description": "Gets or sets the status message.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the version.", + "nullable": true + }, + "HasUpdateAvailable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has update available." + }, + "IsVisible": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is visible." + }, + "Tuners": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class ServiceInfo." + }, + "LiveTvServiceStatus": { + "enum": [ + "Ok", + "Unavailable" + ], + "type": "string" + }, + "LocalizationOption": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "Value": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "LocationType": { + "enum": [ + "FileSystem", + "Remote", + "Virtual", + "Offline" + ], + "type": "string", + "description": "Enum LocationType." + }, + "LogFile": { + "type": "object", + "properties": { + "DateCreated": { + "type": "string", + "description": "Gets or sets the date created.", + "format": "date-time" + }, + "DateModified": { + "type": "string", + "description": "Gets or sets the date modified.", + "format": "date-time" + }, + "Size": { + "type": "integer", + "description": "Gets or sets the size.", + "format": "int64" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name." + } + }, + "additionalProperties": false + }, + "LogLevel": { + "enum": [ + "Trace", + "Debug", + "Information", + "Warning", + "Error", + "Critical", + "None" + ], + "type": "string" + }, + "LyricDto": { + "type": "object", + "properties": { + "Metadata": { + "allOf": [ + { + "$ref": "#/components/schemas/LyricMetadata" + } + ], + "description": "Gets or sets Metadata for the lyrics." + }, + "Lyrics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LyricLine" + }, + "description": "Gets or sets a collection of individual lyric lines." + } + }, + "additionalProperties": false, + "description": "LyricResponse model." + }, + "LyricLine": { + "type": "object", + "properties": { + "Text": { + "type": "string", + "description": "Gets the text of this lyric line." + }, + "Start": { + "type": "integer", + "description": "Gets the start time in ticks.", + "format": "int64", + "nullable": true + }, + "Cues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LyricLineCue" + }, + "description": "Gets the time-aligned cues for the song's lyrics.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Lyric model." + }, + "LyricLineCue": { + "type": "object", + "properties": { + "Position": { + "type": "integer", + "description": "Gets the start character index of the cue.", + "format": "int32" + }, + "EndPosition": { + "type": "integer", + "description": "Gets the end character index of the cue.", + "format": "int32" + }, + "Start": { + "type": "integer", + "description": "Gets the timestamp the lyric is synced to in ticks.", + "format": "int64" + }, + "End": { + "type": "integer", + "description": "Gets the end timestamp the lyric is synced to in ticks.", + "format": "int64", + "nullable": true + } + }, + "additionalProperties": false, + "description": "LyricLineCue model, holds information about the timing of words within a LyricLine." + }, + "LyricMetadata": { + "type": "object", + "properties": { + "Artist": { + "type": "string", + "description": "Gets or sets the song artist.", + "nullable": true + }, + "Album": { + "type": "string", + "description": "Gets or sets the album this song is on.", + "nullable": true + }, + "Title": { + "type": "string", + "description": "Gets or sets the title of the song.", + "nullable": true + }, + "Author": { + "type": "string", + "description": "Gets or sets the author of the lyric data.", + "nullable": true + }, + "Length": { + "type": "integer", + "description": "Gets or sets the length of the song in ticks.", + "format": "int64", + "nullable": true + }, + "By": { + "type": "string", + "description": "Gets or sets who the LRC file was created by.", + "nullable": true + }, + "Offset": { + "type": "integer", + "description": "Gets or sets the lyric offset compared to audio in ticks.", + "format": "int64", + "nullable": true + }, + "Creator": { + "type": "string", + "description": "Gets or sets the software used to create the LRC file.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the version of the creator used.", + "nullable": true + }, + "IsSynced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this lyric is synced.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "LyricMetadata model." + }, + "MediaAttachment": { + "type": "object", + "properties": { + "Codec": { + "type": "string", + "description": "Gets or sets the codec.", + "nullable": true + }, + "CodecTag": { + "type": "string", + "description": "Gets or sets the codec tag.", + "nullable": true + }, + "Comment": { + "type": "string", + "description": "Gets or sets the comment.", + "nullable": true + }, + "Index": { + "type": "integer", + "description": "Gets or sets the index.", + "format": "int32" + }, + "FileName": { + "type": "string", + "description": "Gets or sets the filename.", + "nullable": true + }, + "MimeType": { + "type": "string", + "description": "Gets or sets the MIME type.", + "nullable": true + }, + "DeliveryUrl": { + "type": "string", + "description": "Gets or sets the delivery URL.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class MediaAttachment." + }, + "MediaPathDto": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of the library." + }, + "Path": { + "type": "string", + "description": "Gets or sets the path to add.", + "nullable": true + }, + "PathInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathInfo" + } + ], + "description": "Gets or sets the path info.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Media Path dto." + }, + "MediaPathInfo": { + "type": "object", + "properties": { + "Path": { + "type": "string" + } + }, + "additionalProperties": false + }, + "MediaProtocol": { + "enum": [ + "File", + "Http", + "Rtmp", + "Rtsp", + "Udp", + "Rtp", + "Ftp" + ], + "type": "string" + }, + "MediaSegmentDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the id of the media segment.", + "format": "uuid" + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the id of the associated item.", + "format": "uuid" + }, + "Type": { + "enum": [ + "Unknown", + "Commercial", + "Preview", + "Recap", + "Outro", + "Intro" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaSegmentType" + } + ], + "description": "Gets or sets the type of content this segment defines.", + "default": "Unknown" + }, + "StartTicks": { + "type": "integer", + "description": "Gets or sets the start of the segment.", + "format": "int64" + }, + "EndTicks": { + "type": "integer", + "description": "Gets or sets the end of the segment.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Api model for MediaSegment's." + }, + "MediaSegmentDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaSegmentDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "MediaSegmentType": { + "enum": [ + "Unknown", + "Commercial", + "Preview", + "Recap", + "Outro", + "Intro" + ], + "type": "string", + "description": "Defines the types of content an individual Jellyfin.Database.Implementations.Entities.MediaSegment represents." + }, + "MediaSourceInfo": { + "type": "object", + "properties": { + "Protocol": { + "enum": [ + "File", + "Http", + "Rtmp", + "Rtsp", + "Udp", + "Rtp", + "Ftp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaProtocol" + } + ] + }, + "Id": { + "type": "string", + "nullable": true + }, + "Path": { + "type": "string", + "nullable": true + }, + "EncoderPath": { + "type": "string", + "nullable": true + }, + "EncoderProtocol": { + "enum": [ + "File", + "Http", + "Rtmp", + "Rtsp", + "Udp", + "Rtp", + "Ftp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaProtocol" + } + ], + "nullable": true + }, + "Type": { + "enum": [ + "Default", + "Grouping", + "Placeholder" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaSourceType" + } + ] + }, + "Container": { + "type": "string", + "nullable": true + }, + "Size": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "Name": { + "type": "string", + "nullable": true + }, + "IsRemote": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the media is remote.\r\nDifferentiate internet url vs local network." + }, + "ETag": { + "type": "string", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "ReadAtNativeFramerate": { + "type": "boolean" + }, + "IgnoreDts": { + "type": "boolean" + }, + "IgnoreIndex": { + "type": "boolean" + }, + "GenPtsInput": { + "type": "boolean" + }, + "SupportsTranscoding": { + "type": "boolean" + }, + "SupportsDirectStream": { + "type": "boolean" + }, + "SupportsDirectPlay": { + "type": "boolean" + }, + "IsInfiniteStream": { + "type": "boolean" + }, + "UseMostCompatibleTranscodingProfile": { + "type": "boolean", + "default": false + }, + "RequiresOpening": { + "type": "boolean" + }, + "OpenToken": { + "type": "string", + "nullable": true + }, + "RequiresClosing": { + "type": "boolean" + }, + "LiveStreamId": { + "type": "string", + "nullable": true + }, + "BufferMs": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "RequiresLooping": { + "type": "boolean" + }, + "SupportsProbing": { + "type": "boolean" + }, + "VideoType": { + "enum": [ + "VideoFile", + "Iso", + "Dvd", + "BluRay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/VideoType" + } + ], + "nullable": true + }, + "IsoType": { + "enum": [ + "Dvd", + "BluRay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/IsoType" + } + ], + "nullable": true + }, + "Video3DFormat": { + "enum": [ + "HalfSideBySide", + "FullSideBySide", + "FullTopAndBottom", + "HalfTopAndBottom", + "MVC" + ], + "allOf": [ + { + "$ref": "#/components/schemas/Video3DFormat" + } + ], + "nullable": true + }, + "MediaStreams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaStream" + }, + "nullable": true + }, + "MediaAttachments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaAttachment" + }, + "nullable": true + }, + "Formats": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Bitrate": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "FallbackMaxStreamingBitrate": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Timestamp": { + "enum": [ + "None", + "Zero", + "Valid" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TransportStreamTimestamp" + } + ], + "nullable": true + }, + "RequiredHttpHeaders": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "nullable": true + }, + "TranscodingUrl": { + "type": "string", + "nullable": true + }, + "TranscodingSubProtocol": { + "enum": [ + "http", + "hls" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamProtocol" + } + ], + "description": "Media streaming protocol.\r\nLowercase for backwards compatibility." + }, + "TranscodingContainer": { + "type": "string", + "nullable": true + }, + "AnalyzeDurationMs": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "DefaultAudioStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "DefaultSubtitleStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "HasSegments": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "MediaSourceType": { + "enum": [ + "Default", + "Grouping", + "Placeholder" + ], + "type": "string" + }, + "MediaStream": { + "type": "object", + "properties": { + "Codec": { + "type": "string", + "description": "Gets or sets the codec.", + "nullable": true + }, + "CodecTag": { + "type": "string", + "description": "Gets or sets the codec tag.", + "nullable": true + }, + "Language": { + "type": "string", + "description": "Gets or sets the language.", + "nullable": true + }, + "ColorRange": { + "type": "string", + "description": "Gets or sets the color range.", + "nullable": true + }, + "ColorSpace": { + "type": "string", + "description": "Gets or sets the color space.", + "nullable": true + }, + "ColorTransfer": { + "type": "string", + "description": "Gets or sets the color transfer.", + "nullable": true + }, + "ColorPrimaries": { + "type": "string", + "description": "Gets or sets the color primaries.", + "nullable": true + }, + "DvVersionMajor": { + "type": "integer", + "description": "Gets or sets the Dolby Vision version major.", + "format": "int32", + "nullable": true + }, + "DvVersionMinor": { + "type": "integer", + "description": "Gets or sets the Dolby Vision version minor.", + "format": "int32", + "nullable": true + }, + "DvProfile": { + "type": "integer", + "description": "Gets or sets the Dolby Vision profile.", + "format": "int32", + "nullable": true + }, + "DvLevel": { + "type": "integer", + "description": "Gets or sets the Dolby Vision level.", + "format": "int32", + "nullable": true + }, + "RpuPresentFlag": { + "type": "integer", + "description": "Gets or sets the Dolby Vision rpu present flag.", + "format": "int32", + "nullable": true + }, + "ElPresentFlag": { + "type": "integer", + "description": "Gets or sets the Dolby Vision el present flag.", + "format": "int32", + "nullable": true + }, + "BlPresentFlag": { + "type": "integer", + "description": "Gets or sets the Dolby Vision bl present flag.", + "format": "int32", + "nullable": true + }, + "DvBlSignalCompatibilityId": { + "type": "integer", + "description": "Gets or sets the Dolby Vision bl signal compatibility id.", + "format": "int32", + "nullable": true + }, + "Rotation": { + "type": "integer", + "description": "Gets or sets the Rotation in degrees.", + "format": "int32", + "nullable": true + }, + "Comment": { + "type": "string", + "description": "Gets or sets the comment.", + "nullable": true + }, + "TimeBase": { + "type": "string", + "description": "Gets or sets the time base.", + "nullable": true + }, + "CodecTimeBase": { + "type": "string", + "description": "Gets or sets the codec time base.", + "nullable": true + }, + "Title": { + "type": "string", + "description": "Gets or sets the title.", + "nullable": true + }, + "Hdr10PlusPresentFlag": { + "type": "boolean", + "nullable": true + }, + "VideoRange": { + "enum": [ + "Unknown", + "SDR", + "HDR" + ], + "allOf": [ + { + "$ref": "#/components/schemas/VideoRange" + } + ], + "description": "Gets the video range.", + "default": "Unknown", + "readOnly": true + }, + "VideoRangeType": { + "enum": [ + "Unknown", + "SDR", + "HDR10", + "HLG", + "DOVI", + "DOVIWithHDR10", + "DOVIWithHLG", + "DOVIWithSDR", + "DOVIWithEL", + "DOVIWithHDR10Plus", + "DOVIWithELHDR10Plus", + "DOVIInvalid", + "HDR10Plus" + ], + "allOf": [ + { + "$ref": "#/components/schemas/VideoRangeType" + } + ], + "description": "Gets the video range type.", + "default": "Unknown", + "readOnly": true + }, + "VideoDoViTitle": { + "type": "string", + "description": "Gets the video dovi title.", + "nullable": true, + "readOnly": true + }, + "AudioSpatialFormat": { + "enum": [ + "None", + "DolbyAtmos", + "DTSX" + ], + "allOf": [ + { + "$ref": "#/components/schemas/AudioSpatialFormat" + } + ], + "description": "Gets the audio spatial format.", + "default": "None", + "readOnly": true + }, + "LocalizedUndefined": { + "type": "string", + "nullable": true + }, + "LocalizedDefault": { + "type": "string", + "nullable": true + }, + "LocalizedForced": { + "type": "string", + "nullable": true + }, + "LocalizedExternal": { + "type": "string", + "nullable": true + }, + "LocalizedHearingImpaired": { + "type": "string", + "nullable": true + }, + "DisplayTitle": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "NalLengthSize": { + "type": "string", + "nullable": true + }, + "IsInterlaced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is interlaced." + }, + "IsAVC": { + "type": "boolean", + "nullable": true + }, + "ChannelLayout": { + "type": "string", + "description": "Gets or sets the channel layout.", + "nullable": true + }, + "BitRate": { + "type": "integer", + "description": "Gets or sets the bit rate.", + "format": "int32", + "nullable": true + }, + "BitDepth": { + "type": "integer", + "description": "Gets or sets the bit depth.", + "format": "int32", + "nullable": true + }, + "RefFrames": { + "type": "integer", + "description": "Gets or sets the reference frames.", + "format": "int32", + "nullable": true + }, + "PacketLength": { + "type": "integer", + "description": "Gets or sets the length of the packet.", + "format": "int32", + "nullable": true + }, + "Channels": { + "type": "integer", + "description": "Gets or sets the channels.", + "format": "int32", + "nullable": true + }, + "SampleRate": { + "type": "integer", + "description": "Gets or sets the sample rate.", + "format": "int32", + "nullable": true + }, + "IsDefault": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is default." + }, + "IsForced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is forced." + }, + "IsHearingImpaired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is for the hearing impaired." + }, + "Height": { + "type": "integer", + "description": "Gets or sets the height.", + "format": "int32", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the width.", + "format": "int32", + "nullable": true + }, + "AverageFrameRate": { + "type": "number", + "description": "Gets or sets the average frame rate.", + "format": "float", + "nullable": true + }, + "RealFrameRate": { + "type": "number", + "description": "Gets or sets the real frame rate.", + "format": "float", + "nullable": true + }, + "ReferenceFrameRate": { + "type": "number", + "description": "Gets the framerate used as reference.\r\nPrefer AverageFrameRate, if that is null or an unrealistic value\r\nthen fallback to RealFrameRate.", + "format": "float", + "nullable": true, + "readOnly": true + }, + "Profile": { + "type": "string", + "description": "Gets or sets the profile.", + "nullable": true + }, + "Type": { + "enum": [ + "Audio", + "Video", + "Subtitle", + "EmbeddedImage", + "Data", + "Lyric" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamType" + } + ], + "description": "Gets or sets the type." + }, + "AspectRatio": { + "type": "string", + "description": "Gets or sets the aspect ratio.", + "nullable": true + }, + "Index": { + "type": "integer", + "description": "Gets or sets the index.", + "format": "int32" + }, + "Score": { + "type": "integer", + "description": "Gets or sets the score.", + "format": "int32", + "nullable": true + }, + "IsExternal": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is external." + }, + "DeliveryMethod": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ], + "description": "Gets or sets the method.", + "nullable": true + }, + "DeliveryUrl": { + "type": "string", + "description": "Gets or sets the delivery URL.", + "nullable": true + }, + "IsExternalUrl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is external URL.", + "nullable": true + }, + "IsTextSubtitleStream": { + "type": "boolean", + "readOnly": true + }, + "SupportsExternalStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports external stream]." + }, + "Path": { + "type": "string", + "description": "Gets or sets the filename.", + "nullable": true + }, + "PixelFormat": { + "type": "string", + "description": "Gets or sets the pixel format.", + "nullable": true + }, + "Level": { + "type": "number", + "description": "Gets or sets the level.", + "format": "double", + "nullable": true + }, + "IsAnamorphic": { + "type": "boolean", + "description": "Gets or sets whether this instance is anamorphic.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class MediaStream." + }, + "MediaStreamProtocol": { + "enum": [ + "http", + "hls" + ], + "type": "string", + "description": "Media streaming protocol.\r\nLowercase for backwards compatibility." + }, + "MediaStreamType": { + "enum": [ + "Audio", + "Video", + "Subtitle", + "EmbeddedImage", + "Data", + "Lyric" + ], + "type": "string", + "description": "Enum MediaStreamType." + }, + "MediaType": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "type": "string", + "description": "Media types." + }, + "MediaUpdateInfoDto": { + "type": "object", + "properties": { + "Updates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaUpdateInfoPathDto" + }, + "description": "Gets or sets the list of updates." + } + }, + "additionalProperties": false, + "description": "Media Update Info Dto." + }, + "MediaUpdateInfoPathDto": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Gets or sets media path.", + "nullable": true + }, + "UpdateType": { + "type": "string", + "description": "Gets or sets media update type.\r\nCreated, Modified, Deleted.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The media update info path." + }, + "MediaUrl": { + "type": "object", + "properties": { + "Url": { + "type": "string", + "nullable": true + }, + "Name": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "MessageCommand": { + "required": [ + "Text" + ], + "type": "object", + "properties": { + "Header": { + "type": "string", + "nullable": true + }, + "Text": { + "type": "string" + }, + "TimeoutMs": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + "additionalProperties": false + }, + "MetadataConfiguration": { + "type": "object", + "properties": { + "UseFileCreationTimeForDateAdded": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "MetadataEditorInfo": { + "type": "object", + "properties": { + "ParentalRatingOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParentalRating" + }, + "description": "Gets or sets the parental rating options." + }, + "Countries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CountryInfo" + }, + "description": "Gets or sets the countries." + }, + "Cultures": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CultureDto" + }, + "description": "Gets or sets the cultures." + }, + "ExternalIdInfos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalIdInfo" + }, + "description": "Gets or sets the external id infos." + }, + "ContentType": { + "enum": [ + "unknown", + "movies", + "tvshows", + "music", + "musicvideos", + "trailers", + "homevideos", + "boxsets", + "books", + "photos", + "livetv", + "playlists", + "folders" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionType" + } + ], + "description": "Gets or sets the content type.", + "nullable": true + }, + "ContentTypeOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + }, + "description": "Gets or sets the content type options." + } + }, + "additionalProperties": false, + "description": "A class representing metadata editor information." + }, + "MetadataField": { + "enum": [ + "Cast", + "Genres", + "ProductionLocations", + "Studios", + "Tags", + "Name", + "Overview", + "Runtime", + "OfficialRating" + ], + "type": "string", + "description": "Enum MetadataFields." + }, + "MetadataOptions": { + "type": "object", + "properties": { + "ItemType": { + "type": "string", + "nullable": true + }, + "DisabledMetadataSavers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "LocalMetadataReaderOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledMetadataFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "MetadataFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DisabledImageFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class MetadataOptions." + }, + "MetadataRefreshMode": { + "enum": [ + "None", + "ValidationOnly", + "Default", + "FullRefresh" + ], + "type": "string" + }, + "MovePlaylistItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist identifier of the item.", + "format": "uuid" + }, + "NewIndex": { + "type": "integer", + "description": "Gets or sets the new position.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class MovePlaylistItemRequestDto." + }, + "MovieInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "MovieInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MovieInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "MusicVideoInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "MusicVideoInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MusicVideoInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "NameGuidPair": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "Id": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "NameIdPair": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the identifier.", + "nullable": true + } + }, + "additionalProperties": false + }, + "NameValuePair": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Value": { + "type": "string", + "description": "Gets or sets the value.", + "nullable": true + } + }, + "additionalProperties": false + }, + "NetworkConfiguration": { + "type": "object", + "properties": { + "BaseUrl": { + "type": "string", + "description": "Gets or sets a value used to specify the URL prefix that your Jellyfin instance can be accessed at." + }, + "EnableHttps": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to use HTTPS." + }, + "RequireHttps": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the server should force connections over HTTPS." + }, + "CertificatePath": { + "type": "string", + "description": "Gets or sets the filesystem path of an X.509 certificate to use for SSL." + }, + "CertificatePassword": { + "type": "string", + "description": "Gets or sets the password required to access the X.509 certificate data in the file specified by MediaBrowser.Common.Net.NetworkConfiguration.CertificatePath." + }, + "InternalHttpPort": { + "type": "integer", + "description": "Gets or sets the internal HTTP server port.", + "format": "int32" + }, + "InternalHttpsPort": { + "type": "integer", + "description": "Gets or sets the internal HTTPS server port.", + "format": "int32" + }, + "PublicHttpPort": { + "type": "integer", + "description": "Gets or sets the public HTTP port.", + "format": "int32" + }, + "PublicHttpsPort": { + "type": "integer", + "description": "Gets or sets the public HTTPS port.", + "format": "int32" + }, + "AutoDiscovery": { + "type": "boolean", + "description": "Gets or sets a value indicating whether Autodiscovery is enabled." + }, + "EnableUPnP": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable automatic port forwarding.", + "deprecated": true + }, + "EnableIPv4": { + "type": "boolean", + "description": "Gets or sets a value indicating whether IPv6 is enabled." + }, + "EnableIPv6": { + "type": "boolean", + "description": "Gets or sets a value indicating whether IPv6 is enabled." + }, + "EnableRemoteAccess": { + "type": "boolean", + "description": "Gets or sets a value indicating whether access from outside of the LAN is permitted." + }, + "LocalNetworkSubnets": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the subnets that are deemed to make up the LAN." + }, + "LocalNetworkAddresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the interface addresses which Jellyfin will bind to. If empty, all interfaces will be used." + }, + "KnownProxies": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the known proxies." + }, + "IgnoreVirtualInterfaces": { + "type": "boolean", + "description": "Gets or sets a value indicating whether address names that match MediaBrowser.Common.Net.NetworkConfiguration.VirtualInterfaceNames should be ignored for the purposes of binding." + }, + "VirtualInterfaceNames": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets a value indicating the interface name prefixes that should be ignored. The list can be comma separated and values are case-insensitive. ." + }, + "EnablePublishedServerUriByRequest": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the published server uri is based on information in HTTP requests." + }, + "PublishedServerUriBySubnet": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the PublishedServerUriBySubnet\r\nGets or sets PublishedServerUri to advertise for specific subnets." + }, + "RemoteIPFilter": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the filter for remote IP connectivity. Used in conjunction with ." + }, + "IsRemoteIPFilterBlacklist": { + "type": "boolean", + "description": "Gets or sets a value indicating whether contains a blacklist or a whitelist. Default is a whitelist." + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Common.Net.NetworkConfiguration." + }, + "NewGroupRequestDto": { + "type": "object", + "properties": { + "GroupName": { + "type": "string", + "description": "Gets or sets the group name." + } + }, + "additionalProperties": false, + "description": "Class NewGroupRequestDto." + }, + "NextItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playing item identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class NextItemRequestDto." + }, + "OpenLiveStreamDto": { + "type": "object", + "properties": { + "OpenToken": { + "type": "string", + "description": "Gets or sets the open token.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session id.", + "nullable": true + }, + "MaxStreamingBitrate": { + "type": "integer", + "description": "Gets or sets the max streaming bitrate.", + "format": "int32", + "nullable": true + }, + "StartTimeTicks": { + "type": "integer", + "description": "Gets or sets the start time in ticks.", + "format": "int64", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the audio stream index.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the subtitle stream index.", + "format": "int32", + "nullable": true + }, + "MaxAudioChannels": { + "type": "integer", + "description": "Gets or sets the max audio channels.", + "format": "int32", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item id.", + "format": "uuid", + "nullable": true + }, + "EnableDirectPlay": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable direct play.", + "nullable": true + }, + "EnableDirectStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable direct stream.", + "nullable": true + }, + "AlwaysBurnInSubtitleWhenTranscoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether always burn in subtitles when transcoding.", + "nullable": true + }, + "DeviceProfile": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't.", + "nullable": true + }, + "DirectPlayProtocols": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaProtocol" + }, + "description": "Gets or sets the device play protocols." + } + }, + "additionalProperties": false, + "description": "Open live stream dto." + }, + "OutboundKeepAliveMessage": { + "type": "object", + "properties": { + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "KeepAlive", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Keep alive websocket messages." + }, + "OutboundWebSocketMessage": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/ActivityLogEntryMessage" + }, + { + "$ref": "#/components/schemas/ForceKeepAliveMessage" + }, + { + "$ref": "#/components/schemas/GeneralCommandMessage" + }, + { + "$ref": "#/components/schemas/LibraryChangedMessage" + }, + { + "$ref": "#/components/schemas/OutboundKeepAliveMessage" + }, + { + "$ref": "#/components/schemas/PlayMessage" + }, + { + "$ref": "#/components/schemas/PlaystateMessage" + }, + { + "$ref": "#/components/schemas/PluginInstallationCancelledMessage" + }, + { + "$ref": "#/components/schemas/PluginInstallationCompletedMessage" + }, + { + "$ref": "#/components/schemas/PluginInstallationFailedMessage" + }, + { + "$ref": "#/components/schemas/PluginInstallingMessage" + }, + { + "$ref": "#/components/schemas/PluginUninstalledMessage" + }, + { + "$ref": "#/components/schemas/RefreshProgressMessage" + }, + { + "$ref": "#/components/schemas/RestartRequiredMessage" + }, + { + "$ref": "#/components/schemas/ScheduledTaskEndedMessage" + }, + { + "$ref": "#/components/schemas/ScheduledTasksInfoMessage" + }, + { + "$ref": "#/components/schemas/SeriesTimerCancelledMessage" + }, + { + "$ref": "#/components/schemas/SeriesTimerCreatedMessage" + }, + { + "$ref": "#/components/schemas/ServerRestartingMessage" + }, + { + "$ref": "#/components/schemas/ServerShuttingDownMessage" + }, + { + "$ref": "#/components/schemas/SessionsMessage" + }, + { + "$ref": "#/components/schemas/SyncPlayCommandMessage" + }, + { + "$ref": "#/components/schemas/TimerCancelledMessage" + }, + { + "$ref": "#/components/schemas/TimerCreatedMessage" + }, + { + "$ref": "#/components/schemas/UserDataChangedMessage" + }, + { + "$ref": "#/components/schemas/UserDeletedMessage" + }, + { + "$ref": "#/components/schemas/UserUpdatedMessage" + }, + { + "$ref": "#/components/schemas/SyncPlayGroupUpdateMessage" + } + ], + "description": "Represents the list of possible outbound websocket types", + "discriminator": { + "propertyName": "MessageType", + "mapping": { + "ActivityLogEntry": "#/components/schemas/ActivityLogEntryMessage", + "ForceKeepAlive": "#/components/schemas/ForceKeepAliveMessage", + "GeneralCommand": "#/components/schemas/GeneralCommandMessage", + "LibraryChanged": "#/components/schemas/LibraryChangedMessage", + "KeepAlive": "#/components/schemas/OutboundKeepAliveMessage", + "Play": "#/components/schemas/PlayMessage", + "Playstate": "#/components/schemas/PlaystateMessage", + "PackageInstallationCancelled": "#/components/schemas/PluginInstallationCancelledMessage", + "PackageInstallationCompleted": "#/components/schemas/PluginInstallationCompletedMessage", + "PackageInstallationFailed": "#/components/schemas/PluginInstallationFailedMessage", + "PackageInstalling": "#/components/schemas/PluginInstallingMessage", + "PackageUninstalled": "#/components/schemas/PluginUninstalledMessage", + "RefreshProgress": "#/components/schemas/RefreshProgressMessage", + "RestartRequired": "#/components/schemas/RestartRequiredMessage", + "ScheduledTaskEnded": "#/components/schemas/ScheduledTaskEndedMessage", + "ScheduledTasksInfo": "#/components/schemas/ScheduledTasksInfoMessage", + "SeriesTimerCancelled": "#/components/schemas/SeriesTimerCancelledMessage", + "SeriesTimerCreated": "#/components/schemas/SeriesTimerCreatedMessage", + "ServerRestarting": "#/components/schemas/ServerRestartingMessage", + "ServerShuttingDown": "#/components/schemas/ServerShuttingDownMessage", + "Sessions": "#/components/schemas/SessionsMessage", + "SyncPlayCommand": "#/components/schemas/SyncPlayCommandMessage", + "TimerCancelled": "#/components/schemas/TimerCancelledMessage", + "TimerCreated": "#/components/schemas/TimerCreatedMessage", + "UserDataChanged": "#/components/schemas/UserDataChangedMessage", + "UserDeleted": "#/components/schemas/UserDeletedMessage", + "UserUpdated": "#/components/schemas/UserUpdatedMessage", + "SyncPlayGroupUpdate": "#/components/schemas/SyncPlayGroupUpdateMessage" + } + } + }, + "PackageInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Gets or sets the name." + }, + "description": { + "type": "string", + "description": "Gets or sets a long description of the plugin containing features or helpful explanations." + }, + "overview": { + "type": "string", + "description": "Gets or sets a short overview of what the plugin does." + }, + "owner": { + "type": "string", + "description": "Gets or sets the owner." + }, + "category": { + "type": "string", + "description": "Gets or sets the category." + }, + "guid": { + "type": "string", + "description": "Gets or sets the guid of the assembly associated with this plugin.\r\nThis is used to identify the proper item for automatic updates.", + "format": "uuid" + }, + "versions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VersionInfo" + }, + "description": "Gets or sets the versions." + }, + "imageUrl": { + "type": "string", + "description": "Gets or sets the image url for the package.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PackageInfo." + }, + "ParentalRating": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "Value": { + "type": "integer", + "description": "Gets or sets the value.", + "format": "int32", + "nullable": true + }, + "RatingScore": { + "allOf": [ + { + "$ref": "#/components/schemas/ParentalRatingScore" + } + ], + "description": "Gets or sets the rating score.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class ParentalRating." + }, + "ParentalRatingScore": { + "type": "object", + "properties": { + "score": { + "type": "integer", + "description": "Gets or sets the score.", + "format": "int32" + }, + "subScore": { + "type": "integer", + "description": "Gets or sets the sub score.", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A class representing an parental rating score." + }, + "PathSubstitution": { + "type": "object", + "properties": { + "From": { + "type": "string", + "description": "Gets or sets the value to substitute." + }, + "To": { + "type": "string", + "description": "Gets or sets the value to substitution with." + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Configuration.PathSubstitution." + }, + "PersonKind": { + "enum": [ + "Unknown", + "Actor", + "Director", + "Composer", + "Writer", + "GuestStar", + "Producer", + "Conductor", + "Lyricist", + "Arranger", + "Engineer", + "Mixer", + "Remixer", + "Creator", + "Artist", + "AlbumArtist", + "Author", + "Illustrator", + "Penciller", + "Inker", + "Colorist", + "Letterer", + "CoverArtist", + "Editor", + "Translator" + ], + "type": "string", + "description": "The person kind." + }, + "PersonLookupInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PersonLookupInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/PersonLookupInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "PingRequestDto": { + "type": "object", + "properties": { + "Ping": { + "type": "integer", + "description": "Gets or sets the ping time.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class PingRequestDto." + }, + "PinRedeemResult": { + "type": "object", + "properties": { + "Success": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Users.PinRedeemResult is success." + }, + "UsersReset": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the users reset." + } + }, + "additionalProperties": false + }, + "PlayAccess": { + "enum": [ + "Full", + "None" + ], + "type": "string" + }, + "PlaybackErrorCode": { + "enum": [ + "NotAllowed", + "NoCompatibleStream", + "RateLimitExceeded" + ], + "type": "string" + }, + "PlaybackInfoDto": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "description": "Gets or sets the playback userId.", + "format": "uuid", + "nullable": true + }, + "MaxStreamingBitrate": { + "type": "integer", + "description": "Gets or sets the max streaming bitrate.", + "format": "int32", + "nullable": true + }, + "StartTimeTicks": { + "type": "integer", + "description": "Gets or sets the start time in ticks.", + "format": "int64", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the audio stream index.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the subtitle stream index.", + "format": "int32", + "nullable": true + }, + "MaxAudioChannels": { + "type": "integer", + "description": "Gets or sets the max audio channels.", + "format": "int32", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media source id.", + "nullable": true + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream id.", + "nullable": true + }, + "DeviceProfile": { + "allOf": [ + { + "$ref": "#/components/schemas/DeviceProfile" + } + ], + "description": "A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.\r\n
\r\nSpecifically, it defines the supported containers and\r\ncodecs (video and/or audio, including codec profiles and levels)\r\nthe device is able to direct play (without transcoding or remuxing),\r\nas well as which containers/codecs to transcode to in case it isn't.", + "nullable": true + }, + "EnableDirectPlay": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable direct play.", + "nullable": true + }, + "EnableDirectStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable direct stream.", + "nullable": true + }, + "EnableTranscoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable transcoding.", + "nullable": true + }, + "AllowVideoStreamCopy": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable video stream copy.", + "nullable": true + }, + "AllowAudioStreamCopy": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to allow audio stream copy.", + "nullable": true + }, + "AutoOpenLiveStream": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to auto open the live stream.", + "nullable": true + }, + "AlwaysBurnInSubtitleWhenTranscoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether always burn in subtitles when transcoding.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Playback info dto." + }, + "PlaybackInfoResponse": { + "type": "object", + "properties": { + "MediaSources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaSourceInfo" + }, + "description": "Gets or sets the media sources." + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "ErrorCode": { + "enum": [ + "NotAllowed", + "NoCompatibleStream", + "RateLimitExceeded" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackErrorCode" + } + ], + "description": "Gets or sets the error code.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackInfoResponse." + }, + "PlaybackOrder": { + "enum": [ + "Default", + "Shuffle" + ], + "type": "string", + "description": "Enum PlaybackOrder." + }, + "PlaybackProgressInfo": { + "type": "object", + "properties": { + "CanSeek": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can seek." + }, + "Item": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the item.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + }, + "SessionId": { + "type": "string", + "description": "Gets or sets the session id.", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media version identifier.", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the audio stream.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the subtitle stream.", + "format": "int32", + "nullable": true + }, + "IsPaused": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is paused." + }, + "IsMuted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is muted." + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64", + "nullable": true + }, + "PlaybackStartTimeTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "VolumeLevel": { + "type": "integer", + "description": "Gets or sets the volume level.", + "format": "int32", + "nullable": true + }, + "Brightness": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AspectRatio": { + "type": "string", + "nullable": true + }, + "PlayMethod": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ], + "description": "Gets or sets the play method." + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream identifier.", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "RepeatMode": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ], + "description": "Gets or sets the repeat mode." + }, + "PlaybackOrder": { + "enum": [ + "Default", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackOrder" + } + ], + "description": "Gets or sets the playback order." + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackProgressInfo." + }, + "PlaybackRequestType": { + "enum": [ + "Play", + "SetPlaylistItem", + "RemoveFromPlaylist", + "MovePlaylistItem", + "Queue", + "Unpause", + "Pause", + "Stop", + "Seek", + "Buffer", + "Ready", + "NextItem", + "PreviousItem", + "SetRepeatMode", + "SetShuffleMode", + "Ping", + "IgnoreWait" + ], + "type": "string", + "description": "Enum PlaybackRequestType." + }, + "PlaybackStartInfo": { + "type": "object", + "properties": { + "CanSeek": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can seek." + }, + "Item": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the item.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + }, + "SessionId": { + "type": "string", + "description": "Gets or sets the session id.", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media version identifier.", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the audio stream.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the subtitle stream.", + "format": "int32", + "nullable": true + }, + "IsPaused": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is paused." + }, + "IsMuted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is muted." + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64", + "nullable": true + }, + "PlaybackStartTimeTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "VolumeLevel": { + "type": "integer", + "description": "Gets or sets the volume level.", + "format": "int32", + "nullable": true + }, + "Brightness": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AspectRatio": { + "type": "string", + "nullable": true + }, + "PlayMethod": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ], + "description": "Gets or sets the play method." + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream identifier.", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "RepeatMode": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ], + "description": "Gets or sets the repeat mode." + }, + "PlaybackOrder": { + "enum": [ + "Default", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackOrder" + } + ], + "description": "Gets or sets the playback order." + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackStartInfo." + }, + "PlaybackStopInfo": { + "type": "object", + "properties": { + "Item": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the item.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + }, + "SessionId": { + "type": "string", + "description": "Gets or sets the session id.", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the media version identifier.", + "nullable": true + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64", + "nullable": true + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the live stream identifier.", + "nullable": true + }, + "PlaySessionId": { + "type": "string", + "description": "Gets or sets the play session identifier.", + "nullable": true + }, + "Failed": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Session.PlaybackStopInfo is failed." + }, + "NextMediaType": { + "type": "string", + "nullable": true + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlaybackStopInfo." + }, + "PlayCommand": { + "enum": [ + "PlayNow", + "PlayNext", + "PlayLast", + "PlayInstantMix", + "PlayShuffle" + ], + "type": "string", + "description": "Enum PlayCommand." + }, + "PlayerStateInfo": { + "type": "object", + "properties": { + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the now playing position ticks.", + "format": "int64", + "nullable": true + }, + "CanSeek": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can seek." + }, + "IsPaused": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is paused." + }, + "IsMuted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is muted." + }, + "VolumeLevel": { + "type": "integer", + "description": "Gets or sets the volume level.", + "format": "int32", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the now playing audio stream.", + "format": "int32", + "nullable": true + }, + "SubtitleStreamIndex": { + "type": "integer", + "description": "Gets or sets the index of the now playing subtitle stream.", + "format": "int32", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "description": "Gets or sets the now playing media version identifier.", + "nullable": true + }, + "PlayMethod": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayMethod" + } + ], + "description": "Gets or sets the play method.", + "nullable": true + }, + "RepeatMode": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RepeatMode" + } + ], + "description": "Gets or sets the repeat mode." + }, + "PlaybackOrder": { + "enum": [ + "Default", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaybackOrder" + } + ], + "description": "Gets or sets the playback order." + }, + "LiveStreamId": { + "type": "string", + "description": "Gets or sets the now playing live stream identifier.", + "nullable": true + } + }, + "additionalProperties": false + }, + "PlaylistCreationResult": { + "type": "object", + "properties": { + "Id": { + "type": "string" + } + }, + "additionalProperties": false + }, + "PlaylistDto": { + "type": "object", + "properties": { + "OpenAccess": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the playlist is publicly readable." + }, + "Shares": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + }, + "description": "Gets or sets the share permissions." + }, + "ItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the item ids." + } + }, + "additionalProperties": false, + "description": "DTO for playlists." + }, + "PlaylistUserPermissions": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid" + }, + "CanEdit": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the user has edit permissions." + } + }, + "additionalProperties": false, + "description": "Class to hold data on user permissions for playlists." + }, + "PlayMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayRequest" + } + ], + "description": "Class PlayRequest.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "Play", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Play command websocket message." + }, + "PlayMethod": { + "enum": [ + "Transcode", + "DirectStream", + "DirectPlay" + ], + "type": "string" + }, + "PlayQueueUpdate": { + "type": "object", + "properties": { + "Reason": { + "enum": [ + "NewPlaylist", + "SetCurrentItem", + "RemoveItems", + "MoveItem", + "Queue", + "QueueNext", + "NextItem", + "PreviousItem", + "RepeatMode", + "ShuffleMode" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayQueueUpdateReason" + } + ], + "description": "Gets the request type that originated this update." + }, + "LastUpdate": { + "type": "string", + "description": "Gets the UTC time of the last change to the playing queue.", + "format": "date-time" + }, + "Playlist": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SyncPlayQueueItem" + }, + "description": "Gets the playlist." + }, + "PlayingItemIndex": { + "type": "integer", + "description": "Gets the playing item index in the playlist.", + "format": "int32" + }, + "StartPositionTicks": { + "type": "integer", + "description": "Gets the start position ticks.", + "format": "int64" + }, + "IsPlaying": { + "type": "boolean", + "description": "Gets a value indicating whether the current item is playing." + }, + "ShuffleMode": { + "enum": [ + "Sorted", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupShuffleMode" + } + ], + "description": "Gets the shuffle mode." + }, + "RepeatMode": { + "enum": [ + "RepeatOne", + "RepeatAll", + "RepeatNone" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupRepeatMode" + } + ], + "description": "Gets the repeat mode." + } + }, + "additionalProperties": false, + "description": "Class PlayQueueUpdate." + }, + "PlayQueueUpdateReason": { + "enum": [ + "NewPlaylist", + "SetCurrentItem", + "RemoveItems", + "MoveItem", + "Queue", + "QueueNext", + "NextItem", + "PreviousItem", + "RepeatMode", + "ShuffleMode" + ], + "type": "string", + "description": "Enum PlayQueueUpdateReason." + }, + "PlayRequest": { + "type": "object", + "properties": { + "ItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the item ids.", + "nullable": true + }, + "StartPositionTicks": { + "type": "integer", + "description": "Gets or sets the start position ticks that the first item should be played at.", + "format": "int64", + "nullable": true + }, + "PlayCommand": { + "enum": [ + "PlayNow", + "PlayNext", + "PlayLast", + "PlayInstantMix", + "PlayShuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlayCommand" + } + ], + "description": "Gets or sets the play command." + }, + "ControllingUserId": { + "type": "string", + "description": "Gets or sets the controlling user identifier.", + "format": "uuid" + }, + "SubtitleStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "AudioStreamIndex": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "MediaSourceId": { + "type": "string", + "nullable": true + }, + "StartIndex": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class PlayRequest." + }, + "PlayRequestDto": { + "type": "object", + "properties": { + "PlayingQueue": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the playing queue." + }, + "PlayingItemPosition": { + "type": "integer", + "description": "Gets or sets the position of the playing item in the queue.", + "format": "int32" + }, + "StartPositionTicks": { + "type": "integer", + "description": "Gets or sets the start position ticks.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class PlayRequestDto." + }, + "PlaystateCommand": { + "enum": [ + "Stop", + "Pause", + "Unpause", + "NextTrack", + "PreviousTrack", + "Seek", + "Rewind", + "FastForward", + "PlayPause" + ], + "type": "string", + "description": "Enum PlaystateCommand." + }, + "PlaystateMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/PlaystateRequest" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "Playstate", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Playstate message." + }, + "PlaystateRequest": { + "type": "object", + "properties": { + "Command": { + "enum": [ + "Stop", + "Pause", + "Unpause", + "NextTrack", + "PreviousTrack", + "Seek", + "Rewind", + "FastForward", + "PlayPause" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PlaystateCommand" + } + ], + "description": "Enum PlaystateCommand." + }, + "SeekPositionTicks": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "ControllingUserId": { + "type": "string", + "description": "Gets or sets the controlling user identifier.", + "nullable": true + } + }, + "additionalProperties": false + }, + "PluginInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "Version": { + "type": "string", + "description": "Gets or sets the version." + }, + "ConfigurationFileName": { + "type": "string", + "description": "Gets or sets the name of the configuration file.", + "nullable": true + }, + "Description": { + "type": "string", + "description": "Gets or sets the description." + }, + "Id": { + "type": "string", + "description": "Gets or sets the unique id.", + "format": "uuid" + }, + "CanUninstall": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the plugin can be uninstalled." + }, + "HasImage": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this plugin has a valid image." + }, + "Status": { + "enum": [ + "Active", + "Restart", + "Deleted", + "Superseded", + "Superceded", + "Malfunctioned", + "NotSupported", + "Disabled" + ], + "allOf": [ + { + "$ref": "#/components/schemas/PluginStatus" + } + ], + "description": "Gets or sets a value indicating the status of the plugin." + } + }, + "additionalProperties": false, + "description": "This is a serializable stub class that is used by the api to provide information about installed plugins." + }, + "PluginInstallationCancelledMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/InstallationInfo" + } + ], + "description": "Class InstallationInfo.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageInstallationCancelled", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Plugin installation cancelled message." + }, + "PluginInstallationCompletedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/InstallationInfo" + } + ], + "description": "Class InstallationInfo.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageInstallationCompleted", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Plugin installation completed message." + }, + "PluginInstallationFailedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/InstallationInfo" + } + ], + "description": "Class InstallationInfo.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageInstallationFailed", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Plugin installation failed message." + }, + "PluginInstallingMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/InstallationInfo" + } + ], + "description": "Class InstallationInfo.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageInstalling", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Package installing message." + }, + "PluginStatus": { + "enum": [ + "Active", + "Restart", + "Deleted", + "Superseded", + "Superceded", + "Malfunctioned", + "NotSupported", + "Disabled" + ], + "type": "string", + "description": "Plugin load status." + }, + "PluginUninstalledMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/PluginInfo" + } + ], + "description": "This is a serializable stub class that is used by the api to provide information about installed plugins.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "PackageUninstalled", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Plugin uninstalled message." + }, + "PreviousItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playing item identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class PreviousItemRequestDto." + }, + "ProblemDetails": { + "type": "object", + "properties": { + "type": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "status": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "detail": { + "type": "string", + "nullable": true + }, + "instance": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": { } + }, + "ProcessPriorityClass": { + "enum": [ + "Normal", + "Idle", + "High", + "RealTime", + "BelowNormal", + "AboveNormal" + ], + "type": "string" + }, + "ProfileCondition": { + "type": "object", + "properties": { + "Condition": { + "enum": [ + "Equals", + "NotEquals", + "LessThanEqual", + "GreaterThanEqual", + "EqualsAny" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ProfileConditionType" + } + ] + }, + "Property": { + "enum": [ + "AudioChannels", + "AudioBitrate", + "AudioProfile", + "Width", + "Height", + "Has64BitOffsets", + "PacketLength", + "VideoBitDepth", + "VideoBitrate", + "VideoFramerate", + "VideoLevel", + "VideoProfile", + "VideoTimestamp", + "IsAnamorphic", + "RefFrames", + "NumAudioStreams", + "NumVideoStreams", + "IsSecondaryAudio", + "VideoCodecTag", + "IsAvc", + "IsInterlaced", + "AudioSampleRate", + "AudioBitDepth", + "VideoRangeType", + "NumStreams" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ProfileConditionValue" + } + ] + }, + "Value": { + "type": "string", + "nullable": true + }, + "IsRequired": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "ProfileConditionType": { + "enum": [ + "Equals", + "NotEquals", + "LessThanEqual", + "GreaterThanEqual", + "EqualsAny" + ], + "type": "string" + }, + "ProfileConditionValue": { + "enum": [ + "AudioChannels", + "AudioBitrate", + "AudioProfile", + "Width", + "Height", + "Has64BitOffsets", + "PacketLength", + "VideoBitDepth", + "VideoBitrate", + "VideoFramerate", + "VideoLevel", + "VideoProfile", + "VideoTimestamp", + "IsAnamorphic", + "RefFrames", + "NumAudioStreams", + "NumVideoStreams", + "IsSecondaryAudio", + "VideoCodecTag", + "IsAvc", + "IsInterlaced", + "AudioSampleRate", + "AudioBitDepth", + "VideoRangeType", + "NumStreams" + ], + "type": "string" + }, + "ProgramAudio": { + "enum": [ + "Mono", + "Stereo", + "Dolby", + "DolbyDigital", + "Thx", + "Atmos" + ], + "type": "string" + }, + "PublicSystemInfo": { + "type": "object", + "properties": { + "LocalAddress": { + "type": "string", + "description": "Gets or sets the local address.", + "nullable": true + }, + "ServerName": { + "type": "string", + "description": "Gets or sets the name of the server.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the server version.", + "nullable": true + }, + "ProductName": { + "type": "string", + "description": "Gets or sets the product name. This is the AssemblyProduct name.", + "nullable": true + }, + "OperatingSystem": { + "type": "string", + "description": "Gets or sets the operating system.", + "nullable": true, + "deprecated": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "StartupWizardCompleted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the startup wizard is completed.", + "nullable": true + } + }, + "additionalProperties": false + }, + "QueryFilters": { + "type": "object", + "properties": { + "Genres": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameGuidPair" + }, + "nullable": true + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "QueryFiltersLegacy": { + "type": "object", + "properties": { + "Genres": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Tags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "OfficialRatings": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Years": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "QueueItem": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "format": "uuid" + }, + "PlaylistItemId": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "QueueRequestDto": { + "type": "object", + "properties": { + "ItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the items to enqueue." + }, + "Mode": { + "enum": [ + "Queue", + "QueueNext" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupQueueMode" + } + ], + "description": "Enum GroupQueueMode." + } + }, + "additionalProperties": false, + "description": "Class QueueRequestDto." + }, + "QuickConnectDto": { + "required": [ + "Secret" + ], + "type": "object", + "properties": { + "Secret": { + "type": "string", + "description": "Gets or sets the quick connect secret." + } + }, + "additionalProperties": false, + "description": "The quick connect request body." + }, + "QuickConnectResult": { + "type": "object", + "properties": { + "Authenticated": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this request is authorized." + }, + "Secret": { + "type": "string", + "description": "Gets the secret value used to uniquely identify this request. Can be used to retrieve authentication information." + }, + "Code": { + "type": "string", + "description": "Gets the user facing code used so the user can quickly differentiate this request from others." + }, + "DeviceId": { + "type": "string", + "description": "Gets the requesting device id." + }, + "DeviceName": { + "type": "string", + "description": "Gets the requesting device name." + }, + "AppName": { + "type": "string", + "description": "Gets the requesting app name." + }, + "AppVersion": { + "type": "string", + "description": "Gets the requesting app version." + }, + "DateAdded": { + "type": "string", + "description": "Gets or sets the DateTime that this request was created.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Stores the state of an quick connect request." + }, + "RatingType": { + "enum": [ + "Score", + "Likes" + ], + "type": "string" + }, + "ReadyRequestDto": { + "type": "object", + "properties": { + "When": { + "type": "string", + "description": "Gets or sets when the request has been made by the client.", + "format": "date-time" + }, + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64" + }, + "IsPlaying": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the client playback is unpaused." + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item identifier of the playing item.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class ReadyRequest." + }, + "RecommendationDto": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "nullable": true + }, + "RecommendationType": { + "enum": [ + "SimilarToRecentlyPlayed", + "SimilarToLikedItem", + "HasDirectorFromRecentlyPlayed", + "HasActorFromRecentlyPlayed", + "HasLikedDirector", + "HasLikedActor" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RecommendationType" + } + ] + }, + "BaselineItemName": { + "type": "string", + "nullable": true + }, + "CategoryId": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + }, + "RecommendationType": { + "enum": [ + "SimilarToRecentlyPlayed", + "SimilarToLikedItem", + "HasDirectorFromRecentlyPlayed", + "HasActorFromRecentlyPlayed", + "HasLikedDirector", + "HasLikedActor" + ], + "type": "string" + }, + "RecordingStatus": { + "enum": [ + "New", + "InProgress", + "Completed", + "Cancelled", + "ConflictedOk", + "ConflictedNotOk", + "Error" + ], + "type": "string" + }, + "RefreshProgressMessage": { + "type": "object", + "properties": { + "Data": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "RefreshProgress", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Refresh progress message." + }, + "RemoteImageInfo": { + "type": "object", + "properties": { + "ProviderName": { + "type": "string", + "description": "Gets or sets the name of the provider.", + "nullable": true + }, + "Url": { + "type": "string", + "description": "Gets or sets the URL.", + "nullable": true + }, + "ThumbnailUrl": { + "type": "string", + "description": "Gets or sets a url used for previewing a smaller version.", + "nullable": true + }, + "Height": { + "type": "integer", + "description": "Gets or sets the height.", + "format": "int32", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the width.", + "format": "int32", + "nullable": true + }, + "CommunityRating": { + "type": "number", + "description": "Gets or sets the community rating.", + "format": "double", + "nullable": true + }, + "VoteCount": { + "type": "integer", + "description": "Gets or sets the vote count.", + "format": "int32", + "nullable": true + }, + "Language": { + "type": "string", + "description": "Gets or sets the language.", + "nullable": true + }, + "Type": { + "enum": [ + "Primary", + "Art", + "Backdrop", + "Banner", + "Logo", + "Thumb", + "Disc", + "Box", + "Screenshot", + "Menu", + "Chapter", + "BoxRear", + "Profile" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageType" + } + ], + "description": "Gets or sets the type." + }, + "RatingType": { + "enum": [ + "Score", + "Likes" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RatingType" + } + ], + "description": "Gets or sets the type of the rating." + } + }, + "additionalProperties": false, + "description": "Class RemoteImageInfo." + }, + "RemoteImageResult": { + "type": "object", + "properties": { + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteImageInfo" + }, + "description": "Gets or sets the images.", + "nullable": true + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total record count.", + "format": "int32" + }, + "Providers": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the providers.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class RemoteImageResult." + }, + "RemoteLyricInfoDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the id for the lyric." + }, + "ProviderName": { + "type": "string", + "description": "Gets the provider name." + }, + "Lyrics": { + "allOf": [ + { + "$ref": "#/components/schemas/LyricDto" + } + ], + "description": "Gets the lyrics." + } + }, + "additionalProperties": false, + "description": "The remote lyric info dto." + }, + "RemoteSearchResult": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "ProductionYear": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "IndexNumberEnd": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "ImageUrl": { + "type": "string", + "nullable": true + }, + "SearchProviderName": { + "type": "string", + "nullable": true + }, + "Overview": { + "type": "string", + "nullable": true + }, + "AlbumArtist": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoteSearchResult" + } + ], + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteSearchResult" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "RemoteSubtitleInfo": { + "type": "object", + "properties": { + "ThreeLetterISOLanguageName": { + "type": "string", + "nullable": true + }, + "Id": { + "type": "string", + "nullable": true + }, + "ProviderName": { + "type": "string", + "nullable": true + }, + "Name": { + "type": "string", + "nullable": true + }, + "Format": { + "type": "string", + "nullable": true + }, + "Author": { + "type": "string", + "nullable": true + }, + "Comment": { + "type": "string", + "nullable": true + }, + "DateCreated": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "CommunityRating": { + "type": "number", + "format": "float", + "nullable": true + }, + "FrameRate": { + "type": "number", + "format": "float", + "nullable": true + }, + "DownloadCount": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "IsHashMatch": { + "type": "boolean", + "nullable": true + }, + "AiTranslated": { + "type": "boolean", + "nullable": true + }, + "MachineTranslated": { + "type": "boolean", + "nullable": true + }, + "Forced": { + "type": "boolean", + "nullable": true + }, + "HearingImpaired": { + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": false + }, + "RemoveFromPlaylistRequestDto": { + "type": "object", + "properties": { + "PlaylistItemIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets the playlist identifiers of the items. Ignored when clearing the playlist." + }, + "ClearPlaylist": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the entire playlist should be cleared." + }, + "ClearPlayingItem": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the playing item should be removed as well. Used only when clearing the playlist." + } + }, + "additionalProperties": false, + "description": "Class RemoveFromPlaylistRequestDto." + }, + "RepeatMode": { + "enum": [ + "RepeatNone", + "RepeatAll", + "RepeatOne" + ], + "type": "string" + }, + "RepositoryInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Url": { + "type": "string", + "description": "Gets or sets the URL.", + "nullable": true + }, + "Enabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the repository is enabled." + } + }, + "additionalProperties": false, + "description": "Class RepositoryInfo." + }, + "RestartRequiredMessage": { + "type": "object", + "properties": { + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "RestartRequired", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Restart required." + }, + "ScheduledTaskEndedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskResult" + } + ], + "description": "Class TaskExecutionInfo.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ScheduledTaskEnded", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Scheduled task ended message." + }, + "ScheduledTasksInfoMessage": { + "type": "object", + "properties": { + "Data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskInfo" + }, + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ScheduledTasksInfo", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Scheduled tasks info message." + }, + "ScheduledTasksInfoStartMessage": { + "type": "object", + "properties": { + "Data": { + "type": "string", + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ScheduledTasksInfoStart", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Scheduled tasks info start message.\r\nData is the timing data encoded as \"$initialDelay,$interval\" in ms." + }, + "ScheduledTasksInfoStopMessage": { + "type": "object", + "properties": { + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ScheduledTasksInfoStop", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Scheduled tasks info stop message." + }, + "ScrollDirection": { + "enum": [ + "Horizontal", + "Vertical" + ], + "type": "string", + "description": "An enum representing the axis that should be scrolled." + }, + "SearchHint": { + "type": "object", + "properties": { + "ItemId": { + "type": "string", + "description": "Gets or sets the item id.", + "format": "uuid", + "deprecated": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the item id.", + "format": "uuid" + }, + "Name": { + "type": "string", + "description": "Gets or sets the name." + }, + "MatchedTerm": { + "type": "string", + "description": "Gets or sets the matched term.", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "description": "Gets or sets the index number.", + "format": "int32", + "nullable": true + }, + "ProductionYear": { + "type": "integer", + "description": "Gets or sets the production year.", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "description": "Gets or sets the parent index number.", + "format": "int32", + "nullable": true + }, + "PrimaryImageTag": { + "type": "string", + "description": "Gets or sets the image tag.", + "nullable": true + }, + "ThumbImageTag": { + "type": "string", + "description": "Gets or sets the thumb image tag.", + "nullable": true + }, + "ThumbImageItemId": { + "type": "string", + "description": "Gets or sets the thumb image item identifier.", + "nullable": true + }, + "BackdropImageTag": { + "type": "string", + "description": "Gets or sets the backdrop image tag.", + "nullable": true + }, + "BackdropImageItemId": { + "type": "string", + "description": "Gets or sets the backdrop image item identifier.", + "nullable": true + }, + "Type": { + "enum": [ + "AggregateFolder", + "Audio", + "AudioBook", + "BasePluginFolder", + "Book", + "BoxSet", + "Channel", + "ChannelFolderItem", + "CollectionFolder", + "Episode", + "Folder", + "Genre", + "ManualPlaylistsFolder", + "Movie", + "LiveTvChannel", + "LiveTvProgram", + "MusicAlbum", + "MusicArtist", + "MusicGenre", + "MusicVideo", + "Person", + "Photo", + "PhotoAlbum", + "Playlist", + "PlaylistsFolder", + "Program", + "Recording", + "Season", + "Series", + "Studio", + "Trailer", + "TvChannel", + "TvProgram", + "UserRootFolder", + "UserView", + "Video", + "Year" + ], + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemKind" + } + ], + "description": "Gets or sets the type." + }, + "IsFolder": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is folder.", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "description": "Gets or sets the run time ticks.", + "format": "int64", + "nullable": true + }, + "MediaType": { + "enum": [ + "Unknown", + "Video", + "Audio", + "Photo", + "Book" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaType" + } + ], + "description": "Gets or sets the type of the media.", + "default": "Unknown" + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date.", + "format": "date-time", + "nullable": true + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date.", + "format": "date-time", + "nullable": true + }, + "Series": { + "type": "string", + "description": "Gets or sets the series.", + "nullable": true + }, + "Status": { + "type": "string", + "description": "Gets or sets the status.", + "nullable": true + }, + "Album": { + "type": "string", + "description": "Gets or sets the album.", + "nullable": true + }, + "AlbumId": { + "type": "string", + "description": "Gets or sets the album id.", + "format": "uuid", + "nullable": true + }, + "AlbumArtist": { + "type": "string", + "description": "Gets or sets the album artist.", + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the artists." + }, + "SongCount": { + "type": "integer", + "description": "Gets or sets the song count.", + "format": "int32", + "nullable": true + }, + "EpisodeCount": { + "type": "integer", + "description": "Gets or sets the episode count.", + "format": "int32", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel identifier.", + "format": "uuid", + "nullable": true + }, + "ChannelName": { + "type": "string", + "description": "Gets or sets the name of the channel.", + "nullable": true + }, + "PrimaryImageAspectRatio": { + "type": "number", + "description": "Gets or sets the primary image aspect ratio.", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class SearchHintResult." + }, + "SearchHintResult": { + "type": "object", + "properties": { + "SearchHints": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SearchHint" + }, + "description": "Gets the search hints." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets the total record count.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class SearchHintResult." + }, + "SeekRequestDto": { + "type": "object", + "properties": { + "PositionTicks": { + "type": "integer", + "description": "Gets or sets the position ticks.", + "format": "int64" + } + }, + "additionalProperties": false, + "description": "Class SeekRequestDto." + }, + "SendCommand": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid" + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets the playlist identifier of the playing item.", + "format": "uuid" + }, + "When": { + "type": "string", + "description": "Gets or sets the UTC time when to execute the command.", + "format": "date-time" + }, + "PositionTicks": { + "type": "integer", + "description": "Gets the position ticks.", + "format": "int64", + "nullable": true + }, + "Command": { + "enum": [ + "Unpause", + "Pause", + "Stop", + "Seek" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SendCommandType" + } + ], + "description": "Gets the command." + }, + "EmittedAt": { + "type": "string", + "description": "Gets the UTC time when this command has been emitted.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class SendCommand." + }, + "SendCommandType": { + "enum": [ + "Unpause", + "Pause", + "Stop", + "Seek" + ], + "type": "string", + "description": "Enum SendCommandType." + }, + "SeriesInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "SeriesInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/SeriesInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "SeriesStatus": { + "enum": [ + "Continuing", + "Ended", + "Unreleased" + ], + "type": "string", + "description": "The status of a series." + }, + "SeriesTimerCancelledMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerEventInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SeriesTimerCancelled", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Series timer cancelled message." + }, + "SeriesTimerCreatedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerEventInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SeriesTimerCreated", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Series timer created message." + }, + "SeriesTimerInfoDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the Id of the recording.", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "ExternalId": { + "type": "string", + "description": "Gets or sets the external identifier.", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel id of the recording.", + "format": "uuid" + }, + "ExternalChannelId": { + "type": "string", + "description": "Gets or sets the external channel identifier.", + "nullable": true + }, + "ChannelName": { + "type": "string", + "description": "Gets or sets the channel name of the recording.", + "nullable": true + }, + "ChannelPrimaryImageTag": { + "type": "string", + "nullable": true + }, + "ProgramId": { + "type": "string", + "description": "Gets or sets the program identifier.", + "nullable": true + }, + "ExternalProgramId": { + "type": "string", + "description": "Gets or sets the external program identifier.", + "nullable": true + }, + "Name": { + "type": "string", + "description": "Gets or sets the name of the recording.", + "nullable": true + }, + "Overview": { + "type": "string", + "description": "Gets or sets the description of the recording.", + "nullable": true + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date of the recording, in UTC.", + "format": "date-time" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date of the recording, in UTC.", + "format": "date-time" + }, + "ServiceName": { + "type": "string", + "description": "Gets or sets the name of the service.", + "nullable": true + }, + "Priority": { + "type": "integer", + "description": "Gets or sets the priority.", + "format": "int32" + }, + "PrePaddingSeconds": { + "type": "integer", + "description": "Gets or sets the pre padding seconds.", + "format": "int32" + }, + "PostPaddingSeconds": { + "type": "integer", + "description": "Gets or sets the post padding seconds.", + "format": "int32" + }, + "IsPrePaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is pre padding required." + }, + "ParentBackdropItemId": { + "type": "string", + "description": "Gets or sets the Id of the Parent that has a backdrop if the item does not have one.", + "nullable": true + }, + "ParentBackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the parent backdrop image tags.", + "nullable": true + }, + "IsPostPaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is post padding required." + }, + "KeepUntil": { + "enum": [ + "UntilDeleted", + "UntilSpaceNeeded", + "UntilWatched", + "UntilDate" + ], + "allOf": [ + { + "$ref": "#/components/schemas/KeepUntil" + } + ] + }, + "RecordAnyTime": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [record any time]." + }, + "SkipEpisodesInLibrary": { + "type": "boolean" + }, + "RecordAnyChannel": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [record any channel]." + }, + "KeepUpTo": { + "type": "integer", + "format": "int32" + }, + "RecordNewOnly": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [record new only]." + }, + "Days": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DayOfWeek" + }, + "description": "Gets or sets the days.", + "nullable": true + }, + "DayPattern": { + "enum": [ + "Daily", + "Weekdays", + "Weekends" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DayPattern" + } + ], + "description": "Gets or sets the day pattern.", + "nullable": true + }, + "ImageTags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Gets or sets the image tags.", + "nullable": true + }, + "ParentThumbItemId": { + "type": "string", + "description": "Gets or sets the parent thumb item id.", + "nullable": true + }, + "ParentThumbImageTag": { + "type": "string", + "description": "Gets or sets the parent thumb image tag.", + "nullable": true + }, + "ParentPrimaryImageItemId": { + "type": "string", + "description": "Gets or sets the parent primary image item identifier.", + "format": "uuid", + "nullable": true + }, + "ParentPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the parent primary image tag.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class SeriesTimerInfoDto." + }, + "SeriesTimerInfoDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SeriesTimerInfoDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "ServerConfiguration": { + "type": "object", + "properties": { + "LogFileRetentionDays": { + "type": "integer", + "description": "Gets or sets the number of days we should retain log files.", + "format": "int32" + }, + "IsStartupWizardCompleted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is first run." + }, + "CachePath": { + "type": "string", + "description": "Gets or sets the cache path.", + "nullable": true + }, + "PreviousVersion": { + "type": "string", + "description": "Gets or sets the last known version that was ran using the configuration.", + "nullable": true + }, + "PreviousVersionStr": { + "type": "string", + "description": "Gets or sets the stringified PreviousVersion to be stored/loaded,\r\nbecause System.Version itself isn't xml-serializable.", + "nullable": true + }, + "EnableMetrics": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to enable prometheus metrics exporting." + }, + "EnableNormalizedItemByNameIds": { + "type": "boolean" + }, + "IsPortAuthorized": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is port authorized." + }, + "QuickConnectAvailable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether quick connect is available for use on this server." + }, + "EnableCaseSensitiveItemIds": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [enable case-sensitive item ids]." + }, + "DisableLiveTvChannelUserDataName": { + "type": "boolean" + }, + "MetadataPath": { + "type": "string", + "description": "Gets or sets the metadata path." + }, + "PreferredMetadataLanguage": { + "type": "string", + "description": "Gets or sets the preferred metadata language." + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code." + }, + "SortReplaceCharacters": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets characters to be replaced with a ' ' in strings to create a sort name." + }, + "SortRemoveCharacters": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets characters to be removed from strings to create a sort name." + }, + "SortRemoveWords": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets words to be removed from strings to create a sort name." + }, + "MinResumePct": { + "type": "integer", + "description": "Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated.", + "format": "int32" + }, + "MaxResumePct": { + "type": "integer", + "description": "Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.", + "format": "int32" + }, + "MinResumeDurationSeconds": { + "type": "integer", + "description": "Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates..", + "format": "int32" + }, + "MinAudiobookResume": { + "type": "integer", + "description": "Gets or sets the minimum minutes of a book that must be played in order for playstate to be updated.", + "format": "int32" + }, + "MaxAudiobookResume": { + "type": "integer", + "description": "Gets or sets the remaining minutes of a book that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.", + "format": "int32" + }, + "InactiveSessionThreshold": { + "type": "integer", + "description": "Gets or sets the threshold in minutes after a inactive session gets closed automatically.\r\nIf set to 0 the check for inactive sessions gets disabled.", + "format": "int32" + }, + "LibraryMonitorDelay": { + "type": "integer", + "description": "Gets or sets the delay in seconds that we will wait after a file system change to try and discover what has been added/removed\r\nSome delay is necessary with some items because their creation is not atomic. It involves the creation of several\r\ndifferent directories and files.", + "format": "int32" + }, + "LibraryUpdateDuration": { + "type": "integer", + "description": "Gets or sets the duration in seconds that we will wait after a library updated event before executing the library changed notification.", + "format": "int32" + }, + "CacheSize": { + "type": "integer", + "description": "Gets or sets the maximum amount of items to cache.", + "format": "int32" + }, + "ImageSavingConvention": { + "enum": [ + "Legacy", + "Compatible" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageSavingConvention" + } + ], + "description": "Gets or sets the image saving convention." + }, + "MetadataOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetadataOptions" + } + }, + "SkipDeserializationForBasicTypes": { + "type": "boolean" + }, + "ServerName": { + "type": "string" + }, + "UICulture": { + "type": "string" + }, + "SaveMetadataHidden": { + "type": "boolean" + }, + "ContentTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameValuePair" + } + }, + "RemoteClientBitrateLimit": { + "type": "integer", + "format": "int32" + }, + "EnableFolderView": { + "type": "boolean" + }, + "EnableGroupingMoviesIntoCollections": { + "type": "boolean" + }, + "EnableGroupingShowsIntoCollections": { + "type": "boolean" + }, + "DisplaySpecialsWithinSeasons": { + "type": "boolean" + }, + "CodecsUsed": { + "type": "array", + "items": { + "type": "string" + } + }, + "PluginRepositories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RepositoryInfo" + } + }, + "EnableExternalContentInSuggestions": { + "type": "boolean" + }, + "ImageExtractionTimeoutMs": { + "type": "integer", + "format": "int32" + }, + "PathSubstitutions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PathSubstitution" + } + }, + "EnableSlowResponseWarning": { + "type": "boolean", + "description": "Gets or sets a value indicating whether slow server responses should be logged as a warning." + }, + "SlowResponseThresholdMs": { + "type": "integer", + "description": "Gets or sets the threshold for the slow response time warning in ms.", + "format": "int64" + }, + "CorsHosts": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the cors hosts." + }, + "ActivityLogRetentionDays": { + "type": "integer", + "description": "Gets or sets the number of days we should retain activity logs.", + "format": "int32", + "nullable": true + }, + "LibraryScanFanoutConcurrency": { + "type": "integer", + "description": "Gets or sets the how the library scan fans out.", + "format": "int32" + }, + "LibraryMetadataRefreshConcurrency": { + "type": "integer", + "description": "Gets or sets the how many metadata refreshes can run concurrently.", + "format": "int32" + }, + "AllowClientLogUpload": { + "type": "boolean", + "description": "Gets or sets a value indicating whether clients should be allowed to upload logs." + }, + "DummyChapterDuration": { + "type": "integer", + "description": "Gets or sets the dummy chapter duration in seconds, use 0 (zero) or less to disable generation altogether.", + "format": "int32" + }, + "ChapterImageResolution": { + "enum": [ + "MatchSource", + "P144", + "P240", + "P360", + "P480", + "P720", + "P1080", + "P1440", + "P2160" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ImageResolution" + } + ], + "description": "Gets or sets the chapter image resolution." + }, + "ParallelImageEncodingLimit": { + "type": "integer", + "description": "Gets or sets the limit for parallel image encoding.", + "format": "int32" + }, + "CastReceiverApplications": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CastReceiverApplication" + }, + "description": "Gets or sets the list of cast receiver applications." + }, + "TrickplayOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/TrickplayOptions" + } + ], + "description": "Gets or sets the trickplay options." + }, + "EnableLegacyAuthorization": { + "type": "boolean", + "description": "Gets or sets a value indicating whether old authorization methods are allowed." + } + }, + "additionalProperties": false, + "description": "Represents the server configuration." + }, + "ServerDiscoveryInfo": { + "type": "object", + "properties": { + "Address": { + "type": "string", + "description": "Gets the address." + }, + "Id": { + "type": "string", + "description": "Gets the server identifier." + }, + "Name": { + "type": "string", + "description": "Gets the name." + }, + "EndpointAddress": { + "type": "string", + "description": "Gets the endpoint address.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The server discovery info model." + }, + "ServerRestartingMessage": { + "type": "object", + "properties": { + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ServerRestarting", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Server restarting down message." + }, + "ServerShuttingDownMessage": { + "type": "object", + "properties": { + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "ServerShuttingDown", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Server shutting down message." + }, + "SessionInfoDto": { + "type": "object", + "properties": { + "PlayState": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayerStateInfo" + } + ], + "description": "Gets or sets the play state.", + "nullable": true + }, + "AdditionalUsers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionUserInfo" + }, + "description": "Gets or sets the additional users.", + "nullable": true + }, + "Capabilities": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientCapabilitiesDto" + } + ], + "description": "Gets or sets the client capabilities.", + "nullable": true + }, + "RemoteEndPoint": { + "type": "string", + "description": "Gets or sets the remote end point.", + "nullable": true + }, + "PlayableMediaTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaType" + }, + "description": "Gets or sets the playable media types." + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid" + }, + "UserName": { + "type": "string", + "description": "Gets or sets the username.", + "nullable": true + }, + "Client": { + "type": "string", + "description": "Gets or sets the type of the client.", + "nullable": true + }, + "LastActivityDate": { + "type": "string", + "description": "Gets or sets the last activity date.", + "format": "date-time" + }, + "LastPlaybackCheckIn": { + "type": "string", + "description": "Gets or sets the last playback check in.", + "format": "date-time" + }, + "LastPausedDate": { + "type": "string", + "description": "Gets or sets the last paused date.", + "format": "date-time", + "nullable": true + }, + "DeviceName": { + "type": "string", + "description": "Gets or sets the name of the device.", + "nullable": true + }, + "DeviceType": { + "type": "string", + "description": "Gets or sets the type of the device.", + "nullable": true + }, + "NowPlayingItem": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the now playing item.", + "nullable": true + }, + "NowViewingItem": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the now viewing item.", + "nullable": true + }, + "DeviceId": { + "type": "string", + "description": "Gets or sets the device id.", + "nullable": true + }, + "ApplicationVersion": { + "type": "string", + "description": "Gets or sets the application version.", + "nullable": true + }, + "TranscodingInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/TranscodingInfo" + } + ], + "description": "Gets or sets the transcoding info.", + "nullable": true + }, + "IsActive": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this session is active." + }, + "SupportsMediaControl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the session supports media control." + }, + "SupportsRemoteControl": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the session supports remote control." + }, + "NowPlayingQueue": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueItem" + }, + "description": "Gets or sets the now playing queue.", + "nullable": true + }, + "NowPlayingQueueFullItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "description": "Gets or sets the now playing queue full items.", + "nullable": true + }, + "HasCustomDeviceName": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the session has a custom device name." + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist item id.", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server id.", + "nullable": true + }, + "UserPrimaryImageTag": { + "type": "string", + "description": "Gets or sets the user primary image tag.", + "nullable": true + }, + "SupportedCommands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneralCommandType" + }, + "description": "Gets or sets the supported commands." + } + }, + "additionalProperties": false, + "description": "Session info DTO." + }, + "SessionMessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "type": "string", + "description": "The different kinds of messages that are used in the WebSocket api." + }, + "SessionsMessage": { + "type": "object", + "properties": { + "Data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionInfoDto" + }, + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "Sessions", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Sessions message." + }, + "SessionsStartMessage": { + "type": "object", + "properties": { + "Data": { + "type": "string", + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SessionsStart", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Sessions start message.\r\nData is the timing data encoded as \"$initialDelay,$interval\" in ms." + }, + "SessionsStopMessage": { + "type": "object", + "properties": { + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SessionsStop", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Sessions stop message." + }, + "SessionUserInfo": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "description": "Gets or sets the user identifier.", + "format": "uuid" + }, + "UserName": { + "type": "string", + "description": "Gets or sets the name of the user.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class SessionUserInfo." + }, + "SetChannelMappingDto": { + "required": [ + "ProviderChannelId", + "ProviderId", + "TunerChannelId" + ], + "type": "object", + "properties": { + "ProviderId": { + "type": "string", + "description": "Gets or sets the provider id." + }, + "TunerChannelId": { + "type": "string", + "description": "Gets or sets the tuner channel id." + }, + "ProviderChannelId": { + "type": "string", + "description": "Gets or sets the provider channel id." + } + }, + "additionalProperties": false, + "description": "Set channel mapping dto." + }, + "SetPlaylistItemRequestDto": { + "type": "object", + "properties": { + "PlaylistItemId": { + "type": "string", + "description": "Gets or sets the playlist identifier of the playing item.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class SetPlaylistItemRequestDto." + }, + "SetRepeatModeRequestDto": { + "type": "object", + "properties": { + "Mode": { + "enum": [ + "RepeatOne", + "RepeatAll", + "RepeatNone" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupRepeatMode" + } + ], + "description": "Enum GroupRepeatMode." + } + }, + "additionalProperties": false, + "description": "Class SetRepeatModeRequestDto." + }, + "SetShuffleModeRequestDto": { + "type": "object", + "properties": { + "Mode": { + "enum": [ + "Sorted", + "Shuffle" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupShuffleMode" + } + ], + "description": "Enum GroupShuffleMode." + } + }, + "additionalProperties": false, + "description": "Class SetShuffleModeRequestDto." + }, + "SongInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + }, + "AlbumArtists": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "Album": { + "type": "string", + "nullable": true + }, + "Artists": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "SortOrder": { + "enum": [ + "Ascending", + "Descending" + ], + "type": "string", + "description": "An enum representing the sorting order." + }, + "SpecialViewOptionDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets view option name.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets view option id.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Special view option dto." + }, + "StartupConfigurationDto": { + "type": "object", + "properties": { + "ServerName": { + "type": "string", + "description": "Gets or sets the server name.", + "nullable": true + }, + "UICulture": { + "type": "string", + "description": "Gets or sets UI language culture.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "PreferredMetadataLanguage": { + "type": "string", + "description": "Gets or sets the preferred language for the metadata.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The startup configuration DTO." + }, + "StartupRemoteAccessDto": { + "required": [ + "EnableAutomaticPortMapping", + "EnableRemoteAccess" + ], + "type": "object", + "properties": { + "EnableRemoteAccess": { + "type": "boolean", + "description": "Gets or sets a value indicating whether enable remote access." + }, + "EnableAutomaticPortMapping": { + "type": "boolean", + "description": "Gets or sets a value indicating whether enable automatic port mapping.", + "deprecated": true + } + }, + "additionalProperties": false, + "description": "Startup remote access dto." + }, + "StartupUserDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the username.", + "nullable": true + }, + "Password": { + "type": "string", + "description": "Gets or sets the user's password.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "The startup user DTO." + }, + "SubtitleDeliveryMethod": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "type": "string", + "description": "Delivery method to use during playback of a specific subtitle format." + }, + "SubtitleOptions": { + "type": "object", + "properties": { + "SkipIfEmbeddedSubtitlesPresent": { + "type": "boolean" + }, + "SkipIfAudioTrackMatches": { + "type": "boolean" + }, + "DownloadLanguages": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "DownloadMovieSubtitles": { + "type": "boolean" + }, + "DownloadEpisodeSubtitles": { + "type": "boolean" + }, + "OpenSubtitlesUsername": { + "type": "string", + "nullable": true + }, + "OpenSubtitlesPasswordHash": { + "type": "string", + "nullable": true + }, + "IsOpenSubtitleVipAccount": { + "type": "boolean" + }, + "RequirePerfectMatch": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "SubtitlePlaybackMode": { + "enum": [ + "Default", + "Always", + "OnlyForced", + "None", + "Smart" + ], + "type": "string", + "description": "An enum representing a subtitle playback mode." + }, + "SubtitleProfile": { + "type": "object", + "properties": { + "Format": { + "type": "string", + "description": "Gets or sets the format.", + "nullable": true + }, + "Method": { + "enum": [ + "Encode", + "Embed", + "External", + "Hls", + "Drop" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitleDeliveryMethod" + } + ], + "description": "Gets or sets the delivery method." + }, + "DidlMode": { + "type": "string", + "description": "Gets or sets the DIDL mode.", + "nullable": true + }, + "Language": { + "type": "string", + "description": "Gets or sets the language.", + "nullable": true + }, + "Container": { + "type": "string", + "description": "Gets or sets the container.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "A class for subtitle profile information." + }, + "SyncPlayCommandMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/SendCommand" + } + ], + "description": "Class SendCommand.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SyncPlayCommand", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Sync play command." + }, + "SyncPlayGroupDoesNotExistUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "type": "string", + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "GroupDoesNotExist", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayGroupJoinedUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/GroupInfoDto" + } + ], + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "GroupJoined", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayGroupLeftUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "type": "string", + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "GroupLeft", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayGroupUpdateMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdate" + } + ], + "description": "Group update data" + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "SyncPlayGroupUpdate", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Untyped sync play command." + }, + "SyncPlayLibraryAccessDeniedUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "type": "string", + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "LibraryAccessDenied", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayNotInGroupUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "type": "string", + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "NotInGroup", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayPlayQueueUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/PlayQueueUpdate" + } + ], + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "PlayQueue", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayQueueItem": { + "type": "object", + "properties": { + "ItemId": { + "type": "string", + "description": "Gets the item identifier.", + "format": "uuid" + }, + "PlaylistItemId": { + "type": "string", + "description": "Gets the playlist identifier of the item.", + "format": "uuid", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Class QueueItem." + }, + "SyncPlayStateUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/GroupStateUpdate" + } + ], + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "StateUpdate", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayUserAccessType": { + "enum": [ + "CreateAndJoinGroups", + "JoinGroups", + "None" + ], + "type": "string", + "description": "Enum SyncPlayUserAccessType." + }, + "SyncPlayUserJoinedUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "type": "string", + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "UserJoined", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SyncPlayUserLeftUpdate": { + "type": "object", + "properties": { + "GroupId": { + "type": "string", + "description": "Gets the group identifier.", + "format": "uuid", + "readOnly": true + }, + "Data": { + "type": "string", + "description": "Gets the update data.", + "readOnly": true + }, + "Type": { + "enum": [ + "UserJoined", + "UserLeft", + "GroupJoined", + "GroupLeft", + "StateUpdate", + "PlayQueue", + "NotInGroup", + "GroupDoesNotExist", + "LibraryAccessDenied" + ], + "allOf": [ + { + "$ref": "#/components/schemas/GroupUpdateType" + } + ], + "description": "Enum GroupUpdateType.", + "default": "UserLeft", + "readOnly": true + } + }, + "additionalProperties": false + }, + "SystemInfo": { + "type": "object", + "properties": { + "LocalAddress": { + "type": "string", + "description": "Gets or sets the local address.", + "nullable": true + }, + "ServerName": { + "type": "string", + "description": "Gets or sets the name of the server.", + "nullable": true + }, + "Version": { + "type": "string", + "description": "Gets or sets the server version.", + "nullable": true + }, + "ProductName": { + "type": "string", + "description": "Gets or sets the product name. This is the AssemblyProduct name.", + "nullable": true + }, + "OperatingSystem": { + "type": "string", + "description": "Gets or sets the operating system.", + "nullable": true, + "deprecated": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "StartupWizardCompleted": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the startup wizard is completed.", + "nullable": true + }, + "OperatingSystemDisplayName": { + "type": "string", + "description": "Gets or sets the display name of the operating system.", + "nullable": true, + "deprecated": true + }, + "PackageName": { + "type": "string", + "description": "Gets or sets the package name.", + "nullable": true + }, + "HasPendingRestart": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has pending restart." + }, + "IsShuttingDown": { + "type": "boolean" + }, + "SupportsLibraryMonitor": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [supports library monitor]." + }, + "WebSocketPortNumber": { + "type": "integer", + "description": "Gets or sets the web socket port number.", + "format": "int32" + }, + "CompletedInstallations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InstallationInfo" + }, + "description": "Gets or sets the completed installations.", + "nullable": true + }, + "CanSelfRestart": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can self restart.", + "default": true, + "deprecated": true + }, + "CanLaunchWebBrowser": { + "type": "boolean", + "default": false, + "deprecated": true + }, + "ProgramDataPath": { + "type": "string", + "description": "Gets or sets the program data path.", + "nullable": true, + "deprecated": true + }, + "WebPath": { + "type": "string", + "description": "Gets or sets the web UI resources path.", + "nullable": true, + "deprecated": true + }, + "ItemsByNamePath": { + "type": "string", + "description": "Gets or sets the items by name path.", + "nullable": true, + "deprecated": true + }, + "CachePath": { + "type": "string", + "description": "Gets or sets the cache path.", + "nullable": true, + "deprecated": true + }, + "LogPath": { + "type": "string", + "description": "Gets or sets the log path.", + "nullable": true, + "deprecated": true + }, + "InternalMetadataPath": { + "type": "string", + "description": "Gets or sets the internal metadata path.", + "nullable": true, + "deprecated": true + }, + "TranscodingTempPath": { + "type": "string", + "description": "Gets or sets the transcode path.", + "nullable": true, + "deprecated": true + }, + "CastReceiverApplications": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CastReceiverApplication" + }, + "description": "Gets or sets the list of cast receiver applications.", + "nullable": true + }, + "HasUpdateAvailable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has update available.", + "default": false, + "deprecated": true + }, + "EncoderLocation": { + "type": "string", + "default": "System", + "nullable": true, + "deprecated": true + }, + "SystemArchitecture": { + "type": "string", + "default": "X64", + "nullable": true, + "deprecated": true + } + }, + "additionalProperties": false, + "description": "Class SystemInfo." + }, + "SystemStorageDto": { + "type": "object", + "properties": { + "ProgramDataFolder": { + "allOf": [ + { + "$ref": "#/components/schemas/FolderStorageDto" + } + ], + "description": "Gets or sets the Storage information of the program data folder." + }, + "WebFolder": { + "allOf": [ + { + "$ref": "#/components/schemas/FolderStorageDto" + } + ], + "description": "Gets or sets the Storage information of the web UI resources folder." + }, + "ImageCacheFolder": { + "allOf": [ + { + "$ref": "#/components/schemas/FolderStorageDto" + } + ], + "description": "Gets or sets the Storage information of the folder where images are cached." + }, + "CacheFolder": { + "allOf": [ + { + "$ref": "#/components/schemas/FolderStorageDto" + } + ], + "description": "Gets or sets the Storage information of the cache folder." + }, + "LogFolder": { + "allOf": [ + { + "$ref": "#/components/schemas/FolderStorageDto" + } + ], + "description": "Gets or sets the Storage information of the folder where logfiles are saved to." + }, + "InternalMetadataFolder": { + "allOf": [ + { + "$ref": "#/components/schemas/FolderStorageDto" + } + ], + "description": "Gets or sets the Storage information of the folder where metadata is stored." + }, + "TranscodingTempFolder": { + "allOf": [ + { + "$ref": "#/components/schemas/FolderStorageDto" + } + ], + "description": "Gets or sets the Storage information of the transcoding cache." + }, + "Libraries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryStorageDto" + }, + "description": "Gets or sets the storage informations of all libraries." + } + }, + "additionalProperties": false, + "description": "Contains informations about the systems storage." + }, + "TaskCompletionStatus": { + "enum": [ + "Completed", + "Failed", + "Cancelled", + "Aborted" + ], + "type": "string", + "description": "Enum TaskCompletionStatus." + }, + "TaskInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "State": { + "enum": [ + "Idle", + "Cancelling", + "Running" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TaskState" + } + ], + "description": "Gets or sets the state of the task." + }, + "CurrentProgressPercentage": { + "type": "number", + "description": "Gets or sets the progress.", + "format": "double", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "LastExecutionResult": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskResult" + } + ], + "description": "Gets or sets the last execution result.", + "nullable": true + }, + "Triggers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TaskTriggerInfo" + }, + "description": "Gets or sets the triggers.", + "nullable": true + }, + "Description": { + "type": "string", + "description": "Gets or sets the description.", + "nullable": true + }, + "Category": { + "type": "string", + "description": "Gets or sets the category.", + "nullable": true + }, + "IsHidden": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is hidden." + }, + "Key": { + "type": "string", + "description": "Gets or sets the key.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class TaskInfo." + }, + "TaskResult": { + "type": "object", + "properties": { + "StartTimeUtc": { + "type": "string", + "description": "Gets or sets the start time UTC.", + "format": "date-time" + }, + "EndTimeUtc": { + "type": "string", + "description": "Gets or sets the end time UTC.", + "format": "date-time" + }, + "Status": { + "enum": [ + "Completed", + "Failed", + "Cancelled", + "Aborted" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TaskCompletionStatus" + } + ], + "description": "Gets or sets the status." + }, + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Key": { + "type": "string", + "description": "Gets or sets the key.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "nullable": true + }, + "ErrorMessage": { + "type": "string", + "description": "Gets or sets the error message.", + "nullable": true + }, + "LongErrorMessage": { + "type": "string", + "description": "Gets or sets the long error message.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class TaskExecutionInfo." + }, + "TaskState": { + "enum": [ + "Idle", + "Cancelling", + "Running" + ], + "type": "string", + "description": "Enum TaskState." + }, + "TaskTriggerInfo": { + "type": "object", + "properties": { + "Type": { + "enum": [ + "DailyTrigger", + "WeeklyTrigger", + "IntervalTrigger", + "StartupTrigger" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TaskTriggerInfoType" + } + ], + "description": "Gets or sets the type." + }, + "TimeOfDayTicks": { + "type": "integer", + "description": "Gets or sets the time of day.", + "format": "int64", + "nullable": true + }, + "IntervalTicks": { + "type": "integer", + "description": "Gets or sets the interval.", + "format": "int64", + "nullable": true + }, + "DayOfWeek": { + "enum": [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DayOfWeek" + } + ], + "description": "Gets or sets the day of week.", + "nullable": true + }, + "MaxRuntimeTicks": { + "type": "integer", + "description": "Gets or sets the maximum runtime ticks.", + "format": "int64", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class TaskTriggerInfo." + }, + "TaskTriggerInfoType": { + "enum": [ + "DailyTrigger", + "WeeklyTrigger", + "IntervalTrigger", + "StartupTrigger" + ], + "type": "string", + "description": "Enum TaskTriggerInfoType." + }, + "ThemeMediaResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BaseItemDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + }, + "OwnerId": { + "type": "string", + "description": "Gets or sets the owner id.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class ThemeMediaResult." + }, + "TimerCancelledMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerEventInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "TimerCancelled", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Timer cancelled message." + }, + "TimerCreatedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/TimerEventInfo" + } + ], + "description": "Gets or sets the data.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "TimerCreated", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "Timer created message." + }, + "TimerEventInfo": { + "type": "object", + "properties": { + "Id": { + "type": "string" + }, + "ProgramId": { + "type": "string", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "TimerInfoDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the Id of the recording.", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "ExternalId": { + "type": "string", + "description": "Gets or sets the external identifier.", + "nullable": true + }, + "ChannelId": { + "type": "string", + "description": "Gets or sets the channel id of the recording.", + "format": "uuid" + }, + "ExternalChannelId": { + "type": "string", + "description": "Gets or sets the external channel identifier.", + "nullable": true + }, + "ChannelName": { + "type": "string", + "description": "Gets or sets the channel name of the recording.", + "nullable": true + }, + "ChannelPrimaryImageTag": { + "type": "string", + "nullable": true + }, + "ProgramId": { + "type": "string", + "description": "Gets or sets the program identifier.", + "nullable": true + }, + "ExternalProgramId": { + "type": "string", + "description": "Gets or sets the external program identifier.", + "nullable": true + }, + "Name": { + "type": "string", + "description": "Gets or sets the name of the recording.", + "nullable": true + }, + "Overview": { + "type": "string", + "description": "Gets or sets the description of the recording.", + "nullable": true + }, + "StartDate": { + "type": "string", + "description": "Gets or sets the start date of the recording, in UTC.", + "format": "date-time" + }, + "EndDate": { + "type": "string", + "description": "Gets or sets the end date of the recording, in UTC.", + "format": "date-time" + }, + "ServiceName": { + "type": "string", + "description": "Gets or sets the name of the service.", + "nullable": true + }, + "Priority": { + "type": "integer", + "description": "Gets or sets the priority.", + "format": "int32" + }, + "PrePaddingSeconds": { + "type": "integer", + "description": "Gets or sets the pre padding seconds.", + "format": "int32" + }, + "PostPaddingSeconds": { + "type": "integer", + "description": "Gets or sets the post padding seconds.", + "format": "int32" + }, + "IsPrePaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is pre padding required." + }, + "ParentBackdropItemId": { + "type": "string", + "description": "Gets or sets the Id of the Parent that has a backdrop if the item does not have one.", + "nullable": true + }, + "ParentBackdropImageTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the parent backdrop image tags.", + "nullable": true + }, + "IsPostPaddingRequired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is post padding required." + }, + "KeepUntil": { + "enum": [ + "UntilDeleted", + "UntilSpaceNeeded", + "UntilWatched", + "UntilDate" + ], + "allOf": [ + { + "$ref": "#/components/schemas/KeepUntil" + } + ] + }, + "Status": { + "enum": [ + "New", + "InProgress", + "Completed", + "Cancelled", + "ConflictedOk", + "ConflictedNotOk", + "Error" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RecordingStatus" + } + ], + "description": "Gets or sets the status." + }, + "SeriesTimerId": { + "type": "string", + "description": "Gets or sets the series timer identifier.", + "nullable": true + }, + "ExternalSeriesTimerId": { + "type": "string", + "description": "Gets or sets the external series timer identifier.", + "nullable": true + }, + "RunTimeTicks": { + "type": "integer", + "description": "Gets or sets the run time ticks.", + "format": "int64", + "nullable": true + }, + "ProgramInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseItemDto" + } + ], + "description": "Gets or sets the program information.", + "nullable": true + } + }, + "additionalProperties": false + }, + "TimerInfoDtoQueryResult": { + "type": "object", + "properties": { + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TimerInfoDto" + }, + "description": "Gets or sets the items." + }, + "TotalRecordCount": { + "type": "integer", + "description": "Gets or sets the total number of records available.", + "format": "int32" + }, + "StartIndex": { + "type": "integer", + "description": "Gets or sets the index of the first record in Items.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Query result container." + }, + "TonemappingAlgorithm": { + "enum": [ + "none", + "clip", + "linear", + "gamma", + "reinhard", + "hable", + "mobius", + "bt2390" + ], + "type": "string", + "description": "Enum containing tonemapping algorithms." + }, + "TonemappingMode": { + "enum": [ + "auto", + "max", + "rgb", + "lum", + "itp" + ], + "type": "string", + "description": "Enum containing tonemapping modes." + }, + "TonemappingRange": { + "enum": [ + "auto", + "tv", + "pc" + ], + "type": "string", + "description": "Enum containing tonemapping ranges." + }, + "TrailerInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "OriginalTitle": { + "type": "string", + "description": "Gets or sets the original title.", + "nullable": true + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "MetadataLanguage": { + "type": "string", + "description": "Gets or sets the metadata language.", + "nullable": true + }, + "MetadataCountryCode": { + "type": "string", + "description": "Gets or sets the metadata country code.", + "nullable": true + }, + "ProviderIds": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "description": "Gets or sets the provider ids.", + "nullable": true + }, + "Year": { + "type": "integer", + "description": "Gets or sets the year.", + "format": "int32", + "nullable": true + }, + "IndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "ParentIndexNumber": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "PremiereDate": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "IsAutomated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "TrailerInfoRemoteSearchQuery": { + "type": "object", + "properties": { + "SearchInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/TrailerInfo" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "format": "uuid" + }, + "SearchProviderName": { + "type": "string", + "description": "Gets or sets the provider name to search within if set.", + "nullable": true + }, + "IncludeDisabledProviders": { + "type": "boolean", + "description": "Gets or sets a value indicating whether disabled providers should be included." + } + }, + "additionalProperties": false + }, + "TranscodeReason": { + "enum": [ + "ContainerNotSupported", + "VideoCodecNotSupported", + "AudioCodecNotSupported", + "SubtitleCodecNotSupported", + "AudioIsExternal", + "SecondaryAudioNotSupported", + "VideoProfileNotSupported", + "VideoLevelNotSupported", + "VideoResolutionNotSupported", + "VideoBitDepthNotSupported", + "VideoFramerateNotSupported", + "RefFramesNotSupported", + "AnamorphicVideoNotSupported", + "InterlacedVideoNotSupported", + "AudioChannelsNotSupported", + "AudioProfileNotSupported", + "AudioSampleRateNotSupported", + "AudioBitDepthNotSupported", + "ContainerBitrateExceedsLimit", + "VideoBitrateNotSupported", + "AudioBitrateNotSupported", + "UnknownVideoStreamInfo", + "UnknownAudioStreamInfo", + "DirectPlayError", + "VideoRangeTypeNotSupported", + "VideoCodecTagNotSupported", + "StreamCountExceedsLimit" + ], + "type": "string" + }, + "TranscodeSeekInfo": { + "enum": [ + "Auto", + "Bytes" + ], + "type": "string" + }, + "TranscodingInfo": { + "type": "object", + "properties": { + "AudioCodec": { + "type": "string", + "description": "Gets or sets the thread count used for encoding.", + "nullable": true + }, + "VideoCodec": { + "type": "string", + "description": "Gets or sets the thread count used for encoding.", + "nullable": true + }, + "Container": { + "type": "string", + "description": "Gets or sets the thread count used for encoding.", + "nullable": true + }, + "IsVideoDirect": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the video is passed through." + }, + "IsAudioDirect": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the audio is passed through." + }, + "Bitrate": { + "type": "integer", + "description": "Gets or sets the bitrate.", + "format": "int32", + "nullable": true + }, + "Framerate": { + "type": "number", + "description": "Gets or sets the framerate.", + "format": "float", + "nullable": true + }, + "CompletionPercentage": { + "type": "number", + "description": "Gets or sets the completion percentage.", + "format": "double", + "nullable": true + }, + "Width": { + "type": "integer", + "description": "Gets or sets the video width.", + "format": "int32", + "nullable": true + }, + "Height": { + "type": "integer", + "description": "Gets or sets the video height.", + "format": "int32", + "nullable": true + }, + "AudioChannels": { + "type": "integer", + "description": "Gets or sets the audio channels.", + "format": "int32", + "nullable": true + }, + "HardwareAccelerationType": { + "enum": [ + "none", + "amf", + "qsv", + "nvenc", + "v4l2m2m", + "vaapi", + "videotoolbox", + "rkmpp" + ], + "allOf": [ + { + "$ref": "#/components/schemas/HardwareAccelerationType" + } + ], + "description": "Gets or sets the hardware acceleration type.", + "nullable": true + }, + "TranscodeReasons": { + "enum": [ + "ContainerNotSupported", + "VideoCodecNotSupported", + "AudioCodecNotSupported", + "SubtitleCodecNotSupported", + "AudioIsExternal", + "SecondaryAudioNotSupported", + "VideoProfileNotSupported", + "VideoLevelNotSupported", + "VideoResolutionNotSupported", + "VideoBitDepthNotSupported", + "VideoFramerateNotSupported", + "RefFramesNotSupported", + "AnamorphicVideoNotSupported", + "InterlacedVideoNotSupported", + "AudioChannelsNotSupported", + "AudioProfileNotSupported", + "AudioSampleRateNotSupported", + "AudioBitDepthNotSupported", + "ContainerBitrateExceedsLimit", + "VideoBitrateNotSupported", + "AudioBitrateNotSupported", + "UnknownVideoStreamInfo", + "UnknownAudioStreamInfo", + "DirectPlayError", + "VideoRangeTypeNotSupported", + "VideoCodecTagNotSupported", + "StreamCountExceedsLimit" + ], + "type": "array", + "items": { + "$ref": "#/components/schemas/TranscodeReason" + }, + "description": "Gets or sets the transcode reasons." + } + }, + "additionalProperties": false, + "description": "Class holding information on a running transcode." + }, + "TranscodingProfile": { + "type": "object", + "properties": { + "Container": { + "type": "string", + "description": "Gets or sets the container." + }, + "Type": { + "enum": [ + "Audio", + "Video", + "Photo", + "Subtitle", + "Lyric" + ], + "allOf": [ + { + "$ref": "#/components/schemas/DlnaProfileType" + } + ], + "description": "Gets or sets the DLNA profile type." + }, + "VideoCodec": { + "type": "string", + "description": "Gets or sets the video codec." + }, + "AudioCodec": { + "type": "string", + "description": "Gets or sets the audio codec." + }, + "Protocol": { + "enum": [ + "http", + "hls" + ], + "allOf": [ + { + "$ref": "#/components/schemas/MediaStreamProtocol" + } + ], + "description": "Gets or sets the protocol." + }, + "EstimateContentLength": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the content length should be estimated.", + "default": false + }, + "EnableMpegtsM2TsMode": { + "type": "boolean", + "description": "Gets or sets a value indicating whether M2TS mode is enabled.", + "default": false + }, + "TranscodeSeekInfo": { + "enum": [ + "Auto", + "Bytes" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TranscodeSeekInfo" + } + ], + "description": "Gets or sets the transcoding seek info mode.", + "default": "Auto" + }, + "CopyTimestamps": { + "type": "boolean", + "description": "Gets or sets a value indicating whether timestamps should be copied.", + "default": false + }, + "Context": { + "enum": [ + "Streaming", + "Static" + ], + "allOf": [ + { + "$ref": "#/components/schemas/EncodingContext" + } + ], + "description": "Gets or sets the encoding context.", + "default": "Streaming" + }, + "EnableSubtitlesInManifest": { + "type": "boolean", + "description": "Gets or sets a value indicating whether subtitles are allowed in the manifest.", + "default": false + }, + "MaxAudioChannels": { + "type": "string", + "description": "Gets or sets the maximum audio channels.", + "nullable": true + }, + "MinSegments": { + "type": "integer", + "description": "Gets or sets the minimum amount of segments.", + "format": "int32", + "default": 0 + }, + "SegmentLength": { + "type": "integer", + "description": "Gets or sets the segment length.", + "format": "int32", + "default": 0 + }, + "BreakOnNonKeyFrames": { + "type": "boolean", + "description": "Gets or sets a value indicating whether breaking the video stream on non-keyframes is supported.", + "default": false + }, + "Conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfileCondition" + }, + "description": "Gets or sets the profile conditions." + }, + "EnableAudioVbrEncoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether variable bitrate encoding is supported.", + "default": true + } + }, + "additionalProperties": false, + "description": "A class for transcoding profile information.\r\nNote for client developers: Conditions defined in MediaBrowser.Model.Dlna.CodecProfile has higher priority and can override values defined here." + }, + "TransportStreamTimestamp": { + "enum": [ + "None", + "Zero", + "Valid" + ], + "type": "string" + }, + "TrickplayInfoDto": { + "type": "object", + "properties": { + "Width": { + "type": "integer", + "description": "Gets the width of an individual thumbnail.", + "format": "int32" + }, + "Height": { + "type": "integer", + "description": "Gets the height of an individual thumbnail.", + "format": "int32" + }, + "TileWidth": { + "type": "integer", + "description": "Gets the amount of thumbnails per row.", + "format": "int32" + }, + "TileHeight": { + "type": "integer", + "description": "Gets the amount of thumbnails per column.", + "format": "int32" + }, + "ThumbnailCount": { + "type": "integer", + "description": "Gets the total amount of non-black thumbnails.", + "format": "int32" + }, + "Interval": { + "type": "integer", + "description": "Gets the interval in milliseconds between each trickplay thumbnail.", + "format": "int32" + }, + "Bandwidth": { + "type": "integer", + "description": "Gets the peak bandwidth usage in bits per second.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "The trickplay api model." + }, + "TrickplayOptions": { + "type": "object", + "properties": { + "EnableHwAcceleration": { + "type": "boolean", + "description": "Gets or sets a value indicating whether or not to use HW acceleration." + }, + "EnableHwEncoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether or not to use HW accelerated MJPEG encoding." + }, + "EnableKeyFrameOnlyExtraction": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to only extract key frames.\r\nSignificantly faster, but is not compatible with all decoders and/or video files." + }, + "ScanBehavior": { + "enum": [ + "Blocking", + "NonBlocking" + ], + "allOf": [ + { + "$ref": "#/components/schemas/TrickplayScanBehavior" + } + ], + "description": "Gets or sets the behavior used by trickplay provider on library scan/update." + }, + "ProcessPriority": { + "enum": [ + "Normal", + "Idle", + "High", + "RealTime", + "BelowNormal", + "AboveNormal" + ], + "allOf": [ + { + "$ref": "#/components/schemas/ProcessPriorityClass" + } + ], + "description": "Gets or sets the process priority for the ffmpeg process." + }, + "Interval": { + "type": "integer", + "description": "Gets or sets the interval, in ms, between each new trickplay image.", + "format": "int32" + }, + "WidthResolutions": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "Gets or sets the target width resolutions, in px, to generates preview images for." + }, + "TileWidth": { + "type": "integer", + "description": "Gets or sets number of tile images to allow in X dimension.", + "format": "int32" + }, + "TileHeight": { + "type": "integer", + "description": "Gets or sets number of tile images to allow in Y dimension.", + "format": "int32" + }, + "Qscale": { + "type": "integer", + "description": "Gets or sets the ffmpeg output quality level.", + "format": "int32" + }, + "JpegQuality": { + "type": "integer", + "description": "Gets or sets the jpeg quality to use for image tiles.", + "format": "int32" + }, + "ProcessThreads": { + "type": "integer", + "description": "Gets or sets the number of threads to be used by ffmpeg.", + "format": "int32" + } + }, + "additionalProperties": false, + "description": "Class TrickplayOptions." + }, + "TrickplayScanBehavior": { + "enum": [ + "Blocking", + "NonBlocking" + ], + "type": "string", + "description": "Enum TrickplayScanBehavior." + }, + "TunerChannelMapping": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "ProviderChannelName": { + "type": "string", + "nullable": true + }, + "ProviderChannelId": { + "type": "string", + "nullable": true + }, + "Id": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "TunerHostInfo": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "nullable": true + }, + "Url": { + "type": "string", + "nullable": true + }, + "Type": { + "type": "string", + "nullable": true + }, + "DeviceId": { + "type": "string", + "nullable": true + }, + "FriendlyName": { + "type": "string", + "nullable": true + }, + "ImportFavoritesOnly": { + "type": "boolean" + }, + "AllowHWTranscoding": { + "type": "boolean" + }, + "AllowFmp4TranscodingContainer": { + "type": "boolean" + }, + "AllowStreamSharing": { + "type": "boolean" + }, + "FallbackMaxStreamingBitrate": { + "type": "integer", + "format": "int32" + }, + "EnableStreamLooping": { + "type": "boolean" + }, + "Source": { + "type": "string", + "nullable": true + }, + "TunerCount": { + "type": "integer", + "format": "int32" + }, + "UserAgent": { + "type": "string", + "nullable": true + }, + "IgnoreDts": { + "type": "boolean" + }, + "ReadAtNativeFramerate": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "TypeOptions": { + "type": "object", + "properties": { + "Type": { + "type": "string", + "nullable": true + }, + "MetadataFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "MetadataFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageFetchers": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageFetcherOrder": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "ImageOptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImageOption" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "UnratedItem": { + "enum": [ + "Movie", + "Trailer", + "Series", + "Music", + "Book", + "LiveTvChannel", + "LiveTvProgram", + "ChannelContent", + "Other" + ], + "type": "string", + "description": "An enum representing an unrated item." + }, + "UpdateLibraryOptionsDto": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets the library item id.", + "format": "uuid" + }, + "LibraryOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryOptions" + } + ], + "description": "Gets or sets library options.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Update library options dto." + }, + "UpdateMediaPathRequestDto": { + "required": [ + "Name", + "PathInfo" + ], + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the library name." + }, + "PathInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/MediaPathInfo" + } + ], + "description": "Gets or sets library folder path information." + } + }, + "additionalProperties": false, + "description": "Update library options dto." + }, + "UpdatePlaylistDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name of the new playlist.", + "nullable": true + }, + "Ids": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Gets or sets item ids of the playlist.", + "nullable": true + }, + "Users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlaylistUserPermissions" + }, + "description": "Gets or sets the playlist users.", + "nullable": true + }, + "IsPublic": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the playlist is public.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Update existing playlist dto. Fields set to `null` will not be updated and keep their current values." + }, + "UpdatePlaylistUserDto": { + "type": "object", + "properties": { + "CanEdit": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the user can edit the playlist.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Update existing playlist user dto. Fields set to `null` will not be updated and keep their current values." + }, + "UpdateUserItemDataDto": { + "type": "object", + "properties": { + "Rating": { + "type": "number", + "description": "Gets or sets the rating.", + "format": "double", + "nullable": true + }, + "PlayedPercentage": { + "type": "number", + "description": "Gets or sets the played percentage.", + "format": "double", + "nullable": true + }, + "UnplayedItemCount": { + "type": "integer", + "description": "Gets or sets the unplayed item count.", + "format": "int32", + "nullable": true + }, + "PlaybackPositionTicks": { + "type": "integer", + "description": "Gets or sets the playback position ticks.", + "format": "int64", + "nullable": true + }, + "PlayCount": { + "type": "integer", + "description": "Gets or sets the play count.", + "format": "int32", + "nullable": true + }, + "IsFavorite": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is favorite.", + "nullable": true + }, + "Likes": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UpdateUserItemDataDto is likes.", + "nullable": true + }, + "LastPlayedDate": { + "type": "string", + "description": "Gets or sets the last played date.", + "format": "date-time", + "nullable": true + }, + "Played": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played.", + "nullable": true + }, + "Key": { + "type": "string", + "description": "Gets or sets the key.", + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "This is used by the api to get information about a item user data." + }, + "UpdateUserPassword": { + "type": "object", + "properties": { + "CurrentPassword": { + "type": "string", + "description": "Gets or sets the current sha1-hashed password.", + "nullable": true + }, + "CurrentPw": { + "type": "string", + "description": "Gets or sets the current plain text password.", + "nullable": true + }, + "NewPw": { + "type": "string", + "description": "Gets or sets the new plain text password.", + "nullable": true + }, + "ResetPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to reset the password." + } + }, + "additionalProperties": false, + "description": "The update user password request body." + }, + "UploadSubtitleDto": { + "required": [ + "Data", + "Format", + "IsForced", + "IsHearingImpaired", + "Language" + ], + "type": "object", + "properties": { + "Language": { + "type": "string", + "description": "Gets or sets the subtitle language." + }, + "Format": { + "type": "string", + "description": "Gets or sets the subtitle format." + }, + "IsForced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the subtitle is forced." + }, + "IsHearingImpaired": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the subtitle is for hearing impaired." + }, + "Data": { + "type": "string", + "description": "Gets or sets the subtitle data." + } + }, + "additionalProperties": false, + "description": "Upload subtitles dto." + }, + "UserConfiguration": { + "type": "object", + "properties": { + "AudioLanguagePreference": { + "type": "string", + "description": "Gets or sets the audio language preference.", + "nullable": true + }, + "PlayDefaultAudioTrack": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [play default audio track]." + }, + "SubtitleLanguagePreference": { + "type": "string", + "description": "Gets or sets the subtitle language preference.", + "nullable": true + }, + "DisplayMissingEpisodes": { + "type": "boolean" + }, + "GroupedFolders": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "SubtitleMode": { + "enum": [ + "Default", + "Always", + "OnlyForced", + "None", + "Smart" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SubtitlePlaybackMode" + } + ], + "description": "An enum representing a subtitle playback mode." + }, + "DisplayCollectionsView": { + "type": "boolean" + }, + "EnableLocalPassword": { + "type": "boolean" + }, + "OrderedViews": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "LatestItemsExcludes": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "MyMediaExcludes": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "HidePlayedInLatest": { + "type": "boolean" + }, + "RememberAudioSelections": { + "type": "boolean" + }, + "RememberSubtitleSelections": { + "type": "boolean" + }, + "EnableNextEpisodeAutoPlay": { + "type": "boolean" + }, + "CastReceiverId": { + "type": "string", + "description": "Gets or sets the id of the selected cast receiver.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class UserConfiguration." + }, + "UserDataChangedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDataChangeInfo" + } + ], + "description": "Class UserDataChangeInfo.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "UserDataChanged", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "User data changed message." + }, + "UserDataChangeInfo": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "description": "Gets or sets the user id.", + "format": "uuid" + }, + "UserDataList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserItemDataDto" + }, + "description": "Gets or sets the user data list." + } + }, + "additionalProperties": false, + "description": "Class UserDataChangeInfo." + }, + "UserDeletedMessage": { + "type": "object", + "properties": { + "Data": { + "type": "string", + "description": "Gets or sets the data.", + "format": "uuid" + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "UserDeleted", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "User deleted message." + }, + "UserDto": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "ServerId": { + "type": "string", + "description": "Gets or sets the server identifier.", + "nullable": true + }, + "ServerName": { + "type": "string", + "description": "Gets or sets the name of the server.\r\nThis is not used by the server and is for client-side usage only.", + "nullable": true + }, + "Id": { + "type": "string", + "description": "Gets or sets the id.", + "format": "uuid" + }, + "PrimaryImageTag": { + "type": "string", + "description": "Gets or sets the primary image tag.", + "nullable": true + }, + "HasPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has password." + }, + "HasConfiguredPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has configured password." + }, + "HasConfiguredEasyPassword": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance has configured easy password.", + "deprecated": true + }, + "EnableAutoLogin": { + "type": "boolean", + "description": "Gets or sets whether async login is enabled or not.", + "nullable": true + }, + "LastLoginDate": { + "type": "string", + "description": "Gets or sets the last login date.", + "format": "date-time", + "nullable": true + }, + "LastActivityDate": { + "type": "string", + "description": "Gets or sets the last activity date.", + "format": "date-time", + "nullable": true + }, + "Configuration": { + "allOf": [ + { + "$ref": "#/components/schemas/UserConfiguration" + } + ], + "description": "Gets or sets the configuration.", + "nullable": true + }, + "Policy": { + "allOf": [ + { + "$ref": "#/components/schemas/UserPolicy" + } + ], + "description": "Gets or sets the policy.", + "nullable": true + }, + "PrimaryImageAspectRatio": { + "type": "number", + "description": "Gets or sets the primary image aspect ratio.", + "format": "double", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Class UserDto." + }, + "UserItemDataDto": { + "type": "object", + "properties": { + "Rating": { + "type": "number", + "description": "Gets or sets the rating.", + "format": "double", + "nullable": true + }, + "PlayedPercentage": { + "type": "number", + "description": "Gets or sets the played percentage.", + "format": "double", + "nullable": true + }, + "UnplayedItemCount": { + "type": "integer", + "description": "Gets or sets the unplayed item count.", + "format": "int32", + "nullable": true + }, + "PlaybackPositionTicks": { + "type": "integer", + "description": "Gets or sets the playback position ticks.", + "format": "int64" + }, + "PlayCount": { + "type": "integer", + "description": "Gets or sets the play count.", + "format": "int32" + }, + "IsFavorite": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is favorite." + }, + "Likes": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is likes.", + "nullable": true + }, + "LastPlayedDate": { + "type": "string", + "description": "Gets or sets the last played date.", + "format": "date-time", + "nullable": true + }, + "Played": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played." + }, + "Key": { + "type": "string", + "description": "Gets or sets the key." + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "format": "uuid" + } + }, + "additionalProperties": false, + "description": "Class UserItemDataDto." + }, + "UserPolicy": { + "required": [ + "AuthenticationProviderId", + "PasswordResetProviderId" + ], + "type": "object", + "properties": { + "IsAdministrator": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is administrator." + }, + "IsHidden": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is hidden." + }, + "EnableCollectionManagement": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can manage collections.", + "default": false + }, + "EnableSubtitleManagement": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance can manage subtitles.", + "default": false + }, + "EnableLyricManagement": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this user can manage lyrics.", + "default": false + }, + "IsDisabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether this instance is disabled." + }, + "MaxParentalRating": { + "type": "integer", + "description": "Gets or sets the max parental rating.", + "format": "int32", + "nullable": true + }, + "MaxParentalSubRating": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "BlockedTags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "AllowedTags": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableUserPreferenceAccess": { + "type": "boolean" + }, + "AccessSchedules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccessSchedule" + }, + "nullable": true + }, + "BlockUnratedItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UnratedItem" + }, + "nullable": true + }, + "EnableRemoteControlOfOtherUsers": { + "type": "boolean" + }, + "EnableSharedDeviceControl": { + "type": "boolean" + }, + "EnableRemoteAccess": { + "type": "boolean" + }, + "EnableLiveTvManagement": { + "type": "boolean" + }, + "EnableLiveTvAccess": { + "type": "boolean" + }, + "EnableMediaPlayback": { + "type": "boolean" + }, + "EnableAudioPlaybackTranscoding": { + "type": "boolean" + }, + "EnableVideoPlaybackTranscoding": { + "type": "boolean" + }, + "EnablePlaybackRemuxing": { + "type": "boolean" + }, + "ForceRemoteSourceTranscoding": { + "type": "boolean" + }, + "EnableContentDeletion": { + "type": "boolean" + }, + "EnableContentDeletionFromFolders": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableContentDownloading": { + "type": "boolean" + }, + "EnableSyncTranscoding": { + "type": "boolean", + "description": "Gets or sets a value indicating whether [enable synchronize]." + }, + "EnableMediaConversion": { + "type": "boolean" + }, + "EnabledDevices": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "EnableAllDevices": { + "type": "boolean" + }, + "EnabledChannels": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "EnableAllChannels": { + "type": "boolean" + }, + "EnabledFolders": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "EnableAllFolders": { + "type": "boolean" + }, + "InvalidLoginAttemptCount": { + "type": "integer", + "format": "int32" + }, + "LoginAttemptsBeforeLockout": { + "type": "integer", + "format": "int32" + }, + "MaxActiveSessions": { + "type": "integer", + "format": "int32" + }, + "EnablePublicSharing": { + "type": "boolean" + }, + "BlockedMediaFolders": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "BlockedChannels": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "nullable": true + }, + "RemoteClientBitrateLimit": { + "type": "integer", + "format": "int32" + }, + "AuthenticationProviderId": { + "type": "string" + }, + "PasswordResetProviderId": { + "type": "string" + }, + "SyncPlayAccess": { + "enum": [ + "CreateAndJoinGroups", + "JoinGroups", + "None" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SyncPlayUserAccessType" + } + ], + "description": "Gets or sets a value indicating what SyncPlay features the user can access." + } + }, + "additionalProperties": false + }, + "UserUpdatedMessage": { + "type": "object", + "properties": { + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/UserDto" + } + ], + "description": "Class UserDto.", + "nullable": true + }, + "MessageId": { + "type": "string", + "description": "Gets or sets the message id.", + "format": "uuid" + }, + "MessageType": { + "enum": [ + "ForceKeepAlive", + "GeneralCommand", + "UserDataChanged", + "Sessions", + "Play", + "SyncPlayCommand", + "SyncPlayGroupUpdate", + "Playstate", + "RestartRequired", + "ServerShuttingDown", + "ServerRestarting", + "LibraryChanged", + "UserDeleted", + "UserUpdated", + "SeriesTimerCreated", + "TimerCreated", + "SeriesTimerCancelled", + "TimerCancelled", + "RefreshProgress", + "ScheduledTaskEnded", + "PackageInstallationCancelled", + "PackageInstallationFailed", + "PackageInstallationCompleted", + "PackageInstalling", + "PackageUninstalled", + "ActivityLogEntry", + "ScheduledTasksInfo", + "ActivityLogEntryStart", + "ActivityLogEntryStop", + "SessionsStart", + "SessionsStop", + "ScheduledTasksInfoStart", + "ScheduledTasksInfoStop", + "KeepAlive" + ], + "allOf": [ + { + "$ref": "#/components/schemas/SessionMessageType" + } + ], + "description": "The different kinds of messages that are used in the WebSocket api.", + "default": "UserUpdated", + "readOnly": true + } + }, + "additionalProperties": false, + "description": "User updated message." + }, + "UtcTimeResponse": { + "type": "object", + "properties": { + "RequestReceptionTime": { + "type": "string", + "description": "Gets the UTC time when request has been received.", + "format": "date-time" + }, + "ResponseTransmissionTime": { + "type": "string", + "description": "Gets the UTC time when response has been sent.", + "format": "date-time" + } + }, + "additionalProperties": false, + "description": "Class UtcTimeResponse." + }, + "ValidatePathDto": { + "type": "object", + "properties": { + "ValidateWritable": { + "type": "boolean", + "description": "Gets or sets a value indicating whether validate if path is writable." + }, + "Path": { + "type": "string", + "description": "Gets or sets the path.", + "nullable": true + }, + "IsFile": { + "type": "boolean", + "description": "Gets or sets is path file.", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Validate path object." + }, + "VersionInfo": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Gets or sets the version." + }, + "VersionNumber": { + "type": "string", + "description": "Gets the version as a System.Version.", + "readOnly": true + }, + "changelog": { + "type": "string", + "description": "Gets or sets the changelog for this version.", + "nullable": true + }, + "targetAbi": { + "type": "string", + "description": "Gets or sets the ABI that this version was built against.", + "nullable": true + }, + "sourceUrl": { + "type": "string", + "description": "Gets or sets the source URL.", + "nullable": true + }, + "checksum": { + "type": "string", + "description": "Gets or sets a checksum for the binary.", + "nullable": true + }, + "timestamp": { + "type": "string", + "description": "Gets or sets a timestamp of when the binary was built.", + "nullable": true + }, + "repositoryName": { + "type": "string", + "description": "Gets or sets the repository name." + }, + "repositoryUrl": { + "type": "string", + "description": "Gets or sets the repository url." + } + }, + "additionalProperties": false, + "description": "Defines the MediaBrowser.Model.Updates.VersionInfo class." + }, + "Video3DFormat": { + "enum": [ + "HalfSideBySide", + "FullSideBySide", + "FullTopAndBottom", + "HalfTopAndBottom", + "MVC" + ], + "type": "string" + }, + "VideoRange": { + "enum": [ + "Unknown", + "SDR", + "HDR" + ], + "type": "string", + "description": "An enum representing video ranges." + }, + "VideoRangeType": { + "enum": [ + "Unknown", + "SDR", + "HDR10", + "HLG", + "DOVI", + "DOVIWithHDR10", + "DOVIWithHLG", + "DOVIWithSDR", + "DOVIWithEL", + "DOVIWithHDR10Plus", + "DOVIWithELHDR10Plus", + "DOVIInvalid", + "HDR10Plus" + ], + "type": "string", + "description": "An enum representing types of video ranges." + }, + "VideoType": { + "enum": [ + "VideoFile", + "Iso", + "Dvd", + "BluRay" + ], + "type": "string", + "description": "Enum VideoType." + }, + "VirtualFolderInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Gets or sets the name.", + "nullable": true + }, + "Locations": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Gets or sets the locations.", + "nullable": true + }, + "CollectionType": { + "enum": [ + "movies", + "tvshows", + "music", + "musicvideos", + "homevideos", + "boxsets", + "books", + "mixed" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CollectionTypeOptions" + } + ], + "description": "Gets or sets the type of the collection.", + "nullable": true + }, + "LibraryOptions": { + "allOf": [ + { + "$ref": "#/components/schemas/LibraryOptions" + } + ], + "nullable": true + }, + "ItemId": { + "type": "string", + "description": "Gets or sets the item identifier.", + "nullable": true + }, + "PrimaryImageItemId": { + "type": "string", + "description": "Gets or sets the primary image item identifier.", + "nullable": true + }, + "RefreshProgress": { + "type": "number", + "format": "double", + "nullable": true + }, + "RefreshStatus": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false, + "description": "Used to hold information about a user's list of configured virtual folders." + }, + "WebSocketMessage": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/InboundWebSocketMessage" + }, + { + "$ref": "#/components/schemas/OutboundWebSocketMessage" + } + ], + "description": "Represents the possible websocket types" + }, + "XbmcMetadataOptions": { + "type": "object", + "properties": { + "UserId": { + "type": "string", + "nullable": true + }, + "ReleaseDateFormat": { + "type": "string" + }, + "SaveImagePathsInNfo": { + "type": "boolean" + }, + "EnablePathSubstitution": { + "type": "boolean" + }, + "EnableExtraThumbsDuplication": { + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "securitySchemes": { + "CustomAuthentication": { + "type": "apiKey", + "description": "API key header parameter", + "name": "Authorization", + "in": "header" + } + } + } +} \ No newline at end of file diff --git a/docs/ks-player/GettingStarted.md b/docs/ks-player/GettingStarted.md new file mode 100644 index 00000000..d5ec51cf --- /dev/null +++ b/docs/ks-player/GettingStarted.md @@ -0,0 +1,157 @@ +# Getting Started with KSPlayer + +KSPlayer is a powerful media playback framework for iOS, tvOS, macOS, xrOS, and visionOS. It supports both AVPlayer and FFmpeg-based playback with AppKit/UIKit/SwiftUI support. + +## Requirements + +- iOS 13+ +- macOS 10.15+ +- tvOS 13+ +- xrOS 1+ + +## Troubleshooting + +### Missing Metal Toolchain (CocoaPods builds) + +If your build fails compiling `Shaders.metal` with: + +`cannot execute tool 'metal' due to missing Metal Toolchain` + +Install the component: + +```bash +xcodebuild -downloadComponent MetalToolchain +``` + +Then verify: + +```bash +xcrun --find metal +xcrun metal -v +``` + +## Installation + +### Swift Package Manager + +Add KSPlayer to your `Package.swift`: + +```swift +dependencies: [ + .package(url: "https://github.com/kingslay/KSPlayer.git", .branch("main")) +] +``` + +Or in Xcode: File โ†’ Add Packages โ†’ Enter the repository URL. + +### CocoaPods + +Add to your `Podfile`: + +```ruby +target 'YourApp' do + use_frameworks! + pod 'KSPlayer', :git => 'https://github.com/kingslay/KSPlayer.git', :branch => 'main' + pod 'DisplayCriteria', :git => 'https://github.com/kingslay/KSPlayer.git', :branch => 'main' + pod 'FFmpegKit', :git => 'https://github.com/kingslay/FFmpegKit.git', :branch => 'main' + pod 'Libass', :git => 'https://github.com/kingslay/FFmpegKit.git', :branch => 'main' +end +``` + +Then run: + +```bash +pod install +``` + +## Initial Setup + +### Configure Player Type + +KSPlayer supports two player backends: +- `KSAVPlayer` - Uses AVPlayer (default first player) +- `KSMEPlayer` - Uses FFmpeg for decoding + +Configure the player type before creating any player views: + +```swift +import KSPlayer + +// Use KSMEPlayer as the secondary/fallback player +KSOptions.secondPlayerType = KSMEPlayer.self + +// Or set KSMEPlayer as the primary player +KSOptions.firstPlayerType = KSMEPlayer.self +``` + +### Player Type Selection Strategy + +The player uses `firstPlayerType` initially. If playback fails, it automatically switches to `secondPlayerType`. + +```swift +// Default configuration +KSOptions.firstPlayerType = KSAVPlayer.self // Uses AVPlayer first +KSOptions.secondPlayerType = KSMEPlayer.self // Falls back to FFmpeg +``` + +## Quick Start + +### UIKit + +```swift +import KSPlayer + +class VideoViewController: UIViewController { + private var playerView: IOSVideoPlayerView! + + override func viewDidLoad() { + super.viewDidLoad() + + KSOptions.secondPlayerType = KSMEPlayer.self + + playerView = IOSVideoPlayerView() + view.addSubview(playerView) + + playerView.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate([ + playerView.topAnchor.constraint(equalTo: view.topAnchor), + playerView.leadingAnchor.constraint(equalTo: view.leadingAnchor), + playerView.trailingAnchor.constraint(equalTo: view.trailingAnchor), + playerView.bottomAnchor.constraint(equalTo: view.bottomAnchor), + ]) + + let url = URL(string: "https://example.com/video.mp4")! + playerView.set(url: url, options: KSOptions()) + } +} +``` + +### SwiftUI (iOS 16+) + +```swift +import KSPlayer +import SwiftUI + +struct VideoPlayerScreen: View { + let url: URL + + var body: some View { + KSVideoPlayerView(url: url, options: KSOptions()) + } +} +``` + +## Key Imports + +```swift +import KSPlayer +import AVFoundation // For AVMediaType, etc. +``` + +## Next Steps + +- [UIKit Usage](UIKitUsage.md) - Detailed UIKit integration +- [SwiftUI Usage](SwiftUIUsage.md) - SwiftUI views and modifiers +- [KSOptions](KSOptions.md) - Configuration options +- [Types and Protocols](TypesAndProtocols.md) - Core types reference + diff --git a/docs/ks-player/KSOptions.md b/docs/ks-player/KSOptions.md new file mode 100644 index 00000000..a7370de8 --- /dev/null +++ b/docs/ks-player/KSOptions.md @@ -0,0 +1,349 @@ +# KSOptions + +`KSOptions` is the configuration class for KSPlayer. It contains both instance properties (per-player settings) and static properties (global defaults). + +## Creating Options + +```swift +let options = KSOptions() + +// Configure instance properties +options.isLoopPlay = true +options.startPlayTime = 30.0 // Start at 30 seconds + +// Use with player +playerView.set(url: url, options: options) +``` + +## Instance Properties + +### Buffering + +| Property | Type | Default | Description | +|----------|------|---------|-------------| +| `preferredForwardBufferDuration` | `TimeInterval` | `3.0` | Minimum buffer duration before playback starts | +| `maxBufferDuration` | `TimeInterval` | `30.0` | Maximum buffer duration | +| `isSecondOpen` | `Bool` | `false` | Enable fast open (instant playback) | + +### Seeking + +| Property | Type | Default | Description | +|----------|------|---------|-------------| +| `isAccurateSeek` | `Bool` | `false` | Enable frame-accurate seeking | +| `seekFlags` | `Int32` | `1` | FFmpeg seek flags (AVSEEK_FLAG_BACKWARD) | +| `isSeekedAutoPlay` | `Bool` | `true` | Auto-play after seeking | + +### Playback + +| Property | Type | Default | Description | +|----------|------|---------|-------------| +| `isLoopPlay` | `Bool` | `false` | Loop playback (for short videos) | +| `startPlayTime` | `TimeInterval` | `0` | Initial playback position (seconds) | +| `startPlayRate` | `Float` | `1.0` | Initial playback rate | +| `registerRemoteControll` | `Bool` | `true` | Enable system remote control | + +### Video + +| Property | Type | Default | Description | +|----------|------|---------|-------------| +| `display` | `DisplayEnum` | `.plane` | Display mode (`.plane`, `.vr`, `.vrBox`) | +| `videoDelay` | `Double` | `0.0` | Video delay in seconds | +| `autoDeInterlace` | `Bool` | `false` | Auto-detect interlacing | +| `autoRotate` | `Bool` | `true` | Auto-rotate based on metadata | +| `destinationDynamicRange` | `DynamicRange?` | `nil` | Target HDR mode | +| `videoAdaptable` | `Bool` | `true` | Enable adaptive bitrate | +| `videoFilters` | `[String]` | `[]` | FFmpeg video filters | +| `syncDecodeVideo` | `Bool` | `false` | Synchronous video decoding | +| `hardwareDecode` | `Bool` | `true` | Use hardware decoding | +| `asynchronousDecompression` | `Bool` | `false` | Async hardware decompression | +| `videoDisable` | `Bool` | `false` | Disable video track | + +### Audio + +| Property | Type | Default | Description | +|----------|------|---------|-------------| +| `audioFilters` | `[String]` | `[]` | FFmpeg audio filters | +| `syncDecodeAudio` | `Bool` | `false` | Synchronous audio decoding | + +### Subtitles + +| Property | Type | Default | Description | +|----------|------|---------|-------------| +| `autoSelectEmbedSubtitle` | `Bool` | `true` | Auto-select embedded subtitles | +| `isSeekImageSubtitle` | `Bool` | `false` | Seek for image subtitles | + +### Picture-in-Picture + +| Property | Type | Default | Description | +|----------|------|---------|-------------| +| `canStartPictureInPictureAutomaticallyFromInline` | `Bool` | `true` | Auto-start PiP when app backgrounds | + +### Window (macOS) + +| Property | Type | Default | Description | +|----------|------|---------|-------------| +| `automaticWindowResize` | `Bool` | `true` | Auto-resize window to video aspect ratio | + +### Network/HTTP + +| Property | Type | Default | Description | +|----------|------|---------|-------------| +| `referer` | `String?` | `nil` | HTTP referer header | +| `userAgent` | `String?` | `"KSPlayer"` | HTTP user agent | +| `cache` | `Bool` | `false` | Enable FFmpeg HTTP caching | +| `outputURL` | `URL?` | `nil` | URL to record/save stream | + +### FFmpeg Options + +| Property | Type | Default | Description | +|----------|------|---------|-------------| +| `avOptions` | `[String: Any]` | `[:]` | AVURLAsset options | +| `formatContextOptions` | `[String: Any]` | See below | FFmpeg format context options | +| `decoderOptions` | `[String: Any]` | See below | FFmpeg decoder options | +| `probesize` | `Int64?` | `nil` | FFmpeg probe size | +| `maxAnalyzeDuration` | `Int64?` | `nil` | Max analyze duration | +| `lowres` | `UInt8` | `0` | Low resolution decoding | +| `nobuffer` | `Bool` | `false` | Disable buffering | +| `codecLowDelay` | `Bool` | `false` | Low delay codec mode | + +#### Default formatContextOptions + +```swift +[ + "user_agent": "KSPlayer", + "scan_all_pmts": 1, + "reconnect": 1, + "reconnect_streamed": 1 +] +``` + +#### Default decoderOptions + +```swift +[ + "threads": "auto", + "refcounted_frames": "1" +] +``` + +### Read-Only Timing Properties + +| Property | Type | Description | +|----------|------|-------------| +| `formatName` | `String` | Detected format name | +| `prepareTime` | `Double` | Time when prepare started | +| `dnsStartTime` | `Double` | DNS lookup start time | +| `tcpStartTime` | `Double` | TCP connection start time | +| `tcpConnectedTime` | `Double` | TCP connected time | +| `openTime` | `Double` | File open time | +| `findTime` | `Double` | Stream find time | +| `readyTime` | `Double` | Ready to play time | +| `readAudioTime` | `Double` | First audio read time | +| `readVideoTime` | `Double` | First video read time | +| `decodeAudioTime` | `Double` | First audio decode time | +| `decodeVideoTime` | `Double` | First video decode time | + +## Static Properties (Global Defaults) + +### Player Types + +```swift +// Primary player type (default: AVPlayer) +KSOptions.firstPlayerType: MediaPlayerProtocol.Type = KSAVPlayer.self + +// Fallback player type (default: FFmpeg) +KSOptions.secondPlayerType: MediaPlayerProtocol.Type? = KSMEPlayer.self +``` + +### Buffering Defaults + +```swift +KSOptions.preferredForwardBufferDuration: TimeInterval = 3.0 +KSOptions.maxBufferDuration: TimeInterval = 30.0 +KSOptions.isSecondOpen: Bool = false +``` + +### Playback Defaults + +```swift +KSOptions.isAccurateSeek: Bool = false +KSOptions.isLoopPlay: Bool = false +KSOptions.isAutoPlay: Bool = true +KSOptions.isSeekedAutoPlay: Bool = true +``` + +### Decoding + +```swift +KSOptions.hardwareDecode: Bool = true +KSOptions.asynchronousDecompression: Bool = false +KSOptions.canStartPictureInPictureAutomaticallyFromInline: Bool = true +``` + +### UI Options + +```swift +// Top bar visibility: .always, .horizantalOnly, .none +KSOptions.topBarShowInCase: KSPlayerTopBarShowCase = .always + +// Auto-hide controls delay +KSOptions.animateDelayTimeInterval: TimeInterval = 5.0 + +// Gesture controls +KSOptions.enableBrightnessGestures: Bool = true +KSOptions.enableVolumeGestures: Bool = true +KSOptions.enablePlaytimeGestures: Bool = true + +// Background playback +KSOptions.canBackgroundPlay: Bool = false +``` + +### PiP + +```swift +KSOptions.isPipPopViewController: Bool = false +``` + +### Logging + +```swift +// Log levels: .panic, .fatal, .error, .warning, .info, .verbose, .debug, .trace +KSOptions.logLevel: LogLevel = .warning +KSOptions.logger: LogHandler = OSLog(lable: "KSPlayer") +``` + +### System + +```swift +KSOptions.useSystemHTTPProxy: Bool = true +KSOptions.preferredFrame: Bool = true +``` + +### Subtitle Data Sources + +```swift +KSOptions.subtitleDataSouces: [SubtitleDataSouce] = [DirectorySubtitleDataSouce()] +``` + +## Methods + +### HTTP Headers + +```swift +let options = KSOptions() +options.appendHeader(["Referer": "https://example.com"]) +options.appendHeader(["Authorization": "Bearer token123"]) +``` + +### Cookies + +```swift +let cookies = [HTTPCookie(properties: [ + .name: "session", + .value: "abc123", + .domain: "example.com", + .path: "/" +])!] +options.setCookie(cookies) +``` + +## Overridable Methods + +Subclass `KSOptions` to customize behavior: + +### Buffering Algorithm + +```swift +class CustomOptions: KSOptions { + override func playable(capacitys: [CapacityProtocol], isFirst: Bool, isSeek: Bool) -> LoadingState { + // Custom buffering logic + super.playable(capacitys: capacitys, isFirst: isFirst, isSeek: isSeek) + } +} +``` + +### Adaptive Bitrate + +```swift +override func adaptable(state: VideoAdaptationState?) -> (Int64, Int64)? { + // Return (currentBitrate, targetBitrate) or nil + super.adaptable(state: state) +} +``` + +### Track Selection + +```swift +// Select preferred video track +override func wantedVideo(tracks: [MediaPlayerTrack]) -> Int? { + // Return index of preferred track or nil for auto + return tracks.firstIndex { $0.bitRate > 5_000_000 } +} + +// Select preferred audio track +override func wantedAudio(tracks: [MediaPlayerTrack]) -> Int? { + // Return index of preferred track or nil for auto + return tracks.firstIndex { $0.languageCode == "en" } +} +``` + +### Display Layer + +```swift +override func isUseDisplayLayer() -> Bool { + // Return true to use AVSampleBufferDisplayLayer (supports HDR10+) + // Return false for other display modes + display == .plane +} +``` + +### Track Processing + +```swift +override func process(assetTrack: some MediaPlayerTrack) { + super.process(assetTrack: assetTrack) + // Custom processing before decoder creation +} +``` + +### Live Playback Rate + +```swift +override func liveAdaptivePlaybackRate(loadingState: LoadingState) -> Float? { + // Return adjusted playback rate for live streams + // Return nil to keep current rate + if loadingState.loadedTime > preferredForwardBufferDuration + 5 { + return 1.2 // Speed up if too far behind + } + return nil +} +``` + +## Example: Custom Options + +```swift +class StreamingOptions: KSOptions { + override init() { + super.init() + + // Low latency settings + preferredForwardBufferDuration = 1.0 + isSecondOpen = true + nobuffer = true + codecLowDelay = true + + // Custom headers + appendHeader(["X-Custom-Header": "value"]) + } + + override func wantedAudio(tracks: [MediaPlayerTrack]) -> Int? { + // Prefer English audio + return tracks.firstIndex { $0.languageCode == "en" } + } +} + +// Usage +let options = StreamingOptions() +playerView.set(url: streamURL, options: options) +``` + diff --git a/docs/ks-player/KSPlayerLayer.md b/docs/ks-player/KSPlayerLayer.md new file mode 100644 index 00000000..e8d071ff --- /dev/null +++ b/docs/ks-player/KSPlayerLayer.md @@ -0,0 +1,442 @@ +# KSPlayerLayer + +`KSPlayerLayer` is the core playback controller that manages the media player instance and provides a high-level API for playback control. + +## Overview + +`KSPlayerLayer` wraps `MediaPlayerProtocol` implementations (`KSAVPlayer` or `KSMEPlayer`) and handles: +- Player lifecycle management +- Playback state transitions +- Remote control integration +- Picture-in-Picture support +- Background/foreground handling + +## Creating a KSPlayerLayer + +### Basic Initialization + +```swift +let url = URL(string: "https://example.com/video.mp4")! +let options = KSOptions() + +let playerLayer = KSPlayerLayer( + url: url, + isAutoPlay: true, // Default: KSOptions.isAutoPlay + options: options, + delegate: self +) +``` + +### Constructor Parameters + +```swift +public init( + url: URL, + isAutoPlay: Bool = KSOptions.isAutoPlay, + options: KSOptions, + delegate: KSPlayerLayerDelegate? = nil +) +``` + +## Properties + +### Core Properties + +| Property | Type | Description | +|----------|------|-------------| +| `url` | `URL` | Current media URL (read-only after init) | +| `options` | `KSOptions` | Player configuration (read-only) | +| `player` | `MediaPlayerProtocol` | Underlying player instance | +| `state` | `KSPlayerState` | Current playback state (read-only) | +| `delegate` | `KSPlayerLayerDelegate?` | Event delegate | + +### Published Properties (for Combine/SwiftUI) + +```swift +@Published public var bufferingProgress: Int = 0 // 0-100 +@Published public var loopCount: Int = 0 // Loop iteration count +@Published public var isPipActive: Bool = false // Picture-in-Picture state +``` + +## Playback Control Methods + +### play() + +Start or resume playback: + +```swift +playerLayer.play() +``` + +### pause() + +Pause playback: + +```swift +playerLayer.pause() +``` + +### stop() + +Stop playback and reset player state: + +```swift +playerLayer.stop() +``` + +### seek(time:autoPlay:completion:) + +Seek to a specific time: + +```swift +playerLayer.seek(time: 30.0, autoPlay: true) { finished in + if finished { + print("Seek completed") + } +} +``` + +Parameters: +- `time: TimeInterval` - Target time in seconds +- `autoPlay: Bool` - Whether to auto-play after seeking +- `completion: @escaping ((Bool) -> Void)` - Called when seek completes + +### prepareToPlay() + +Prepare the player (called automatically when `isAutoPlay` is true): + +```swift +playerLayer.prepareToPlay() +``` + +## URL Management + +### set(url:options:) + +Change the video URL: + +```swift +let newURL = URL(string: "https://example.com/another-video.mp4")! +playerLayer.set(url: newURL, options: KSOptions()) +``` + +### set(urls:options:) + +Set a playlist of URLs: + +```swift +let urls = [ + URL(string: "https://example.com/video1.mp4")!, + URL(string: "https://example.com/video2.mp4")!, + URL(string: "https://example.com/video3.mp4")! +] +playerLayer.set(urls: urls, options: KSOptions()) +``` + +The player automatically advances to the next URL when playback finishes. + +## Accessing the Player + +### Player Properties + +Access underlying player properties through `playerLayer.player`: + +```swift +// Duration +let duration = playerLayer.player.duration + +// Current time +let currentTime = playerLayer.player.currentPlaybackTime + +// Playing state +let isPlaying = playerLayer.player.isPlaying + +// Seekable +let canSeek = playerLayer.player.seekable + +// Natural size +let videoSize = playerLayer.player.naturalSize + +// File size (estimated) +let fileSize = playerLayer.player.fileSize +``` + +### Player Control + +```swift +// Volume (0.0 to 1.0) +playerLayer.player.playbackVolume = 0.5 + +// Mute +playerLayer.player.isMuted = true + +// Playback rate +playerLayer.player.playbackRate = 1.5 + +// Content mode +playerLayer.player.contentMode = .scaleAspectFit +``` + +### Tracks + +```swift +// Get audio tracks +let audioTracks = playerLayer.player.tracks(mediaType: .audio) + +// Get video tracks +let videoTracks = playerLayer.player.tracks(mediaType: .video) + +// Select a track +if let englishTrack = audioTracks.first(where: { $0.languageCode == "en" }) { + playerLayer.player.select(track: englishTrack) +} +``` + +### External Playback (AirPlay) + +```swift +// Enable AirPlay +playerLayer.player.allowsExternalPlayback = true + +// Check if actively using AirPlay +let isAirPlaying = playerLayer.player.isExternalPlaybackActive + +// Auto-switch to external when screen connected +playerLayer.player.usesExternalPlaybackWhileExternalScreenIsActive = true +``` + +### Picture-in-Picture + +```swift +// Available on tvOS 14.0+, iOS 14.0+ +if #available(tvOS 14.0, iOS 14.0, *) { + // Toggle PiP + playerLayer.isPipActive.toggle() + + // Or access controller directly + playerLayer.player.pipController?.start(view: playerLayer) + playerLayer.player.pipController?.stop(restoreUserInterface: true) +} +``` + +### Dynamic Info + +```swift +if let dynamicInfo = playerLayer.player.dynamicInfo { + print("FPS: \(dynamicInfo.displayFPS)") + print("A/V Sync: \(dynamicInfo.audioVideoSyncDiff)") + print("Dropped frames: \(dynamicInfo.droppedVideoFrameCount)") + print("Audio bitrate: \(dynamicInfo.audioBitrate)") + print("Video bitrate: \(dynamicInfo.videoBitrate)") + + // Metadata + if let title = dynamicInfo.metadata["title"] { + print("Title: \(title)") + } +} +``` + +### Chapters + +```swift +let chapters = playerLayer.player.chapters +for chapter in chapters { + print("\(chapter.title): \(chapter.start) - \(chapter.end)") +} +``` + +### Thumbnails + +```swift +Task { + if let thumbnail = await playerLayer.player.thumbnailImageAtCurrentTime() { + let image = UIImage(cgImage: thumbnail) + // Use thumbnail + } +} +``` + +## KSPlayerLayerDelegate + +Implement the delegate to receive events: + +```swift +extension MyViewController: KSPlayerLayerDelegate { + func player(layer: KSPlayerLayer, state: KSPlayerState) { + switch state { + case .initialized: + print("Player initialized") + case .preparing: + print("Preparing...") + case .readyToPlay: + print("Ready - Duration: \(layer.player.duration)") + case .buffering: + print("Buffering...") + case .bufferFinished: + print("Playing") + case .paused: + print("Paused") + case .playedToTheEnd: + print("Finished") + case .error: + print("Error occurred") + } + } + + func player(layer: KSPlayerLayer, currentTime: TimeInterval, totalTime: TimeInterval) { + let progress = totalTime > 0 ? currentTime / totalTime : 0 + print("Progress: \(Int(progress * 100))%") + } + + func player(layer: KSPlayerLayer, finish error: Error?) { + if let error = error { + print("Playback error: \(error.localizedDescription)") + } else { + print("Playback completed successfully") + } + } + + func player(layer: KSPlayerLayer, bufferedCount: Int, consumeTime: TimeInterval) { + // bufferedCount: 0 = initial load + // consumeTime: time spent buffering + print("Buffer #\(bufferedCount), took \(consumeTime)s") + } +} +``` + +## Player View Integration + +The player's view can be added to your view hierarchy: + +```swift +if let playerView = playerLayer.player.view { + containerView.addSubview(playerView) + playerView.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate([ + playerView.topAnchor.constraint(equalTo: containerView.topAnchor), + playerView.leadingAnchor.constraint(equalTo: containerView.leadingAnchor), + playerView.trailingAnchor.constraint(equalTo: containerView.trailingAnchor), + playerView.bottomAnchor.constraint(equalTo: containerView.bottomAnchor), + ]) +} +``` + +## Remote Control + +Remote control is automatically registered when `options.registerRemoteControll` is `true` (default). + +### Supported Commands + +- Play/Pause +- Stop +- Next/Previous track (for playlists) +- Skip forward/backward (15 seconds) +- Change playback position +- Change playback rate +- Change repeat mode +- Language/audio track selection + +### Customizing Remote Control + +```swift +// Disable auto-registration +options.registerRemoteControll = false + +// Manually register later +playerLayer.registerRemoteControllEvent() +``` + +### Now Playing Info + +```swift +import MediaPlayer + +// Set custom Now Playing info +MPNowPlayingInfoCenter.default().nowPlayingInfo = [ + MPMediaItemPropertyTitle: "Video Title", + MPMediaItemPropertyArtist: "Artist Name", + MPMediaItemPropertyPlaybackDuration: playerLayer.player.duration +] +``` + +## Background/Foreground Handling + +KSPlayerLayer automatically handles app lifecycle: + +- **Background**: Pauses video (unless `KSOptions.canBackgroundPlay` is `true`) +- **Foreground**: Resumes display + +```swift +// Enable background playback +KSOptions.canBackgroundPlay = true +``` + +## Player Type Switching + +The player automatically switches from `firstPlayerType` to `secondPlayerType` on failure: + +```swift +// Configure player types before creating KSPlayerLayer +KSOptions.firstPlayerType = KSAVPlayer.self +KSOptions.secondPlayerType = KSMEPlayer.self +``` + +## Complete Example + +```swift +class VideoPlayerController: UIViewController, KSPlayerLayerDelegate { + private var playerLayer: KSPlayerLayer! + private var containerView: UIView! + + override func viewDidLoad() { + super.viewDidLoad() + + containerView = UIView() + view.addSubview(containerView) + containerView.frame = view.bounds + + let url = URL(string: "https://example.com/video.mp4")! + let options = KSOptions() + options.isLoopPlay = true + + playerLayer = KSPlayerLayer( + url: url, + options: options, + delegate: self + ) + + if let playerView = playerLayer.player.view { + containerView.addSubview(playerView) + playerView.frame = containerView.bounds + playerView.autoresizingMask = [.flexibleWidth, .flexibleHeight] + } + } + + // MARK: - KSPlayerLayerDelegate + + func player(layer: KSPlayerLayer, state: KSPlayerState) { + print("State: \(state)") + } + + func player(layer: KSPlayerLayer, currentTime: TimeInterval, totalTime: TimeInterval) { + // Update progress UI + } + + func player(layer: KSPlayerLayer, finish error: Error?) { + if let error = error { + showError(error) + } + } + + func player(layer: KSPlayerLayer, bufferedCount: Int, consumeTime: TimeInterval) { + if bufferedCount == 0 { + print("Initial load took \(consumeTime)s") + } + } + + deinit { + playerLayer.stop() + } +} +``` + diff --git a/docs/ks-player/SubtitleSupport.md b/docs/ks-player/SubtitleSupport.md new file mode 100644 index 00000000..5480e00f --- /dev/null +++ b/docs/ks-player/SubtitleSupport.md @@ -0,0 +1,490 @@ +# Subtitle Support + +KSPlayer provides comprehensive subtitle support including embedded subtitles, external subtitle files, and online subtitle search. + +## SubtitleModel + +`SubtitleModel` manages subtitle sources, selection, and rendering. + +### Properties + +```swift +open class SubtitleModel: ObservableObject { + // Available subtitle sources + @Published public private(set) var subtitleInfos: [any SubtitleInfo] + + // Current subtitle parts being displayed + @Published public private(set) var parts: [SubtitlePart] + + // Global subtitle delay (seconds) + public var subtitleDelay: Double = 0.0 + + // Current media URL + public var url: URL? + + // Selected subtitle + @Published public var selectedSubtitleInfo: (any SubtitleInfo)? +} +``` + +### Static Styling Properties + +```swift +SubtitleModel.textColor: Color = .white +SubtitleModel.textBackgroundColor: Color = .clear +SubtitleModel.textFontSize: CGFloat = SubtitleModel.Size.standard.rawValue +SubtitleModel.textBold: Bool = false +SubtitleModel.textItalic: Bool = false +SubtitleModel.textPosition: TextPosition = TextPosition() +``` + +### Font Sizes + +```swift +public enum Size { + case smaller // 12pt (iPhone), 20pt (iPad/Mac), 48pt (TV) + case standard // 16pt (iPhone), 26pt (iPad/Mac), 58pt (TV) + case large // 20pt (iPhone), 32pt (iPad/Mac), 68pt (TV) +} +``` + +### Methods + +```swift +// Add subtitle source +public func addSubtitle(info: any SubtitleInfo) + +// Add subtitle data source +public func addSubtitle(dataSouce: SubtitleDataSouce) + +// Search for subtitles online +public func searchSubtitle(query: String?, languages: [String]) + +// Get subtitle for current time (called internally) +public func subtitle(currentTime: TimeInterval) -> Bool +``` + +## SubtitleInfo Protocol + +Protocol for subtitle track information: + +```swift +public protocol SubtitleInfo: KSSubtitleProtocol, AnyObject, Hashable, Identifiable { + var subtitleID: String { get } + var name: String { get } + var delay: TimeInterval { get set } + var isEnabled: Bool { get set } +} +``` + +### KSSubtitleProtocol + +```swift +public protocol KSSubtitleProtocol { + func search(for time: TimeInterval) -> [SubtitlePart] +} +``` + +## URLSubtitleInfo + +Subtitle from a URL: + +```swift +public class URLSubtitleInfo: KSSubtitle, SubtitleInfo { + public private(set) var downloadURL: URL + public var delay: TimeInterval = 0 + public private(set) var name: String + public let subtitleID: String + public var comment: String? + public var isEnabled: Bool + + // Simple initializer + public convenience init(url: URL) + + // Full initializer + public init( + subtitleID: String, + name: String, + url: URL, + userAgent: String? = nil + ) +} +``` + +### Example: Loading External Subtitle + +```swift +let subtitleURL = URL(string: "https://example.com/subtitle.srt")! +let subtitleInfo = URLSubtitleInfo(url: subtitleURL) + +// Add to subtitle model +subtitleModel.addSubtitle(info: subtitleInfo) + +// Or select directly +subtitleModel.selectedSubtitleInfo = subtitleInfo +``` + +## SubtitlePart + +A single subtitle cue: + +```swift +public class SubtitlePart: CustomStringConvertible, Identifiable { + public var start: TimeInterval + public var end: TimeInterval + public var origin: CGPoint = .zero + public let text: NSAttributedString? + public var image: UIImage? // For image-based subtitles (e.g., SUP) + public var textPosition: TextPosition? + + public convenience init(_ start: TimeInterval, _ end: TimeInterval, _ string: String) + public init(_ start: TimeInterval, _ end: TimeInterval, attributedString: NSAttributedString?) +} +``` + +## SubtitleDataSouce Protocol + +Protocol for subtitle sources: + +```swift +public protocol SubtitleDataSouce: AnyObject { + var infos: [any SubtitleInfo] { get } +} +``` + +### FileURLSubtitleDataSouce + +For file-based subtitle sources: + +```swift +public protocol FileURLSubtitleDataSouce: SubtitleDataSouce { + func searchSubtitle(fileURL: URL?) async throws +} +``` + +### SearchSubtitleDataSouce + +For online subtitle search: + +```swift +public protocol SearchSubtitleDataSouce: SubtitleDataSouce { + func searchSubtitle(query: String?, languages: [String]) async throws +} +``` + +### CacheSubtitleDataSouce + +For cached subtitles: + +```swift +public protocol CacheSubtitleDataSouce: FileURLSubtitleDataSouce { + func addCache(fileURL: URL, downloadURL: URL) +} +``` + +## Built-in Data Sources + +### URLSubtitleDataSouce + +Simple URL-based subtitle source: + +```swift +public class URLSubtitleDataSouce: SubtitleDataSouce { + public var infos: [any SubtitleInfo] + + public init(urls: [URL]) +} + +// Example +let subtitleSource = URLSubtitleDataSouce(urls: [ + URL(string: "https://example.com/english.srt")!, + URL(string: "https://example.com/spanish.srt")! +]) +``` + +### DirectorySubtitleDataSouce + +Searches for subtitles in the same directory as the video: + +```swift +public class DirectorySubtitleDataSouce: FileURLSubtitleDataSouce { + public var infos: [any SubtitleInfo] + + public init() + public func searchSubtitle(fileURL: URL?) async throws +} +``` + +### PlistCacheSubtitleDataSouce + +Caches downloaded subtitle locations: + +```swift +public class PlistCacheSubtitleDataSouce: CacheSubtitleDataSouce { + public static let singleton: PlistCacheSubtitleDataSouce + public var infos: [any SubtitleInfo] + + public func searchSubtitle(fileURL: URL?) async throws + public func addCache(fileURL: URL, downloadURL: URL) +} +``` + +## Online Subtitle Providers + +### ShooterSubtitleDataSouce + +Shooter.cn subtitle search (for local files): + +```swift +public class ShooterSubtitleDataSouce: FileURLSubtitleDataSouce { + public var infos: [any SubtitleInfo] + + public init() + public func searchSubtitle(fileURL: URL?) async throws +} +``` + +### AssrtSubtitleDataSouce + +Assrt.net subtitle search: + +```swift +public class AssrtSubtitleDataSouce: SearchSubtitleDataSouce { + public var infos: [any SubtitleInfo] + + public init(token: String) + public func searchSubtitle(query: String?, languages: [String]) async throws +} + +// Example +let assrtSource = AssrtSubtitleDataSouce(token: "your-api-token") +``` + +### OpenSubtitleDataSouce + +OpenSubtitles.com API: + +```swift +public class OpenSubtitleDataSouce: SearchSubtitleDataSouce { + public var infos: [any SubtitleInfo] + + public init(apiKey: String, username: String? = nil, password: String? = nil) + + // Search by query + public func searchSubtitle(query: String?, languages: [String]) async throws + + // Search by IDs + public func searchSubtitle( + query: String?, + imdbID: Int, + tmdbID: Int, + languages: [String] + ) async throws + + // Search with custom parameters + public func searchSubtitle(queryItems: [String: String]) async throws +} + +// Example +let openSubSource = OpenSubtitleDataSouce(apiKey: "your-api-key") +``` + +## Configuring Default Data Sources + +```swift +// Set default subtitle data sources +KSOptions.subtitleDataSouces = [ + DirectorySubtitleDataSouce(), + PlistCacheSubtitleDataSouce.singleton +] + +// Add online search +KSOptions.subtitleDataSouces.append( + OpenSubtitleDataSouce(apiKey: "your-key") +) +``` + +## UIKit Integration + +### With VideoPlayerView + +```swift +class VideoViewController: UIViewController { + let playerView = IOSVideoPlayerView() + + func loadSubtitle(url: URL) { + let subtitleInfo = URLSubtitleInfo(url: url) + playerView.srtControl.addSubtitle(info: subtitleInfo) + playerView.srtControl.selectedSubtitleInfo = subtitleInfo + } + + func selectSubtitle(at index: Int) { + let subtitles = playerView.srtControl.subtitleInfos + if index < subtitles.count { + playerView.srtControl.selectedSubtitleInfo = subtitles[index] + } + } + + func disableSubtitles() { + playerView.srtControl.selectedSubtitleInfo = nil + } +} +``` + +### Subtitle Styling + +```swift +// Configure before creating player +SubtitleModel.textFontSize = 20 +SubtitleModel.textColor = .yellow +SubtitleModel.textBackgroundColor = Color.black.opacity(0.5) +SubtitleModel.textBold = true + +// Update during playback (VideoPlayerView only) +playerView.updateSrt() +``` + +## SwiftUI Integration + +### With KSVideoPlayer.Coordinator + +```swift +struct PlayerView: View { + @StateObject var coordinator = KSVideoPlayer.Coordinator() + + var body: some View { + VStack { + KSVideoPlayer(coordinator: coordinator, url: url, options: KSOptions()) + + // Subtitle picker + Picker("Subtitle", selection: $coordinator.subtitleModel.selectedSubtitleInfo) { + Text("Off").tag(nil as (any SubtitleInfo)?) + ForEach(coordinator.subtitleModel.subtitleInfos, id: \.subtitleID) { info in + Text(info.name).tag(info as (any SubtitleInfo)?) + } + } + } + } +} +``` + +### Adding External Subtitles + +```swift +func addSubtitle(url: URL) { + let info = URLSubtitleInfo(url: url) + coordinator.subtitleModel.addSubtitle(info: info) +} +``` + +### Searching Online Subtitles + +```swift +func searchSubtitles(title: String) { + coordinator.subtitleModel.searchSubtitle( + query: title, + languages: ["en", "es"] + ) +} +``` + +## TextPosition + +Subtitle text positioning: + +```swift +public struct TextPosition { + public var verticalAlign: VerticalAlignment = .bottom + public var horizontalAlign: HorizontalAlignment = .center + public var leftMargin: CGFloat = 0 + public var rightMargin: CGFloat = 0 + public var verticalMargin: CGFloat = 10 +} + +// Configure position +SubtitleModel.textPosition = TextPosition( + verticalAlign: .bottom, + horizontalAlign: .center, + verticalMargin: 50 +) +``` + +## Supported Subtitle Formats + +KSPlayer supports various subtitle formats through FFmpeg and built-in parsers: + +- **Text Formats**: SRT, ASS/SSA, VTT, TTML +- **Image Formats**: SUP/PGS, VobSub (IDX/SUB) +- **Embedded Subtitles**: From MKV, MP4, etc. + +## Parsing Subtitles Manually + +```swift +let subtitle = KSSubtitle() + +// Parse from URL +Task { + try await subtitle.parse(url: subtitleURL) + print("Loaded \(subtitle.parts.count) subtitle cues") +} + +// Parse from data +try subtitle.parse(data: subtitleData, encoding: .utf8) + +// Search for subtitle at time +let parts = subtitle.search(for: currentTime) +``` + +## Complete Example + +```swift +class SubtitlePlayerController: UIViewController, KSPlayerLayerDelegate { + private var playerLayer: KSPlayerLayer! + private var subtitleModel = SubtitleModel() + private var subtitleLabel = UILabel() + + override func viewDidLoad() { + super.viewDidLoad() + setupSubtitleLabel() + + // Configure subtitle sources + let subtitleSource = URLSubtitleDataSouce(urls: [ + URL(string: "https://example.com/english.srt")! + ]) + subtitleModel.addSubtitle(dataSouce: subtitleSource) + + // Create player + let url = URL(string: "https://example.com/video.mp4")! + playerLayer = KSPlayerLayer(url: url, options: KSOptions(), delegate: self) + subtitleModel.url = url + } + + func player(layer: KSPlayerLayer, state: KSPlayerState) { + if state == .readyToPlay { + // Add embedded subtitles + if let subtitleDataSource = layer.player.subtitleDataSouce { + subtitleModel.addSubtitle(dataSouce: subtitleDataSource) + } + + // Auto-select first subtitle + subtitleModel.selectedSubtitleInfo = subtitleModel.subtitleInfos.first + } + } + + func player(layer: KSPlayerLayer, currentTime: TimeInterval, totalTime: TimeInterval) { + if subtitleModel.subtitle(currentTime: currentTime) { + updateSubtitleDisplay() + } + } + + private func updateSubtitleDisplay() { + if let part = subtitleModel.parts.first { + subtitleLabel.attributedText = part.text + subtitleLabel.isHidden = false + } else { + subtitleLabel.isHidden = true + } + } +} +``` + diff --git a/docs/ks-player/SwiftUIUsage.md b/docs/ks-player/SwiftUIUsage.md new file mode 100644 index 00000000..c1fd8470 --- /dev/null +++ b/docs/ks-player/SwiftUIUsage.md @@ -0,0 +1,426 @@ +# SwiftUI Usage + +KSPlayer provides full SwiftUI support with `KSVideoPlayer` (a UIViewRepresentable) and `KSVideoPlayerView` (a complete player view with controls). + +**Minimum Requirements:** iOS 16.0, macOS 13.0, tvOS 16.0 + +## KSVideoPlayerView + +`KSVideoPlayerView` is a complete video player with built-in controls, subtitle display, and settings. + +### Basic Usage + +```swift +import KSPlayer +import SwiftUI + +struct VideoScreen: View { + let url = URL(string: "https://example.com/video.mp4")! + + var body: some View { + KSVideoPlayerView(url: url, options: KSOptions()) + } +} +``` + +### With Custom Title + +```swift +KSVideoPlayerView( + url: url, + options: KSOptions(), + title: "My Video Title" +) +``` + +### With Coordinator and Subtitle Data Source + +```swift +struct VideoScreen: View { + @StateObject private var coordinator = KSVideoPlayer.Coordinator() + let url: URL + let subtitleDataSource: SubtitleDataSouce? + + var body: some View { + KSVideoPlayerView( + coordinator: coordinator, + url: url, + options: KSOptions(), + title: "Video Title", + subtitleDataSouce: subtitleDataSource + ) + } +} +``` + +## KSVideoPlayer + +`KSVideoPlayer` is the lower-level UIViewRepresentable that provides the video rendering surface. Use this when you want full control over the UI. + +### Basic Usage + +```swift +import KSPlayer +import SwiftUI + +struct CustomPlayerView: View { + @StateObject private var coordinator = KSVideoPlayer.Coordinator() + let url: URL + let options: KSOptions + + var body: some View { + KSVideoPlayer(coordinator: coordinator, url: url, options: options) + .onStateChanged { layer, state in + print("State changed: \(state)") + } + .onPlay { currentTime, totalTime in + print("Playing: \(currentTime)/\(totalTime)") + } + .onFinish { layer, error in + if let error = error { + print("Error: \(error)") + } + } + } +} +``` + +### Initializer + +```swift +public struct KSVideoPlayer { + public init( + coordinator: Coordinator, + url: URL, + options: KSOptions + ) +} +``` + +## KSVideoPlayer.Coordinator + +The Coordinator manages player state and provides bindings for SwiftUI views. + +### Creating a Coordinator + +```swift +@StateObject private var coordinator = KSVideoPlayer.Coordinator() +``` + +### Published Properties + +```swift +@MainActor +public final class Coordinator: ObservableObject { + // Playback state (read-only computed property) + public var state: KSPlayerState { get } + + // Mute control + @Published public var isMuted: Bool = false + + // Volume (0.0 to 1.0) + @Published public var playbackVolume: Float = 1.0 + + // Content mode toggle + @Published public var isScaleAspectFill: Bool = false + + // Playback rate (1.0 = normal) + @Published public var playbackRate: Float = 1.0 + + // Controls visibility + @Published public var isMaskShow: Bool = true + + // Subtitle model + public var subtitleModel: SubtitleModel + + // Time model for progress display + public var timemodel: ControllerTimeModel + + // The underlying player layer + public var playerLayer: KSPlayerLayer? +} +``` + +### Coordinator Methods + +```swift +// Skip forward/backward by seconds +public func skip(interval: Int) + +// Seek to specific time +public func seek(time: TimeInterval) + +// Show/hide controls with optional auto-hide +public func mask(show: Bool, autoHide: Bool = true) + +// Reset player state (called automatically on view dismissal) +public func resetPlayer() +``` + +### Using Coordinator for Playback Control + +```swift +struct PlayerView: View { + @StateObject private var coordinator = KSVideoPlayer.Coordinator() + let url: URL + + var body: some View { + VStack { + KSVideoPlayer(coordinator: coordinator, url: url, options: KSOptions()) + + HStack { + Button("Play") { + coordinator.playerLayer?.play() + } + + Button("Pause") { + coordinator.playerLayer?.pause() + } + + Button("-15s") { + coordinator.skip(interval: -15) + } + + Button("+15s") { + coordinator.skip(interval: 15) + } + } + + Slider(value: $coordinator.playbackVolume, in: 0...1) + + Toggle("Mute", isOn: $coordinator.isMuted) + } + } +} +``` + +## View Modifiers + +### onStateChanged + +Called when playback state changes: + +```swift +KSVideoPlayer(coordinator: coordinator, url: url, options: options) + .onStateChanged { layer, state in + switch state { + case .initialized: break + case .preparing: break + case .readyToPlay: + // Access metadata + if let title = layer.player.dynamicInfo?.metadata["title"] { + print("Title: \(title)") + } + case .buffering: break + case .bufferFinished: break + case .paused: break + case .playedToTheEnd: break + case .error: break + } + } +``` + +### onPlay + +Called periodically during playback with current and total time: + +```swift +.onPlay { currentTime, totalTime in + let progress = currentTime / totalTime + print("Progress: \(Int(progress * 100))%") +} +``` + +### onFinish + +Called when playback ends (naturally or with error): + +```swift +.onFinish { layer, error in + if let error = error { + print("Playback failed: \(error.localizedDescription)") + } else { + print("Playback completed") + } +} +``` + +### onBufferChanged + +Called when buffering status changes: + +```swift +.onBufferChanged { bufferedCount, consumeTime in + // bufferedCount: 0 = initial loading + print("Buffer count: \(bufferedCount), time: \(consumeTime)") +} +``` + +### onSwipe (iOS only) + +Called on swipe gestures: + +```swift +#if canImport(UIKit) +.onSwipe { direction in + switch direction { + case .up: print("Swipe up") + case .down: print("Swipe down") + case .left: print("Swipe left") + case .right: print("Swipe right") + default: break + } +} +#endif +``` + +## ControllerTimeModel + +Used for displaying playback time: + +```swift +public class ControllerTimeModel: ObservableObject { + @Published public var currentTime: Int = 0 + @Published public var totalTime: Int = 1 +} +``` + +Usage: + +```swift +struct TimeDisplay: View { + @ObservedObject var timeModel: ControllerTimeModel + + var body: some View { + Text("\(timeModel.currentTime) / \(timeModel.totalTime)") + } +} + +// In your player view: +TimeDisplay(timeModel: coordinator.timemodel) +``` + +## Subtitle Integration + +Access subtitles through the coordinator: + +```swift +struct SubtitlePicker: View { + @ObservedObject var subtitleModel: SubtitleModel + + var body: some View { + Picker("Subtitle", selection: $subtitleModel.selectedSubtitleInfo) { + Text("Off").tag(nil as (any SubtitleInfo)?) + ForEach(subtitleModel.subtitleInfos, id: \.subtitleID) { info in + Text(info.name).tag(info as (any SubtitleInfo)?) + } + } + } +} + +// Usage: +SubtitlePicker(subtitleModel: coordinator.subtitleModel) +``` + +## Complete Example + +```swift +import KSPlayer +import SwiftUI + +@available(iOS 16.0, *) +struct FullPlayerView: View { + @StateObject private var coordinator = KSVideoPlayer.Coordinator() + @State private var url: URL + @State private var title: String + @Environment(\.dismiss) private var dismiss + + init(url: URL, title: String) { + _url = State(initialValue: url) + _title = State(initialValue: title) + } + + var body: some View { + ZStack { + KSVideoPlayer(coordinator: coordinator, url: url, options: KSOptions()) + .onStateChanged { layer, state in + if state == .readyToPlay { + if let movieTitle = layer.player.dynamicInfo?.metadata["title"] { + title = movieTitle + } + } + } + .onFinish { _, error in + if error != nil { + dismiss() + } + } + .ignoresSafeArea() + .onTapGesture { + coordinator.isMaskShow.toggle() + } + + // Custom controls overlay + if coordinator.isMaskShow { + VStack { + HStack { + Button("Back") { dismiss() } + Spacer() + Text(title) + } + .padding() + + Spacer() + + HStack(spacing: 40) { + Button(action: { coordinator.skip(interval: -15) }) { + Image(systemName: "gobackward.15") + } + + Button(action: { + if coordinator.state.isPlaying { + coordinator.playerLayer?.pause() + } else { + coordinator.playerLayer?.play() + } + }) { + Image(systemName: coordinator.state.isPlaying ? "pause.fill" : "play.fill") + } + + Button(action: { coordinator.skip(interval: 15) }) { + Image(systemName: "goforward.15") + } + } + .font(.largeTitle) + + Spacer() + } + .foregroundColor(.white) + } + } + .preferredColorScheme(.dark) + } +} +``` + +## URL Change Handling + +The player automatically detects URL changes: + +```swift +struct DynamicPlayerView: View { + @StateObject private var coordinator = KSVideoPlayer.Coordinator() + @State private var currentURL: URL + + var body: some View { + VStack { + KSVideoPlayer(coordinator: coordinator, url: currentURL, options: KSOptions()) + + Button("Load Next Video") { + currentURL = URL(string: "https://example.com/next-video.mp4")! + } + } + } +} +``` + diff --git a/docs/ks-player/TrackManagement.md b/docs/ks-player/TrackManagement.md new file mode 100644 index 00000000..f8eefd82 --- /dev/null +++ b/docs/ks-player/TrackManagement.md @@ -0,0 +1,473 @@ +# Track Management + +KSPlayer provides APIs for managing audio, video, and subtitle tracks within media files. + +## Overview + +Tracks represent individual streams within a media container (video tracks, audio tracks, subtitle tracks). You can: +- Query available tracks +- Get track metadata +- Select/enable specific tracks + +## Getting Tracks + +### From MediaPlayerProtocol + +```swift +// Get audio tracks +let audioTracks = player.tracks(mediaType: .audio) + +// Get video tracks +let videoTracks = player.tracks(mediaType: .video) + +// Get subtitle tracks +let subtitleTracks = player.tracks(mediaType: .subtitle) +``` + +### From KSPlayerLayer + +```swift +if let player = playerLayer.player { + let audioTracks = player.tracks(mediaType: .audio) + // ... +} +``` + +### From VideoPlayerView + +```swift +if let player = playerView.playerLayer?.player { + let tracks = player.tracks(mediaType: .audio) + // ... +} +``` + +### From SwiftUI Coordinator + +```swift +let audioTracks = coordinator.playerLayer?.player.tracks(mediaType: .audio) ?? [] +``` + +## MediaPlayerTrack Protocol + +All tracks conform to `MediaPlayerTrack`: + +```swift +public protocol MediaPlayerTrack: AnyObject, CustomStringConvertible { + var trackID: Int32 { get } + var name: String { get } + var languageCode: String? { get } + var mediaType: AVFoundation.AVMediaType { get } + var nominalFrameRate: Float { get set } + var bitRate: Int64 { get } + var bitDepth: Int32 { get } + var isEnabled: Bool { get set } + var isImageSubtitle: Bool { get } + var rotation: Int16 { get } + var dovi: DOVIDecoderConfigurationRecord? { get } + var fieldOrder: FFmpegFieldOrder { get } + var formatDescription: CMFormatDescription? { get } +} +``` + +## Track Properties + +### Basic Properties + +| Property | Type | Description | +|----------|------|-------------| +| `trackID` | `Int32` | Unique track identifier | +| `name` | `String` | Track name (often empty) | +| `languageCode` | `String?` | ISO 639-1/639-2 language code | +| `mediaType` | `AVMediaType` | `.audio`, `.video`, or `.subtitle` | +| `isEnabled` | `Bool` | Whether track is currently active | + +### Audio Properties + +| Property | Type | Description | +|----------|------|-------------| +| `bitRate` | `Int64` | Audio bitrate in bps | +| `audioStreamBasicDescription` | `AudioStreamBasicDescription?` | Core Audio format info | + +### Video Properties + +| Property | Type | Description | +|----------|------|-------------| +| `naturalSize` | `CGSize` | Video dimensions | +| `nominalFrameRate` | `Float` | Frame rate | +| `bitRate` | `Int64` | Video bitrate in bps | +| `bitDepth` | `Int32` | Color depth (8, 10, 12) | +| `rotation` | `Int16` | Rotation in degrees | +| `fieldOrder` | `FFmpegFieldOrder` | Interlacing type | +| `dynamicRange` | `DynamicRange?` | SDR/HDR/Dolby Vision | +| `dovi` | `DOVIDecoderConfigurationRecord?` | Dolby Vision config | + +### Color Properties + +| Property | Type | Description | +|----------|------|-------------| +| `colorPrimaries` | `String?` | Color primaries (e.g., "ITU_R_709_2") | +| `transferFunction` | `String?` | Transfer function | +| `yCbCrMatrix` | `String?` | YCbCr matrix | +| `colorSpace` | `CGColorSpace?` | Computed color space | + +### Subtitle Properties + +| Property | Type | Description | +|----------|------|-------------| +| `isImageSubtitle` | `Bool` | True for bitmap subtitles (SUP, VobSub) | + +### Computed Properties + +```swift +extension MediaPlayerTrack { + // Localized language name + var language: String? { + languageCode.flatMap { Locale.current.localizedString(forLanguageCode: $0) } + } + + // FourCC codec type + var codecType: FourCharCode + + // Video format subtype + var mediaSubType: CMFormatDescription.MediaSubType +} +``` + +## Selecting Tracks + +### Select a Track + +```swift +// Find English audio track +if let englishTrack = audioTracks.first(where: { $0.languageCode == "en" }) { + player.select(track: englishTrack) +} +``` + +### Select Track by Index + +```swift +let audioTracks = player.tracks(mediaType: .audio) +if audioTracks.count > 1 { + player.select(track: audioTracks[1]) +} +``` + +### Check Currently Selected Track + +```swift +let currentAudio = audioTracks.first(where: { $0.isEnabled }) +print("Current audio: \(currentAudio?.name ?? "none")") +``` + +## Track Selection Examples + +### Audio Track Selection + +```swift +func selectAudioTrack(languageCode: String) { + let audioTracks = player.tracks(mediaType: .audio) + + if let track = audioTracks.first(where: { $0.languageCode == languageCode }) { + player.select(track: track) + print("Selected: \(track.language ?? track.name)") + } +} + +// Usage +selectAudioTrack(languageCode: "en") // English +selectAudioTrack(languageCode: "es") // Spanish +selectAudioTrack(languageCode: "ja") // Japanese +``` + +### Video Track Selection (Multi-angle/quality) + +```swift +func selectVideoTrack(preferredBitrate: Int64) { + let videoTracks = player.tracks(mediaType: .video) + + // Find closest bitrate + let sorted = videoTracks.sorted { + abs($0.bitRate - preferredBitrate) < abs($1.bitRate - preferredBitrate) + } + + if let track = sorted.first { + player.select(track: track) + print("Selected video: \(track.naturalSize.width)x\(track.naturalSize.height)") + } +} +``` + +### HDR Track Selection + +```swift +func selectHDRTrack() { + let videoTracks = player.tracks(mediaType: .video) + + // Prefer Dolby Vision, then HDR10, then SDR + let preferredOrder: [DynamicRange] = [.dolbyVision, .hdr10, .hlg, .sdr] + + for range in preferredOrder { + if let track = videoTracks.first(where: { $0.dynamicRange == range }) { + player.select(track: track) + print("Selected: \(range)") + return + } + } +} +``` + +## UIKit Track Selection UI + +### Using UIAlertController + +```swift +func showAudioTrackPicker() { + guard let player = playerLayer?.player else { return } + + let audioTracks = player.tracks(mediaType: .audio) + guard !audioTracks.isEmpty else { return } + + let alert = UIAlertController( + title: "Select Audio Track", + message: nil, + preferredStyle: .actionSheet + ) + + for track in audioTracks { + let title = track.language ?? track.name + let action = UIAlertAction(title: title, style: .default) { _ in + player.select(track: track) + } + + if track.isEnabled { + action.setValue(true, forKey: "checked") + } + + alert.addAction(action) + } + + alert.addAction(UIAlertAction(title: "Cancel", style: .cancel)) + present(alert, animated: true) +} +``` + +### Track Info Display + +```swift +func displayTrackInfo() { + guard let player = playerLayer?.player else { return } + + // Video info + if let videoTrack = player.tracks(mediaType: .video).first(where: { $0.isEnabled }) { + print("Video: \(videoTrack.naturalSize.width)x\(videoTrack.naturalSize.height)") + print("FPS: \(videoTrack.nominalFrameRate)") + print("Bitrate: \(videoTrack.bitRate / 1000) kbps") + print("HDR: \(videoTrack.dynamicRange?.description ?? "SDR")") + } + + // Audio info + if let audioTrack = player.tracks(mediaType: .audio).first(where: { $0.isEnabled }) { + print("Audio: \(audioTrack.language ?? "Unknown")") + print("Bitrate: \(audioTrack.bitRate / 1000) kbps") + } +} +``` + +## SwiftUI Track Selection + +### Audio Track Picker + +```swift +struct AudioTrackPicker: View { + let player: MediaPlayerProtocol? + + var audioTracks: [MediaPlayerTrack] { + player?.tracks(mediaType: .audio) ?? [] + } + + var body: some View { + Menu { + ForEach(audioTracks, id: \.trackID) { track in + Button { + player?.select(track: track) + } label: { + HStack { + Text(track.language ?? track.name) + if track.isEnabled { + Image(systemName: "checkmark") + } + } + } + } + } label: { + Image(systemName: "waveform.circle.fill") + } + } +} +``` + +### Video Track Picker + +```swift +struct VideoTrackPicker: View { + let player: MediaPlayerProtocol? + + var videoTracks: [MediaPlayerTrack] { + player?.tracks(mediaType: .video) ?? [] + } + + var body: some View { + Picker("Video", selection: Binding( + get: { videoTracks.first(where: { $0.isEnabled })?.trackID }, + set: { newValue in + if let track = videoTracks.first(where: { $0.trackID == newValue }) { + player?.select(track: track) + } + } + )) { + ForEach(videoTracks, id: \.trackID) { track in + Text("\(Int(track.naturalSize.width))x\(Int(track.naturalSize.height))") + .tag(track.trackID as Int32?) + } + } + } +} +``` + +## Automatic Track Selection + +Configure `KSOptions` for automatic track selection: + +```swift +class CustomOptions: KSOptions { + // Prefer English audio + override func wantedAudio(tracks: [MediaPlayerTrack]) -> Int? { + if let index = tracks.firstIndex(where: { $0.languageCode == "en" }) { + return index + } + return nil // Use default selection + } + + // Prefer highest quality video + override func wantedVideo(tracks: [MediaPlayerTrack]) -> Int? { + if let index = tracks.enumerated().max(by: { $0.element.bitRate < $1.element.bitRate })?.offset { + return index + } + return nil + } +} +``` + +## Track Events + +### Detecting Track Changes + +```swift +func player(layer: KSPlayerLayer, state: KSPlayerState) { + if state == .readyToPlay { + let player = layer.player + + // Log available tracks + print("Audio tracks: \(player.tracks(mediaType: .audio).count)") + print("Video tracks: \(player.tracks(mediaType: .video).count)") + print("Subtitle tracks: \(player.tracks(mediaType: .subtitle).count)") + + // Get current selections + let currentAudio = player.tracks(mediaType: .audio).first(where: { $0.isEnabled }) + let currentVideo = player.tracks(mediaType: .video).first(where: { $0.isEnabled }) + + print("Current audio: \(currentAudio?.language ?? "unknown")") + print("Current video: \(currentVideo?.naturalSize ?? .zero)") + } +} +``` + +## Complete Example + +```swift +class TrackSelectionController: UIViewController, KSPlayerLayerDelegate { + private var playerLayer: KSPlayerLayer! + private var audioButton: UIButton! + private var videoInfoLabel: UILabel! + + override func viewDidLoad() { + super.viewDidLoad() + setupUI() + + let url = URL(string: "https://example.com/multi-track-video.mkv")! + playerLayer = KSPlayerLayer(url: url, options: KSOptions(), delegate: self) + } + + func player(layer: KSPlayerLayer, state: KSPlayerState) { + if state == .readyToPlay { + updateTrackUI() + } + } + + private func updateTrackUI() { + guard let player = playerLayer?.player else { return } + + // Update video info + if let video = player.tracks(mediaType: .video).first(where: { $0.isEnabled }) { + videoInfoLabel.text = """ + \(Int(video.naturalSize.width))x\(Int(video.naturalSize.height)) @ \(Int(video.nominalFrameRate))fps + \(video.dynamicRange?.description ?? "SDR") + """ + } + + // Update audio button + let audioCount = player.tracks(mediaType: .audio).count + audioButton.isHidden = audioCount < 2 + + if let audio = player.tracks(mediaType: .audio).first(where: { $0.isEnabled }) { + audioButton.setTitle(audio.language ?? "Audio", for: .normal) + } + } + + @objc private func audioButtonTapped() { + guard let player = playerLayer?.player else { return } + + let tracks = player.tracks(mediaType: .audio) + let alert = UIAlertController(title: "Audio Track", message: nil, preferredStyle: .actionSheet) + + for track in tracks { + let title = [track.language, track.name] + .compactMap { $0 } + .joined(separator: " - ") + + let action = UIAlertAction(title: title.isEmpty ? "Track \(track.trackID)" : title, style: .default) { [weak self] _ in + player.select(track: track) + self?.updateTrackUI() + } + + if track.isEnabled { + action.setValue(true, forKey: "checked") + alert.preferredAction = action + } + + alert.addAction(action) + } + + alert.addAction(UIAlertAction(title: "Cancel", style: .cancel)) + present(alert, animated: true) + } + + private func setupUI() { + audioButton = UIButton(type: .system) + audioButton.addTarget(self, action: #selector(audioButtonTapped), for: .touchUpInside) + view.addSubview(audioButton) + + videoInfoLabel = UILabel() + videoInfoLabel.numberOfLines = 0 + view.addSubview(videoInfoLabel) + } + + // Delegate methods... + func player(layer: KSPlayerLayer, currentTime: TimeInterval, totalTime: TimeInterval) {} + func player(layer: KSPlayerLayer, finish error: Error?) {} + func player(layer: KSPlayerLayer, bufferedCount: Int, consumeTime: TimeInterval) {} +} +``` + diff --git a/docs/ks-player/TypesAndProtocols.md b/docs/ks-player/TypesAndProtocols.md new file mode 100644 index 00000000..c8b1eb0e --- /dev/null +++ b/docs/ks-player/TypesAndProtocols.md @@ -0,0 +1,543 @@ +# Types and Protocols + +This reference documents all core types, protocols, and enums in KSPlayer. + +## Protocols + +### MediaPlayerProtocol + +The main protocol that player implementations (`KSAVPlayer`, `KSMEPlayer`) must conform to. + +```swift +public protocol MediaPlayerProtocol: MediaPlayback { + var delegate: MediaPlayerDelegate? { get set } + var view: UIView? { get } + var playableTime: TimeInterval { get } + var isReadyToPlay: Bool { get } + var playbackState: MediaPlaybackState { get } + var loadState: MediaLoadState { get } + var isPlaying: Bool { get } + var seekable: Bool { get } + var isMuted: Bool { get set } + var allowsExternalPlayback: Bool { get set } + var usesExternalPlaybackWhileExternalScreenIsActive: Bool { get set } + var isExternalPlaybackActive: Bool { get } + var playbackRate: Float { get set } + var playbackVolume: Float { get set } + var contentMode: UIViewContentMode { get set } + var subtitleDataSouce: SubtitleDataSouce? { get } + var dynamicInfo: DynamicInfo? { get } + + @available(macOS 12.0, iOS 15.0, tvOS 15.0, *) + var playbackCoordinator: AVPlaybackCoordinator { get } + + @available(tvOS 14.0, *) + var pipController: KSPictureInPictureController? { get } + + init(url: URL, options: KSOptions) + func replace(url: URL, options: KSOptions) + func play() + func pause() + func enterBackground() + func enterForeground() + func thumbnailImageAtCurrentTime() async -> CGImage? + func tracks(mediaType: AVFoundation.AVMediaType) -> [MediaPlayerTrack] + func select(track: some MediaPlayerTrack) +} +``` + +### MediaPlayback + +Base protocol for playback functionality: + +```swift +public protocol MediaPlayback: AnyObject { + var duration: TimeInterval { get } + var fileSize: Double { get } + var naturalSize: CGSize { get } + var chapters: [Chapter] { get } + var currentPlaybackTime: TimeInterval { get } + + func prepareToPlay() + func shutdown() + func seek(time: TimeInterval, completion: @escaping ((Bool) -> Void)) +} +``` + +### MediaPlayerDelegate + +Delegate for receiving player events: + +```swift +@MainActor +public protocol MediaPlayerDelegate: AnyObject { + func readyToPlay(player: some MediaPlayerProtocol) + func changeLoadState(player: some MediaPlayerProtocol) + func changeBuffering(player: some MediaPlayerProtocol, progress: Int) + func playBack(player: some MediaPlayerProtocol, loopCount: Int) + func finish(player: some MediaPlayerProtocol, error: Error?) +} +``` + +### MediaPlayerTrack + +Protocol for audio/video/subtitle track information: + +```swift +public protocol MediaPlayerTrack: AnyObject, CustomStringConvertible { + var trackID: Int32 { get } + var name: String { get } + var languageCode: String? { get } + var mediaType: AVFoundation.AVMediaType { get } + var nominalFrameRate: Float { get set } + var bitRate: Int64 { get } + var bitDepth: Int32 { get } + var isEnabled: Bool { get set } + var isImageSubtitle: Bool { get } + var rotation: Int16 { get } + var dovi: DOVIDecoderConfigurationRecord? { get } + var fieldOrder: FFmpegFieldOrder { get } + var formatDescription: CMFormatDescription? { get } +} +``` + +#### Extension Properties + +```swift +extension MediaPlayerTrack { + var language: String? // Localized language name + var codecType: FourCharCode + var dynamicRange: DynamicRange? + var colorSpace: CGColorSpace? + var mediaSubType: CMFormatDescription.MediaSubType + var audioStreamBasicDescription: AudioStreamBasicDescription? + var naturalSize: CGSize + var colorPrimaries: String? + var transferFunction: String? + var yCbCrMatrix: String? +} +``` + +### KSPlayerLayerDelegate + +Delegate for `KSPlayerLayer` events: + +```swift +@MainActor +public protocol KSPlayerLayerDelegate: AnyObject { + func player(layer: KSPlayerLayer, state: KSPlayerState) + func player(layer: KSPlayerLayer, currentTime: TimeInterval, totalTime: TimeInterval) + func player(layer: KSPlayerLayer, finish error: Error?) + func player(layer: KSPlayerLayer, bufferedCount: Int, consumeTime: TimeInterval) +} +``` + +### PlayerControllerDelegate + +Delegate for `PlayerView` events: + +```swift +public protocol PlayerControllerDelegate: AnyObject { + func playerController(state: KSPlayerState) + func playerController(currentTime: TimeInterval, totalTime: TimeInterval) + func playerController(finish error: Error?) + func playerController(maskShow: Bool) + func playerController(action: PlayerButtonType) + func playerController(bufferedCount: Int, consumeTime: TimeInterval) + func playerController(seek: TimeInterval) +} +``` + +### CapacityProtocol + +Buffer capacity information: + +```swift +public protocol CapacityProtocol { + var fps: Float { get } + var packetCount: Int { get } + var frameCount: Int { get } + var frameMaxCount: Int { get } + var isEndOfFile: Bool { get } + var mediaType: AVFoundation.AVMediaType { get } +} +``` + +## Enums + +### KSPlayerState + +Player state enumeration: + +```swift +public enum KSPlayerState: CustomStringConvertible { + case initialized // Player created + case preparing // Loading media + case readyToPlay // Ready to start playback + case buffering // Buffering data + case bufferFinished // Buffer sufficient, playing + case paused // Playback paused + case playedToTheEnd // Reached end of media + case error // Error occurred + + public var isPlaying: Bool // true for .buffering or .bufferFinished +} +``` + +### MediaPlaybackState + +Low-level playback state: + +```swift +public enum MediaPlaybackState: Int { + case idle + case playing + case paused + case seeking + case finished + case stopped +} +``` + +### MediaLoadState + +Loading state: + +```swift +public enum MediaLoadState: Int { + case idle + case loading + case playable +} +``` + +### DynamicRange + +HDR/SDR content range: + +```swift +public enum DynamicRange: Int32 { + case sdr = 0 + case hdr10 = 2 + case hlg = 3 + case dolbyVision = 5 + + static var availableHDRModes: [DynamicRange] // Device-supported modes +} +``` + +### DisplayEnum + +Video display mode: + +```swift +@MainActor +public enum DisplayEnum { + case plane // Normal 2D display + case vr // VR mode (spherical) + case vrBox // VR Box mode (side-by-side) +} +``` + +### FFmpegFieldOrder + +Video interlacing: + +```swift +public enum FFmpegFieldOrder: UInt8 { + case unknown = 0 + case progressive + case tt // Top coded first, top displayed first + case bb // Bottom coded first, bottom displayed first + case tb // Top coded first, bottom displayed first + case bt // Bottom coded first, top displayed first +} +``` + +### VideoInterlacingType + +Detected interlacing type: + +```swift +public enum VideoInterlacingType: String { + case tff // Top field first + case bff // Bottom field first + case progressive // Progressive scan + case undetermined +} +``` + +### ClockProcessType + +Internal clock synchronization: + +```swift +public enum ClockProcessType { + case remain + case next + case dropNextFrame + case dropNextPacket + case dropGOPPacket + case flush + case seek +} +``` + +### PlayerButtonType + +UI button types: + +```swift +public enum PlayerButtonType: Int { + case play = 101 + case pause + case back + case srt // Subtitles + case landscape // Fullscreen + case replay + case lock + case rate // Playback speed + case definition // Quality + case pictureInPicture + case audioSwitch + case videoSwitch +} +``` + +### KSPlayerTopBarShowCase + +Top bar visibility: + +```swift +public enum KSPlayerTopBarShowCase { + case always // Always show + case horizantalOnly // Only in landscape + case none // Never show +} +``` + +### KSPanDirection + +Gesture direction: + +```swift +public enum KSPanDirection { + case horizontal + case vertical +} +``` + +### TimeType + +Time formatting: + +```swift +public enum TimeType { + case min // MM:SS + case hour // H:MM:SS + case minOrHour // MM:SS or H:MM:SS based on duration + case millisecond // HH:MM:SS.ms +} +``` + +### LogLevel + +Logging levels: + +```swift +public enum LogLevel: Int32 { + case panic = 0 + case fatal = 8 + case error = 16 + case warning = 24 + case info = 32 + case verbose = 40 + case debug = 48 + case trace = 56 +} +``` + +## Structs + +### Chapter + +Video chapter information: + +```swift +public struct Chapter { + public let start: TimeInterval + public let end: TimeInterval + public let title: String +} +``` + +### LoadingState + +Buffer loading state: + +```swift +public struct LoadingState { + public let loadedTime: TimeInterval + public let progress: TimeInterval + public let packetCount: Int + public let frameCount: Int + public let isEndOfFile: Bool + public let isPlayable: Bool + public let isFirst: Bool + public let isSeek: Bool +} +``` + +### VideoAdaptationState + +Adaptive bitrate state: + +```swift +public struct VideoAdaptationState { + public struct BitRateState { + let bitRate: Int64 + let time: TimeInterval + } + + public let bitRates: [Int64] + public let duration: TimeInterval + public internal(set) var fps: Float + public internal(set) var bitRateStates: [BitRateState] + public internal(set) var currentPlaybackTime: TimeInterval + public internal(set) var isPlayable: Bool + public internal(set) var loadedCount: Int +} +``` + +### DOVIDecoderConfigurationRecord + +Dolby Vision configuration: + +```swift +public struct DOVIDecoderConfigurationRecord { + public let dv_version_major: UInt8 + public let dv_version_minor: UInt8 + public let dv_profile: UInt8 + public let dv_level: UInt8 + public let rpu_present_flag: UInt8 + public let el_present_flag: UInt8 + public let bl_present_flag: UInt8 + public let dv_bl_signal_compatibility_id: UInt8 +} +``` + +### KSClock + +Internal clock for A/V sync: + +```swift +public struct KSClock { + public private(set) var lastMediaTime: CFTimeInterval + public internal(set) var position: Int64 + public internal(set) var time: CMTime + + func getTime() -> TimeInterval +} +``` + +### TextPosition + +Subtitle text positioning: + +```swift +public struct TextPosition { + public var verticalAlign: VerticalAlignment = .bottom + public var horizontalAlign: HorizontalAlignment = .center + public var leftMargin: CGFloat = 0 + public var rightMargin: CGFloat = 0 + public var verticalMargin: CGFloat = 10 + public var edgeInsets: EdgeInsets { get } +} +``` + +## Classes + +### DynamicInfo + +Runtime playback information: + +```swift +public class DynamicInfo: ObservableObject { + public var metadata: [String: String] // Media metadata + public var bytesRead: Int64 // Bytes transferred + public var audioBitrate: Int // Current audio bitrate + public var videoBitrate: Int // Current video bitrate + + @Published + public var displayFPS: Double = 0.0 // Current display FPS + public var audioVideoSyncDiff: Double = 0.0 // A/V sync difference + public var droppedVideoFrameCount: UInt32 // Dropped frames + public var droppedVideoPacketCount: UInt32 // Dropped packets +} +``` + +## Error Handling + +### KSPlayerErrorCode + +```swift +public enum KSPlayerErrorCode: Int { + case unknown + case formatCreate + case formatOpenInput + case formatOutputCreate + case formatWriteHeader + case formatFindStreamInfo + case readFrame + case codecContextCreate + case codecContextSetParam + case codecContextFindDecoder + case codesContextOpen + case codecVideoSendPacket + case codecAudioSendPacket + case codecVideoReceiveFrame + case codecAudioReceiveFrame + case auidoSwrInit + case codecSubtitleSendPacket + case videoTracksUnplayable + case subtitleUnEncoding + case subtitleUnParse + case subtitleFormatUnSupport + case subtitleParamsEmpty +} +``` + +### Error Domain + +```swift +public let KSPlayerErrorDomain = "KSPlayerErrorDomain" +``` + +## Extensions + +### TimeInterval Formatting + +```swift +extension TimeInterval { + func toString(for type: TimeType) -> String +} + +// Example: +let time: TimeInterval = 3661 // 1 hour, 1 minute, 1 second +time.toString(for: .min) // "61:01" +time.toString(for: .hour) // "1:01:01" +time.toString(for: .minOrHour) // "1:01:01" +``` + +### Int Formatting + +```swift +extension Int { + func toString(for type: TimeType) -> String +} + +extension FixedWidthInteger { + var kmFormatted: String // "1.5K", "2.3M", etc. +} +``` + diff --git a/docs/ks-player/UIKitUsage.md b/docs/ks-player/UIKitUsage.md new file mode 100644 index 00000000..7b67f1b2 --- /dev/null +++ b/docs/ks-player/UIKitUsage.md @@ -0,0 +1,337 @@ +# UIKit Usage + +This guide covers using KSPlayer with UIKit in iOS applications. + +## IOSVideoPlayerView + +`IOSVideoPlayerView` is the main UIKit video player view for iOS. It extends `VideoPlayerView` with iOS-specific features like fullscreen, gestures, and AirPlay. + +### Basic Setup + +```swift +import KSPlayer + +class VideoViewController: UIViewController { + private var playerView: IOSVideoPlayerView! + + override func viewDidLoad() { + super.viewDidLoad() + + playerView = IOSVideoPlayerView() + view.addSubview(playerView) + + playerView.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate([ + playerView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), + playerView.leadingAnchor.constraint(equalTo: view.leadingAnchor), + playerView.trailingAnchor.constraint(equalTo: view.trailingAnchor), + playerView.bottomAnchor.constraint(equalTo: view.bottomAnchor), + ]) + } +} +``` + +### Setting Video URL + +#### Simple URL + +```swift +let url = URL(string: "https://example.com/video.mp4")! +playerView.set(url: url, options: KSOptions()) +``` + +#### With KSPlayerResource + +```swift +let resource = KSPlayerResource( + url: URL(string: "https://example.com/video.mp4")!, + options: KSOptions(), + name: "Video Title", + cover: URL(string: "https://example.com/cover.jpg"), + subtitleURLs: [URL(string: "https://example.com/subtitle.srt")!] +) +playerView.set(resource: resource) +``` + +#### Multiple Definitions (Quality Options) + +```swift +let hdDefinition = KSPlayerResourceDefinition( + url: URL(string: "https://example.com/video_hd.mp4")!, + definition: "1080p", + options: KSOptions() +) + +let sdDefinition = KSPlayerResourceDefinition( + url: URL(string: "https://example.com/video_sd.mp4")!, + definition: "480p", + options: KSOptions() +) + +let resource = KSPlayerResource( + name: "Video Title", + definitions: [hdDefinition, sdDefinition], + cover: URL(string: "https://example.com/cover.jpg") +) + +playerView.set(resource: resource, definitionIndex: 0) +``` + +### KSPlayerResource + +```swift +public class KSPlayerResource { + public let name: String + public let definitions: [KSPlayerResourceDefinition] + public let cover: URL? + public let subtitleDataSouce: SubtitleDataSouce? + public var nowPlayingInfo: KSNowPlayableMetadata? + + // Convenience initializer for single URL + public convenience init( + url: URL, + options: KSOptions = KSOptions(), + name: String = "", + cover: URL? = nil, + subtitleURLs: [URL]? = nil + ) + + // Full initializer + public init( + name: String, + definitions: [KSPlayerResourceDefinition], + cover: URL? = nil, + subtitleDataSouce: SubtitleDataSouce? = nil + ) +} +``` + +### KSPlayerResourceDefinition + +```swift +public struct KSPlayerResourceDefinition { + public let url: URL + public let definition: String + public let options: KSOptions + + public init(url: URL, definition: String, options: KSOptions = KSOptions()) +} +``` + +### PlayerControllerDelegate + +Implement `PlayerControllerDelegate` to receive playback events: + +```swift +class VideoViewController: UIViewController, PlayerControllerDelegate { + override func viewDidLoad() { + super.viewDidLoad() + playerView.delegate = self + } + + func playerController(state: KSPlayerState) { + switch state { + case .initialized: + print("Player initialized") + case .preparing: + print("Preparing to play") + case .readyToPlay: + print("Ready to play") + case .buffering: + print("Buffering...") + case .bufferFinished: + print("Buffer finished, playing") + case .paused: + print("Paused") + case .playedToTheEnd: + print("Playback completed") + case .error: + print("Error occurred") + } + } + + func playerController(currentTime: TimeInterval, totalTime: TimeInterval) { + // Called periodically during playback + print("Progress: \(currentTime)/\(totalTime)") + } + + func playerController(finish error: Error?) { + if let error = error { + print("Playback error: \(error)") + } else { + print("Playback finished") + } + } + + func playerController(maskShow: Bool) { + // Controls visibility changed + } + + func playerController(action: PlayerButtonType) { + // Button pressed + } + + func playerController(bufferedCount: Int, consumeTime: TimeInterval) { + // Buffer status update (bufferedCount: 0 = first load) + } + + func playerController(seek: TimeInterval) { + // Seek completed + } +} +``` + +### Playback Control + +```swift +// Play +playerView.play() + +// Pause +playerView.pause() + +// Seek to time +playerView.seek(time: 30.0) { finished in + print("Seek completed: \(finished)") +} + +// Reset player +playerView.resetPlayer() +``` + +### Time Callbacks + +```swift +// Listen to time changes +playerView.playTimeDidChange = { currentTime, totalTime in + print("Current: \(currentTime), Total: \(totalTime)") +} + +// Back button handler +playerView.backBlock = { [weak self] in + self?.navigationController?.popViewController(animated: true) +} +``` + +### Fullscreen Control + +```swift +// Check if in fullscreen +let isFullscreen = playerView.landscapeButton.isSelected + +// Toggle fullscreen +playerView.updateUI(isFullScreen: true) // Enter fullscreen +playerView.updateUI(isFullScreen: false) // Exit fullscreen +``` + +### Customizing IOSVideoPlayerView + +Subclass to customize behavior: + +```swift +class CustomVideoPlayerView: IOSVideoPlayerView { + override func customizeUIComponents() { + super.customizeUIComponents() + + // Hide playback rate button + toolBar.playbackRateButton.isHidden = true + } + + override func onButtonPressed(type: PlayerButtonType, button: UIButton) { + if type == .landscape { + // Custom landscape button behavior + } else { + super.onButtonPressed(type: type, button: button) + } + } + + override func updateUI(isLandscape: Bool) { + super.updateUI(isLandscape: isLandscape) + // Additional UI updates for orientation + } +} +``` + +## VideoPlayerView (Base Class) + +`VideoPlayerView` is the base class with playback controls. `IOSVideoPlayerView` extends it for iOS. + +### Key Properties + +```swift +public var playerLayer: KSPlayerLayer? +public weak var delegate: PlayerControllerDelegate? +public let toolBar: PlayerToolBar +public let srtControl: SubtitleModel +public var playTimeDidChange: ((TimeInterval, TimeInterval) -> Void)? +public var backBlock: (() -> Void)? +``` + +### Accessing Player Layer + +```swift +// Get the underlying player +if let player = playerView.playerLayer?.player { + // Access player properties + let duration = player.duration + let currentTime = player.currentPlaybackTime + let isPlaying = player.isPlaying +} +``` + +## IOSVideoPlayerView Properties + +```swift +// UI Components +public var backButton: UIButton +public var maskImageView: UIImageView // Cover image +public var airplayStatusView: UIView // AirPlay status indicator +public var routeButton: AVRoutePickerView // AirPlay route picker +public var landscapeButton: UIControl // Fullscreen toggle +public var volumeViewSlider: UXSlider // Volume control + +// State +public var isMaskShow: Bool // Controls visibility +``` + +## PlayerButtonType + +Button types for `onButtonPressed`: + +```swift +public enum PlayerButtonType: Int { + case play = 101 + case pause + case back + case srt // Subtitle selection + case landscape // Fullscreen toggle + case replay + case lock // Lock controls + case rate // Playback rate + case definition // Quality selection + case pictureInPicture + case audioSwitch // Audio track + case videoSwitch // Video track +} +``` + +## Document Picker Integration + +`IOSVideoPlayerView` supports opening files via document picker: + +```swift +extension IOSVideoPlayerView: UIDocumentPickerDelegate { + public func documentPicker(_ controller: UIDocumentPickerViewController, + didPickDocumentsAt urls: [URL]) { + if let url = urls.first { + if url.isMovie || url.isAudio { + set(url: url, options: KSOptions()) + } else { + // Assume subtitle file + srtControl.selectedSubtitleInfo = URLSubtitleInfo(url: url) + } + } + } +} +``` + diff --git a/eas.json b/eas.json index 08f54fd4..8a9736d3 100644 --- a/eas.json +++ b/eas.json @@ -45,14 +45,14 @@ }, "production": { "environment": "production", - "channel": "0.48.0", + "channel": "0.52.0", "android": { "image": "latest" } }, "production-apk": { "environment": "production", - "channel": "0.48.0", + "channel": "0.52.0", "android": { "buildType": "apk", "image": "latest" @@ -60,7 +60,7 @@ }, "production-apk-tv": { "environment": "production", - "channel": "0.48.0", + "channel": "0.52.0", "android": { "buildType": "apk", "image": "latest" diff --git a/hooks/useAppRouter.ts b/hooks/useAppRouter.ts new file mode 100644 index 00000000..956ea928 --- /dev/null +++ b/hooks/useAppRouter.ts @@ -0,0 +1,86 @@ +import { useRouter } from "expo-router"; +import { useCallback, useMemo } from "react"; +import { useOfflineMode } from "@/providers/OfflineModeProvider"; + +/** + * Drop-in replacement for expo-router's useRouter that automatically + * preserves offline state across navigation. + * + * - For object-form navigation, automatically adds offline=true when in offline context + * - For string URLs, passes through unchanged (caller handles offline param) + * + * @example + * import useRouter from "@/hooks/useAppRouter"; + * + * const router = useRouter(); + * router.push({ pathname: "/items/page", params: { id: item.Id } }); // offline added automatically + */ +export function useAppRouter() { + const router = useRouter(); + const isOffline = useOfflineMode(); + + const push = useCallback( + (href: Parameters[0]) => { + if (typeof href === "string") { + router.push(href as any); + } else { + const callerParams = (href.params ?? {}) as Record; + const hasExplicitOffline = "offline" in callerParams; + router.push({ + ...href, + params: { + // Only add offline if caller hasn't explicitly set it + ...(isOffline && !hasExplicitOffline && { offline: "true" }), + ...callerParams, + }, + } as any); + } + }, + [router, isOffline], + ); + + const replace = useCallback( + (href: Parameters[0]) => { + if (typeof href === "string") { + router.replace(href as any); + } else { + const callerParams = (href.params ?? {}) as Record; + const hasExplicitOffline = "offline" in callerParams; + router.replace({ + ...href, + params: { + // Only add offline if caller hasn't explicitly set it + ...(isOffline && !hasExplicitOffline && { offline: "true" }), + ...callerParams, + }, + } as any); + } + }, + [router, isOffline], + ); + + const setParams = useCallback( + (params: Parameters[0]) => { + const callerParams = (params ?? {}) as Record; + const hasExplicitOffline = "offline" in callerParams; + router.setParams({ + // Only add offline if caller hasn't explicitly set it + ...(isOffline && !hasExplicitOffline && { offline: "true" }), + ...callerParams, + }); + }, + [router, isOffline], + ); + + return useMemo( + () => ({ + ...router, + push, + replace, + setParams, + }), + [router, push, replace, setParams], + ); +} + +export default useAppRouter; diff --git a/hooks/useControlsVisibility.ts b/hooks/useControlsVisibility.ts deleted file mode 100644 index caca0d84..00000000 --- a/hooks/useControlsVisibility.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { useCallback, useEffect, useRef } from "react"; -import { useSharedValue } from "react-native-reanimated"; - -export const useControlsVisibility = (timeout = 3000) => { - const opacity = useSharedValue(1); - - const hideControlsTimerRef = useRef | null>( - null, - ); - - const showControls = useCallback(() => { - opacity.value = 1; - if (hideControlsTimerRef.current) { - clearTimeout(hideControlsTimerRef.current); - } - hideControlsTimerRef.current = setTimeout(() => { - opacity.value = 0; - }, timeout); - }, [timeout]); - - const hideControls = useCallback(() => { - opacity.value = 0; - if (hideControlsTimerRef.current) { - clearTimeout(hideControlsTimerRef.current); - } - }, []); - - useEffect(() => { - return () => { - if (hideControlsTimerRef.current) { - clearTimeout(hideControlsTimerRef.current); - } - }; - }, []); - - return { opacity, showControls, hideControls }; -}; diff --git a/hooks/useCreditSkipper.ts b/hooks/useCreditSkipper.ts index d023e7be..40c1d695 100644 --- a/hooks/useCreditSkipper.ts +++ b/hooks/useCreditSkipper.ts @@ -5,29 +5,32 @@ import { useSegments } from "@/utils/segments"; import { msToSeconds, secondsToMs } from "@/utils/time"; import { useHaptic } from "./useHaptic"; +/** + * Custom hook to handle skipping credits in a media player. + * The player reports time values in milliseconds. + */ export const useCreditSkipper = ( itemId: string, currentTime: number, - seek: (time: number) => void, + seek: (ms: number) => void, play: () => void, - isVlc = false, isOffline = false, api: Api | null = null, downloadedFiles: DownloadedItem[] | undefined = undefined, + totalDuration?: number, ) => { const [showSkipCreditButton, setShowSkipCreditButton] = useState(false); const lightHapticFeedback = useHaptic("light"); - if (isVlc) { - currentTime = msToSeconds(currentTime); - } + // Convert ms to seconds for comparison with timestamps + const currentTimeSeconds = msToSeconds(currentTime); + const totalDurationInSeconds = + totalDuration != null ? msToSeconds(totalDuration) : undefined; + + // Regular function (not useCallback) to match useIntroSkipper pattern const wrappedSeek = (seconds: number) => { - if (isVlc) { - seek(secondsToMs(seconds)); - return; - } - seek(seconds); + seek(secondsToMs(seconds)); }; const { data: segments } = useSegments( @@ -38,27 +41,69 @@ export const useCreditSkipper = ( ); const creditTimestamps = segments?.creditSegments?.[0]; + // Determine if there's content after credits (credits don't extend to video end) + // Use a 5-second buffer to account for timing discrepancies + const hasContentAfterCredits = (() => { + if ( + !creditTimestamps || + totalDurationInSeconds == null || + !Number.isFinite(totalDurationInSeconds) + ) { + return false; + } + const creditsEndToVideoEnd = + totalDurationInSeconds - creditTimestamps.endTime; + // If credits end more than 5 seconds before video ends, there's content after + return creditsEndToVideoEnd > 5; + })(); + useEffect(() => { if (creditTimestamps) { - setShowSkipCreditButton( - currentTime > creditTimestamps.startTime && - currentTime < creditTimestamps.endTime, - ); + const shouldShow = + currentTimeSeconds > creditTimestamps.startTime && + currentTimeSeconds < creditTimestamps.endTime; + + setShowSkipCreditButton(shouldShow); + } else { + // Reset button state when no credit timestamps exist + if (showSkipCreditButton) { + setShowSkipCreditButton(false); + } } - }, [creditTimestamps, currentTime]); + }, [creditTimestamps, currentTimeSeconds, showSkipCreditButton]); const skipCredit = useCallback(() => { if (!creditTimestamps) return; + try { lightHapticFeedback(); - wrappedSeek(creditTimestamps.endTime); + + // Calculate the target seek position + let seekTarget = creditTimestamps.endTime; + + // If we have total duration, ensure we don't seek past the end of the video. + // Some media sources report credit end times that exceed the actual video duration, + // which causes the player to pause/stop when seeking past the end. + // Leave a small buffer (2 seconds) to trigger the natural end-of-video flow + // (next episode countdown, etc.) instead of an abrupt pause. + if (totalDurationInSeconds && seekTarget >= totalDurationInSeconds) { + seekTarget = Math.max(0, totalDurationInSeconds - 2); + } + + wrappedSeek(seekTarget); setTimeout(() => { play(); }, 200); } catch (error) { - console.error("Error skipping credit", error); + console.error("[CREDIT_SKIPPER] Error skipping credit", error); } - }, [creditTimestamps, lightHapticFeedback, wrappedSeek, play]); + }, [ + creditTimestamps, + lightHapticFeedback, + wrappedSeek, + play, + totalDurationInSeconds, + ]); - return { showSkipCreditButton, skipCredit }; + return { showSkipCreditButton, skipCredit, hasContentAfterCredits }; }; diff --git a/hooks/useDefaultPlaySettings.ts b/hooks/useDefaultPlaySettings.ts index b9ab1d44..51b0e9ee 100644 --- a/hooks/useDefaultPlaySettings.ts +++ b/hooks/useDefaultPlaySettings.ts @@ -1,51 +1,23 @@ import { type BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; import { useMemo } from "react"; -import { BITRATES } from "@/components/BitrateSelector"; import type { Settings } from "@/utils/atoms/settings"; +import { getDefaultPlaySettings } from "@/utils/jellyfin/getDefaultPlaySettings"; -// Used only for initial play settings. -const useDefaultPlaySettings = ( - item: BaseItemDto, - settings: Settings | null, -) => { - const playSettings = useMemo(() => { - // 1. Get first media source - const mediaSource = item.MediaSources?.[0]; - - // 2. Get default or preferred audio - const defaultAudioIndex = mediaSource?.DefaultAudioStreamIndex; - const preferedAudioIndex = mediaSource?.MediaStreams?.find( - (x) => - x.Type === "Audio" && - x.Language === - settings?.defaultAudioLanguage?.ThreeLetterISOLanguageName, - )?.Index; - - const firstAudioIndex = mediaSource?.MediaStreams?.find( - (x) => x.Type === "Audio", - )?.Index; - - // 4. Get default bitrate from settings or fallback to max - let bitrate = settings?.defaultBitrate ?? BITRATES[0]; - // value undefined seems to get lost in settings. This is just a failsafe - if (bitrate.key === BITRATES[0].key) { - bitrate = BITRATES[0]; - } +/** + * React hook wrapper for getDefaultPlaySettings. + * Used in UI components for initial playback (no previous track state). + */ +const useDefaultPlaySettings = (item: BaseItemDto, settings: Settings | null) => + useMemo(() => { + const { mediaSource, audioIndex, subtitleIndex, bitrate } = + getDefaultPlaySettings(item, settings); return { - defaultAudioIndex: - preferedAudioIndex ?? defaultAudioIndex ?? firstAudioIndex ?? undefined, - defaultSubtitleIndex: mediaSource?.DefaultSubtitleStreamIndex ?? -1, - defaultMediaSource: mediaSource ?? undefined, - defaultBitrate: bitrate ?? undefined, + defaultMediaSource: mediaSource, + defaultAudioIndex: audioIndex, + defaultSubtitleIndex: subtitleIndex, + defaultBitrate: bitrate, }; - }, [ - item.MediaSources, - settings?.defaultAudioLanguage, - settings?.defaultSubtitleLanguage, - ]); - - return playSettings; -}; + }, [item, settings]); export default useDefaultPlaySettings; diff --git a/hooks/useDownloadedFileOpener.ts b/hooks/useDownloadedFileOpener.ts deleted file mode 100644 index 732ae36c..00000000 --- a/hooks/useDownloadedFileOpener.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; -import { useRouter } from "expo-router"; -import { useCallback } from "react"; -import { usePlaySettings } from "@/providers/PlaySettingsProvider"; -import { writeToLog } from "@/utils/log"; - -export const useDownloadedFileOpener = () => { - const router = useRouter(); - const { setPlayUrl, setOfflineSettings } = usePlaySettings(); - - const openFile = useCallback( - async (item: BaseItemDto) => { - if (!item.Id) { - writeToLog("ERROR", "Attempted to open a file without an ID."); - console.error("Attempted to open a file without an ID."); - return; - } - const queryParams = new URLSearchParams({ - itemId: item.Id, - offline: "true", - playbackPosition: - item.UserData?.PlaybackPositionTicks?.toString() ?? "0", - }); - try { - router.push(`/player/direct-player?${queryParams.toString()}`); - } catch (error) { - writeToLog("ERROR", "Error opening file", error); - console.error("Error opening file:", error); - } - }, - [setOfflineSettings, setPlayUrl, router], - ); - - return { openFile }; -}; diff --git a/hooks/useFavorite.ts b/hooks/useFavorite.ts index b9e47e08..77af77ee 100644 --- a/hooks/useFavorite.ts +++ b/hooks/useFavorite.ts @@ -1,109 +1,140 @@ import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; -import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api"; import { useMutation, useQueryClient } from "@tanstack/react-query"; -import { useAtom } from "jotai"; -import { useEffect, useState } from "react"; +import { atom, useAtom } from "jotai"; +import { useCallback, useEffect, useMemo, useRef } from "react"; import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +// Shared atom to store favorite status across all components +// Maps itemId -> isFavorite +const favoritesAtom = atom>({}); + export const useFavorite = (item: BaseItemDto) => { const queryClient = useQueryClient(); const [api] = useAtom(apiAtom); const [user] = useAtom(userAtom); - const type = "item"; - const [isFavorite, setIsFavorite] = useState(item.UserData?.IsFavorite); + const [favorites, setFavorites] = useAtom(favoritesAtom); + + const itemId = item.Id ?? ""; + + // Get current favorite status from shared state, falling back to item data + const isFavorite = itemId + ? (favorites[itemId] ?? item.UserData?.IsFavorite) + : item.UserData?.IsFavorite; + + // Update shared state when item data changes + useEffect(() => { + if (itemId && item.UserData?.IsFavorite !== undefined) { + setFavorites((prev) => ({ + ...prev, + [itemId]: item.UserData!.IsFavorite!, + })); + } + }, [itemId, item.UserData?.IsFavorite, setFavorites]); + + // Helper to update favorite status in shared state + const setIsFavorite = useCallback( + (value: boolean | undefined) => { + if (itemId && value !== undefined) { + setFavorites((prev) => ({ ...prev, [itemId]: value })); + } + }, + [itemId, setFavorites], + ); + + // Use refs to avoid stale closure issues in mutationFn + const itemRef = useRef(item); + const apiRef = useRef(api); + const userRef = useRef(user); + + // Keep refs updated + useEffect(() => { + itemRef.current = item; + }, [item]); useEffect(() => { - setIsFavorite(item.UserData?.IsFavorite); - }, [item.UserData?.IsFavorite]); + apiRef.current = api; + }, [api]); - const updateItemInQueries = (newData: Partial) => { - queryClient.setQueryData( - [type, item.Id], - (old) => { - if (!old) return old; - return { - ...old, - ...newData, - UserData: { ...old.UserData, ...newData.UserData }, - }; - }, - ); - }; + useEffect(() => { + userRef.current = user; + }, [user]); - const markFavoriteMutation = useMutation({ - mutationFn: async () => { - if (api && user) { - await getUserLibraryApi(api).markFavoriteItem({ - userId: user.Id, - itemId: item.Id!, - }); - } + const itemQueryKeyPrefix = useMemo( + () => ["item", item.Id] as const, + [item.Id], + ); + + const updateItemInQueries = useCallback( + (newData: Partial) => { + queryClient.setQueriesData( + { queryKey: itemQueryKeyPrefix }, + (old) => { + if (!old) return old; + return { + ...old, + ...newData, + UserData: { ...old.UserData, ...newData.UserData }, + }; + }, + ); }, - onMutate: async () => { - await queryClient.cancelQueries({ queryKey: [type, item.Id] }); - const previousItem = queryClient.getQueryData([ - type, - item.Id, - ]); - updateItemInQueries({ UserData: { IsFavorite: true } }); + [itemQueryKeyPrefix, queryClient], + ); - return { previousItem }; - }, - onError: (_err, _variables, context) => { - if (context?.previousItem) { - queryClient.setQueryData([type, item.Id], context.previousItem); + const favoriteMutation = useMutation({ + mutationFn: async (nextIsFavorite: boolean) => { + const currentApi = apiRef.current; + const currentUser = userRef.current; + const currentItem = itemRef.current; + + if (!currentApi || !currentUser?.Id || !currentItem?.Id) { + return; } + + // Use the same endpoint format as the web client: + // POST /Users/{userId}/FavoriteItems/{itemId} - add favorite + // DELETE /Users/{userId}/FavoriteItems/{itemId} - remove favorite + const path = `/Users/${currentUser.Id}/FavoriteItems/${currentItem.Id}`; + + const response = nextIsFavorite + ? await currentApi.post(path, {}, {}) + : await currentApi.delete(path, {}); + return response.data; + }, + onMutate: async (nextIsFavorite: boolean) => { + await queryClient.cancelQueries({ queryKey: itemQueryKeyPrefix }); + + const previousIsFavorite = isFavorite; + const previousQueries = queryClient.getQueriesData({ + queryKey: itemQueryKeyPrefix, + }); + + setIsFavorite(nextIsFavorite); + updateItemInQueries({ UserData: { IsFavorite: nextIsFavorite } }); + + return { previousIsFavorite, previousQueries }; + }, + onError: (_err, _nextIsFavorite, context) => { + if (context?.previousQueries) { + for (const [queryKey, data] of context.previousQueries) { + queryClient.setQueryData(queryKey, data); + } + } + setIsFavorite(context?.previousIsFavorite); }, onSettled: () => { - queryClient.invalidateQueries({ queryKey: [type, item.Id] }); + queryClient.invalidateQueries({ queryKey: itemQueryKeyPrefix }); queryClient.invalidateQueries({ queryKey: ["home", "favorites"] }); - setIsFavorite(true); }, }); - const unmarkFavoriteMutation = useMutation({ - mutationFn: async () => { - if (api && user) { - await getUserLibraryApi(api).unmarkFavoriteItem({ - userId: user.Id, - itemId: item.Id!, - }); - } - }, - onMutate: async () => { - await queryClient.cancelQueries({ queryKey: [type, item.Id] }); - const previousItem = queryClient.getQueryData([ - type, - item.Id, - ]); - updateItemInQueries({ UserData: { IsFavorite: false } }); - - return { previousItem }; - }, - onError: (_err, _variables, context) => { - if (context?.previousItem) { - queryClient.setQueryData([type, item.Id], context.previousItem); - } - }, - onSettled: () => { - queryClient.invalidateQueries({ queryKey: [type, item.Id] }); - queryClient.invalidateQueries({ queryKey: ["home", "favorites"] }); - setIsFavorite(false); - }, - }); - - const toggleFavorite = () => { - if (isFavorite) { - unmarkFavoriteMutation.mutate(); - } else { - markFavoriteMutation.mutate(); - } - }; + const toggleFavorite = useCallback(() => { + favoriteMutation.mutate(!isFavorite); + }, [favoriteMutation, isFavorite]); return { isFavorite, toggleFavorite, - markFavoriteMutation, - unmarkFavoriteMutation, + favoriteMutation, }; }; diff --git a/hooks/useImageColors.ts b/hooks/useImageColors.ts deleted file mode 100644 index 4d8a0136..00000000 --- a/hooks/useImageColors.ts +++ /dev/null @@ -1,120 +0,0 @@ -import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; -import { useAtom, useAtomValue } from "jotai"; -import { useEffect, useMemo } from "react"; -import { Platform } from "react-native"; -import type * as ImageColorsType from "react-native-image-colors"; -import { apiAtom } from "@/providers/JellyfinProvider"; - -// Conditionally import react-native-image-colors only on non-TV platforms -const ImageColors = Platform.isTV - ? null - : (require("react-native-image-colors") as typeof ImageColorsType); - -import { - adjustToNearBlack, - calculateTextColor, - isCloseToBlack, - itemThemeColorAtom, -} from "@/utils/atoms/primaryColor"; -import { getItemImage } from "@/utils/getItemImage"; -import { storage } from "@/utils/mmkv"; - -/** - * Custom hook to extract and manage image colors for a given item. - * - * @param item - The BaseItemDto object representing the item. - * @param disabled - A boolean flag to disable color extraction. - * - */ -export const useImageColors = ({ - item, - url, - disabled, -}: { - item?: BaseItemDto | null; - url?: string | null; - disabled?: boolean; -}) => { - const api = useAtomValue(apiAtom); - const [, setPrimaryColor] = useAtom(itemThemeColorAtom); - - const isTv = Platform.isTV; - - const source = useMemo(() => { - if (!api) return; - if (url) return { uri: url }; - if (item) - return getItemImage({ - item, - api, - variant: "Primary", - quality: 80, - width: 300, - }); - return null; - }, [api, item, url]); - - useEffect(() => { - if (isTv) return; - if (disabled) return; - if (source?.uri) { - const _primary = storage.getString(`${source.uri}-primary`); - const _text = storage.getString(`${source.uri}-text`); - - if (_primary && _text) { - setPrimaryColor({ - primary: _primary, - text: _text, - }); - return; - } - - // Extract colors from the image - if (!ImageColors?.getColors) return; - - ImageColors.getColors(source.uri, { - fallback: "#fff", - cache: false, - }) - .then((colors: ImageColorsType.ImageColorsResult) => { - let primary = "#fff"; - let text = "#000"; - let backup = "#fff"; - - // Select the appropriate color based on the platform - if (colors.platform === "android") { - primary = colors.dominant; - backup = colors.vibrant; - } else if (colors.platform === "ios") { - primary = colors.detail; - backup = colors.primary; - } - - // Adjust the primary color if it's too close to black - if (primary && isCloseToBlack(primary)) { - if (backup && !isCloseToBlack(backup)) primary = backup; - primary = adjustToNearBlack(primary); - } - - // Calculate the text color based on the primary color - if (primary) text = calculateTextColor(primary); - - setPrimaryColor({ - primary, - text, - }); - - // Cache the colors in storage - if (source.uri && primary) { - storage.set(`${source.uri}-primary`, primary); - storage.set(`${source.uri}-text`, text); - } - }) - .catch((error: any) => { - console.error("Error getting colors", error); - }); - } - }, [isTv, source?.uri, setPrimaryColor, disabled]); - - if (isTv) return; -}; diff --git a/hooks/useIntroSkipper.ts b/hooks/useIntroSkipper.ts index d11ed511..eeed9833 100644 --- a/hooks/useIntroSkipper.ts +++ b/hooks/useIntroSkipper.ts @@ -7,31 +7,26 @@ import { useHaptic } from "./useHaptic"; /** * Custom hook to handle skipping intros in a media player. + * MPV player uses milliseconds for time. * - * @param {number} currentTime - The current playback time in seconds. + * @param {number} currentTime - The current playback time in milliseconds. */ export const useIntroSkipper = ( itemId: string, currentTime: number, - seek: (ticks: number) => void, + seek: (ms: number) => void, play: () => void, - isVlc = false, isOffline = false, api: Api | null = null, downloadedFiles: DownloadedItem[] | undefined = undefined, ) => { const [showSkipButton, setShowSkipButton] = useState(false); - if (isVlc) { - currentTime = msToSeconds(currentTime); - } + // Convert ms to seconds for comparison with timestamps + const currentTimeSeconds = msToSeconds(currentTime); const lightHapticFeedback = useHaptic("light"); const wrappedSeek = (seconds: number) => { - if (isVlc) { - seek(secondsToMs(seconds)); - return; - } - seek(seconds); + seek(secondsToMs(seconds)); }; const { data: segments } = useSegments( @@ -45,8 +40,8 @@ export const useIntroSkipper = ( useEffect(() => { if (introTimestamps) { const shouldShow = - currentTime > introTimestamps.startTime && - currentTime < introTimestamps.endTime; + currentTimeSeconds > introTimestamps.startTime && + currentTimeSeconds < introTimestamps.endTime; setShowSkipButton(shouldShow); } else { @@ -54,7 +49,7 @@ export const useIntroSkipper = ( setShowSkipButton(false); } } - }, [introTimestamps, currentTime, showSkipButton]); + }, [introTimestamps, currentTimeSeconds, showSkipButton]); const skipIntro = useCallback(() => { if (!introTimestamps) return; diff --git a/hooks/useItemPeopleQuery.ts b/hooks/useItemPeopleQuery.ts new file mode 100644 index 00000000..2dbad062 --- /dev/null +++ b/hooks/useItemPeopleQuery.ts @@ -0,0 +1,37 @@ +import type { + BaseItemPerson, + ItemFields, +} from "@jellyfin/sdk/lib/generated-client/models"; +import { getItemsApi } from "@jellyfin/sdk/lib/utils/api"; +import { useQuery } from "@tanstack/react-query"; +import { useAtom } from "jotai"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; + +export const useItemPeopleQuery = ( + itemId: string | undefined, + enabled: boolean, +) => { + const [api] = useAtom(apiAtom); + const [user] = useAtom(userAtom); + + return useQuery({ + queryKey: ["item", itemId, "people"], + queryFn: async () => { + if (!api || !user?.Id || !itemId) return []; + + const response = await getItemsApi(api).getItems({ + ids: [itemId], + userId: user.Id, + fields: ["People" satisfies ItemFields], + }); + + const people = response.data.Items?.[0]?.People; + return Array.isArray(people) ? people : []; + }, + enabled: !!api && !!user?.Id && !!itemId && enabled, + staleTime: 10 * 60 * 1000, + refetchOnMount: false, + refetchOnReconnect: false, + refetchOnWindowFocus: false, + }); +}; diff --git a/hooks/useMarkAsPlayed.ts b/hooks/useMarkAsPlayed.ts index c789e1bd..e21687fa 100644 --- a/hooks/useMarkAsPlayed.ts +++ b/hooks/useMarkAsPlayed.ts @@ -1,25 +1,77 @@ import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { useQueryClient } from "@tanstack/react-query"; +import { useCallback } from "react"; import { useHaptic } from "./useHaptic"; import { usePlaybackManager } from "./usePlaybackManager"; import { useInvalidatePlaybackProgressCache } from "./useRevalidatePlaybackProgressCache"; export const useMarkAsPlayed = (items: BaseItemDto[]) => { + const queryClient = useQueryClient(); const lightHapticFeedback = useHaptic("light"); const { markItemPlayed, markItemUnplayed } = usePlaybackManager(); const invalidatePlaybackProgressCache = useInvalidatePlaybackProgressCache(); - const toggle = async (played: boolean) => { - lightHapticFeedback(); - // Process all items - await Promise.all( - items.map((item) => { - if (!item.Id) return Promise.resolve(); - return played ? markItemPlayed(item.Id) : markItemUnplayed(item.Id); - }), - ); + const toggle = useCallback( + async (played: boolean) => { + lightHapticFeedback(); - await invalidatePlaybackProgressCache(); - }; + const itemIds = items.map((item) => item.Id).filter(Boolean) as string[]; + + const previousQueriesByItemId = itemIds.map((itemId) => ({ + itemId, + queries: queryClient.getQueriesData({ + queryKey: ["item", itemId], + }), + })); + + for (const itemId of itemIds) { + queryClient.setQueriesData( + { queryKey: ["item", itemId] }, + (old) => { + if (!old) return old; + return { + ...old, + UserData: { + ...old.UserData, + Played: played, + PlaybackPositionTicks: 0, + PlayedPercentage: 0, + }, + }; + }, + ); + } + + // Process all items + try { + await Promise.all( + items.map((item) => { + if (!item.Id) return Promise.resolve(); + return played ? markItemPlayed(item.Id) : markItemUnplayed(item.Id); + }), + ); + } catch (_error) { + for (const { queries } of previousQueriesByItemId) { + for (const [queryKey, data] of queries) { + queryClient.setQueryData(queryKey, data); + } + } + } finally { + await invalidatePlaybackProgressCache(); + for (const itemId of itemIds) { + queryClient.invalidateQueries({ queryKey: ["item", itemId] }); + } + } + }, + [ + invalidatePlaybackProgressCache, + items, + lightHapticFeedback, + markItemPlayed, + markItemUnplayed, + queryClient, + ], + ); return toggle; }; diff --git a/hooks/useMusicCast.ts b/hooks/useMusicCast.ts new file mode 100644 index 00000000..2352a610 --- /dev/null +++ b/hooks/useMusicCast.ts @@ -0,0 +1,161 @@ +import type { Api } from "@jellyfin/sdk"; +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; +import { useCallback } from "react"; +import CastContext, { + CastState, + MediaStreamType, + PlayServicesState, + useCastState, + useRemoteMediaClient, +} from "react-native-google-cast"; +import { getAudioContentType } from "@/utils/jellyfin/audio/getAudioContentType"; +import { getAudioStreamUrl } from "@/utils/jellyfin/audio/getAudioStreamUrl"; + +interface UseMusicCastOptions { + api: Api | null; + userId: string | undefined; +} + +interface CastQueueOptions { + queue: BaseItemDto[]; + startIndex: number; +} + +/** + * Hook for casting music to Chromecast with full queue support + */ +export const useMusicCast = ({ api, userId }: UseMusicCastOptions) => { + const client = useRemoteMediaClient(); + const castState = useCastState(); + + const isConnected = castState === CastState.CONNECTED; + + /** + * Get album art URL for a track + */ + const getAlbumArtUrl = useCallback( + (track: BaseItemDto): string | undefined => { + if (!api) return undefined; + const albumId = track.AlbumId || track.ParentId; + if (albumId) { + return `${api.basePath}/Items/${albumId}/Images/Primary?maxHeight=600&maxWidth=600`; + } + return `${api.basePath}/Items/${track.Id}/Images/Primary?maxHeight=600&maxWidth=600`; + }, + [api], + ); + + /** + * Cast a queue of tracks to Chromecast + * Uses native queue support for seamless track transitions + */ + const castQueue = useCallback( + async ({ queue, startIndex }: CastQueueOptions): Promise => { + if (!client || !api || !userId) { + console.warn("Cannot cast: missing client, api, or userId"); + return false; + } + + try { + // Check Play Services state (Android) + const state = await CastContext.getPlayServicesState(); + if (state && state !== PlayServicesState.SUCCESS) { + CastContext.showPlayServicesErrorDialog(state); + return false; + } + + // Build queue items - limit to 100 tracks due to Cast SDK message size limit + const queueToSend = queue.slice(0, 100); + const queueItems = await Promise.all( + queueToSend.map(async (track) => { + const streamResult = await getAudioStreamUrl( + api, + userId, + track.Id!, + ); + if (!streamResult) { + throw new Error( + `Failed to get stream URL for track: ${track.Name}`, + ); + } + + const contentType = getAudioContentType( + streamResult.mediaSource?.Container, + ); + + // Calculate stream duration in seconds from runtime ticks + const streamDurationSeconds = track.RunTimeTicks + ? track.RunTimeTicks / 10000000 + : undefined; + + return { + mediaInfo: { + contentId: track.Id, + contentUrl: streamResult.url, + contentType, + streamType: MediaStreamType.BUFFERED, + streamDuration: streamDurationSeconds, + metadata: { + type: "musicTrack" as const, + title: track.Name || "Unknown Track", + artist: track.AlbumArtist || track.Artists?.join(", ") || "", + albumName: track.Album || "", + images: getAlbumArtUrl(track) + ? [{ url: getAlbumArtUrl(track)! }] + : [], + }, + }, + autoplay: true, + preloadTime: 10, // Preload 10 seconds before track ends + }; + }), + ); + + // Load media with queue + await client.loadMedia({ + queueData: { + items: queueItems, + startIndex: Math.min(startIndex, queueItems.length - 1), + }, + }); + + // Show expanded controls + CastContext.showExpandedControls(); + + return true; + } catch (error) { + console.error("Failed to cast music queue:", error); + return false; + } + }, + [client, api, userId, getAlbumArtUrl], + ); + + /** + * Cast a single track to Chromecast + */ + const castTrack = useCallback( + async (track: BaseItemDto): Promise => { + return castQueue({ queue: [track], startIndex: 0 }); + }, + [castQueue], + ); + + /** + * Stop casting and disconnect + */ + const stopCasting = useCallback(async () => { + if (client) { + await client.stop(); + } + }, [client]); + + return { + client, + isConnected, + castState, + castQueue, + castTrack, + stopCasting, + }; +}; diff --git a/hooks/useNetworkAwareQueryClient.ts b/hooks/useNetworkAwareQueryClient.ts new file mode 100644 index 00000000..66c92874 --- /dev/null +++ b/hooks/useNetworkAwareQueryClient.ts @@ -0,0 +1,61 @@ +import type { + InvalidateOptions, + InvalidateQueryFilters, + QueryClient, + QueryKey, +} from "@tanstack/react-query"; +import { useQueryClient } from "@tanstack/react-query"; +import { useCallback, useMemo } from "react"; +import { invalidateQueriesWhenOnline } from "@/utils/query/networkAwareInvalidate"; + +type NetworkAwareQueryClient = QueryClient & { + forceInvalidateQueries: QueryClient["invalidateQueries"]; +}; + +/** + * Returns a queryClient wrapper with network-aware invalidation. + * Use this instead of useQueryClient when you need to invalidate queries. + * + * - invalidateQueries: Only invalidates when online (preserves offline cache) + * - forceInvalidateQueries: Always invalidates (use sparingly) + */ +export function useNetworkAwareQueryClient(): NetworkAwareQueryClient { + const queryClient = useQueryClient(); + + const networkAwareInvalidate = useCallback( + ( + filters?: InvalidateQueryFilters, + options?: InvalidateOptions, + ): Promise => { + if (!filters) { + return Promise.resolve(); + } + return invalidateQueriesWhenOnline(queryClient, filters, options); + }, + [queryClient], + ); + + return useMemo(() => { + // Use a Proxy to wrap the queryClient and override invalidateQueries. + // Object.create doesn't work because QueryClient uses private fields (#) + // which can only be accessed on the exact instance they were defined on. + const forceInvalidate = queryClient.invalidateQueries.bind(queryClient); + + return new Proxy(queryClient, { + get(target, prop) { + if (prop === "invalidateQueries") { + return networkAwareInvalidate; + } + if (prop === "forceInvalidateQueries") { + return forceInvalidate; + } + const value = Reflect.get(target, prop, target); + // Bind methods to the original target to preserve private field access + if (typeof value === "function") { + return value.bind(target); + } + return value; + }, + }) as NetworkAwareQueryClient; + }, [queryClient, networkAwareInvalidate]); +} diff --git a/hooks/useOrientation.ts b/hooks/useOrientation.ts index 3483aefb..924e6253 100644 --- a/hooks/useOrientation.ts +++ b/hooks/useOrientation.ts @@ -1,5 +1,5 @@ import type { OrientationChangeEvent } from "expo-screen-orientation"; -import { useEffect, useState } from "react"; +import { useCallback, useEffect, useState } from "react"; import { Platform } from "react-native"; import { addOrientationChangeListener, @@ -21,6 +21,8 @@ const orientationToOrientationLock = ( return OrientationLock.LANDSCAPE_RIGHT; case Orientation.PORTRAIT_UP: return OrientationLock.PORTRAIT_UP; + case Orientation.UNKNOWN: + return OrientationLock.LANDSCAPE; default: return OrientationLock.PORTRAIT_UP; } @@ -53,27 +55,28 @@ export const useOrientation = () => { }; }, []); - const lockOrientation = async ( - lock: (typeof OrientationLock)[keyof typeof OrientationLock], - ) => { - if (Platform.isTV) return; + const lockOrientation = useCallback( + async (lock: (typeof OrientationLock)[keyof typeof OrientationLock]) => { + if (Platform.isTV) return; - if (lock === OrientationLock.DEFAULT) { - await unlockAsync(); - } else { - await lockAsync(lock); - } - }; + if (lock === OrientationLock.DEFAULT) { + await unlockAsync(); + } else { + await lockAsync(lock); + } + }, + [], + ); - const unlockOrientationFn = async () => { + const unlockOrientation = useCallback(async () => { if (Platform.isTV) return; await unlockAsync(); - }; + }, []); return { orientation, setOrientation, lockOrientation, - unlockOrientation: unlockOrientationFn, + unlockOrientation, }; }; diff --git a/hooks/usePlaybackManager.ts b/hooks/usePlaybackManager.ts index 5ea237cf..8387511f 100644 --- a/hooks/usePlaybackManager.ts +++ b/hooks/usePlaybackManager.ts @@ -3,7 +3,7 @@ import type { PlaybackProgressInfo, } from "@jellyfin/sdk/lib/generated-client"; import { getPlaystateApi, getTvShowsApi } from "@jellyfin/sdk/lib/utils/api"; -import { useQuery } from "@tanstack/react-query"; +import { useQuery, useQueryClient } from "@tanstack/react-query"; import { useAtomValue } from "jotai"; import { useMemo } from "react"; import { useDownload } from "@/providers/DownloadProvider"; @@ -69,6 +69,7 @@ export const usePlaybackManager = ({ const api = useAtomValue(apiAtom); const user = useAtomValue(userAtom); const { isConnected } = useNetworkStatus(); + const queryClient = useQueryClient(); const { getDownloadedItemById, updateDownloadedItem, getDownloadedItems } = useDownload(); @@ -186,6 +187,9 @@ export const usePlaybackManager = ({ }, }, }); + // Force invalidate queries so they refetch from updated local database + queryClient.invalidateQueries({ queryKey: ["item", itemId] }); + queryClient.invalidateQueries({ queryKey: ["episodes"] }); } // Handle remote state update if online @@ -226,6 +230,9 @@ export const usePlaybackManager = ({ }, }, }); + // Force invalidate queries so they refetch from updated local database + queryClient.invalidateQueries({ queryKey: ["item", itemId] }); + queryClient.invalidateQueries({ queryKey: ["episodes"] }); } // Handle remote state update if online @@ -237,6 +244,7 @@ export const usePlaybackManager = ({ }); } catch (error) { console.error("Failed to mark item as played on server", error); + throw error; } } }; @@ -267,6 +275,9 @@ export const usePlaybackManager = ({ }, }, }); + // Force invalidate queries so they refetch from updated local database + queryClient.invalidateQueries({ queryKey: ["item", itemId] }); + queryClient.invalidateQueries({ queryKey: ["episodes"] }); } // Handle remote state update if online @@ -278,6 +289,7 @@ export const usePlaybackManager = ({ }); } catch (error) { console.error("Failed to mark item as unplayed on server", error); + throw error; } } }; diff --git a/hooks/usePlaybackSpeed.ts b/hooks/usePlaybackSpeed.ts new file mode 100644 index 00000000..f946c905 --- /dev/null +++ b/hooks/usePlaybackSpeed.ts @@ -0,0 +1,45 @@ +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; +import { useMemo } from "react"; +import type { Settings } from "@/utils/atoms/settings"; + +/** + * Determines the appropriate playback speed for a media item based on a three-tier priority system: + * 1. Media-specific speed (highest priority) + * 2. Series-specific speed (medium priority) + * 3. Default speed (lowest priority) + */ +const usePlaybackSpeed = ( + item: BaseItemDto | null, + settings: Settings | null, +): { readonly playbackSpeed: number } => { + const playbackSpeed = useMemo(() => { + if (!settings || !item) { + return 1.0; + } + + // Start with the lowest priority: default playback speed + let selectedPlaybackSpeed = settings.defaultPlaybackSpeed; + + // Second priority: use what is set for Series if it is a Series + if (item.SeriesId && settings.playbackSpeedPerShow[item.SeriesId]) { + selectedPlaybackSpeed = settings.playbackSpeedPerShow[item.SeriesId]; + } + + // Highest priority: use what is set for Media if it is set + if (item.Id && settings.playbackSpeedPerMedia[item.Id] !== undefined) { + selectedPlaybackSpeed = settings.playbackSpeedPerMedia[item.Id]; + } + + return selectedPlaybackSpeed; + }, [ + item?.Id, + item?.SeriesId, + settings?.defaultPlaybackSpeed, + settings?.playbackSpeedPerMedia, + settings?.playbackSpeedPerShow, + ]); + + return { playbackSpeed }; +}; + +export default usePlaybackSpeed; diff --git a/hooks/usePlaylistMutations.ts b/hooks/usePlaylistMutations.ts new file mode 100644 index 00000000..dd3f13d6 --- /dev/null +++ b/hooks/usePlaylistMutations.ts @@ -0,0 +1,194 @@ +import { getLibraryApi, getPlaylistsApi } from "@jellyfin/sdk/lib/utils/api"; +import { useMutation } from "@tanstack/react-query"; +import { useAtomValue } from "jotai"; +import { useTranslation } from "react-i18next"; +import { toast } from "sonner-native"; +import { useNetworkAwareQueryClient } from "@/hooks/useNetworkAwareQueryClient"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; + +/** + * Hook to create a new playlist + */ +export const useCreatePlaylist = () => { + const api = useAtomValue(apiAtom); + const user = useAtomValue(userAtom); + const queryClient = useNetworkAwareQueryClient(); + const { t } = useTranslation(); + + const mutation = useMutation({ + mutationFn: async ({ + name, + trackIds, + }: { + name: string; + trackIds?: string[]; + }): Promise => { + if (!api || !user?.Id) { + throw new Error("API not configured"); + } + + const response = await getPlaylistsApi(api).createPlaylist({ + createPlaylistDto: { + Name: name, + Ids: trackIds, + UserId: user.Id, + MediaType: "Audio", + }, + }); + + return response.data.Id; + }, + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: ["music-playlists"], + refetchType: "all", + }); + toast.success(t("music.playlists.created")); + }, + onError: (error: Error) => { + toast.error(error.message || t("music.playlists.failed_to_create")); + }, + }); + + return mutation; +}; + +/** + * Hook to add a track to a playlist + */ +export const useAddToPlaylist = () => { + const api = useAtomValue(apiAtom); + const user = useAtomValue(userAtom); + const queryClient = useNetworkAwareQueryClient(); + const { t } = useTranslation(); + + const mutation = useMutation({ + mutationFn: async ({ + playlistId, + trackIds, + }: { + playlistId: string; + trackIds: string[]; + playlistName?: string; + }): Promise => { + if (!api || !user?.Id) { + throw new Error("API not configured"); + } + + await getPlaylistsApi(api).addItemToPlaylist({ + playlistId, + ids: trackIds, + userId: user.Id, + }); + }, + onSuccess: (_data, variables) => { + queryClient.invalidateQueries({ + queryKey: ["music-playlists"], + }); + queryClient.invalidateQueries({ + queryKey: ["music-playlist", variables.playlistId], + }); + if (variables.playlistName) { + toast.success( + t("music.playlists.added_to", { name: variables.playlistName }), + ); + } else { + toast.success(t("music.playlists.added")); + } + }, + onError: (error: Error) => { + toast.error(error.message || t("music.playlists.failed_to_add")); + }, + }); + + return mutation; +}; + +/** + * Hook to remove a track from a playlist + */ +export const useRemoveFromPlaylist = () => { + const api = useAtomValue(apiAtom); + const queryClient = useNetworkAwareQueryClient(); + const { t } = useTranslation(); + + const mutation = useMutation({ + mutationFn: async ({ + playlistId, + entryIds, + }: { + playlistId: string; + entryIds: string[]; + playlistName?: string; + }): Promise => { + if (!api) { + throw new Error("API not configured"); + } + + await getPlaylistsApi(api).removeItemFromPlaylist({ + playlistId, + entryIds, + }); + }, + onSuccess: (_data, variables) => { + queryClient.invalidateQueries({ + queryKey: ["music-playlists"], + }); + queryClient.invalidateQueries({ + queryKey: ["music-playlist", variables.playlistId], + }); + queryClient.invalidateQueries({ + queryKey: ["music-playlist-tracks", variables.playlistId], + }); + if (variables.playlistName) { + toast.success( + t("music.playlists.removed_from", { name: variables.playlistName }), + ); + } else { + toast.success(t("music.playlists.removed")); + } + }, + onError: (error: Error) => { + toast.error(error.message || t("music.playlists.failed_to_remove")); + }, + }); + + return mutation; +}; + +/** + * Hook to delete a playlist + */ +export const useDeletePlaylist = () => { + const api = useAtomValue(apiAtom); + const queryClient = useNetworkAwareQueryClient(); + const { t } = useTranslation(); + + const mutation = useMutation({ + mutationFn: async ({ + playlistId, + }: { + playlistId: string; + }): Promise => { + if (!api) { + throw new Error("API not configured"); + } + + await getLibraryApi(api).deleteItem({ + itemId: playlistId, + }); + }, + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: ["music-playlists"], + refetchType: "all", + }); + toast.success(t("music.playlists.deleted")); + }, + onError: (error: Error) => { + toast.error(error.message || t("music.playlists.failed_to_delete")); + }, + }); + + return mutation; +}; diff --git a/hooks/useRevalidatePlaybackProgressCache.ts b/hooks/useRevalidatePlaybackProgressCache.ts index e10202f3..c8c310fc 100644 --- a/hooks/useRevalidatePlaybackProgressCache.ts +++ b/hooks/useRevalidatePlaybackProgressCache.ts @@ -1,4 +1,4 @@ -import { useQueryClient } from "@tanstack/react-query"; +import { useNetworkAwareQueryClient } from "@/hooks/useNetworkAwareQueryClient"; import { useDownload } from "@/providers/DownloadProvider"; import { useTwoWaySync } from "./useTwoWaySync"; @@ -6,7 +6,7 @@ import { useTwoWaySync } from "./useTwoWaySync"; * useRevalidatePlaybackProgressCache invalidates queries related to playback progress. */ export function useInvalidatePlaybackProgressCache() { - const queryClient = useQueryClient(); + const queryClient = useNetworkAwareQueryClient(); const { getDownloadedItems } = useDownload(); const { syncPlaybackState } = useTwoWaySync(); diff --git a/hooks/useJellyseerr.ts b/hooks/useSeerr.ts similarity index 79% rename from hooks/useJellyseerr.ts rename to hooks/useSeerr.ts index f03775ae..679677d4 100644 --- a/hooks/useJellyseerr.ts +++ b/hooks/useSeerr.ts @@ -2,7 +2,7 @@ import axios, { type AxiosError, type AxiosInstance } from "axios"; import { atom } from "jotai"; import { useAtom } from "jotai/index"; import { inRange } from "lodash"; -import type { User as JellyseerrUser } from "@/utils/jellyseerr/server/entity/User"; +import type { User as SeerrUser } from "@/utils/jellyseerr/server/entity/User"; import type { MovieResult, Results, @@ -10,10 +10,10 @@ import type { } from "@/utils/jellyseerr/server/models/Search"; import { storage } from "@/utils/mmkv"; import "@/augmentations"; -import { useQueryClient } from "@tanstack/react-query"; import { t } from "i18next"; import { useCallback, useMemo } from "react"; import { toast } from "sonner-native"; +import { useNetworkAwareQueryClient } from "@/hooks/useNetworkAwareQueryClient"; import { useSettings } from "@/utils/atoms/settings"; import type { RTRating } from "@/utils/jellyseerr/server/api/rating/rottentomatoes"; import { @@ -62,12 +62,12 @@ interface SearchResults { results: Results[]; } -const JELLYSEERR_USER = "JELLYSEERR_USER"; -const JELLYSEERR_COOKIES = "JELLYSEERR_COOKIES"; +const SEERR_USER = "SEERR_USER"; +const SEERR_COOKIES = "SEERR_COOKIES"; -export const clearJellyseerrStorageData = () => { - storage.remove(JELLYSEERR_USER); - storage.remove(JELLYSEERR_COOKIES); +export const clearSeerrStorageData = () => { + storage.remove(SEERR_USER); + storage.remove(SEERR_COOKIES); }; export enum Endpoints { @@ -111,7 +111,7 @@ export type TestResult = isValid: false; }; -export class JellyseerrApi { +export class SeerrApi { axios: AxiosInstance; constructor(baseUrl: string) { @@ -126,8 +126,8 @@ export class JellyseerrApi { } async test(): Promise { - const user = storage.get(JELLYSEERR_USER); - const cookies = storage.get(JELLYSEERR_COOKIES); + const user = storage.get(SEERR_USER); + const cookies = storage.get(SEERR_COOKIES); if (user && cookies) { return Promise.resolve({ @@ -142,15 +142,13 @@ export class JellyseerrApi { const { status, headers, data } = response; if (inRange(status, 200, 299)) { if (data.version < "2.0.0") { - const error = t( - "jellyseerr.toasts.jellyseer_does_not_meet_requirements", - ); + const error = t("seerr.toasts.seer_does_not_meet_requirements"); toast.error(error); throw Error(error); } storage.setAny( - JELLYSEERR_COOKIES, + SEERR_COOKIES, headers["set-cookie"]?.flatMap((c) => c.split("; ")) ?? [], ); return { @@ -158,9 +156,9 @@ export class JellyseerrApi { requiresPass: true, }; } - toast.error(t("jellyseerr.toasts.jellyseerr_test_failed")); + toast.error(t("seerr.toasts.seerr_test_failed")); writeErrorLog( - `Jellyseerr returned a ${status} for url:\n${response.config.url}`, + `Seerr returned a ${status} for url:\n${response.config.url}`, response.data, ); return { @@ -169,7 +167,7 @@ export class JellyseerrApi { }; }) .catch((e) => { - const msg = t("jellyseerr.toasts.failed_to_test_jellyseerr_server_url"); + const msg = t("seerr.toasts.failed_to_test_seerr_server_url"); toast.error(msg); console.error(msg, e); return { @@ -179,9 +177,9 @@ export class JellyseerrApi { }); } - async login(username: string, password: string): Promise { + async login(username: string, password: string): Promise { return this.axios - ?.post(Endpoints.API_V1 + Endpoints.AUTH_JELLYFIN, { + ?.post(Endpoints.API_V1 + Endpoints.AUTH_JELLYFIN, { username, password, email: username, @@ -189,7 +187,7 @@ export class JellyseerrApi { .then((response) => { const user = response?.data; if (!user) throw Error("Login failed"); - storage.setAny(JELLYSEERR_USER, user); + storage.setAny(SEERR_USER, user); return user; }); } @@ -364,7 +362,7 @@ export class JellyseerrApi { const issue = response.data; if (issue.status === IssueStatus.OPEN) { - toast.success(t("jellyseerr.toasts.issue_submitted")); + toast.success(t("seerr.toasts.issue_submitted")); } return issue; }); @@ -392,7 +390,7 @@ export class JellyseerrApi { const cookies = response.headers["set-cookie"]; if (cookies) { storage.setAny( - JELLYSEERR_COOKIES, + SEERR_COOKIES, response.headers["set-cookie"]?.flatMap((c) => c.split("; ")), ); } @@ -400,11 +398,11 @@ export class JellyseerrApi { }, (error: AxiosError) => { writeErrorLog( - `Jellyseerr response error\nerror: ${error.toString()}\nurl: ${error?.config?.url}`, + `Seerr response error\nerror: ${error.toString()}\nurl: ${error?.config?.url}`, error.response?.data, ); if (error.response?.status === 403) { - clearJellyseerrStorageData(); + clearSeerrStorageData(); } return Promise.reject(error); }, @@ -412,7 +410,7 @@ export class JellyseerrApi { this.axios.interceptors.request.use( async (config) => { - const cookies = storage.get(JELLYSEERR_COOKIES); + const cookies = storage.get(SEERR_COOKIES); if (cookies) { const headerName = this.axios.defaults.xsrfHeaderName!; const xsrfToken = cookies @@ -425,65 +423,61 @@ export class JellyseerrApi { return config; }, (error) => { - console.error("Jellyseerr request error", error); + console.error("Seerr request error", error); }, ); } } -const jellyseerrUserAtom = atom(storage.get(JELLYSEERR_USER)); +const seerrUserAtom = atom(storage.get(SEERR_USER)); -export const useJellyseerr = () => { +export const useSeerr = () => { const { settings, updateSettings } = useSettings(); - const [jellyseerrUser, setJellyseerrUser] = useAtom(jellyseerrUserAtom); - const queryClient = useQueryClient(); + const [seerrUser, setSeerrUser] = useAtom(seerrUserAtom); + const queryClient = useNetworkAwareQueryClient(); - const jellyseerrApi = useMemo(() => { - const cookies = storage.get(JELLYSEERR_COOKIES); - if (settings?.jellyseerrServerUrl && cookies && jellyseerrUser) { - return new JellyseerrApi(settings?.jellyseerrServerUrl); + const seerrApi = useMemo(() => { + const cookies = storage.get(SEERR_COOKIES); + if (settings?.seerrServerUrl && cookies && seerrUser) { + return new SeerrApi(settings?.seerrServerUrl); } return undefined; - }, [settings?.jellyseerrServerUrl, jellyseerrUser]); + }, [settings?.seerrServerUrl, seerrUser]); - const clearAllJellyseerData = useCallback(async () => { - clearJellyseerrStorageData(); - setJellyseerrUser(undefined); - updateSettings({ jellyseerrServerUrl: undefined }); + const clearAllSeerrData = useCallback(async () => { + clearSeerrStorageData(); + setSeerrUser(undefined); + updateSettings({ seerrServerUrl: undefined }); }, []); const requestMedia = useCallback( (title: string, request: MediaRequestBody, onSuccess?: () => void) => { - jellyseerrApi?.request?.(request)?.then(async (mediaRequest) => { + seerrApi?.request?.(request)?.then(async (mediaRequest) => { await queryClient.invalidateQueries({ - queryKey: ["search", "jellyseerr"], + queryKey: ["search", "seerr"], }); switch (mediaRequest.status) { case MediaRequestStatus.PENDING: case MediaRequestStatus.APPROVED: - toast.success( - t("jellyseerr.toasts.requested_item", { item: title }), - ); + toast.success(t("seerr.toasts.requested_item", { item: title })); onSuccess?.(); break; case MediaRequestStatus.DECLINED: - toast.error( - t("jellyseerr.toasts.you_dont_have_permission_to_request"), - ); + toast.error(t("seerr.toasts.you_dont_have_permission_to_request")); break; case MediaRequestStatus.FAILED: toast.error( - t("jellyseerr.toasts.something_went_wrong_requesting_media"), + t("seerr.toasts.something_went_wrong_requesting_media"), ); break; } }); }, - [jellyseerrApi], + [seerrApi], ); - const isJellyseerrMovieOrTvResult = ( + const isSeerrMovieOrTvResult = ( items: any | null | undefined, ): items is MovieResult | TvResult => { return ( @@ -496,7 +490,7 @@ export const useJellyseerr = () => { const getTitle = ( item?: TvResult | TvDetails | MovieResult | MovieDetails | PersonCreditCast, ) => { - return isJellyseerrMovieOrTvResult(item) + return isSeerrMovieOrTvResult(item) ? item.mediaType === MediaType.MOVIE ? item?.title : item?.name @@ -509,7 +503,7 @@ export const useJellyseerr = () => { item?: TvResult | TvDetails | MovieResult | MovieDetails | PersonCreditCast, ) => { return new Date( - (isJellyseerrMovieOrTvResult(item) + (isSeerrMovieOrTvResult(item) ? item.mediaType === MediaType.MOVIE ? item?.releaseDate : item?.firstAirDate @@ -522,36 +516,35 @@ export const useJellyseerr = () => { const getMediaType = ( item?: TvResult | TvDetails | MovieResult | MovieDetails | PersonCreditCast, ): MediaType => { - return isJellyseerrMovieOrTvResult(item) + return isSeerrMovieOrTvResult(item) ? (item.mediaType as MediaType) : item?.mediaInfo?.mediaType; }; - const jellyseerrRegion = useMemo( - () => jellyseerrUser?.settings?.region || "US", - [jellyseerrUser], + const seerrRegion = useMemo( + // streamingRegion and discoverRegion exists. region doesn't + () => seerrUser?.settings?.discoverRegion || "US", + [seerrUser], ); - const jellyseerrLocale = useMemo(() => { - const locale = jellyseerrUser?.settings?.locale || "en"; + const seerrLocale = useMemo(() => { + const locale = seerrUser?.settings?.locale || "en"; // Use regex to check if locale already contains region code (e.g., zh-CN, pt-BR) // If not, append the region to create a valid BCP 47 locale string - return /^[a-z]{2,3}-/i.test(locale) - ? locale - : `${locale}-${jellyseerrRegion}`; - }, [jellyseerrUser, jellyseerrRegion]); + return /^[a-z]{2,3}-/i.test(locale) ? locale : `${locale}-${seerrRegion}`; + }, [seerrUser, seerrRegion]); return { - jellyseerrApi, - jellyseerrUser, - setJellyseerrUser, - clearAllJellyseerData, - isJellyseerrMovieOrTvResult, + seerrApi, + seerrUser, + setSeerrUser, + clearAllSeerrData, + isSeerrMovieOrTvResult, getTitle, getYear, getMediaType, - jellyseerrRegion, - jellyseerrLocale, + seerrRegion, + seerrLocale, requestMedia, }; }; diff --git a/hooks/useWatchlistMutations.ts b/hooks/useWatchlistMutations.ts new file mode 100644 index 00000000..e3e39ef9 --- /dev/null +++ b/hooks/useWatchlistMutations.ts @@ -0,0 +1,296 @@ +import { useMutation } from "@tanstack/react-query"; +import { useAtomValue } from "jotai"; +import { useCallback } from "react"; +import { toast } from "sonner-native"; +import { useNetworkAwareQueryClient } from "@/hooks/useNetworkAwareQueryClient"; +import { apiAtom } from "@/providers/JellyfinProvider"; +import { useSettings } from "@/utils/atoms/settings"; +import { createStreamystatsApi } from "@/utils/streamystats/api"; +import type { + CreateWatchlistRequest, + StreamystatsWatchlist, + UpdateWatchlistRequest, +} from "@/utils/streamystats/types"; + +/** + * Hook to create a new watchlist + */ +export const useCreateWatchlist = () => { + const api = useAtomValue(apiAtom); + const { settings } = useSettings(); + const queryClient = useNetworkAwareQueryClient(); + + const mutation = useMutation({ + mutationFn: async ( + data: CreateWatchlistRequest, + ): Promise => { + if (!settings?.streamyStatsServerUrl || !api?.accessToken) { + throw new Error("Streamystats not configured"); + } + + const streamystatsApi = createStreamystatsApi({ + serverUrl: settings.streamyStatsServerUrl, + jellyfinToken: api.accessToken, + }); + + const response = await streamystatsApi.createWatchlist(data); + if (response.error) { + throw new Error(response.error); + } + return response.data; + }, + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: ["streamystats", "watchlists"], + }); + toast.success("Watchlist created"); + }, + onError: (error: Error) => { + toast.error(error.message || "Failed to create watchlist"); + }, + }); + + return mutation; +}; + +/** + * Hook to update a watchlist + */ +export const useUpdateWatchlist = () => { + const api = useAtomValue(apiAtom); + const { settings } = useSettings(); + const queryClient = useNetworkAwareQueryClient(); + + const mutation = useMutation({ + mutationFn: async ({ + watchlistId, + data, + }: { + watchlistId: number; + data: UpdateWatchlistRequest; + }): Promise => { + if (!settings?.streamyStatsServerUrl || !api?.accessToken) { + throw new Error("Streamystats not configured"); + } + + const streamystatsApi = createStreamystatsApi({ + serverUrl: settings.streamyStatsServerUrl, + jellyfinToken: api.accessToken, + }); + + const response = await streamystatsApi.updateWatchlist(watchlistId, data); + if (response.error) { + throw new Error(response.error); + } + return response.data; + }, + onSuccess: (_data, variables) => { + queryClient.invalidateQueries({ + queryKey: ["streamystats", "watchlists"], + }); + queryClient.invalidateQueries({ + queryKey: ["streamystats", "watchlist", variables.watchlistId], + }); + toast.success("Watchlist updated"); + }, + onError: (error: Error) => { + toast.error(error.message || "Failed to update watchlist"); + }, + }); + + return mutation; +}; + +/** + * Hook to delete a watchlist + */ +export const useDeleteWatchlist = () => { + const api = useAtomValue(apiAtom); + const { settings } = useSettings(); + const queryClient = useNetworkAwareQueryClient(); + + const mutation = useMutation({ + mutationFn: async (watchlistId: number): Promise => { + if (!settings?.streamyStatsServerUrl || !api?.accessToken) { + throw new Error("Streamystats not configured"); + } + + const streamystatsApi = createStreamystatsApi({ + serverUrl: settings.streamyStatsServerUrl, + jellyfinToken: api.accessToken, + }); + + const response = await streamystatsApi.deleteWatchlist(watchlistId); + if (response.error) { + throw new Error(response.error); + } + }, + onSuccess: (_data, watchlistId) => { + queryClient.invalidateQueries({ + queryKey: ["streamystats", "watchlists"], + }); + queryClient.removeQueries({ + queryKey: ["streamystats", "watchlist", watchlistId], + }); + toast.success("Watchlist deleted"); + }, + onError: (error: Error) => { + toast.error(error.message || "Failed to delete watchlist"); + }, + }); + + return mutation; +}; + +/** + * Hook to add an item to a watchlist with optimistic update + */ +export const useAddToWatchlist = () => { + const api = useAtomValue(apiAtom); + const { settings } = useSettings(); + const queryClient = useNetworkAwareQueryClient(); + + const mutation = useMutation({ + mutationFn: async ({ + watchlistId, + itemId, + }: { + watchlistId: number; + itemId: string; + watchlistName?: string; + }): Promise => { + if (!settings?.streamyStatsServerUrl || !api?.accessToken) { + throw new Error("Streamystats not configured"); + } + + const streamystatsApi = createStreamystatsApi({ + serverUrl: settings.streamyStatsServerUrl, + jellyfinToken: api.accessToken, + }); + + const response = await streamystatsApi.addWatchlistItem( + watchlistId, + itemId, + ); + if (response.error) { + throw new Error(response.error); + } + }, + onSuccess: (_data, variables) => { + queryClient.invalidateQueries({ + queryKey: ["streamystats", "watchlist", variables.watchlistId], + }); + queryClient.invalidateQueries({ + queryKey: ["streamystats", "watchlistItems", variables.watchlistId], + }); + queryClient.invalidateQueries({ + queryKey: ["streamystats", "itemInWatchlists", variables.itemId], + }); + if (variables.watchlistName) { + toast.success(`Added to ${variables.watchlistName}`); + } else { + toast.success("Added to watchlist"); + } + }, + onError: (error: Error) => { + toast.error(error.message || "Failed to add to watchlist"); + }, + }); + + return mutation; +}; + +/** + * Hook to remove an item from a watchlist with optimistic update + */ +export const useRemoveFromWatchlist = () => { + const api = useAtomValue(apiAtom); + const { settings } = useSettings(); + const queryClient = useNetworkAwareQueryClient(); + + const mutation = useMutation({ + mutationFn: async ({ + watchlistId, + itemId, + }: { + watchlistId: number; + itemId: string; + watchlistName?: string; + }): Promise => { + if (!settings?.streamyStatsServerUrl || !api?.accessToken) { + throw new Error("Streamystats not configured"); + } + + const streamystatsApi = createStreamystatsApi({ + serverUrl: settings.streamyStatsServerUrl, + jellyfinToken: api.accessToken, + }); + + const response = await streamystatsApi.removeWatchlistItem( + watchlistId, + itemId, + ); + if (response.error) { + throw new Error(response.error); + } + }, + onSuccess: (_data, variables) => { + queryClient.invalidateQueries({ + queryKey: ["streamystats", "watchlist", variables.watchlistId], + }); + queryClient.invalidateQueries({ + queryKey: ["streamystats", "watchlistItems", variables.watchlistId], + }); + queryClient.invalidateQueries({ + queryKey: ["streamystats", "itemInWatchlists", variables.itemId], + }); + if (variables.watchlistName) { + toast.success(`Removed from ${variables.watchlistName}`); + } else { + toast.success("Removed from watchlist"); + } + }, + onError: (error: Error) => { + toast.error(error.message || "Failed to remove from watchlist"); + }, + }); + + return mutation; +}; + +/** + * Hook to toggle an item in a watchlist + */ +export const useToggleWatchlistItem = () => { + const addMutation = useAddToWatchlist(); + const removeMutation = useRemoveFromWatchlist(); + + const toggle = useCallback( + async (params: { + watchlistId: number; + itemId: string; + isInWatchlist: boolean; + watchlistName?: string; + }) => { + if (params.isInWatchlist) { + await removeMutation.mutateAsync({ + watchlistId: params.watchlistId, + itemId: params.itemId, + watchlistName: params.watchlistName, + }); + } else { + await addMutation.mutateAsync({ + watchlistId: params.watchlistId, + itemId: params.itemId, + watchlistName: params.watchlistName, + }); + } + }, + [addMutation, removeMutation], + ); + + return { + toggle, + isLoading: addMutation.isPending || removeMutation.isPending, + }; +}; diff --git a/hooks/useWatchlists.ts b/hooks/useWatchlists.ts new file mode 100644 index 00000000..84891aa7 --- /dev/null +++ b/hooks/useWatchlists.ts @@ -0,0 +1,290 @@ +import type { + BaseItemDto, + PublicSystemInfo, +} from "@jellyfin/sdk/lib/generated-client/models"; +import { getItemsApi, getSystemApi } from "@jellyfin/sdk/lib/utils/api"; +import { useQuery } from "@tanstack/react-query"; +import { useAtomValue } from "jotai"; +import { useMemo } from "react"; +import { apiAtom, userAtom } from "@/providers/JellyfinProvider"; +import { useSettings } from "@/utils/atoms/settings"; +import { createStreamystatsApi } from "@/utils/streamystats/api"; +import type { + GetWatchlistItemsParams, + StreamystatsWatchlist, +} from "@/utils/streamystats/types"; + +/** + * Hook to check if Streamystats is configured + */ +export const useStreamystatsEnabled = () => { + const { settings } = useSettings(); + return useMemo( + () => Boolean(settings?.streamyStatsServerUrl), + [settings?.streamyStatsServerUrl], + ); +}; + +/** + * Hook to get the Jellyfin server ID needed for Streamystats API calls + */ +export const useJellyfinServerId = () => { + const api = useAtomValue(apiAtom); + const streamystatsEnabled = useStreamystatsEnabled(); + + const { data: serverInfo, isLoading } = useQuery({ + queryKey: ["jellyfin", "serverInfo"], + queryFn: async (): Promise => { + if (!api) return null; + const response = await getSystemApi(api).getPublicSystemInfo(); + return response.data; + }, + enabled: Boolean(api) && streamystatsEnabled, + staleTime: 60 * 60 * 1000, // 1 hour + }); + + return { + jellyfinServerId: serverInfo?.Id, + isLoading, + }; +}; + +/** + * Hook to get all watchlists (own + public) + */ +export const useWatchlistsQuery = () => { + const api = useAtomValue(apiAtom); + const user = useAtomValue(userAtom); + const { settings } = useSettings(); + const streamystatsEnabled = useStreamystatsEnabled(); + + return useQuery({ + queryKey: [ + "streamystats", + "watchlists", + settings?.streamyStatsServerUrl, + user?.Id, + ], + queryFn: async (): Promise => { + if (!settings?.streamyStatsServerUrl || !api?.accessToken) { + return []; + } + + const streamystatsApi = createStreamystatsApi({ + serverUrl: settings.streamyStatsServerUrl, + jellyfinToken: api.accessToken, + }); + + const response = await streamystatsApi.getWatchlists(); + return response.data || []; + }, + enabled: streamystatsEnabled && Boolean(api?.accessToken), + staleTime: 60 * 1000, // 1 minute + }); +}; + +/** + * Hook to get a single watchlist with its items + */ +export const useWatchlistDetailQuery = ( + watchlistId: number | undefined, + params?: GetWatchlistItemsParams, +) => { + const api = useAtomValue(apiAtom); + const user = useAtomValue(userAtom); + const { settings } = useSettings(); + const streamystatsEnabled = useStreamystatsEnabled(); + + return useQuery({ + queryKey: [ + "streamystats", + "watchlist", + watchlistId, + params?.type, + params?.sort, + settings?.streamyStatsServerUrl, + ], + queryFn: async (): Promise => { + if ( + !settings?.streamyStatsServerUrl || + !api?.accessToken || + !watchlistId + ) { + return null; + } + + const streamystatsApi = createStreamystatsApi({ + serverUrl: settings.streamyStatsServerUrl, + jellyfinToken: api.accessToken, + }); + + const response = await streamystatsApi.getWatchlistDetail( + watchlistId, + params, + ); + return response.data || null; + }, + enabled: + streamystatsEnabled && + Boolean(api?.accessToken) && + Boolean(watchlistId) && + Boolean(user?.Id), + staleTime: 60 * 1000, // 1 minute + }); +}; + +/** + * Hook to get watchlist items enriched with Jellyfin item data + */ +export const useWatchlistItemsQuery = ( + watchlistId: number | undefined, + params?: GetWatchlistItemsParams, +) => { + const api = useAtomValue(apiAtom); + const user = useAtomValue(userAtom); + const { settings } = useSettings(); + const { jellyfinServerId } = useJellyfinServerId(); + const streamystatsEnabled = useStreamystatsEnabled(); + + return useQuery({ + queryKey: [ + "streamystats", + "watchlistItems", + watchlistId, + jellyfinServerId, + params?.type, + params?.sort, + settings?.streamyStatsServerUrl, + ], + queryFn: async (): Promise => { + if ( + !settings?.streamyStatsServerUrl || + !api?.accessToken || + !watchlistId || + !jellyfinServerId || + !user?.Id + ) { + return []; + } + + const streamystatsApi = createStreamystatsApi({ + serverUrl: settings.streamyStatsServerUrl, + jellyfinToken: api.accessToken, + }); + + // Get watchlist item IDs from Streamystats + const watchlistDetail = await streamystatsApi.getWatchlistItemIds({ + watchlistId, + jellyfinServerId, + }); + + const itemIds = watchlistDetail.data?.items; + if (!itemIds?.length) { + return []; + } + + // Fetch full item details from Jellyfin + const response = await getItemsApi(api).getItems({ + userId: user.Id, + ids: itemIds, + fields: [ + "PrimaryImageAspectRatio", + "Genres", + "Overview", + "DateCreated", + ], + enableImageTypes: ["Primary", "Backdrop", "Thumb"], + }); + + return response.data.Items || []; + }, + enabled: + streamystatsEnabled && + Boolean(api?.accessToken) && + Boolean(watchlistId) && + Boolean(jellyfinServerId) && + Boolean(user?.Id), + staleTime: 60 * 1000, // 1 minute + }); +}; + +/** + * Hook to get the user's own watchlists only (for add-to-watchlist picker) + */ +export const useMyWatchlistsQuery = () => { + const user = useAtomValue(userAtom); + const { data: allWatchlists, ...rest } = useWatchlistsQuery(); + + const myWatchlists = useMemo(() => { + if (!allWatchlists || !user?.Id) return []; + return allWatchlists.filter((w) => w.userId === user.Id); + }, [allWatchlists, user?.Id]); + + return { + data: myWatchlists, + ...rest, + }; +}; + +/** + * Hook to check which of the user's watchlists contain a specific item + */ +export const useItemInWatchlists = (itemId: string | undefined) => { + const { data: myWatchlists } = useMyWatchlistsQuery(); + const api = useAtomValue(apiAtom); + const { settings } = useSettings(); + const { jellyfinServerId } = useJellyfinServerId(); + const streamystatsEnabled = useStreamystatsEnabled(); + + return useQuery({ + queryKey: [ + "streamystats", + "itemInWatchlists", + itemId, + jellyfinServerId, + settings?.streamyStatsServerUrl, + ], + queryFn: async (): Promise => { + if ( + !settings?.streamyStatsServerUrl || + !api?.accessToken || + !itemId || + !jellyfinServerId || + !myWatchlists?.length + ) { + return []; + } + + const streamystatsApi = createStreamystatsApi({ + serverUrl: settings.streamyStatsServerUrl, + jellyfinToken: api.accessToken, + }); + + // Check each watchlist to see if it contains the item + const watchlistsContainingItem: number[] = []; + + for (const watchlist of myWatchlists) { + try { + const detail = await streamystatsApi.getWatchlistItemIds({ + watchlistId: watchlist.id, + jellyfinServerId, + }); + if (detail.data?.items?.includes(itemId)) { + watchlistsContainingItem.push(watchlist.id); + } + } catch { + // Ignore errors for individual watchlists + } + } + + return watchlistsContainingItem; + }, + enabled: + streamystatsEnabled && + Boolean(api?.accessToken) && + Boolean(itemId) && + Boolean(jellyfinServerId) && + Boolean(myWatchlists?.length), + staleTime: 30 * 1000, // 30 seconds + }); +}; diff --git a/hooks/useWebsockets.ts b/hooks/useWebsockets.ts index 32b110a4..6881f3d6 100644 --- a/hooks/useWebsockets.ts +++ b/hooks/useWebsockets.ts @@ -1,7 +1,7 @@ -import { useRouter } from "expo-router"; import { useEffect } from "react"; import { useTranslation } from "react-i18next"; import { Alert } from "react-native"; +import useRouter from "@/hooks/useAppRouter"; import { useWebSocketContext } from "@/providers/WebSocketProvider"; interface UseWebSocketProps { @@ -96,8 +96,6 @@ export const useWebSocket = ({ | Record | undefined; // Arguments are Dictionary - console.log("[WS] ~ ", lastMessage); - if (command === "PlayPause") { console.log("Command ~ PlayPause"); togglePlay(); diff --git a/hooks/useWifiSSID.ts b/hooks/useWifiSSID.ts new file mode 100644 index 00000000..05005cfe --- /dev/null +++ b/hooks/useWifiSSID.ts @@ -0,0 +1,97 @@ +import * as Location from "expo-location"; +import { useCallback, useEffect, useState } from "react"; +import { getSSID } from "@/modules/wifi-ssid"; + +export type PermissionStatus = + | "granted" + | "denied" + | "undetermined" + | "unavailable"; + +export interface UseWifiSSIDReturn { + ssid: string | null; + permissionStatus: PermissionStatus; + requestPermission: () => Promise; + isLoading: boolean; +} + +function mapLocationStatus( + status: Location.PermissionStatus, +): PermissionStatus { + switch (status) { + case Location.PermissionStatus.GRANTED: + return "granted"; + case Location.PermissionStatus.DENIED: + return "denied"; + default: + return "undetermined"; + } +} + +export function useWifiSSID(): UseWifiSSIDReturn { + const [ssid, setSSID] = useState(null); + const [permissionStatus, setPermissionStatus] = + useState("undetermined"); + const [isLoading, setIsLoading] = useState(true); + + const fetchSSID = useCallback(async () => { + const result = await getSSID(); + console.log("[WiFi Debug] Native module SSID:", result); + setSSID(result); + }, []); + + const requestPermission = useCallback(async (): Promise => { + try { + const { status } = await Location.requestForegroundPermissionsAsync(); + const newStatus = mapLocationStatus(status); + setPermissionStatus(newStatus); + + if (newStatus === "granted") { + await fetchSSID(); + } + + return newStatus === "granted"; + } catch { + setPermissionStatus("unavailable"); + return false; + } + }, [fetchSSID]); + + useEffect(() => { + async function initialize() { + setIsLoading(true); + try { + const { status } = await Location.getForegroundPermissionsAsync(); + const mappedStatus = mapLocationStatus(status); + setPermissionStatus(mappedStatus); + + if (mappedStatus === "granted") { + await fetchSSID(); + } + } catch { + setPermissionStatus("unavailable"); + } + setIsLoading(false); + } + + initialize(); + }, [fetchSSID]); + + // Refresh SSID when permission status changes to granted + useEffect(() => { + if (permissionStatus === "granted") { + fetchSSID(); + + // Also set up an interval to periodically check SSID + const interval = setInterval(fetchSSID, 10000); // Check every 10 seconds + return () => clearInterval(interval); + } + }, [permissionStatus, fetchSSID]); + + return { + ssid, + permissionStatus, + requestPermission, + isLoading, + }; +} diff --git a/index.js b/index.js index 8e1414bc..dbc9139f 100644 --- a/index.js +++ b/index.js @@ -1,2 +1,6 @@ import "react-native-url-polyfill/auto"; +import TrackPlayer from "react-native-track-player"; +import { PlaybackService } from "./services/PlaybackService"; import "expo-router/entry"; + +TrackPlayer.registerPlaybackService(() => PlaybackService); diff --git a/modules/VlcPlayer.types.ts b/modules/VlcPlayer.types.ts deleted file mode 100644 index 93c0923d..00000000 --- a/modules/VlcPlayer.types.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { ViewStyle } from "react-native"; - -export type PlaybackStatePayload = { - nativeEvent: { - target: number; - state: "Opening" | "Buffering" | "Playing" | "Paused" | "Error"; - currentTime: number; - duration: number; - isBuffering: boolean; - isPlaying: boolean; - }; -}; - -export type ProgressUpdatePayload = { - nativeEvent: { - currentTime: number; - duration: number; - isPlaying: boolean; - isBuffering: boolean; - }; -}; - -export type VideoLoadStartPayload = { - nativeEvent: { - target: number; - }; -}; - -export type PipStartedPayload = { - nativeEvent: { - pipStarted: boolean; - }; -}; - -export type VideoStateChangePayload = PlaybackStatePayload; - -export type VideoProgressPayload = ProgressUpdatePayload; - -export type VlcPlayerSource = { - uri: string; - type?: string; - isNetwork?: boolean; - autoplay?: boolean; - startPosition?: number; - externalSubtitles?: { name: string; DeliveryUrl: string }[]; - initOptions?: any[]; - mediaOptions?: { [key: string]: any }; -}; - -export type TrackInfo = { - name: string; - index: number; - language?: string; -}; - -export type ChapterInfo = { - name: string; - timeOffset: number; - duration: number; -}; - -export type NowPlayingMetadata = { - title?: string; - artist?: string; - albumTitle?: string; - artworkUri?: string; -}; - -export type VlcPlayerViewProps = { - source: VlcPlayerSource; - style?: ViewStyle | ViewStyle[]; - progressUpdateInterval?: number; - paused?: boolean; - muted?: boolean; - volume?: number; - videoAspectRatio?: string; - nowPlayingMetadata?: NowPlayingMetadata; - onVideoProgress?: (event: ProgressUpdatePayload) => void; - onVideoStateChange?: (event: PlaybackStatePayload) => void; - onVideoLoadStart?: (event: VideoLoadStartPayload) => void; - onVideoLoadEnd?: (event: VideoLoadStartPayload) => void; - onVideoError?: (event: PlaybackStatePayload) => void; - onPipStarted?: (event: PipStartedPayload) => void; -}; - -export interface VlcPlayerViewRef { - startPictureInPicture: () => Promise; - play: () => Promise; - pause: () => Promise; - stop: () => Promise; - seekTo: (time: number) => Promise; - setAudioTrack: (trackIndex: number) => Promise; - getAudioTracks: () => Promise; - setSubtitleTrack: (trackIndex: number) => Promise; - getSubtitleTracks: () => Promise; - setSubtitleDelay: (delay: number) => Promise; - setAudioDelay: (delay: number) => Promise; - takeSnapshot: (path: string, width: number, height: number) => Promise; - setRate: (rate: number) => Promise; - nextChapter: () => Promise; - previousChapter: () => Promise; - getChapters: () => Promise; - setVideoCropGeometry: (cropGeometry: string | null) => Promise; - getVideoCropGeometry: () => Promise; - setSubtitleURL: (url: string) => Promise; - setVideoAspectRatio: (aspectRatio: string | null) => Promise; - setVideoScaleFactor: (scaleFactor: number) => Promise; -} diff --git a/modules/VlcPlayerView.tsx b/modules/VlcPlayerView.tsx deleted file mode 100644 index a5cac3af..00000000 --- a/modules/VlcPlayerView.tsx +++ /dev/null @@ -1,147 +0,0 @@ -import { requireNativeViewManager } from "expo-modules-core"; -import * as React from "react"; -import { ViewStyle } from "react-native"; -import type { - VlcPlayerSource, - VlcPlayerViewProps, - VlcPlayerViewRef, -} from "./VlcPlayer.types"; - -interface NativeViewRef extends VlcPlayerViewRef { - setNativeProps?: (props: Partial) => void; -} - -const VLCViewManager = requireNativeViewManager("VlcPlayer"); - -// Create a forwarded ref version of the native view -const NativeView = React.forwardRef( - (props, ref) => { - return ; - }, -); - -const VlcPlayerView = React.forwardRef( - (props, ref) => { - const nativeRef = React.useRef(null); - - React.useImperativeHandle(ref, () => ({ - startPictureInPicture: async () => { - await nativeRef.current?.startPictureInPicture(); - }, - play: async () => { - await nativeRef.current?.play(); - }, - pause: async () => { - await nativeRef.current?.pause(); - }, - stop: async () => { - await nativeRef.current?.stop(); - }, - seekTo: async (time: number) => { - await nativeRef.current?.seekTo(time); - }, - setAudioTrack: async (trackIndex: number) => { - await nativeRef.current?.setAudioTrack(trackIndex); - }, - getAudioTracks: async () => { - const tracks = await nativeRef.current?.getAudioTracks(); - return tracks ?? null; - }, - setSubtitleTrack: async (trackIndex: number) => { - await nativeRef.current?.setSubtitleTrack(trackIndex); - }, - getSubtitleTracks: async () => { - const tracks = await nativeRef.current?.getSubtitleTracks(); - return tracks ?? null; - }, - setSubtitleDelay: async (delay: number) => { - await nativeRef.current?.setSubtitleDelay(delay); - }, - setAudioDelay: async (delay: number) => { - await nativeRef.current?.setAudioDelay(delay); - }, - takeSnapshot: async (path: string, width: number, height: number) => { - await nativeRef.current?.takeSnapshot(path, width, height); - }, - setRate: async (rate: number) => { - await nativeRef.current?.setRate(rate); - }, - nextChapter: async () => { - await nativeRef.current?.nextChapter(); - }, - previousChapter: async () => { - await nativeRef.current?.previousChapter(); - }, - getChapters: async () => { - const chapters = await nativeRef.current?.getChapters(); - return chapters ?? null; - }, - setVideoCropGeometry: async (geometry: string | null) => { - await nativeRef.current?.setVideoCropGeometry(geometry); - }, - getVideoCropGeometry: async () => { - const geometry = await nativeRef.current?.getVideoCropGeometry(); - return geometry ?? null; - }, - setSubtitleURL: async (url: string) => { - await nativeRef.current?.setSubtitleURL(url); - }, - setVideoAspectRatio: async (aspectRatio: string | null) => { - await nativeRef.current?.setVideoAspectRatio(aspectRatio); - }, - setVideoScaleFactor: async (scaleFactor: number) => { - await nativeRef.current?.setVideoScaleFactor(scaleFactor); - }, - })); - - const { - source, - style, - progressUpdateInterval = 500, - paused, - muted, - volume, - videoAspectRatio, - nowPlayingMetadata, - onVideoLoadStart, - onVideoStateChange, - onVideoProgress, - onVideoLoadEnd, - onVideoError, - onPipStarted, - ...otherProps - } = props; - - const processedSource: VlcPlayerSource = - typeof source === "string" - ? ({ uri: source } as unknown as VlcPlayerSource) - : source; - - if (processedSource.startPosition !== undefined) { - processedSource.startPosition = Math.floor(processedSource.startPosition); - } - - return ( - - ); - }, -); - -export default VlcPlayerView; diff --git a/modules/background-downloader/android/build.gradle b/modules/background-downloader/android/build.gradle index ed8acf6b..1b273d72 100644 --- a/modules/background-downloader/android/build.gradle +++ b/modules/background-downloader/android/build.gradle @@ -35,7 +35,7 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" - implementation "com.squareup.okhttp3:okhttp:5.3.0" + implementation "com.squareup.okhttp3:okhttp:4.12.0" } tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { diff --git a/modules/background-downloader/android/src/main/java/expo/modules/backgrounddownloader/DownloadService.kt b/modules/background-downloader/android/src/main/java/expo/modules/backgrounddownloader/DownloadService.kt index ed05fc5c..e7cc01b9 100644 --- a/modules/background-downloader/android/src/main/java/expo/modules/backgrounddownloader/DownloadService.kt +++ b/modules/background-downloader/android/src/main/java/expo/modules/backgrounddownloader/DownloadService.kt @@ -5,42 +5,92 @@ import android.app.NotificationChannel import android.app.NotificationManager import android.app.Service import android.content.Intent +import android.content.pm.ServiceInfo import android.os.Binder import android.os.Build import android.os.IBinder +import android.os.SystemClock import android.util.Log import androidx.core.app.NotificationCompat +import androidx.core.app.ServiceCompat class DownloadService : Service() { private val TAG = "DownloadService" private val NOTIFICATION_ID = 1001 private val CHANNEL_ID = "download_channel" - + + // Time threshold to detect if we're in boot context (10 minutes after boot) + private val BOOT_THRESHOLD_MS = 10 * 60 * 1000L + private val binder = DownloadServiceBinder() private var activeDownloadCount = 0 private var currentDownloadTitle = "Preparing download..." private var currentProgress = 0 - + private var isForegroundStarted = false + inner class DownloadServiceBinder : Binder() { fun getService(): DownloadService = this@DownloadService } - + override fun onCreate() { super.onCreate() Log.d(TAG, "DownloadService created") createNotificationChannel() } - + override fun onBind(intent: Intent?): IBinder { Log.d(TAG, "DownloadService bound") return binder } - + override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { Log.d(TAG, "DownloadService started") - startForeground(NOTIFICATION_ID, createNotification()) + + // On Android 15+, dataSync foreground services cannot be started from BOOT_COMPLETED context + // Check if we're likely in a boot context and skip foreground start if so + if (Build.VERSION.SDK_INT >= 35 && isLikelyBootContext()) { + Log.w(TAG, "Skipping foreground start - likely boot context on Android 15+") + stopSelf() + return START_NOT_STICKY + } + + startForegroundSafely() return START_STICKY } + + /** + * Check if we're likely in a boot context by checking system uptime. + * If the system has been up for less than the threshold, we might be in boot context. + */ + private fun isLikelyBootContext(): Boolean { + val uptimeMs = SystemClock.elapsedRealtime() + return uptimeMs < BOOT_THRESHOLD_MS + } + + /** + * Start foreground service safely with proper service type for Android 14+ + */ + private fun startForegroundSafely() { + if (isForegroundStarted) return + + try { + if (Build.VERSION.SDK_INT >= 34) { + ServiceCompat.startForeground( + this, + NOTIFICATION_ID, + createNotification(), + ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC + ) + } else { + startForeground(NOTIFICATION_ID, createNotification()) + } + isForegroundStarted = true + } catch (e: Exception) { + Log.e(TAG, "Failed to start foreground service", e) + // If we can't start foreground, stop the service + stopSelf() + } + } override fun onDestroy() { Log.d(TAG, "DownloadService destroyed") @@ -86,7 +136,7 @@ class DownloadService : Service() { activeDownloadCount++ Log.d(TAG, "Download started, active count: $activeDownloadCount") if (activeDownloadCount == 1) { - startForeground(NOTIFICATION_ID, createNotification()) + startForegroundSafely() } } @@ -94,7 +144,10 @@ class DownloadService : Service() { activeDownloadCount = maxOf(0, activeDownloadCount - 1) Log.d(TAG, "Download stopped, active count: $activeDownloadCount") if (activeDownloadCount == 0) { - stopForeground(STOP_FOREGROUND_REMOVE) + if (isForegroundStarted) { + ServiceCompat.stopForeground(this, ServiceCompat.STOP_FOREGROUND_REMOVE) + isForegroundStarted = false + } stopSelf() } } diff --git a/modules/index.ts b/modules/index.ts index d0ea5cd2..e026be73 100644 --- a/modules/index.ts +++ b/modules/index.ts @@ -1,17 +1,4 @@ -import type { - ChapterInfo, - PlaybackStatePayload, - ProgressUpdatePayload, - TrackInfo, - VideoLoadStartPayload, - VideoProgressPayload, - VideoStateChangePayload, - VlcPlayerSource, - VlcPlayerViewProps, - VlcPlayerViewRef, -} from "./VlcPlayer.types"; -import VlcPlayerView from "./VlcPlayerView"; - +// Background Downloader export type { ActiveDownload, DownloadCompleteEvent, @@ -19,23 +6,19 @@ export type { DownloadProgressEvent, DownloadStartedEvent, } from "./background-downloader"; -// Background Downloader export { default as BackgroundDownloader } from "./background-downloader"; -// Component -export { VlcPlayerView }; - -// Component Types -export type { VlcPlayerViewProps, VlcPlayerViewRef }; - -// Media Types -export type { ChapterInfo, TrackInfo, VlcPlayerSource }; - -// Playback Events (alphabetically sorted) +// MPV Player (iOS + Android) export type { - PlaybackStatePayload, - ProgressUpdatePayload, - VideoLoadStartPayload, - VideoProgressPayload, - VideoStateChangePayload, -}; + AudioTrack as MpvAudioTrack, + MpvPlayerViewProps, + MpvPlayerViewRef, + OnErrorEventPayload as MpvOnErrorEventPayload, + OnLoadEventPayload as MpvOnLoadEventPayload, + OnPlaybackStateChangePayload as MpvOnPlaybackStateChangePayload, + OnProgressEventPayload as MpvOnProgressEventPayload, + OnTracksReadyEventPayload as MpvOnTracksReadyEventPayload, + SubtitleTrack as MpvSubtitleTrack, + VideoSource as MpvVideoSource, +} from "./mpv-player"; +export { MpvPlayerView } from "./mpv-player"; diff --git a/modules/mpv-player/android/build.gradle b/modules/mpv-player/android/build.gradle new file mode 100644 index 00000000..ec59bcd3 --- /dev/null +++ b/modules/mpv-player/android/build.gradle @@ -0,0 +1,57 @@ +apply plugin: 'com.android.library' + +group = 'expo.modules.mpvplayer' +version = '0.7.6' + +def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle") +apply from: expoModulesCorePlugin +applyKotlinExpoModulesCorePlugin() +useCoreDependencies() +useExpoPublishing() + +// If you want to use the managed Android SDK versions from expo-modules-core, set this to true. +// The Android SDK versions will be bumped from time to time in SDK releases and may introduce breaking changes in your module code. +// Most of the time, you may like to manage the Android SDK versions yourself. +def useManagedAndroidSdkVersions = false +if (useManagedAndroidSdkVersions) { + useDefaultAndroidSdkVersions() +} else { + buildscript { + // Simple helper that allows the root project to override versions declared by this library. + ext.safeExtGet = { prop, fallback -> + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback + } + } + project.android { + compileSdkVersion safeExtGet("compileSdkVersion", 36) + defaultConfig { + minSdkVersion safeExtGet("minSdkVersion", 26) + targetSdkVersion safeExtGet("targetSdkVersion", 36) + } + } +} + +android { + namespace "expo.modules.mpvplayer" + defaultConfig { + versionCode 1 + versionName "0.7.6" + ndk { + // Architectures supported by mpv-android + abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64' + } + } + lintOptions { + abortOnError false + } + sourceSets { + main { + jniLibs.srcDirs = ['libs'] + } + } +} + +dependencies { + // libmpv from Maven Central + implementation 'dev.jdtech.mpv:libmpv:0.5.1' +} diff --git a/modules/mpv-player/android/src/main/AndroidManifest.xml b/modules/mpv-player/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000..c6f2e479 --- /dev/null +++ b/modules/mpv-player/android/src/main/AndroidManifest.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/MPVLayerRenderer.kt b/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/MPVLayerRenderer.kt new file mode 100644 index 00000000..039ff94a --- /dev/null +++ b/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/MPVLayerRenderer.kt @@ -0,0 +1,553 @@ +package expo.modules.mpvplayer + +import android.content.Context +import android.os.Handler +import android.os.Looper +import android.util.Log +import android.view.Surface + +/** + * MPV renderer that wraps libmpv for video playback. + * This mirrors the iOS MPVLayerRenderer implementation. + */ +class MPVLayerRenderer(private val context: Context) : MPVLib.EventObserver { + + companion object { + private const val TAG = "MPVLayerRenderer" + + // Property observation format types + const val MPV_FORMAT_NONE = 0 + const val MPV_FORMAT_STRING = 1 + const val MPV_FORMAT_OSD_STRING = 2 + const val MPV_FORMAT_FLAG = 3 + const val MPV_FORMAT_INT64 = 4 + const val MPV_FORMAT_DOUBLE = 5 + const val MPV_FORMAT_NODE = 6 + } + + interface Delegate { + fun onPositionChanged(position: Double, duration: Double) + fun onPauseChanged(isPaused: Boolean) + fun onLoadingChanged(isLoading: Boolean) + fun onReadyToSeek() + fun onTracksReady() + fun onError(message: String) + fun onVideoDimensionsChanged(width: Int, height: Int) + } + + var delegate: Delegate? = null + + private val mainHandler = Handler(Looper.getMainLooper()) + + private var surface: Surface? = null + private var isRunning = false + private var isStopping = false + + // Cached state + private var cachedPosition: Double = 0.0 + private var cachedDuration: Double = 0.0 + private var _isPaused: Boolean = true + private var _isLoading: Boolean = false + private var _playbackSpeed: Double = 1.0 + private var isReadyToSeek: Boolean = false + + // Video dimensions + private var _videoWidth: Int = 0 + private var _videoHeight: Int = 0 + + val videoWidth: Int + get() = _videoWidth + + val videoHeight: Int + get() = _videoHeight + + // Current video config + private var currentUrl: String? = null + private var currentHeaders: Map? = null + private var pendingExternalSubtitles: List = emptyList() + private var initialSubtitleId: Int? = null + private var initialAudioId: Int? = null + + val isPausedState: Boolean + get() = _isPaused + + val currentPosition: Double + get() = cachedPosition + + val duration: Double + get() = cachedDuration + + fun start() { + if (isRunning) return + + try { + MPVLib.create(context) + MPVLib.addObserver(this) + + // Configure mpv options before initialization (based on Findroid) + MPVLib.setOptionString("vo", "gpu") + MPVLib.setOptionString("gpu-context", "android") + MPVLib.setOptionString("opengl-es", "yes") + + // Hardware video decoding + MPVLib.setOptionString("hwdec", "mediacodec-copy") + MPVLib.setOptionString("hwdec-codecs", "h264,hevc,mpeg4,mpeg2video,vp8,vp9,av1") + + // Cache settings for better network streaming + MPVLib.setOptionString("cache", "yes") + MPVLib.setOptionString("cache-pause-initial", "yes") + MPVLib.setOptionString("demuxer-max-bytes", "150MiB") + MPVLib.setOptionString("demuxer-max-back-bytes", "75MiB") + MPVLib.setOptionString("demuxer-readahead-secs", "20") + + // Seeking optimization - faster seeking at the cost of less precision + // Use keyframe seeking by default (much faster for network streams) + MPVLib.setOptionString("hr-seek", "no") + // Drop frames during seeking for faster response + MPVLib.setOptionString("hr-seek-framedrop", "yes") + + // Subtitle settings + MPVLib.setOptionString("sub-scale-with-window", "yes") + MPVLib.setOptionString("sub-use-margins", "no") + MPVLib.setOptionString("subs-match-os-language", "yes") + MPVLib.setOptionString("subs-fallback", "yes") + + // Important: Start with force-window=no, will be set to yes when surface is attached + MPVLib.setOptionString("force-window", "no") + MPVLib.setOptionString("keep-open", "always") + + MPVLib.initialize() + + // Observe properties + observeProperties() + + isRunning = true + Log.i(TAG, "MPV renderer started") + } catch (e: Exception) { + Log.e(TAG, "Failed to start MPV renderer: ${e.message}") + delegate?.onError("Failed to start renderer: ${e.message}") + } + } + + fun stop() { + if (isStopping) return + if (!isRunning) return + + isStopping = true + isRunning = false + + try { + MPVLib.removeObserver(this) + MPVLib.detachSurface() + MPVLib.destroy() + } catch (e: Exception) { + Log.e(TAG, "Error stopping MPV: ${e.message}") + } + + isStopping = false + } + + /** + * Attach surface and re-enable video output. + * Based on Findroid's implementation. + */ + fun attachSurface(surface: Surface) { + this.surface = surface + if (isRunning) { + MPVLib.attachSurface(surface) + // Re-enable video output after attaching surface (Findroid approach) + MPVLib.setOptionString("force-window", "yes") + MPVLib.setOptionString("vo", "gpu") + Log.i(TAG, "Surface attached, video output re-enabled") + } + } + + /** + * Detach surface and disable video output. + * Based on Findroid's implementation. + */ + fun detachSurface() { + this.surface = null + if (isRunning) { + try { + // Disable video output before detaching surface (Findroid approach) + MPVLib.setOptionString("vo", "null") + MPVLib.setOptionString("force-window", "no") + Log.i(TAG, "Video output disabled before surface detach") + } catch (e: Exception) { + Log.e(TAG, "Failed to disable video output: ${e.message}") + } + + MPVLib.detachSurface() + } + } + + /** + * Updates the surface size. Called from surfaceChanged. + * Based on Findroid's implementation. + */ + fun updateSurfaceSize(width: Int, height: Int) { + if (isRunning) { + MPVLib.setPropertyString("android-surface-size", "${width}x$height") + Log.i(TAG, "Surface size updated: ${width}x$height") + } + } + + fun load( + url: String, + headers: Map? = null, + startPosition: Double? = null, + externalSubtitles: List? = null, + initialSubtitleId: Int? = null, + initialAudioId: Int? = null + ) { + currentUrl = url + currentHeaders = headers + pendingExternalSubtitles = externalSubtitles ?: emptyList() + this.initialSubtitleId = initialSubtitleId + this.initialAudioId = initialAudioId + + _isLoading = true + isReadyToSeek = false + mainHandler.post { delegate?.onLoadingChanged(true) } + + // Stop previous playback + MPVLib.command(arrayOf("stop")) + + // Set HTTP headers if provided + updateHttpHeaders(headers) + + // Set start position + if (startPosition != null && startPosition > 0) { + MPVLib.setPropertyString("start", String.format("%.2f", startPosition)) + } else { + MPVLib.setPropertyString("start", "0") + } + + // Set initial audio track if specified + if (initialAudioId != null && initialAudioId > 0) { + setAudioTrack(initialAudioId) + } + + // Set initial subtitle track if no external subs + if (pendingExternalSubtitles.isEmpty()) { + if (initialSubtitleId != null) { + setSubtitleTrack(initialSubtitleId) + } else { + disableSubtitles() + } + } else { + disableSubtitles() + } + + // Load the file + MPVLib.command(arrayOf("loadfile", url, "replace")) + } + + fun reloadCurrentItem() { + currentUrl?.let { url -> + load(url, currentHeaders) + } + } + + private fun updateHttpHeaders(headers: Map?) { + if (headers.isNullOrEmpty()) { + // Clear headers + return + } + + val headerString = headers.entries.joinToString("\r\n") { "${it.key}: ${it.value}" } + MPVLib.setPropertyString("http-header-fields", headerString) + } + + private fun observeProperties() { + MPVLib.observeProperty("duration", MPV_FORMAT_DOUBLE) + MPVLib.observeProperty("time-pos", MPV_FORMAT_DOUBLE) + MPVLib.observeProperty("pause", MPV_FORMAT_FLAG) + MPVLib.observeProperty("track-list/count", MPV_FORMAT_INT64) + MPVLib.observeProperty("paused-for-cache", MPV_FORMAT_FLAG) + // Video dimensions for PiP aspect ratio + MPVLib.observeProperty("video-params/w", MPV_FORMAT_INT64) + MPVLib.observeProperty("video-params/h", MPV_FORMAT_INT64) + } + + // MARK: - Playback Controls + + fun play() { + MPVLib.setPropertyBoolean("pause", false) + } + + fun pause() { + MPVLib.setPropertyBoolean("pause", true) + } + + fun togglePause() { + if (_isPaused) play() else pause() + } + + fun seekTo(seconds: Double) { + val clamped = maxOf(0.0, seconds) + cachedPosition = clamped + MPVLib.command(arrayOf("seek", clamped.toString(), "absolute")) + } + + fun seekBy(seconds: Double) { + val newPosition = maxOf(0.0, cachedPosition + seconds) + cachedPosition = newPosition + MPVLib.command(arrayOf("seek", seconds.toString(), "relative")) + } + + fun setSpeed(speed: Double) { + _playbackSpeed = speed + MPVLib.setPropertyDouble("speed", speed) + } + + fun getSpeed(): Double { + return MPVLib.getPropertyDouble("speed") ?: _playbackSpeed + } + + // MARK: - Subtitle Controls + + fun getSubtitleTracks(): List> { + val tracks = mutableListOf>() + + val trackCount = MPVLib.getPropertyInt("track-list/count") ?: 0 + + for (i in 0 until trackCount) { + val trackType = MPVLib.getPropertyString("track-list/$i/type") ?: continue + if (trackType != "sub") continue + + val trackId = MPVLib.getPropertyInt("track-list/$i/id") ?: continue + val track = mutableMapOf("id" to trackId) + + MPVLib.getPropertyString("track-list/$i/title")?.let { track["title"] = it } + MPVLib.getPropertyString("track-list/$i/lang")?.let { track["lang"] = it } + + val selected = MPVLib.getPropertyBoolean("track-list/$i/selected") ?: false + track["selected"] = selected + + tracks.add(track) + } + + return tracks + } + + fun setSubtitleTrack(trackId: Int) { + Log.i(TAG, "setSubtitleTrack: setting sid to $trackId") + if (trackId < 0) { + MPVLib.setPropertyString("sid", "no") + } else { + MPVLib.setPropertyInt("sid", trackId) + } + } + + fun disableSubtitles() { + MPVLib.setPropertyString("sid", "no") + } + + fun getCurrentSubtitleTrack(): Int { + return MPVLib.getPropertyInt("sid") ?: 0 + } + + fun addSubtitleFile(url: String, select: Boolean = true) { + val flag = if (select) "select" else "cached" + MPVLib.command(arrayOf("sub-add", url, flag)) + } + + // MARK: - Subtitle Positioning + + fun setSubtitlePosition(position: Int) { + MPVLib.setPropertyInt("sub-pos", position) + } + + fun setSubtitleScale(scale: Double) { + MPVLib.setPropertyDouble("sub-scale", scale) + } + + fun setSubtitleMarginY(margin: Int) { + MPVLib.setPropertyInt("sub-margin-y", margin) + } + + fun setSubtitleAlignX(alignment: String) { + MPVLib.setPropertyString("sub-align-x", alignment) + } + + fun setSubtitleAlignY(alignment: String) { + MPVLib.setPropertyString("sub-align-y", alignment) + } + + fun setSubtitleFontSize(size: Int) { + MPVLib.setPropertyInt("sub-font-size", size) + } + + // MARK: - Audio Track Controls + + fun getAudioTracks(): List> { + val tracks = mutableListOf>() + + val trackCount = MPVLib.getPropertyInt("track-list/count") ?: 0 + + for (i in 0 until trackCount) { + val trackType = MPVLib.getPropertyString("track-list/$i/type") ?: continue + if (trackType != "audio") continue + + val trackId = MPVLib.getPropertyInt("track-list/$i/id") ?: continue + val track = mutableMapOf("id" to trackId) + + MPVLib.getPropertyString("track-list/$i/title")?.let { track["title"] = it } + MPVLib.getPropertyString("track-list/$i/lang")?.let { track["lang"] = it } + MPVLib.getPropertyString("track-list/$i/codec")?.let { track["codec"] = it } + + val channels = MPVLib.getPropertyInt("track-list/$i/audio-channels") + if (channels != null && channels > 0) { + track["channels"] = channels + } + + val selected = MPVLib.getPropertyBoolean("track-list/$i/selected") ?: false + track["selected"] = selected + + tracks.add(track) + } + + return tracks + } + + fun setAudioTrack(trackId: Int) { + Log.i(TAG, "setAudioTrack: setting aid to $trackId") + MPVLib.setPropertyInt("aid", trackId) + } + + fun getCurrentAudioTrack(): Int { + return MPVLib.getPropertyInt("aid") ?: 0 + } + + // MARK: - Video Scaling + + fun setZoomedToFill(zoomed: Boolean) { + // panscan: 0.0 = fit (letterbox), 1.0 = fill (crop) + val panscanValue = if (zoomed) 1.0 else 0.0 + Log.i(TAG, "setZoomedToFill: setting panscan to $panscanValue") + MPVLib.setPropertyDouble("panscan", panscanValue) + } + + // MARK: - MPVLib.EventObserver + + override fun eventProperty(property: String) { + // Property changed but no value provided + } + + override fun eventProperty(property: String, value: Long) { + when (property) { + "track-list/count" -> { + if (value > 0) { + Log.i(TAG, "Track list updated: $value tracks available") + mainHandler.post { delegate?.onTracksReady() } + } + } + "video-params/w" -> { + val width = value.toInt() + if (width > 0 && width != _videoWidth) { + _videoWidth = width + notifyVideoDimensionsIfReady() + } + } + "video-params/h" -> { + val height = value.toInt() + if (height > 0 && height != _videoHeight) { + _videoHeight = height + notifyVideoDimensionsIfReady() + } + } + } + } + + private fun notifyVideoDimensionsIfReady() { + if (_videoWidth > 0 && _videoHeight > 0) { + Log.i(TAG, "Video dimensions: ${_videoWidth}x${_videoHeight}") + mainHandler.post { delegate?.onVideoDimensionsChanged(_videoWidth, _videoHeight) } + } + } + + override fun eventProperty(property: String, value: Boolean) { + when (property) { + "pause" -> { + if (value != _isPaused) { + _isPaused = value + mainHandler.post { delegate?.onPauseChanged(value) } + } + } + "paused-for-cache" -> { + if (value != _isLoading) { + _isLoading = value + mainHandler.post { delegate?.onLoadingChanged(value) } + } + } + } + } + + override fun eventProperty(property: String, value: String) { + // Handle string properties if needed + } + + override fun eventProperty(property: String, value: Double) { + when (property) { + "duration" -> { + cachedDuration = value + mainHandler.post { delegate?.onPositionChanged(cachedPosition, cachedDuration) } + } + "time-pos" -> { + cachedPosition = value + mainHandler.post { delegate?.onPositionChanged(cachedPosition, cachedDuration) } + } + } + } + + override fun event(eventId: Int) { + when (eventId) { + MPVLib.MPV_EVENT_FILE_LOADED -> { + // Add external subtitles now that file is loaded + if (pendingExternalSubtitles.isNotEmpty()) { + pendingExternalSubtitles.forEachIndexed { index, subUrl -> + android.util.Log.d("MPVRenderer", "Adding external subtitle [$index]: $subUrl") + MPVLib.command(arrayOf("sub-add", subUrl)) + } + pendingExternalSubtitles = emptyList() + + // Set subtitle after external subs are added + initialSubtitleId?.let { setSubtitleTrack(it) } ?: disableSubtitles() + } + + if (!isReadyToSeek) { + isReadyToSeek = true + mainHandler.post { delegate?.onReadyToSeek() } + } + + if (_isLoading) { + _isLoading = false + mainHandler.post { delegate?.onLoadingChanged(false) } + } + } + MPVLib.MPV_EVENT_SEEK -> { + // Seek started - show loading indicator + if (!_isLoading) { + _isLoading = true + mainHandler.post { delegate?.onLoadingChanged(true) } + } + } + MPVLib.MPV_EVENT_PLAYBACK_RESTART -> { + // Video playback has started/restarted (including after seek) + if (_isLoading) { + _isLoading = false + mainHandler.post { delegate?.onLoadingChanged(false) } + } + } + MPVLib.MPV_EVENT_END_FILE -> { + Log.i(TAG, "Playback ended") + } + MPVLib.MPV_EVENT_SHUTDOWN -> { + Log.w(TAG, "MPV shutdown") + } + } + } +} + diff --git a/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/MPVLib.kt b/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/MPVLib.kt new file mode 100644 index 00000000..5c0f422e --- /dev/null +++ b/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/MPVLib.kt @@ -0,0 +1,220 @@ +package expo.modules.mpvplayer + +import android.content.Context +import android.util.Log +import android.view.Surface +import dev.jdtech.mpv.MPVLib as LibMPV + +/** + * Wrapper around the dev.jdtech.mpv.MPVLib class. + * This provides a consistent interface for the rest of the app. + */ +object MPVLib { + private const val TAG = "MPVLib" + + private var initialized = false + + // Event observer interface + interface EventObserver { + fun eventProperty(property: String) + fun eventProperty(property: String, value: Long) + fun eventProperty(property: String, value: Boolean) + fun eventProperty(property: String, value: String) + fun eventProperty(property: String, value: Double) + fun event(eventId: Int) + } + + private val observers = mutableListOf() + + // Library event observer that forwards to our observers + private val libObserver = object : LibMPV.EventObserver { + override fun eventProperty(property: String) { + synchronized(observers) { + for (observer in observers) { + observer.eventProperty(property) + } + } + } + + override fun eventProperty(property: String, value: Long) { + synchronized(observers) { + for (observer in observers) { + observer.eventProperty(property, value) + } + } + } + + override fun eventProperty(property: String, value: Boolean) { + synchronized(observers) { + for (observer in observers) { + observer.eventProperty(property, value) + } + } + } + + override fun eventProperty(property: String, value: String) { + synchronized(observers) { + for (observer in observers) { + observer.eventProperty(property, value) + } + } + } + + override fun eventProperty(property: String, value: Double) { + synchronized(observers) { + for (observer in observers) { + observer.eventProperty(property, value) + } + } + } + + override fun event(eventId: Int) { + synchronized(observers) { + for (observer in observers) { + observer.event(eventId) + } + } + } + } + + fun addObserver(observer: EventObserver) { + synchronized(observers) { + observers.add(observer) + } + } + + fun removeObserver(observer: EventObserver) { + synchronized(observers) { + observers.remove(observer) + } + } + + // MPV Event IDs + const val MPV_EVENT_NONE = 0 + const val MPV_EVENT_SHUTDOWN = 1 + const val MPV_EVENT_LOG_MESSAGE = 2 + const val MPV_EVENT_GET_PROPERTY_REPLY = 3 + const val MPV_EVENT_SET_PROPERTY_REPLY = 4 + const val MPV_EVENT_COMMAND_REPLY = 5 + const val MPV_EVENT_START_FILE = 6 + const val MPV_EVENT_END_FILE = 7 + const val MPV_EVENT_FILE_LOADED = 8 + const val MPV_EVENT_IDLE = 11 + const val MPV_EVENT_TICK = 14 + const val MPV_EVENT_CLIENT_MESSAGE = 16 + const val MPV_EVENT_VIDEO_RECONFIG = 17 + const val MPV_EVENT_AUDIO_RECONFIG = 18 + const val MPV_EVENT_SEEK = 20 + const val MPV_EVENT_PLAYBACK_RESTART = 21 + const val MPV_EVENT_PROPERTY_CHANGE = 22 + const val MPV_EVENT_QUEUE_OVERFLOW = 24 + + // End file reason + const val MPV_END_FILE_REASON_EOF = 0 + const val MPV_END_FILE_REASON_STOP = 2 + const val MPV_END_FILE_REASON_QUIT = 3 + const val MPV_END_FILE_REASON_ERROR = 4 + const val MPV_END_FILE_REASON_REDIRECT = 5 + + /** + * Create and initialize the MPV library + */ + fun create(context: Context, configDir: String? = null) { + if (initialized) return + + try { + LibMPV.create(context) + LibMPV.addObserver(libObserver) + initialized = true + Log.i(TAG, "libmpv created successfully") + } catch (e: Exception) { + Log.e(TAG, "Failed to create libmpv: ${e.message}") + throw e + } + } + + fun initialize() { + LibMPV.init() + } + + fun destroy() { + if (!initialized) return + try { + LibMPV.removeObserver(libObserver) + LibMPV.destroy() + } catch (e: Exception) { + Log.e(TAG, "Error destroying mpv: ${e.message}") + } + initialized = false + } + + fun isInitialized(): Boolean = initialized + + fun attachSurface(surface: Surface) { + LibMPV.attachSurface(surface) + } + + fun detachSurface() { + LibMPV.detachSurface() + } + + fun command(cmd: Array) { + LibMPV.command(cmd) + } + + fun setOptionString(name: String, value: String): Int { + return LibMPV.setOptionString(name, value) + } + + fun getPropertyInt(name: String): Int? { + return try { + LibMPV.getPropertyInt(name) + } catch (e: Exception) { + null + } + } + + fun getPropertyDouble(name: String): Double? { + return try { + LibMPV.getPropertyDouble(name) + } catch (e: Exception) { + null + } + } + + fun getPropertyBoolean(name: String): Boolean? { + return try { + LibMPV.getPropertyBoolean(name) + } catch (e: Exception) { + null + } + } + + fun getPropertyString(name: String): String? { + return try { + LibMPV.getPropertyString(name) + } catch (e: Exception) { + null + } + } + + fun setPropertyInt(name: String, value: Int) { + LibMPV.setPropertyInt(name, value) + } + + fun setPropertyDouble(name: String, value: Double) { + LibMPV.setPropertyDouble(name, value) + } + + fun setPropertyBoolean(name: String, value: Boolean) { + LibMPV.setPropertyBoolean(name, value) + } + + fun setPropertyString(name: String, value: String) { + LibMPV.setPropertyString(name, value) + } + + fun observeProperty(name: String, format: Int) { + LibMPV.observeProperty(name, format) + } +} diff --git a/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/MpvPlayerModule.kt b/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/MpvPlayerModule.kt new file mode 100644 index 00000000..053082e1 --- /dev/null +++ b/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/MpvPlayerModule.kt @@ -0,0 +1,180 @@ +package expo.modules.mpvplayer + +import expo.modules.kotlin.modules.Module +import expo.modules.kotlin.modules.ModuleDefinition + +class MpvPlayerModule : Module() { + override fun definition() = ModuleDefinition { + Name("MpvPlayer") + + // Defines event names that the module can send to JavaScript. + Events("onChange") + + // Defines a JavaScript synchronous function that runs the native code on the JavaScript thread. + Function("hello") { + "Hello from MPV Player! ๐Ÿ‘‹" + } + + // Defines a JavaScript function that always returns a Promise and whose native code + // is by default dispatched on the different thread than the JavaScript runtime runs on. + AsyncFunction("setValueAsync") { value: String -> + sendEvent("onChange", mapOf("value" to value)) + } + + // Enables the module to be used as a native view. + View(MpvPlayerView::class) { + // All video load options are passed via a single "source" prop + Prop("source") { view: MpvPlayerView, source: Map? -> + if (source == null) return@Prop + + val urlString = source["url"] as? String ?: return@Prop + + @Suppress("UNCHECKED_CAST") + val config = VideoLoadConfig( + url = urlString, + headers = source["headers"] as? Map, + externalSubtitles = source["externalSubtitles"] as? List, + startPosition = (source["startPosition"] as? Number)?.toDouble(), + autoplay = (source["autoplay"] as? Boolean) ?: true, + initialSubtitleId = (source["initialSubtitleId"] as? Number)?.toInt(), + initialAudioId = (source["initialAudioId"] as? Number)?.toInt() + ) + + view.loadVideo(config) + } + + // Async function to play video + AsyncFunction("play") { view: MpvPlayerView -> + view.play() + } + + // Async function to pause video + AsyncFunction("pause") { view: MpvPlayerView -> + view.pause() + } + + // Async function to seek to position + AsyncFunction("seekTo") { view: MpvPlayerView, position: Double -> + view.seekTo(position) + } + + // Async function to seek by offset + AsyncFunction("seekBy") { view: MpvPlayerView, offset: Double -> + view.seekBy(offset) + } + + // Async function to set playback speed + AsyncFunction("setSpeed") { view: MpvPlayerView, speed: Double -> + view.setSpeed(speed) + } + + // Function to get current speed + AsyncFunction("getSpeed") { view: MpvPlayerView -> + view.getSpeed() + } + + // Function to check if paused + AsyncFunction("isPaused") { view: MpvPlayerView -> + view.isPaused() + } + + // Function to get current position + AsyncFunction("getCurrentPosition") { view: MpvPlayerView -> + view.getCurrentPosition() + } + + // Function to get duration + AsyncFunction("getDuration") { view: MpvPlayerView -> + view.getDuration() + } + + // Picture in Picture functions + AsyncFunction("startPictureInPicture") { view: MpvPlayerView -> + view.startPictureInPicture() + } + + AsyncFunction("stopPictureInPicture") { view: MpvPlayerView -> + view.stopPictureInPicture() + } + + AsyncFunction("isPictureInPictureSupported") { view: MpvPlayerView -> + view.isPictureInPictureSupported() + } + + AsyncFunction("isPictureInPictureActive") { view: MpvPlayerView -> + view.isPictureInPictureActive() + } + + // Subtitle functions + AsyncFunction("getSubtitleTracks") { view: MpvPlayerView -> + view.getSubtitleTracks() + } + + AsyncFunction("setSubtitleTrack") { view: MpvPlayerView, trackId: Int -> + view.setSubtitleTrack(trackId) + } + + AsyncFunction("disableSubtitles") { view: MpvPlayerView -> + view.disableSubtitles() + } + + AsyncFunction("getCurrentSubtitleTrack") { view: MpvPlayerView -> + view.getCurrentSubtitleTrack() + } + + AsyncFunction("addSubtitleFile") { view: MpvPlayerView, url: String, select: Boolean -> + view.addSubtitleFile(url, select) + } + + // Subtitle positioning functions + AsyncFunction("setSubtitlePosition") { view: MpvPlayerView, position: Int -> + view.setSubtitlePosition(position) + } + + AsyncFunction("setSubtitleScale") { view: MpvPlayerView, scale: Double -> + view.setSubtitleScale(scale) + } + + AsyncFunction("setSubtitleMarginY") { view: MpvPlayerView, margin: Int -> + view.setSubtitleMarginY(margin) + } + + AsyncFunction("setSubtitleAlignX") { view: MpvPlayerView, alignment: String -> + view.setSubtitleAlignX(alignment) + } + + AsyncFunction("setSubtitleAlignY") { view: MpvPlayerView, alignment: String -> + view.setSubtitleAlignY(alignment) + } + + AsyncFunction("setSubtitleFontSize") { view: MpvPlayerView, size: Int -> + view.setSubtitleFontSize(size) + } + + // Audio track functions + AsyncFunction("getAudioTracks") { view: MpvPlayerView -> + view.getAudioTracks() + } + + AsyncFunction("setAudioTrack") { view: MpvPlayerView, trackId: Int -> + view.setAudioTrack(trackId) + } + + AsyncFunction("getCurrentAudioTrack") { view: MpvPlayerView -> + view.getCurrentAudioTrack() + } + + // Video scaling functions + AsyncFunction("setZoomedToFill") { view: MpvPlayerView, zoomed: Boolean -> + view.setZoomedToFill(zoomed) + } + + AsyncFunction("isZoomedToFill") { view: MpvPlayerView -> + view.isZoomedToFill() + } + + // Defines events that the view can send to JavaScript + Events("onLoad", "onPlaybackStateChange", "onProgress", "onError", "onTracksReady") + } + } +} diff --git a/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/MpvPlayerView.kt b/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/MpvPlayerView.kt new file mode 100644 index 00000000..ecc7ab52 --- /dev/null +++ b/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/MpvPlayerView.kt @@ -0,0 +1,398 @@ +package expo.modules.mpvplayer + +import android.content.Context +import android.graphics.Color +import android.os.Build +import android.util.Log +import android.view.SurfaceHolder +import android.view.SurfaceView +import android.widget.FrameLayout +import expo.modules.kotlin.AppContext +import expo.modules.kotlin.viewevent.EventDispatcher +import expo.modules.kotlin.views.ExpoView + +/** + * Configuration for loading a video + */ +data class VideoLoadConfig( + val url: String, + val headers: Map? = null, + val externalSubtitles: List? = null, + val startPosition: Double? = null, + val autoplay: Boolean = true, + val initialSubtitleId: Int? = null, + val initialAudioId: Int? = null +) + +/** + * MpvPlayerView - ExpoView that hosts the MPV player. + * This mirrors the iOS MpvPlayerView implementation. + */ +class MpvPlayerView(context: Context, appContext: AppContext) : ExpoView(context, appContext), + MPVLayerRenderer.Delegate, SurfaceHolder.Callback { + + companion object { + private const val TAG = "MpvPlayerView" + + /** + * Detect if running on an Android emulator. + * MPV player has EGL/OpenGL compatibility issues on emulators. + */ + private fun isEmulator(): Boolean { + return (Build.FINGERPRINT.startsWith("generic") + || Build.FINGERPRINT.startsWith("unknown") + || Build.MODEL.contains("google_sdk") + || Build.MODEL.contains("Emulator") + || Build.MODEL.contains("Android SDK built for x86") + || Build.MANUFACTURER.contains("Genymotion") + || (Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic")) + || "google_sdk" == Build.PRODUCT + || Build.HARDWARE.contains("goldfish") + || Build.HARDWARE.contains("ranchu")) + } + } + + // Event dispatchers + val onLoad by EventDispatcher() + val onPlaybackStateChange by EventDispatcher() + val onProgress by EventDispatcher() + val onError by EventDispatcher() + val onTracksReady by EventDispatcher() + + private var surfaceView: SurfaceView + private var renderer: MPVLayerRenderer? = null + private var pipController: PiPController? = null + + private var currentUrl: String? = null + private var cachedPosition: Double = 0.0 + private var cachedDuration: Double = 0.0 + private var intendedPlayState: Boolean = false + private var surfaceReady: Boolean = false + private var pendingConfig: VideoLoadConfig? = null + + init { + setBackgroundColor(Color.BLACK) + + // Create SurfaceView for video rendering + surfaceView = SurfaceView(context).apply { + layoutParams = FrameLayout.LayoutParams( + FrameLayout.LayoutParams.MATCH_PARENT, + FrameLayout.LayoutParams.MATCH_PARENT + ) + holder.addCallback(this@MpvPlayerView) + } + addView(surfaceView) + + // Initialize renderer + renderer = MPVLayerRenderer(context) + renderer?.delegate = this + + // Initialize PiP controller with Expo's AppContext for proper activity access + pipController = PiPController(context, appContext) + pipController?.setPlayerView(surfaceView) + pipController?.delegate = object : PiPController.Delegate { + override fun onPlay() { + play() + } + + override fun onPause() { + pause() + } + + override fun onSeekBy(seconds: Double) { + seekBy(seconds) + } + } + + // Start the renderer (skip on emulators to avoid EGL crashes) + if (isEmulator()) { + Log.w(TAG, "Running on emulator - MPV player disabled due to EGL/OpenGL compatibility issues") + // Don't start renderer on emulator, will show error when trying to play + } else { + try { + renderer?.start() + } catch (e: Exception) { + Log.e(TAG, "Failed to start renderer: ${e.message}") + onError(mapOf("error" to "Failed to start renderer: ${e.message}")) + } + } + } + + private var isOnEmulator: Boolean = isEmulator() + + // MARK: - SurfaceHolder.Callback + + override fun surfaceCreated(holder: SurfaceHolder) { + Log.i(TAG, "Surface created") + surfaceReady = true + renderer?.attachSurface(holder.surface) + + // If we have a pending load, execute it now + pendingConfig?.let { config -> + loadVideoInternal(config) + pendingConfig = null + } + } + + override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) { + Log.i(TAG, "Surface changed: ${width}x${height}") + // Update MPV with the new surface size (Findroid approach) + renderer?.updateSurfaceSize(width, height) + } + + override fun surfaceDestroyed(holder: SurfaceHolder) { + Log.i(TAG, "Surface destroyed") + surfaceReady = false + renderer?.detachSurface() + } + + // MARK: - Video Loading + + fun loadVideo(config: VideoLoadConfig) { + // Block video loading on emulators + if (isOnEmulator) { + Log.w(TAG, "Cannot load video on emulator - MPV player not supported") + onError(mapOf("error" to "MPV player is not supported on emulators. Please test on a real device.")) + return + } + + // Skip reload if same URL is already playing + if (currentUrl == config.url) { + return + } + + if (!surfaceReady) { + // Surface not ready, store config and load when ready + pendingConfig = config + return + } + + loadVideoInternal(config) + } + + private fun loadVideoInternal(config: VideoLoadConfig) { + currentUrl = config.url + + renderer?.load( + url = config.url, + headers = config.headers, + startPosition = config.startPosition, + externalSubtitles = config.externalSubtitles, + initialSubtitleId = config.initialSubtitleId, + initialAudioId = config.initialAudioId + ) + + if (config.autoplay) { + play() + } + + onLoad(mapOf("url" to config.url)) + } + + // Convenience method for simple loads + fun loadVideo(url: String, headers: Map? = null) { + loadVideo(VideoLoadConfig(url = url, headers = headers)) + } + + // MARK: - Playback Controls + + fun play() { + intendedPlayState = true + renderer?.play() + pipController?.setPlaybackRate(1.0) + } + + fun pause() { + intendedPlayState = false + renderer?.pause() + pipController?.setPlaybackRate(0.0) + } + + fun seekTo(position: Double) { + renderer?.seekTo(position) + } + + fun seekBy(offset: Double) { + renderer?.seekBy(offset) + } + + fun setSpeed(speed: Double) { + renderer?.setSpeed(speed) + } + + fun getSpeed(): Double { + return renderer?.getSpeed() ?: 1.0 + } + + fun isPaused(): Boolean { + return renderer?.isPausedState ?: true + } + + fun getCurrentPosition(): Double { + return cachedPosition + } + + fun getDuration(): Double { + return cachedDuration + } + + // MARK: - Picture in Picture + + fun startPictureInPicture() { + Log.i(TAG, "startPictureInPicture called") + pipController?.startPictureInPicture() + } + + fun stopPictureInPicture() { + pipController?.stopPictureInPicture() + } + + fun isPictureInPictureSupported(): Boolean { + return pipController?.isPictureInPictureSupported() ?: false + } + + fun isPictureInPictureActive(): Boolean { + return pipController?.isPictureInPictureActive() ?: false + } + + // MARK: - Subtitle Controls + + fun getSubtitleTracks(): List> { + return renderer?.getSubtitleTracks() ?: emptyList() + } + + fun setSubtitleTrack(trackId: Int) { + renderer?.setSubtitleTrack(trackId) + } + + fun disableSubtitles() { + renderer?.disableSubtitles() + } + + fun getCurrentSubtitleTrack(): Int { + return renderer?.getCurrentSubtitleTrack() ?: 0 + } + + fun addSubtitleFile(url: String, select: Boolean = true) { + renderer?.addSubtitleFile(url, select) + } + + // MARK: - Subtitle Positioning + + fun setSubtitlePosition(position: Int) { + renderer?.setSubtitlePosition(position) + } + + fun setSubtitleScale(scale: Double) { + renderer?.setSubtitleScale(scale) + } + + fun setSubtitleMarginY(margin: Int) { + renderer?.setSubtitleMarginY(margin) + } + + fun setSubtitleAlignX(alignment: String) { + renderer?.setSubtitleAlignX(alignment) + } + + fun setSubtitleAlignY(alignment: String) { + renderer?.setSubtitleAlignY(alignment) + } + + fun setSubtitleFontSize(size: Int) { + renderer?.setSubtitleFontSize(size) + } + + // MARK: - Audio Track Controls + + fun getAudioTracks(): List> { + return renderer?.getAudioTracks() ?: emptyList() + } + + fun setAudioTrack(trackId: Int) { + renderer?.setAudioTrack(trackId) + } + + fun getCurrentAudioTrack(): Int { + return renderer?.getCurrentAudioTrack() ?: 0 + } + + // MARK: - Video Scaling + + private var _isZoomedToFill: Boolean = false + + fun setZoomedToFill(zoomed: Boolean) { + _isZoomedToFill = zoomed + renderer?.setZoomedToFill(zoomed) + } + + fun isZoomedToFill(): Boolean { + return _isZoomedToFill + } + + // MARK: - MPVLayerRenderer.Delegate + + override fun onPositionChanged(position: Double, duration: Double) { + cachedPosition = position + cachedDuration = duration + + // Update PiP progress + if (pipController?.isPictureInPictureActive() == true) { + pipController?.setCurrentTime(position, duration) + } + + onProgress(mapOf( + "position" to position, + "duration" to duration, + "progress" to if (duration > 0) position / duration else 0.0 + )) + } + + override fun onPauseChanged(isPaused: Boolean) { + // Sync PiP playback rate + pipController?.setPlaybackRate(if (isPaused) 0.0 else 1.0) + + onPlaybackStateChange(mapOf( + "isPaused" to isPaused, + "isPlaying" to !isPaused + )) + } + + override fun onLoadingChanged(isLoading: Boolean) { + onPlaybackStateChange(mapOf( + "isLoading" to isLoading + )) + } + + override fun onReadyToSeek() { + onPlaybackStateChange(mapOf( + "isReadyToSeek" to true + )) + } + + override fun onTracksReady() { + onTracksReady(emptyMap()) + } + + override fun onVideoDimensionsChanged(width: Int, height: Int) { + // Update PiP controller with video dimensions for proper aspect ratio + pipController?.setVideoDimensions(width, height) + } + + override fun onError(message: String) { + onError(mapOf("error" to message)) + } + + // MARK: - Cleanup + + fun cleanup() { + pipController?.stopPictureInPicture() + renderer?.stop() + surfaceView.holder.removeCallback(this) + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + cleanup() + } +} diff --git a/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/PiPController.kt b/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/PiPController.kt new file mode 100644 index 00000000..438ccaa1 --- /dev/null +++ b/modules/mpv-player/android/src/main/java/expo/modules/mpvplayer/PiPController.kt @@ -0,0 +1,263 @@ +package expo.modules.mpvplayer + +import android.app.Activity +import android.app.PictureInPictureParams +import android.content.Context +import android.content.pm.PackageManager +import android.graphics.Rect +import android.os.Build +import android.util.Log +import android.util.Rational +import android.view.View +import androidx.annotation.RequiresApi +import expo.modules.kotlin.AppContext + +/** + * Picture-in-Picture controller for Android. + * This mirrors the iOS PiPController implementation. + */ +class PiPController(private val context: Context, private val appContext: AppContext? = null) { + + companion object { + private const val TAG = "PiPController" + private const val DEFAULT_ASPECT_WIDTH = 16 + private const val DEFAULT_ASPECT_HEIGHT = 9 + } + + interface Delegate { + fun onPlay() + fun onPause() + fun onSeekBy(seconds: Double) + } + + var delegate: Delegate? = null + + private var currentPosition: Double = 0.0 + private var currentDuration: Double = 0.0 + private var playbackRate: Double = 1.0 + + // Video dimensions for proper aspect ratio + private var videoWidth: Int = 0 + private var videoHeight: Int = 0 + + // Reference to the player view for source rect + private var playerView: View? = null + + /** + * Check if Picture-in-Picture is supported on this device + */ + fun isPictureInPictureSupported(): Boolean { + return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + context.packageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE) + } else { + false + } + } + + /** + * Check if Picture-in-Picture is currently active + */ + fun isPictureInPictureActive(): Boolean { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + val activity = getActivity() + return activity?.isInPictureInPictureMode ?: false + } + return false + } + + /** + * Start Picture-in-Picture mode + */ + fun startPictureInPicture() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + val activity = getActivity() + if (activity == null) { + Log.e(TAG, "Cannot start PiP: no activity found") + return + } + + if (!isPictureInPictureSupported()) { + Log.e(TAG, "PiP not supported on this device") + return + } + + try { + val params = buildPiPParams(forEntering = true) + activity.enterPictureInPictureMode(params) + Log.i(TAG, "Entered PiP mode") + } catch (e: Exception) { + Log.e(TAG, "Failed to enter PiP: ${e.message}") + } + } else { + Log.w(TAG, "PiP requires Android O or higher") + } + } + + /** + * Stop Picture-in-Picture mode + */ + fun stopPictureInPicture() { + // On Android, exiting PiP is typically done by the user + // or by finishing the activity. We can request to move task to back. + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + val activity = getActivity() + if (activity?.isInPictureInPictureMode == true) { + // Move task to back which will exit PiP + activity.moveTaskToBack(false) + } + } + } + + /** + * Update the current playback position and duration + * Note: We don't update PiP params here as we're not using progress in PiP controls + */ + fun setCurrentTime(position: Double, duration: Double) { + currentPosition = position + currentDuration = duration + } + + /** + * Set the playback rate (0.0 for paused, 1.0 for playing) + */ + fun setPlaybackRate(rate: Double) { + playbackRate = rate + + // Update PiP params to reflect play/pause state + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + val activity = getActivity() + if (activity?.isInPictureInPictureMode == true) { + try { + activity.setPictureInPictureParams(buildPiPParams()) + } catch (e: Exception) { + Log.e(TAG, "Failed to update PiP params: ${e.message}") + } + } + } + } + + /** + * Set the video dimensions for proper aspect ratio calculation + */ + fun setVideoDimensions(width: Int, height: Int) { + if (width > 0 && height > 0) { + videoWidth = width + videoHeight = height + Log.i(TAG, "Video dimensions set: ${width}x${height}") + + // Update PiP params if active + updatePiPParamsIfNeeded() + } + } + + /** + * Set the player view reference for source rect hint + */ + fun setPlayerView(view: View?) { + playerView = view + } + + private fun updatePiPParamsIfNeeded() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + val activity = getActivity() + if (activity?.isInPictureInPictureMode == true) { + try { + activity.setPictureInPictureParams(buildPiPParams()) + } catch (e: Exception) { + Log.e(TAG, "Failed to update PiP params: ${e.message}") + } + } + } + } + + /** + * Build Picture-in-Picture params for the current player state. + * Calculates proper aspect ratio and source rect based on video and view dimensions. + */ + @RequiresApi(Build.VERSION_CODES.O) + private fun buildPiPParams(forEntering: Boolean = false): PictureInPictureParams { + val view = playerView + val viewWidth = view?.width ?: 0 + val viewHeight = view?.height ?: 0 + + // Display aspect ratio from view (exactly like Findroid) + val displayAspectRatio = Rational(viewWidth.coerceAtLeast(1), viewHeight.coerceAtLeast(1)) + + // Video aspect ratio with 2.39:1 clamping (exactly like Findroid) + // Findroid: Rational(it.width.coerceAtMost((it.height * 2.39f).toInt()), + // it.height.coerceAtMost((it.width * 2.39f).toInt())) + val aspectRatio = if (videoWidth > 0 && videoHeight > 0) { + Rational( + videoWidth.coerceAtMost((videoHeight * 2.39f).toInt()), + videoHeight.coerceAtMost((videoWidth * 2.39f).toInt()) + ) + } else { + Rational(DEFAULT_ASPECT_WIDTH, DEFAULT_ASPECT_HEIGHT) + } + + // Source rect hint calculation (exactly like Findroid) + val sourceRectHint = if (viewWidth > 0 && viewHeight > 0 && videoWidth > 0 && videoHeight > 0) { + if (displayAspectRatio < aspectRatio) { + // Letterboxing - black bars top/bottom + val space = ((viewHeight - (viewWidth.toFloat() / aspectRatio.toFloat())) / 2).toInt() + Rect( + 0, + space, + viewWidth, + (viewWidth.toFloat() / aspectRatio.toFloat()).toInt() + space + ) + } else { + // Pillarboxing - black bars left/right + val space = ((viewWidth - (viewHeight.toFloat() * aspectRatio.toFloat())) / 2).toInt() + Rect( + space, + 0, + (viewHeight.toFloat() * aspectRatio.toFloat()).toInt() + space, + viewHeight + ) + } + } else { + null + } + + val builder = PictureInPictureParams.Builder() + .setAspectRatio(aspectRatio) + + sourceRectHint?.let { builder.setSourceRectHint(it) } + + // On Android 12+, enable auto-enter (like Findroid) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + builder.setAutoEnterEnabled(true) + } + + return builder.build() + } + + private fun getActivity(): Activity? { + // First try Expo's AppContext (preferred in React Native) + appContext?.currentActivity?.let { return it } + + // Fallback: Try to get from context wrapper chain + var ctx = context + while (ctx is android.content.ContextWrapper) { + if (ctx is Activity) { + return ctx + } + ctx = ctx.baseContext + } + return null + } + + /** + * Handle PiP action (called from activity when user taps PiP controls) + */ + fun handlePiPAction(action: String) { + when (action) { + "play" -> delegate?.onPlay() + "pause" -> delegate?.onPause() + "skip_forward" -> delegate?.onSeekBy(10.0) + "skip_backward" -> delegate?.onSeekBy(-10.0) + } + } +} + diff --git a/modules/mpv-player/expo-module.config.json b/modules/mpv-player/expo-module.config.json new file mode 100644 index 00000000..f5092bad --- /dev/null +++ b/modules/mpv-player/expo-module.config.json @@ -0,0 +1,9 @@ +{ + "platforms": ["apple", "android", "web"], + "apple": { + "modules": ["MpvPlayerModule"] + }, + "android": { + "modules": ["expo.modules.mpvplayer.MpvPlayerModule"] + } +} diff --git a/modules/mpv-player/index.ts b/modules/mpv-player/index.ts new file mode 100644 index 00000000..cab14e34 --- /dev/null +++ b/modules/mpv-player/index.ts @@ -0,0 +1,6 @@ +// Reexport the native module. On web, it will be resolved to MpvPlayerModule.web.ts +// and on native platforms to MpvPlayerModule.ts + +export * from "./src/MpvPlayer.types"; +export { default } from "./src/MpvPlayerModule"; +export { default as MpvPlayerView } from "./src/MpvPlayerView"; diff --git a/modules/mpv-player/ios/Logger.swift b/modules/mpv-player/ios/Logger.swift new file mode 100644 index 00000000..43d89182 --- /dev/null +++ b/modules/mpv-player/ios/Logger.swift @@ -0,0 +1,154 @@ +import Foundation + +final class Logger: @unchecked Sendable { + static let shared = Logger() + + struct LogEntry { + let message: String + let type: String + let timestamp: Date + } + + private let queue = DispatchQueue(label: "mpvkit.logger", attributes: .concurrent) + private var logs: [LogEntry] = [] + private let logFileURL: URL + + private let maxFileSize = 1024 * 512 + private let maxLogEntries = 1000 + + private init() { + let tmpDir = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true) + logFileURL = tmpDir.appendingPathComponent("logs.txt") + } + + func log(_ message: String, type: String = "General") { + let entry = LogEntry(message: message, type: type, timestamp: Date()) + + queue.async(flags: .barrier) { + self.logs.append(entry) + + if self.logs.count > self.maxLogEntries { + self.logs.removeFirst(self.logs.count - self.maxLogEntries) + } + + self.saveLogToFile(entry) + self.debugLog(entry) + + DispatchQueue.main.async { + NotificationCenter.default.post(name: NSNotification.Name("LoggerNotification"), object: nil, + userInfo: [ + "message": message, + "type": type, + "timestamp": entry.timestamp + ] + ) + } + } + } + + func getLogs() -> String { + var result = "" + queue.sync { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "dd-MM HH:mm:ss" + result = logs.map { "[\(dateFormatter.string(from: $0.timestamp))] [\($0.type)] \($0.message)" } + .joined(separator: "\n----\n") + } + return result + } + + func getLogsAsync() async -> String { + return await withCheckedContinuation { continuation in + queue.async { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "dd-MM HH:mm:ss" + let result = self.logs.map { "[\(dateFormatter.string(from: $0.timestamp))] [\($0.type)] \($0.message)" } + .joined(separator: "\n----\n") + continuation.resume(returning: result) + } + } + } + + func clearLogs() { + queue.async(flags: .barrier) { + self.logs.removeAll() + try? FileManager.default.removeItem(at: self.logFileURL) + } + } + + func clearLogsAsync() async { + await withCheckedContinuation { continuation in + queue.async(flags: .barrier) { + self.logs.removeAll() + try? FileManager.default.removeItem(at: self.logFileURL) + continuation.resume() + } + } + } + + private func saveLogToFile(_ log: LogEntry) { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "dd-MM HH:mm:ss" + + let logString = "[\(dateFormatter.string(from: log.timestamp))] [\(log.type)] \(log.message)\n---\n" + + guard let data = logString.data(using: .utf8) else { + print("Failed to encode log string to UTF-8") + return + } + + do { + if FileManager.default.fileExists(atPath: logFileURL.path) { + let attributes = try FileManager.default.attributesOfItem(atPath: logFileURL.path) + let fileSize = attributes[.size] as? UInt64 ?? 0 + + if fileSize + UInt64(data.count) > maxFileSize { + self.truncateLogFile() + } + + if let handle = try? FileHandle(forWritingTo: logFileURL) { + handle.seekToEndOfFile() + handle.write(data) + handle.closeFile() + } + } else { + try data.write(to: logFileURL) + } + } catch { + print("Error managing log file: \(error)") + try? data.write(to: logFileURL) + } + } + + private func truncateLogFile() { + do { + guard let content = try? String(contentsOf: logFileURL, encoding: .utf8), + !content.isEmpty else { + return + } + + let entries = content.components(separatedBy: "\n---\n") + guard entries.count > 10 else { return } + + let keepCount = entries.count / 2 + let truncatedEntries = Array(entries.suffix(keepCount)) + let truncatedContent = truncatedEntries.joined(separator: "\n---\n") + + if let truncatedData = truncatedContent.data(using: .utf8) { + try truncatedData.write(to: logFileURL) + } + } catch { + print("Error truncating log file: \(error)") + try? FileManager.default.removeItem(at: logFileURL) + } + } + + private func debugLog(_ entry: LogEntry) { +#if DEBUG + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "dd-MM HH:mm:ss" + let formattedMessage = "[\(dateFormatter.string(from: entry.timestamp))] [\(entry.type)] \(entry.message)" + print(formattedMessage) +#endif + } +} diff --git a/modules/mpv-player/ios/MPVLayerRenderer.swift b/modules/mpv-player/ios/MPVLayerRenderer.swift new file mode 100644 index 00000000..728e9fc3 --- /dev/null +++ b/modules/mpv-player/ios/MPVLayerRenderer.swift @@ -0,0 +1,765 @@ +import UIKit +import MPVKit +import CoreMedia +import CoreVideo +import AVFoundation + +protocol MPVLayerRendererDelegate: AnyObject { + func renderer(_ renderer: MPVLayerRenderer, didUpdatePosition position: Double, duration: Double) + func renderer(_ renderer: MPVLayerRenderer, didChangePause isPaused: Bool) + func renderer(_ renderer: MPVLayerRenderer, didChangeLoading isLoading: Bool) + func renderer(_ renderer: MPVLayerRenderer, didBecomeReadyToSeek: Bool) + func renderer(_ renderer: MPVLayerRenderer, didBecomeTracksReady: Bool) +} + +/// MPV player using vo_avfoundation for video output. +/// This renders video directly to AVSampleBufferDisplayLayer for PiP support. +final class MPVLayerRenderer { + enum RendererError: Error { + case mpvCreationFailed + case mpvInitialization(Int32) + } + + private let displayLayer: AVSampleBufferDisplayLayer + private let queue = DispatchQueue(label: "mpv.avfoundation", qos: .userInitiated) + private let stateQueue = DispatchQueue(label: "mpv.avfoundation.state", attributes: .concurrent) + + private var mpv: OpaquePointer? + + private var currentPreset: PlayerPreset? + private var currentURL: URL? + private var currentHeaders: [String: String]? + private var pendingExternalSubtitles: [String] = [] + private var initialSubtitleId: Int? + private var initialAudioId: Int? + + private var isRunning = false + private var isStopping = false + + // KVO observation for display layer status + private var statusObservation: NSKeyValueObservation? + + weak var delegate: MPVLayerRendererDelegate? + + // Thread-safe state for playback + private var _cachedDuration: Double = 0 + private var _cachedPosition: Double = 0 + private var _isPaused: Bool = true + private var _playbackSpeed: Double = 1.0 + private var _isLoading: Bool = false + private var _isReadyToSeek: Bool = false + + // Thread-safe accessors + private var cachedDuration: Double { + get { stateQueue.sync { _cachedDuration } } + set { stateQueue.async(flags: .barrier) { self._cachedDuration = newValue } } + } + private var cachedPosition: Double { + get { stateQueue.sync { _cachedPosition } } + set { stateQueue.async(flags: .barrier) { self._cachedPosition = newValue } } + } + private var isPaused: Bool { + get { stateQueue.sync { _isPaused } } + set { stateQueue.async(flags: .barrier) { self._isPaused = newValue } } + } + private var playbackSpeed: Double { + get { stateQueue.sync { _playbackSpeed } } + set { stateQueue.async(flags: .barrier) { self._playbackSpeed = newValue } } + } + private var isLoading: Bool { + get { stateQueue.sync { _isLoading } } + set { stateQueue.async(flags: .barrier) { self._isLoading = newValue } } + } + private var isReadyToSeek: Bool { + get { stateQueue.sync { _isReadyToSeek } } + set { stateQueue.async(flags: .barrier) { self._isReadyToSeek = newValue } } + } + + var isPausedState: Bool { + return isPaused + } + + init(displayLayer: AVSampleBufferDisplayLayer) { + self.displayLayer = displayLayer + observeDisplayLayerStatus() + } + + + /// Watches for display layer failures and auto-recovers. + /// + /// iOS aggressively kills VideoToolbox decoder sessions when the app is + /// backgrounded, the screen is locked, or system resources are low. + /// This causes the video to go black - especially problematic for PiP. + /// + /// This KVO observer detects when the display layer status becomes `.failed` + /// and automatically reinitializes the hardware decoder to restore video. + private func observeDisplayLayerStatus() { + statusObservation = displayLayer.observe(\.status, options: [.new]) { [weak self] layer, _ in + guard let self else { return } + + if layer.status == .failed { + print("๐Ÿ”ง Display layer failed - auto-resetting decoder") + self.queue.async { + self.performDecoderReset() + } + } + } + } + + /// Actually performs the decoder reset (called by observer or manually) + private func performDecoderReset() { + guard let handle = mpv else { return } + print("๐Ÿ”ง Resetting decoder: status=\(displayLayer.status.rawValue), requiresFlush=\(displayLayer.requiresFlushToResumeDecoding)") + commandSync(handle, ["set", "hwdec", "no"]) + commandSync(handle, ["set", "hwdec", "auto"]) + } + + deinit { + stop() + } + + func start() throws { + guard !isRunning else { return } + guard let handle = mpv_create() else { + throw RendererError.mpvCreationFailed + } + mpv = handle + + // Logging - only warnings and errors in release, verbose in debug + #if DEBUG + checkError(mpv_request_log_messages(handle, "warn")) + #else + checkError(mpv_request_log_messages(handle, "no")) + #endif + + // Pass the AVSampleBufferDisplayLayer to mpv via --wid + // The vo_avfoundation driver expects this + let layerPtrInt = Int(bitPattern: Unmanaged.passUnretained(displayLayer).toOpaque()) + var displayLayerPtr = Int64(layerPtrInt) + checkError(mpv_set_option(handle, "wid", MPV_FORMAT_INT64, &displayLayerPtr)) + + // Use AVFoundation video output - required for PiP support + checkError(mpv_set_option_string(handle, "vo", "avfoundation")) + + // Enable composite OSD mode - renders subtitles directly onto video frames using GPU + // This is better for PiP as subtitles are baked into the video + checkError(mpv_set_option_string(handle, "avfoundation-composite-osd", "yes")) + + // Hardware decoding with VideoToolbox + // On simulator, use software decoding since VideoToolbox is not available + // On device, use VideoToolbox with software fallback enabled + #if targetEnvironment(simulator) + checkError(mpv_set_option_string(handle, "hwdec", "no")) + #else + checkError(mpv_set_option_string(handle, "hwdec", "videotoolbox")) + #endif + checkError(mpv_set_option_string(handle, "hwdec-codecs", "all")) + checkError(mpv_set_option_string(handle, "hwdec-software-fallback", "yes")) + + // Subtitle and audio settings + checkError(mpv_set_option_string(mpv, "subs-match-os-language", "yes")) + checkError(mpv_set_option_string(mpv, "subs-fallback", "yes")) + + // Initialize mpv + let initStatus = mpv_initialize(handle) + guard initStatus >= 0 else { + throw RendererError.mpvInitialization(initStatus) + } + + // Observe properties + observeProperties() + + // Setup wakeup callback + mpv_set_wakeup_callback(handle, { ctx in + guard let ctx = ctx else { return } + let instance = Unmanaged.fromOpaque(ctx).takeUnretainedValue() + instance.processEvents() + }, Unmanaged.passUnretained(self).toOpaque()) + isRunning = true + } + + func stop() { + if isStopping { return } + if !isRunning, mpv == nil { return } + isRunning = false + isStopping = true + + // Stop observing display layer status + statusObservation?.invalidate() + statusObservation = nil + + queue.sync { [weak self] in + guard let self, let handle = self.mpv else { return } + + mpv_set_wakeup_callback(handle, nil, nil) + mpv_terminate_destroy(handle) + self.mpv = nil + } + + DispatchQueue.main.async { [weak self] in + guard let self else { return } + if #available(iOS 18.0, *) { + self.displayLayer.sampleBufferRenderer.flush(removingDisplayedImage: true, completionHandler: nil) + } else { + self.displayLayer.flushAndRemoveImage() + } + } + + isStopping = false + } + + func load( + url: URL, + with preset: PlayerPreset, + headers: [String: String]? = nil, + startPosition: Double? = nil, + externalSubtitles: [String]? = nil, + initialSubtitleId: Int? = nil, + initialAudioId: Int? = nil + ) { + currentPreset = preset + currentURL = url + currentHeaders = headers + pendingExternalSubtitles = externalSubtitles ?? [] + self.initialSubtitleId = initialSubtitleId + self.initialAudioId = initialAudioId + queue.async { [weak self] in + guard let self else { return } + self.isLoading = true + self.isReadyToSeek = false + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.delegate?.renderer(self, didChangeLoading: true) + } + + guard let handle = self.mpv else { return } + + self.apply(commands: preset.commands, on: handle) + // Stop previous playback before loading new file + self.command(handle, ["stop"]) + self.updateHTTPHeaders(headers) + // Set start position + if let startPos = startPosition, startPos > 0 { + self.setProperty(name: "start", value: String(format: "%.2f", startPos)) + } else { + self.setProperty(name: "start", value: "0") + } + // Set initial audio track if specified + if let audioId = self.initialAudioId, audioId > 0 { + self.setAudioTrack(audioId) + } + // Set initial subtitle track if no external subs + if self.pendingExternalSubtitles.isEmpty { + if let subId = self.initialSubtitleId { + self.setSubtitleTrack(subId) + } else { + self.disableSubtitles() + } + } else { + self.disableSubtitles() + } + let target = url.isFileURL ? url.path : url.absoluteString + self.command(handle, ["loadfile", target, "replace"]) + } + } + + func reloadCurrentItem() { + guard let url = currentURL, let preset = currentPreset else { return } + load(url: url, with: preset, headers: currentHeaders) + } + + func applyPreset(_ preset: PlayerPreset) { + currentPreset = preset + guard let handle = mpv else { return } + queue.async { [weak self] in + guard let self else { return } + self.apply(commands: preset.commands, on: handle) + } + } + + // MARK: - Property Helpers + + private func setOption(name: String, value: String) { + guard let handle = mpv else { return } + checkError(mpv_set_option_string(handle, name, value)) + } + + private func setProperty(name: String, value: String) { + guard let handle = mpv else { return } + let status = mpv_set_property_string(handle, name, value) + if status < 0 { + Logger.shared.log("Failed to set property \(name)=\(value) (\(status))", type: "Warn") + } + } + + private func clearProperty(name: String) { + guard let handle = mpv else { return } + let status = mpv_set_property(handle, name, MPV_FORMAT_NONE, nil) + if status < 0 { + Logger.shared.log("Failed to clear property \(name) (\(status))", type: "Warn") + } + } + + private func updateHTTPHeaders(_ headers: [String: String]?) { + guard let headers, !headers.isEmpty else { + clearProperty(name: "http-header-fields") + return + } + + let headerString = headers + .map { key, value in "\(key): \(value)" } + .joined(separator: "\r\n") + setProperty(name: "http-header-fields", value: headerString) + } + + private func observeProperties() { + guard let handle = mpv else { return } + let properties: [(String, mpv_format)] = [ + ("duration", MPV_FORMAT_DOUBLE), + ("time-pos", MPV_FORMAT_DOUBLE), + ("pause", MPV_FORMAT_FLAG), + ("track-list/count", MPV_FORMAT_INT64), + ("paused-for-cache", MPV_FORMAT_FLAG) + ] + for (name, format) in properties { + mpv_observe_property(handle, 0, name, format) + } + } + + private func apply(commands: [[String]], on handle: OpaquePointer) { + for command in commands { + guard !command.isEmpty else { continue } + self.command(handle, command) + } + } + + private func command(_ handle: OpaquePointer, _ args: [String]) { + guard !args.isEmpty else { return } + _ = withCStringArray(args) { pointer in + mpv_command_async(handle, 0, pointer) + } + } + + @discardableResult + private func commandSync(_ handle: OpaquePointer, _ args: [String]) -> Int32 { + guard !args.isEmpty else { return -1 } + return withCStringArray(args) { pointer in + mpv_command(handle, pointer) + } + } + + private func checkError(_ status: CInt) { + if status < 0 { + Logger.shared.log("MPV API error: \(String(cString: mpv_error_string(status)))", type: "Error") + } + } + + // MARK: - Event Handling + + private func processEvents() { + queue.async { [weak self] in + guard let self else { return } + + while self.mpv != nil && !self.isStopping { + guard let handle = self.mpv, + let eventPointer = mpv_wait_event(handle, 0) else { return } + let event = eventPointer.pointee + if event.event_id == MPV_EVENT_NONE { break } + self.handleEvent(event) + if event.event_id == MPV_EVENT_SHUTDOWN { break } + } + } + } + + private func handleEvent(_ event: mpv_event) { + switch event.event_id { + case MPV_EVENT_FILE_LOADED: + // Add external subtitles now that the file is loaded + let hadExternalSubs = !pendingExternalSubtitles.isEmpty + if hadExternalSubs, let handle = mpv { + for (index, subUrl) in pendingExternalSubtitles.enumerated() { + print("๐Ÿ”ง Adding external subtitle [\(index)]: \(subUrl)") + // Use commandSync to ensure subs are added in exact order (not async) + commandSync(handle, ["sub-add", subUrl]) + } + pendingExternalSubtitles = [] + // Set subtitle after external subs are added + if let subId = initialSubtitleId { + setSubtitleTrack(subId) + } else { + disableSubtitles() + } + } + if !isReadyToSeek { + isReadyToSeek = true + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.delegate?.renderer(self, didBecomeReadyToSeek: true) + } + } + // Notify loading ended + if isLoading { + isLoading = false + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.delegate?.renderer(self, didChangeLoading: false) + } + } + + case MPV_EVENT_SEEK: + // Seek started - show loading indicator + if !isLoading { + isLoading = true + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.delegate?.renderer(self, didChangeLoading: true) + } + } + + case MPV_EVENT_PLAYBACK_RESTART: + // Video playback has started/restarted (including after seek) + if isLoading { + isLoading = false + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.delegate?.renderer(self, didChangeLoading: false) + } + } + case MPV_EVENT_PROPERTY_CHANGE: + if let property = event.data?.assumingMemoryBound(to: mpv_event_property.self).pointee.name { + let name = String(cString: property) + refreshProperty(named: name, event: event) + } + + case MPV_EVENT_SHUTDOWN: + Logger.shared.log("mpv shutdown", type: "Warn") + + case MPV_EVENT_LOG_MESSAGE: + if let logMessagePointer = event.data?.assumingMemoryBound(to: mpv_event_log_message.self) { + let component = String(cString: logMessagePointer.pointee.prefix) + let text = String(cString: logMessagePointer.pointee.text) + let lower = text.lowercased() + if lower.contains("error") { + Logger.shared.log("mpv[\(component)] \(text)", type: "Error") + } else if lower.contains("warn") || lower.contains("warning") { + Logger.shared.log("mpv[\(component)] \(text)", type: "Warn") + } + } + default: + break + } + } + + private func refreshProperty(named name: String, event: mpv_event) { + guard let handle = mpv else { return } + switch name { + case "duration": + var value = Double(0) + let status = getProperty(handle: handle, name: name, format: MPV_FORMAT_DOUBLE, value: &value) + if status >= 0 { + cachedDuration = value + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.delegate?.renderer(self, didUpdatePosition: self.cachedPosition, duration: self.cachedDuration) + } + } + case "time-pos": + var value = Double(0) + let status = getProperty(handle: handle, name: name, format: MPV_FORMAT_DOUBLE, value: &value) + if status >= 0 { + cachedPosition = value + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.delegate?.renderer(self, didUpdatePosition: self.cachedPosition, duration: self.cachedDuration) + } + } + case "pause": + var flag: Int32 = 0 + let status = getProperty(handle: handle, name: name, format: MPV_FORMAT_FLAG, value: &flag) + if status >= 0 { + let newPaused = flag != 0 + if newPaused != isPaused { + isPaused = newPaused + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.delegate?.renderer(self, didChangePause: self.isPaused) + } + } + } + case "paused-for-cache": + var flag: Int32 = 0 + let status = getProperty(handle: handle, name: name, format: MPV_FORMAT_FLAG, value: &flag) + if status >= 0 { + let buffering = flag != 0 + if buffering != isLoading { + isLoading = buffering + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.delegate?.renderer(self, didChangeLoading: buffering) + } + } + } + case "track-list/count": + var trackCount: Int64 = 0 + let status = getProperty(handle: handle, name: name, format: MPV_FORMAT_INT64, value: &trackCount) + if status >= 0 && trackCount > 0 { + Logger.shared.log("Track list updated: \(trackCount) tracks available", type: "Info") + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.delegate?.renderer(self, didBecomeTracksReady: true) + } + } + default: + break + } + } + + private func getStringProperty(handle: OpaquePointer, name: String) -> String? { + var result: String? + if let cString = mpv_get_property_string(handle, name) { + result = String(cString: cString) + mpv_free(cString) + } + return result + } + + @discardableResult + private func getProperty(handle: OpaquePointer, name: String, format: mpv_format, value: inout T) -> Int32 { + return withUnsafeMutablePointer(to: &value) { mutablePointer in + return mpv_get_property(handle, name, format, mutablePointer) + } + } + + @inline(__always) + private func withCStringArray(_ args: [String], body: (UnsafeMutablePointer?>?) -> R) -> R { + var cStrings = [UnsafeMutablePointer?]() + cStrings.reserveCapacity(args.count + 1) + for s in args { + cStrings.append(strdup(s)) + } + cStrings.append(nil) + defer { + for ptr in cStrings where ptr != nil { + free(ptr) + } + } + + return cStrings.withUnsafeMutableBufferPointer { buffer in + return buffer.baseAddress!.withMemoryRebound(to: UnsafePointer?.self, capacity: buffer.count) { rebound in + return body(UnsafeMutablePointer(mutating: rebound)) + } + } + } + + // MARK: - Playback Controls + + func play() { + setProperty(name: "pause", value: "no") + } + + func pausePlayback() { + setProperty(name: "pause", value: "yes") + } + + func togglePause() { + if isPaused { play() } else { pausePlayback() } + } + + func seek(to seconds: Double) { + guard let handle = mpv else { return } + let clamped = max(0, seconds) + cachedPosition = clamped + commandSync(handle, ["seek", String(clamped), "absolute"]) + } + + + + func seek(by seconds: Double) { + guard let handle = mpv else { return } + let newPosition = max(0, cachedPosition + seconds) + cachedPosition = newPosition + commandSync(handle, ["seek", String(seconds), "relative"]) + } + + /// Sync timebase - no-op for vo_avfoundation (mpv handles timing) + func syncTimebase() { + // vo_avfoundation manages its own timebase + } + + func setSpeed(_ speed: Double) { + playbackSpeed = speed + setProperty(name: "speed", value: String(speed)) + } + + func getSpeed() -> Double { + guard let handle = mpv else { return 1.0 } + var speed: Double = 1.0 + getProperty(handle: handle, name: "speed", format: MPV_FORMAT_DOUBLE, value: &speed) + return speed + } + + // MARK: - Subtitle Controls + + func getSubtitleTracks() -> [[String: Any]] { + guard let handle = mpv else { + Logger.shared.log("getSubtitleTracks: mpv handle is nil", type: "Warn") + return [] + } + var tracks: [[String: Any]] = [] + + var trackCount: Int64 = 0 + getProperty(handle: handle, name: "track-list/count", format: MPV_FORMAT_INT64, value: &trackCount) + + for i in 0.. Int { + guard let handle = mpv else { return 0 } + var sid: Int64 = 0 + getProperty(handle: handle, name: "sid", format: MPV_FORMAT_INT64, value: &sid) + return Int(sid) + } + + func addSubtitleFile(url: String, select: Bool = true) { + guard let handle = mpv else { return } + let flag = select ? "select" : "cached" + commandSync(handle, ["sub-add", url, flag]) + } + + // MARK: - Subtitle Positioning + + func setSubtitlePosition(_ position: Int) { + setProperty(name: "sub-pos", value: String(position)) + } + + func setSubtitleScale(_ scale: Double) { + setProperty(name: "sub-scale", value: String(scale)) + } + + func setSubtitleMarginY(_ margin: Int) { + setProperty(name: "sub-margin-y", value: String(margin)) + } + + func setSubtitleAlignX(_ alignment: String) { + setProperty(name: "sub-align-x", value: alignment) + } + + func setSubtitleAlignY(_ alignment: String) { + setProperty(name: "sub-align-y", value: alignment) + } + + func setSubtitleFontSize(_ size: Int) { + setProperty(name: "sub-font-size", value: String(size)) + } + + // MARK: - Audio Track Controls + + func getAudioTracks() -> [[String: Any]] { + guard let handle = mpv else { + Logger.shared.log("getAudioTracks: mpv handle is nil", type: "Warn") + return [] + } + var tracks: [[String: Any]] = [] + + var trackCount: Int64 = 0 + getProperty(handle: handle, name: "track-list/count", format: MPV_FORMAT_INT64, value: &trackCount) + + for i in 0.. 0 { + track["channels"] = Int(channels) + } + + var selected: Int32 = 0 + getProperty(handle: handle, name: "track-list/\(i)/selected", format: MPV_FORMAT_FLAG, value: &selected) + track["selected"] = selected != 0 + + Logger.shared.log("getAudioTracks: found audio track id=\(trackId), title=\(track["title"] ?? "none"), lang=\(track["lang"] ?? "none")", type: "Info") + tracks.append(track) + } + + Logger.shared.log("getAudioTracks: returning \(tracks.count) audio tracks", type: "Info") + return tracks + } + + func setAudioTrack(_ trackId: Int) { + guard mpv != nil else { + Logger.shared.log("setAudioTrack: mpv handle is nil", type: "Warn") + return + } + Logger.shared.log("setAudioTrack: setting aid to \(trackId)", type: "Info") + setProperty(name: "aid", value: String(trackId)) + } + + func getCurrentAudioTrack() -> Int { + guard let handle = mpv else { return 0 } + var aid: Int64 = 0 + getProperty(handle: handle, name: "aid", format: MPV_FORMAT_INT64, value: &aid) + return Int(aid) + } +} diff --git a/modules/mpv-player/ios/MpvPlayer.podspec b/modules/mpv-player/ios/MpvPlayer.podspec new file mode 100644 index 00000000..2a6c2ed6 --- /dev/null +++ b/modules/mpv-player/ios/MpvPlayer.podspec @@ -0,0 +1,33 @@ +Pod::Spec.new do |s| + s.name = 'MpvPlayer' + s.version = '1.0.0' + s.summary = 'MPVKit for Expo' + s.description = 'MPVKit for Expo' + s.author = 'mpvkit' + s.homepage = 'https://github.com/mpvkit/MPVKit' + s.platforms = { + :ios => '15.1', + :tvos => '15.1' + } + s.source = { git: 'https://github.com/mpvkit/MPVKit.git' } + s.static_framework = true + + s.dependency 'ExpoModulesCore' + s.dependency 'MPVKit-GPL' + + # Swift/Objective-C compatibility + s.pod_target_xcconfig = { + 'DEFINES_MODULE' => 'YES', + 'VALID_ARCHS' => 'arm64', + 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386', + 'DEBUG_INFORMATION_FORMAT' => 'dwarf', + 'STRIP_INSTALLED_PRODUCT' => 'YES', + 'DEPLOYMENT_POSTPROCESSING' => 'YES', + } + + s.user_target_xcconfig = { + 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' + } + + s.source_files = "*.{h,m,mm,swift,hpp,cpp}" +end diff --git a/modules/mpv-player/ios/MpvPlayerModule.swift b/modules/mpv-player/ios/MpvPlayerModule.swift new file mode 100644 index 00000000..c8355791 --- /dev/null +++ b/modules/mpv-player/ios/MpvPlayerModule.swift @@ -0,0 +1,180 @@ +import ExpoModulesCore + +public class MpvPlayerModule: Module { + public func definition() -> ModuleDefinition { + Name("MpvPlayer") + + // Defines event names that the module can send to JavaScript. + Events("onChange") + + // Defines a JavaScript synchronous function that runs the native code on the JavaScript thread. + Function("hello") { + return "Hello from MPV Player! ๐Ÿ‘‹" + } + + // Defines a JavaScript function that always returns a Promise and whose native code + // is by default dispatched on the different thread than the JavaScript runtime runs on. + AsyncFunction("setValueAsync") { (value: String) in + // Send an event to JavaScript. + self.sendEvent("onChange", [ + "value": value + ]) + } + + // Enables the module to be used as a native view. Definition components that are accepted as part of the + // view definition: Prop, Events. + View(MpvPlayerView.self) { + // All video load options are passed via a single "source" prop + Prop("source") { (view: MpvPlayerView, source: [String: Any]?) in + guard let source = source, + let urlString = source["url"] as? String, + let videoURL = URL(string: urlString) else { return } + + let config = VideoLoadConfig( + url: videoURL, + headers: source["headers"] as? [String: String], + externalSubtitles: source["externalSubtitles"] as? [String], + startPosition: source["startPosition"] as? Double, + autoplay: (source["autoplay"] as? Bool) ?? true, + initialSubtitleId: source["initialSubtitleId"] as? Int, + initialAudioId: source["initialAudioId"] as? Int + ) + + view.loadVideo(config: config) + } + + // Async function to play video + AsyncFunction("play") { (view: MpvPlayerView) in + view.play() + } + + // Async function to pause video + AsyncFunction("pause") { (view: MpvPlayerView) in + view.pause() + } + + // Async function to seek to position + AsyncFunction("seekTo") { (view: MpvPlayerView, position: Double) in + view.seekTo(position: position) + } + + // Async function to seek by offset + AsyncFunction("seekBy") { (view: MpvPlayerView, offset: Double) in + view.seekBy(offset: offset) + } + + // Async function to set playback speed + AsyncFunction("setSpeed") { (view: MpvPlayerView, speed: Double) in + view.setSpeed(speed: speed) + } + + // Function to get current speed + AsyncFunction("getSpeed") { (view: MpvPlayerView) -> Double in + return view.getSpeed() + } + + // Function to check if paused + AsyncFunction("isPaused") { (view: MpvPlayerView) -> Bool in + return view.isPaused() + } + + // Function to get current position + AsyncFunction("getCurrentPosition") { (view: MpvPlayerView) -> Double in + return view.getCurrentPosition() + } + + // Function to get duration + AsyncFunction("getDuration") { (view: MpvPlayerView) -> Double in + return view.getDuration() + } + + // Picture in Picture functions + AsyncFunction("startPictureInPicture") { (view: MpvPlayerView) in + view.startPictureInPicture() + } + + AsyncFunction("stopPictureInPicture") { (view: MpvPlayerView) in + view.stopPictureInPicture() + } + + AsyncFunction("isPictureInPictureSupported") { (view: MpvPlayerView) -> Bool in + return view.isPictureInPictureSupported() + } + + AsyncFunction("isPictureInPictureActive") { (view: MpvPlayerView) -> Bool in + return view.isPictureInPictureActive() + } + + // Subtitle functions + AsyncFunction("getSubtitleTracks") { (view: MpvPlayerView) -> [[String: Any]] in + return view.getSubtitleTracks() + } + + AsyncFunction("setSubtitleTrack") { (view: MpvPlayerView, trackId: Int) in + view.setSubtitleTrack(trackId) + } + + AsyncFunction("disableSubtitles") { (view: MpvPlayerView) in + view.disableSubtitles() + } + + AsyncFunction("getCurrentSubtitleTrack") { (view: MpvPlayerView) -> Int in + return view.getCurrentSubtitleTrack() + } + + AsyncFunction("addSubtitleFile") { (view: MpvPlayerView, url: String, select: Bool) in + view.addSubtitleFile(url: url, select: select) + } + + // Subtitle positioning functions + AsyncFunction("setSubtitlePosition") { (view: MpvPlayerView, position: Int) in + view.setSubtitlePosition(position) + } + + AsyncFunction("setSubtitleScale") { (view: MpvPlayerView, scale: Double) in + view.setSubtitleScale(scale) + } + + AsyncFunction("setSubtitleMarginY") { (view: MpvPlayerView, margin: Int) in + view.setSubtitleMarginY(margin) + } + + AsyncFunction("setSubtitleAlignX") { (view: MpvPlayerView, alignment: String) in + view.setSubtitleAlignX(alignment) + } + + AsyncFunction("setSubtitleAlignY") { (view: MpvPlayerView, alignment: String) in + view.setSubtitleAlignY(alignment) + } + + AsyncFunction("setSubtitleFontSize") { (view: MpvPlayerView, size: Int) in + view.setSubtitleFontSize(size) + } + + // Audio track functions + AsyncFunction("getAudioTracks") { (view: MpvPlayerView) -> [[String: Any]] in + return view.getAudioTracks() + } + + AsyncFunction("setAudioTrack") { (view: MpvPlayerView, trackId: Int) in + view.setAudioTrack(trackId) + } + + AsyncFunction("getCurrentAudioTrack") { (view: MpvPlayerView) -> Int in + return view.getCurrentAudioTrack() + } + + // Video scaling functions + AsyncFunction("setZoomedToFill") { (view: MpvPlayerView, zoomed: Bool) in + view.setZoomedToFill(zoomed) + } + + AsyncFunction("isZoomedToFill") { (view: MpvPlayerView) -> Bool in + return view.isZoomedToFill() + } + + // Defines events that the view can send to JavaScript + Events("onLoad", "onPlaybackStateChange", "onProgress", "onError", "onTracksReady") + } + } +} diff --git a/modules/mpv-player/ios/MpvPlayerView.swift b/modules/mpv-player/ios/MpvPlayerView.swift new file mode 100644 index 00000000..b4cc40bf --- /dev/null +++ b/modules/mpv-player/ios/MpvPlayerView.swift @@ -0,0 +1,434 @@ +import AVFoundation +import CoreMedia +import ExpoModulesCore +import UIKit + +/// Configuration for loading a video +struct VideoLoadConfig { + let url: URL + var headers: [String: String]? + var externalSubtitles: [String]? + var startPosition: Double? + var autoplay: Bool + /// MPV subtitle track ID to select on start (1-based, -1 to disable, nil to use default) + var initialSubtitleId: Int? + /// MPV audio track ID to select on start (1-based, nil to use default) + var initialAudioId: Int? + + init( + url: URL, + headers: [String: String]? = nil, + externalSubtitles: [String]? = nil, + startPosition: Double? = nil, + autoplay: Bool = true, + initialSubtitleId: Int? = nil, + initialAudioId: Int? = nil + ) { + self.url = url + self.headers = headers + self.externalSubtitles = externalSubtitles + self.startPosition = startPosition + self.autoplay = autoplay + self.initialSubtitleId = initialSubtitleId + self.initialAudioId = initialAudioId + } +} + +// This view will be used as a native component. Make sure to inherit from `ExpoView` +// to apply the proper styling (e.g. border radius and shadows). +class MpvPlayerView: ExpoView { + private let displayLayer = AVSampleBufferDisplayLayer() + private var renderer: MPVLayerRenderer? + private var videoContainer: UIView! + private var pipController: PiPController? + + let onLoad = EventDispatcher() + let onPlaybackStateChange = EventDispatcher() + let onProgress = EventDispatcher() + let onError = EventDispatcher() + let onTracksReady = EventDispatcher() + + private var currentURL: URL? + private var cachedPosition: Double = 0 + private var cachedDuration: Double = 0 + private var intendedPlayState: Bool = false + private var _isZoomedToFill: Bool = false + + required init(appContext: AppContext? = nil) { + super.init(appContext: appContext) + setupView() + // Note: Decoder reset is handled automatically via KVO in MPVLayerRenderer + } + + private func setupView() { + clipsToBounds = true + backgroundColor = .black + + videoContainer = UIView() + videoContainer.translatesAutoresizingMaskIntoConstraints = false + videoContainer.backgroundColor = .black + videoContainer.clipsToBounds = true + addSubview(videoContainer) + + displayLayer.frame = bounds + displayLayer.videoGravity = .resizeAspect + if #available(iOS 17.0, *) { + displayLayer.wantsExtendedDynamicRangeContent = true + } + displayLayer.backgroundColor = UIColor.black.cgColor + videoContainer.layer.addSublayer(displayLayer) + + NSLayoutConstraint.activate([ + videoContainer.topAnchor.constraint(equalTo: topAnchor), + videoContainer.leadingAnchor.constraint(equalTo: leadingAnchor), + videoContainer.trailingAnchor.constraint(equalTo: trailingAnchor), + videoContainer.bottomAnchor.constraint(equalTo: bottomAnchor) + ]) + + renderer = MPVLayerRenderer(displayLayer: displayLayer) + renderer?.delegate = self + + // Setup PiP + pipController = PiPController(sampleBufferDisplayLayer: displayLayer) + pipController?.delegate = self + + do { + try renderer?.start() + } catch { + onError(["error": "Failed to start renderer: \(error.localizedDescription)"]) + } + } + + override func layoutSubviews() { + super.layoutSubviews() + CATransaction.begin() + CATransaction.setDisableActions(true) + displayLayer.frame = videoContainer.bounds + displayLayer.isHidden = false + displayLayer.opacity = 1.0 + CATransaction.commit() + } + + func loadVideo(config: VideoLoadConfig) { + // Skip reload if same URL is already playing + if currentURL == config.url { + return + } + currentURL = config.url + + let preset = PlayerPreset( + id: .sdrRec709, + title: "Default", + summary: "Default playback preset", + stream: nil, + commands: [] + ) + + // Pass everything to the renderer - it handles start position and external subs + renderer?.load( + url: config.url, + with: preset, + headers: config.headers, + startPosition: config.startPosition, + externalSubtitles: config.externalSubtitles, + initialSubtitleId: config.initialSubtitleId, + initialAudioId: config.initialAudioId + ) + + if config.autoplay { + play() + } + + onLoad(["url": config.url.absoluteString]) + } + + // Convenience method for simple loads + func loadVideo(url: URL, headers: [String: String]? = nil) { + loadVideo(config: VideoLoadConfig(url: url, headers: headers)) + } + + func play() { + intendedPlayState = true + renderer?.play() + pipController?.setPlaybackRate(1.0) + pipController?.updatePlaybackState() + } + + func pause() { + intendedPlayState = false + renderer?.pausePlayback() + pipController?.setPlaybackRate(0.0) + pipController?.updatePlaybackState() + } + + func seekTo(position: Double) { + renderer?.seek(to: position) + } + + func seekBy(offset: Double) { + renderer?.seek(by: offset) + } + + func setSpeed(speed: Double) { + renderer?.setSpeed(speed) + } + + func getSpeed() -> Double { + return renderer?.getSpeed() ?? 1.0 + } + + func isPaused() -> Bool { + return renderer?.isPausedState ?? true + } + + func getCurrentPosition() -> Double { + return cachedPosition + } + + func getDuration() -> Double { + return cachedDuration + } + + // MARK: - Picture in Picture + + func startPictureInPicture() { + print("๐ŸŽฌ MpvPlayerView: startPictureInPicture called") + print("๐ŸŽฌ Duration: \(getDuration()), IsPlaying: \(!isPaused())") + pipController?.startPictureInPicture() + } + + func stopPictureInPicture() { + pipController?.stopPictureInPicture() + } + + func isPictureInPictureSupported() -> Bool { + return pipController?.isPictureInPictureSupported ?? false + } + + func isPictureInPictureActive() -> Bool { + return pipController?.isPictureInPictureActive ?? false + } + + // MARK: - Subtitle Controls + + func getSubtitleTracks() -> [[String: Any]] { + return renderer?.getSubtitleTracks() ?? [] + } + + func setSubtitleTrack(_ trackId: Int) { + renderer?.setSubtitleTrack(trackId) + } + + func disableSubtitles() { + renderer?.disableSubtitles() + } + + func getCurrentSubtitleTrack() -> Int { + return renderer?.getCurrentSubtitleTrack() ?? 0 + } + + func addSubtitleFile(url: String, select: Bool = true) { + renderer?.addSubtitleFile(url: url, select: select) + } + + // MARK: - Audio Track Controls + + func getAudioTracks() -> [[String: Any]] { + return renderer?.getAudioTracks() ?? [] + } + + func setAudioTrack(_ trackId: Int) { + renderer?.setAudioTrack(trackId) + } + + func getCurrentAudioTrack() -> Int { + return renderer?.getCurrentAudioTrack() ?? 0 + } + + // MARK: - Subtitle Positioning + + func setSubtitlePosition(_ position: Int) { + renderer?.setSubtitlePosition(position) + } + + func setSubtitleScale(_ scale: Double) { + renderer?.setSubtitleScale(scale) + } + + func setSubtitleMarginY(_ margin: Int) { + renderer?.setSubtitleMarginY(margin) + } + + func setSubtitleAlignX(_ alignment: String) { + renderer?.setSubtitleAlignX(alignment) + } + + func setSubtitleAlignY(_ alignment: String) { + renderer?.setSubtitleAlignY(alignment) + } + + func setSubtitleFontSize(_ size: Int) { + renderer?.setSubtitleFontSize(size) + } + + // MARK: - Video Scaling + + func setZoomedToFill(_ zoomed: Bool) { + _isZoomedToFill = zoomed + displayLayer.videoGravity = zoomed ? .resizeAspectFill : .resizeAspect + } + + func isZoomedToFill() -> Bool { + return _isZoomedToFill + } + + deinit { + pipController?.stopPictureInPicture() + renderer?.stop() + displayLayer.removeFromSuperlayer() + } +} + +// MARK: - MPVLayerRendererDelegate + +extension MpvPlayerView: MPVLayerRendererDelegate { + func renderer(_: MPVLayerRenderer, didUpdatePosition position: Double, duration: Double) { + cachedPosition = position + cachedDuration = duration + + DispatchQueue.main.async { [weak self] in + guard let self else { return } + // Update PiP current time for progress bar + if self.pipController?.isPictureInPictureActive == true { + self.pipController?.setCurrentTimeFromSeconds(position, duration: duration) + } + + self.onProgress([ + "position": position, + "duration": duration, + "progress": duration > 0 ? position / duration : 0, + ]) + } + } + + func renderer(_: MPVLayerRenderer, didChangePause isPaused: Bool) { + DispatchQueue.main.async { [weak self] in + guard let self else { return } + // Don't update intendedPlayState here - it's only set by user actions (play/pause) + // This prevents PiP UI flicker during seeking + + // Sync timebase rate with actual playback state + self.pipController?.setPlaybackRate(isPaused ? 0.0 : 1.0) + + self.onPlaybackStateChange([ + "isPaused": isPaused, + "isPlaying": !isPaused, + ]) + } + } + + func renderer(_: MPVLayerRenderer, didChangeLoading isLoading: Bool) { + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.onPlaybackStateChange([ + "isLoading": isLoading, + ]) + } + } + + func renderer(_: MPVLayerRenderer, didBecomeReadyToSeek: Bool) { + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.onPlaybackStateChange([ + "isReadyToSeek": didBecomeReadyToSeek, + ]) + } + } + + func renderer(_: MPVLayerRenderer, didBecomeTracksReady: Bool) { + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.onTracksReady([:]) + } + } +} + +// MARK: - PiPControllerDelegate + +extension MpvPlayerView: PiPControllerDelegate { + func pipController(_ controller: PiPController, willStartPictureInPicture: Bool) { + print("PiP will start") + // Sync timebase before PiP starts for smooth transition + renderer?.syncTimebase() + // Set current time for PiP progress bar + pipController?.setCurrentTimeFromSeconds(cachedPosition, duration: cachedDuration) + + // Reset to fit for PiP (zoomed video doesn't display correctly in PiP) + if _isZoomedToFill { + displayLayer.videoGravity = .resizeAspect + } + } + + func pipController(_ controller: PiPController, didStartPictureInPicture: Bool) { + print("PiP did start: \(didStartPictureInPicture)") + // Ensure current time is synced when PiP starts + pipController?.setCurrentTimeFromSeconds(cachedPosition, duration: cachedDuration) + } + + func pipController(_ controller: PiPController, willStopPictureInPicture: Bool) { + print("PiP will stop") + // Sync timebase before returning from PiP + renderer?.syncTimebase() + } + + func pipController(_ controller: PiPController, didStopPictureInPicture: Bool) { + print("PiP did stop") + // Ensure timebase is synced after PiP ends + renderer?.syncTimebase() + pipController?.updatePlaybackState() + + // Restore the user's zoom preference + if _isZoomedToFill { + displayLayer.videoGravity = .resizeAspectFill + } + } + + func pipController(_ controller: PiPController, restoreUserInterfaceForPictureInPictureStop completionHandler: @escaping (Bool) -> Void) { + print("PiP restore user interface") + completionHandler(true) + } + + func pipControllerPlay(_ controller: PiPController) { + print("PiP play requested") + intendedPlayState = true + renderer?.play() + pipController?.setPlaybackRate(1.0) + } + + func pipControllerPause(_ controller: PiPController) { + print("PiP pause requested") + intendedPlayState = false + renderer?.pausePlayback() + pipController?.setPlaybackRate(0.0) + } + + func pipController(_ controller: PiPController, skipByInterval interval: CMTime) { + let seconds = CMTimeGetSeconds(interval) + print("PiP skip by interval: \(seconds)") + let target = max(0, cachedPosition + seconds) + seekTo(position: target) + } + + func pipControllerIsPlaying(_ controller: PiPController) -> Bool { + // Use intended state to ignore transient pauses during seeking + return intendedPlayState + } + + func pipControllerDuration(_ controller: PiPController) -> Double { + return getDuration() + } + + func pipControllerCurrentPosition(_ controller: PiPController) -> Double { + return getCurrentPosition() + } +} diff --git a/modules/mpv-player/ios/PiPController.swift b/modules/mpv-player/ios/PiPController.swift new file mode 100644 index 00000000..7a58cb38 --- /dev/null +++ b/modules/mpv-player/ios/PiPController.swift @@ -0,0 +1,233 @@ +import AVKit +import AVFoundation + +protocol PiPControllerDelegate: AnyObject { + func pipController(_ controller: PiPController, willStartPictureInPicture: Bool) + func pipController(_ controller: PiPController, didStartPictureInPicture: Bool) + func pipController(_ controller: PiPController, willStopPictureInPicture: Bool) + func pipController(_ controller: PiPController, didStopPictureInPicture: Bool) + func pipController(_ controller: PiPController, restoreUserInterfaceForPictureInPictureStop completionHandler: @escaping (Bool) -> Void) + func pipControllerPlay(_ controller: PiPController) + func pipControllerPause(_ controller: PiPController) + func pipController(_ controller: PiPController, skipByInterval interval: CMTime) + func pipControllerIsPlaying(_ controller: PiPController) -> Bool + func pipControllerDuration(_ controller: PiPController) -> Double + func pipControllerCurrentPosition(_ controller: PiPController) -> Double +} + +final class PiPController: NSObject { + private var pipController: AVPictureInPictureController? + private weak var sampleBufferDisplayLayer: AVSampleBufferDisplayLayer? + + weak var delegate: PiPControllerDelegate? + + // Timebase for PiP progress tracking + private var timebase: CMTimebase? + + // Track current time for PiP progress + private var currentTime: CMTime = .zero + private var currentDuration: Double = 0 + + var isPictureInPictureSupported: Bool { + return AVPictureInPictureController.isPictureInPictureSupported() + } + + var isPictureInPictureActive: Bool { + return pipController?.isPictureInPictureActive ?? false + } + + var isPictureInPicturePossible: Bool { + return pipController?.isPictureInPicturePossible ?? false + } + + init(sampleBufferDisplayLayer: AVSampleBufferDisplayLayer) { + self.sampleBufferDisplayLayer = sampleBufferDisplayLayer + super.init() + setupTimebase() + setupPictureInPicture() + } + + private func setupTimebase() { + // Create a timebase for tracking playback time + var newTimebase: CMTimebase? + let status = CMTimebaseCreateWithSourceClock( + allocator: kCFAllocatorDefault, + sourceClock: CMClockGetHostTimeClock(), + timebaseOut: &newTimebase + ) + + if status == noErr, let tb = newTimebase { + timebase = tb + CMTimebaseSetTime(tb, time: .zero) + CMTimebaseSetRate(tb, rate: 0) // Start paused + + // Set the control timebase on the display layer + sampleBufferDisplayLayer?.controlTimebase = tb + } + } + + private func setupPictureInPicture() { + guard isPictureInPictureSupported, + let displayLayer = sampleBufferDisplayLayer else { + return + } + + let contentSource = AVPictureInPictureController.ContentSource( + sampleBufferDisplayLayer: displayLayer, + playbackDelegate: self + ) + + pipController = AVPictureInPictureController(contentSource: contentSource) + pipController?.delegate = self + pipController?.requiresLinearPlayback = false + #if !os(tvOS) + pipController?.canStartPictureInPictureAutomaticallyFromInline = true + #endif + } + + func startPictureInPicture() { + guard let pipController = pipController, + pipController.isPictureInPicturePossible else { + return + } + + pipController.startPictureInPicture() + } + + func stopPictureInPicture() { + pipController?.stopPictureInPicture() + } + + func invalidate() { + if Thread.isMainThread { + pipController?.invalidatePlaybackState() + } else { + DispatchQueue.main.async { [weak self] in + self?.pipController?.invalidatePlaybackState() + } + } + } + + func updatePlaybackState() { + // Only invalidate when PiP is active to avoid "no context menu visible" warnings + guard isPictureInPictureActive else { return } + + if Thread.isMainThread { + pipController?.invalidatePlaybackState() + } else { + DispatchQueue.main.async { [weak self] in + self?.pipController?.invalidatePlaybackState() + } + } + } + + /// Updates the current playback time for PiP progress display + func setCurrentTime(_ time: CMTime) { + currentTime = time + + // Update the timebase to reflect current position + if let tb = timebase { + CMTimebaseSetTime(tb, time: time) + } + + // Only invalidate when PiP is active to avoid unnecessary updates + if isPictureInPictureActive { + updatePlaybackState() + } + } + + /// Updates the current playback time from seconds + func setCurrentTimeFromSeconds(_ seconds: Double, duration: Double) { + guard seconds >= 0 else { return } + currentDuration = duration + let time = CMTime(seconds: seconds, preferredTimescale: 1000) + setCurrentTime(time) + } + + /// Updates the playback rate on the timebase (1.0 = playing, 0.0 = paused) + func setPlaybackRate(_ rate: Float) { + if let tb = timebase { + CMTimebaseSetRate(tb, rate: Float64(rate)) + } + } +} + +// MARK: - AVPictureInPictureControllerDelegate + +extension PiPController: AVPictureInPictureControllerDelegate { + func pictureInPictureControllerWillStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) { + delegate?.pipController(self, willStartPictureInPicture: true) + } + + func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) { + delegate?.pipController(self, didStartPictureInPicture: true) + } + + func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, failedToStartPictureInPictureWithError error: Error) { + print("Failed to start PiP: \(error)") + delegate?.pipController(self, didStartPictureInPicture: false) + } + + func pictureInPictureControllerWillStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) { + delegate?.pipController(self, willStopPictureInPicture: true) + } + + func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) { + delegate?.pipController(self, didStopPictureInPicture: true) + } + + func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) { + delegate?.pipController(self, restoreUserInterfaceForPictureInPictureStop: completionHandler) + } +} + +// MARK: - AVPictureInPictureSampleBufferPlaybackDelegate + +extension PiPController: AVPictureInPictureSampleBufferPlaybackDelegate { + + func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, setPlaying playing: Bool) { + if playing { + delegate?.pipControllerPlay(self) + } else { + delegate?.pipControllerPause(self) + } + } + + func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, didTransitionToRenderSize newRenderSize: CMVideoDimensions) { + } + + func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, skipByInterval skipInterval: CMTime, completion completionHandler: @escaping () -> Void) { + delegate?.pipController(self, skipByInterval: skipInterval) + completionHandler() + } + + var isPlaying: Bool { + return delegate?.pipControllerIsPlaying(self) ?? false + } + + var timeRangeForPlayback: CMTimeRange { + let duration = delegate?.pipControllerDuration(self) ?? 0 + if duration > 0 { + let cmDuration = CMTime(seconds: duration, preferredTimescale: 1000) + return CMTimeRange(start: .zero, duration: cmDuration) + } + return CMTimeRange(start: .zero, duration: .positiveInfinity) + } + + func pictureInPictureControllerTimeRangeForPlayback(_ pictureInPictureController: AVPictureInPictureController) -> CMTimeRange { + return timeRangeForPlayback + } + + func pictureInPictureControllerIsPlaybackPaused(_ pictureInPictureController: AVPictureInPictureController) -> Bool { + return !isPlaying + } + + func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, setPlaying playing: Bool, completion: @escaping () -> Void) { + if playing { + delegate?.pipControllerPlay(self) + } else { + delegate?.pipControllerPause(self) + } + completion() + } +} \ No newline at end of file diff --git a/modules/mpv-player/ios/PlayerPreset.swift b/modules/mpv-player/ios/PlayerPreset.swift new file mode 100644 index 00000000..38112f05 --- /dev/null +++ b/modules/mpv-player/ios/PlayerPreset.swift @@ -0,0 +1,40 @@ +import Foundation + +struct PlayerPreset: Identifiable, Hashable { + enum Identifier: String, CaseIterable { + case sdrRec709 + case hdr10 + case dolbyVisionP5 + case dolbyVisionP8 + } + + struct Stream: Hashable { + enum Source: Hashable { + case remote(URL) + case bundled(resource: String, withExtension: String) + } + + let source: Source + let note: String + + func resolveURL() -> URL? { + switch source { + case .remote(let url): + return url + case .bundled(let resource, let ext): + return Bundle.main.url(forResource: resource, withExtension: ext) + } + } + } + + let id: Identifier + let title: String + let summary: String + let stream: Stream? + let commands: [[String]] + + static var presets: [PlayerPreset] { + let list: [PlayerPreset] = [] + return list + } +} \ No newline at end of file diff --git a/modules/mpv-player/src/MpvPlayer.types.ts b/modules/mpv-player/src/MpvPlayer.types.ts new file mode 100644 index 00000000..8ed61d51 --- /dev/null +++ b/modules/mpv-player/src/MpvPlayer.types.ts @@ -0,0 +1,108 @@ +import type { StyleProp, ViewStyle } from "react-native"; + +export type OnLoadEventPayload = { + url: string; +}; + +export type OnPlaybackStateChangePayload = { + isPaused?: boolean; + isPlaying?: boolean; + isLoading?: boolean; + isReadyToSeek?: boolean; +}; + +export type OnProgressEventPayload = { + position: number; + duration: number; + progress: number; +}; + +export type OnErrorEventPayload = { + error: string; +}; + +export type OnTracksReadyEventPayload = Record; + +export type MpvPlayerModuleEvents = { + onChange: (params: ChangeEventPayload) => void; +}; + +export type ChangeEventPayload = { + value: string; +}; + +export type VideoSource = { + url: string; + headers?: Record; + externalSubtitles?: string[]; + startPosition?: number; + autoplay?: boolean; + /** MPV subtitle track ID to select on start (1-based, -1 to disable) */ + initialSubtitleId?: number; + /** MPV audio track ID to select on start (1-based) */ + initialAudioId?: number; +}; + +export type MpvPlayerViewProps = { + source?: VideoSource; + style?: StyleProp; + onLoad?: (event: { nativeEvent: OnLoadEventPayload }) => void; + onPlaybackStateChange?: (event: { + nativeEvent: OnPlaybackStateChangePayload; + }) => void; + onProgress?: (event: { nativeEvent: OnProgressEventPayload }) => void; + onError?: (event: { nativeEvent: OnErrorEventPayload }) => void; + onTracksReady?: (event: { nativeEvent: OnTracksReadyEventPayload }) => void; +}; + +export interface MpvPlayerViewRef { + play: () => Promise; + pause: () => Promise; + seekTo: (position: number) => Promise; + seekBy: (offset: number) => Promise; + setSpeed: (speed: number) => Promise; + getSpeed: () => Promise; + isPaused: () => Promise; + getCurrentPosition: () => Promise; + getDuration: () => Promise; + startPictureInPicture: () => Promise; + stopPictureInPicture: () => Promise; + isPictureInPictureSupported: () => Promise; + isPictureInPictureActive: () => Promise; + // Subtitle controls + getSubtitleTracks: () => Promise; + setSubtitleTrack: (trackId: number) => Promise; + disableSubtitles: () => Promise; + getCurrentSubtitleTrack: () => Promise; + addSubtitleFile: (url: string, select?: boolean) => Promise; + // Subtitle positioning + setSubtitlePosition: (position: number) => Promise; + setSubtitleScale: (scale: number) => Promise; + setSubtitleMarginY: (margin: number) => Promise; + setSubtitleAlignX: (alignment: "left" | "center" | "right") => Promise; + setSubtitleAlignY: (alignment: "top" | "center" | "bottom") => Promise; + setSubtitleFontSize: (size: number) => Promise; + // Audio controls + getAudioTracks: () => Promise; + setAudioTrack: (trackId: number) => Promise; + getCurrentAudioTrack: () => Promise; + // Video scaling + setZoomedToFill: (zoomed: boolean) => Promise; + isZoomedToFill: () => Promise; +} + +export type SubtitleTrack = { + id: number; + title?: string; + lang?: string; + selected?: boolean; +}; + +export type AudioTrack = { + id: number; + title?: string; + lang?: string; + codec?: string; + channels?: number; + selected?: boolean; +}; diff --git a/modules/mpv-player/src/MpvPlayerModule.ts b/modules/mpv-player/src/MpvPlayerModule.ts new file mode 100644 index 00000000..a1b72af8 --- /dev/null +++ b/modules/mpv-player/src/MpvPlayerModule.ts @@ -0,0 +1,11 @@ +import { NativeModule, requireNativeModule } from "expo"; + +import { MpvPlayerModuleEvents } from "./MpvPlayer.types"; + +declare class MpvPlayerModule extends NativeModule { + hello(): string; + setValueAsync(value: string): Promise; +} + +// This call loads the native module object from the JSI. +export default requireNativeModule("MpvPlayer"); diff --git a/modules/mpv-player/src/MpvPlayerModule.web.ts b/modules/mpv-player/src/MpvPlayerModule.web.ts new file mode 100644 index 00000000..47e29e15 --- /dev/null +++ b/modules/mpv-player/src/MpvPlayerModule.web.ts @@ -0,0 +1,19 @@ +import { NativeModule, registerWebModule } from "expo"; + +import { ChangeEventPayload } from "./MpvPlayer.types"; + +type MpvPlayerModuleEvents = { + onChange: (params: ChangeEventPayload) => void; +}; + +class MpvPlayerModule extends NativeModule { + PI = Math.PI; + async setValueAsync(value: string): Promise { + this.emit("onChange", { value }); + } + hello() { + return "Hello world! ๐Ÿ‘‹"; + } +} + +export default registerWebModule(MpvPlayerModule, "MpvPlayerModule"); diff --git a/modules/mpv-player/src/MpvPlayerView.tsx b/modules/mpv-player/src/MpvPlayerView.tsx new file mode 100644 index 00000000..e5e0ccda --- /dev/null +++ b/modules/mpv-player/src/MpvPlayerView.tsx @@ -0,0 +1,108 @@ +import { requireNativeView } from "expo"; +import * as React from "react"; +import { useImperativeHandle, useRef } from "react"; + +import { MpvPlayerViewProps, MpvPlayerViewRef } from "./MpvPlayer.types"; + +const NativeView: React.ComponentType = + requireNativeView("MpvPlayer"); + +export default React.forwardRef( + function MpvPlayerView(props, ref) { + const nativeRef = useRef(null); + + useImperativeHandle(ref, () => ({ + play: async () => { + await nativeRef.current?.play(); + }, + pause: async () => { + await nativeRef.current?.pause(); + }, + seekTo: async (position: number) => { + await nativeRef.current?.seekTo(position); + }, + seekBy: async (offset: number) => { + await nativeRef.current?.seekBy(offset); + }, + setSpeed: async (speed: number) => { + await nativeRef.current?.setSpeed(speed); + }, + getSpeed: async () => { + return await nativeRef.current?.getSpeed(); + }, + isPaused: async () => { + return await nativeRef.current?.isPaused(); + }, + getCurrentPosition: async () => { + return await nativeRef.current?.getCurrentPosition(); + }, + getDuration: async () => { + return await nativeRef.current?.getDuration(); + }, + startPictureInPicture: async () => { + await nativeRef.current?.startPictureInPicture(); + }, + stopPictureInPicture: async () => { + await nativeRef.current?.stopPictureInPicture(); + }, + isPictureInPictureSupported: async () => { + return await nativeRef.current?.isPictureInPictureSupported(); + }, + isPictureInPictureActive: async () => { + return await nativeRef.current?.isPictureInPictureActive(); + }, + getSubtitleTracks: async () => { + return await nativeRef.current?.getSubtitleTracks(); + }, + setSubtitleTrack: async (trackId: number) => { + await nativeRef.current?.setSubtitleTrack(trackId); + }, + disableSubtitles: async () => { + await nativeRef.current?.disableSubtitles(); + }, + getCurrentSubtitleTrack: async () => { + return await nativeRef.current?.getCurrentSubtitleTrack(); + }, + addSubtitleFile: async (url: string, select = true) => { + await nativeRef.current?.addSubtitleFile(url, select); + }, + setSubtitlePosition: async (position: number) => { + await nativeRef.current?.setSubtitlePosition(position); + }, + setSubtitleScale: async (scale: number) => { + await nativeRef.current?.setSubtitleScale(scale); + }, + setSubtitleMarginY: async (margin: number) => { + await nativeRef.current?.setSubtitleMarginY(margin); + }, + setSubtitleAlignX: async (alignment: "left" | "center" | "right") => { + await nativeRef.current?.setSubtitleAlignX(alignment); + }, + setSubtitleAlignY: async (alignment: "top" | "center" | "bottom") => { + await nativeRef.current?.setSubtitleAlignY(alignment); + }, + setSubtitleFontSize: async (size: number) => { + await nativeRef.current?.setSubtitleFontSize(size); + }, + // Audio controls + getAudioTracks: async () => { + return await nativeRef.current?.getAudioTracks(); + }, + setAudioTrack: async (trackId: number) => { + await nativeRef.current?.setAudioTrack(trackId); + }, + getCurrentAudioTrack: async () => { + return await nativeRef.current?.getCurrentAudioTrack(); + }, + // Video scaling + setZoomedToFill: async (zoomed: boolean) => { + await nativeRef.current?.setZoomedToFill(zoomed); + }, + isZoomedToFill: async () => { + return await nativeRef.current?.isZoomedToFill(); + }, + })); + + return ; + }, +); diff --git a/modules/mpv-player/src/MpvPlayerView.web.tsx b/modules/mpv-player/src/MpvPlayerView.web.tsx new file mode 100644 index 00000000..a5252b4b --- /dev/null +++ b/modules/mpv-player/src/MpvPlayerView.web.tsx @@ -0,0 +1,17 @@ +import { useTranslation } from "react-i18next"; +import { MpvPlayerViewProps } from "./MpvPlayer.types"; + +export default function MpvPlayerView(props: MpvPlayerViewProps) { + const url = props.source?.url ?? ""; + const { t } = useTranslation(); + return ( +
+