mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b92e2c6601 |
+8
-4
@@ -19,10 +19,10 @@ indent_size = 4
|
|||||||
dotnet_sort_system_directives_first = true
|
dotnet_sort_system_directives_first = true
|
||||||
|
|
||||||
# Avoid "this." and "Me." if not necessary
|
# Avoid "this." and "Me." if not necessary
|
||||||
dotnet_style_qualification_for_field = false:warning
|
dotnet_style_qualification_for_field = false:refactoring
|
||||||
dotnet_style_qualification_for_property = false:warning
|
dotnet_style_qualification_for_property = false:refactoring
|
||||||
dotnet_style_qualification_for_method = false:warning
|
dotnet_style_qualification_for_method = false:refactoring
|
||||||
dotnet_style_qualification_for_event = false:warning
|
dotnet_style_qualification_for_event = false:refactoring
|
||||||
|
|
||||||
# Indentation preferences
|
# Indentation preferences
|
||||||
csharp_indent_block_contents = true
|
csharp_indent_block_contents = true
|
||||||
@@ -32,6 +32,10 @@ csharp_indent_case_contents_when_block = true
|
|||||||
csharp_indent_switch_labels = true
|
csharp_indent_switch_labels = true
|
||||||
csharp_indent_labels = flush_left
|
csharp_indent_labels = flush_left
|
||||||
|
|
||||||
|
dotnet_style_qualification_for_field = false:suggestion
|
||||||
|
dotnet_style_qualification_for_property = false:suggestion
|
||||||
|
dotnet_style_qualification_for_method = false:suggestion
|
||||||
|
dotnet_style_qualification_for_event = false:suggestion
|
||||||
dotnet_naming_style.instance_field_style.capitalization = camel_case
|
dotnet_naming_style.instance_field_style.capitalization = camel_case
|
||||||
dotnet_naming_style.instance_field_style.required_prefix = _
|
dotnet_naming_style.instance_field_style.required_prefix = _
|
||||||
|
|
||||||
|
|||||||
+50
-199
@@ -9,13 +9,13 @@ variables:
|
|||||||
testsFolder: './_tests'
|
testsFolder: './_tests'
|
||||||
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
|
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
|
||||||
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
|
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
|
||||||
majorVersion: '4.2.0'
|
majorVersion: '4.1.0'
|
||||||
minorVersion: $[counter('minorVersion', 2000)]
|
minorVersion: $[counter('minorVersion', 2000)]
|
||||||
radarrVersion: '$(majorVersion).$(minorVersion)'
|
radarrVersion: '$(majorVersion).$(minorVersion)'
|
||||||
buildName: '$(Build.SourceBranchName).$(radarrVersion)'
|
buildName: '$(Build.SourceBranchName).$(radarrVersion)'
|
||||||
sentryOrg: 'servarr'
|
sentryOrg: 'servarr'
|
||||||
sentryUrl: 'https://sentry.servarr.com'
|
sentryUrl: 'https://sentry.servarr.com'
|
||||||
dotnetVersion: '6.0.300'
|
dotnetVersion: '6.0.201'
|
||||||
nodeVersion: '16.X'
|
nodeVersion: '16.X'
|
||||||
innoVersion: '6.2.0'
|
innoVersion: '6.2.0'
|
||||||
windowsImage: 'windows-2022'
|
windowsImage: 'windows-2022'
|
||||||
@@ -97,14 +97,15 @@ stages:
|
|||||||
- bash: |
|
- bash: |
|
||||||
BUNDLEDVERSIONS=${AGENT_TOOLSDIRECTORY}/dotnet/sdk/${DOTNETVERSION}/Microsoft.NETCoreSdk.BundledVersions.props
|
BUNDLEDVERSIONS=${AGENT_TOOLSDIRECTORY}/dotnet/sdk/${DOTNETVERSION}/Microsoft.NETCoreSdk.BundledVersions.props
|
||||||
echo $BUNDLEDVERSIONS
|
echo $BUNDLEDVERSIONS
|
||||||
|
grep osx-x64 $BUNDLEDVERSIONS
|
||||||
if grep -q freebsd-x64 $BUNDLEDVERSIONS; then
|
if grep -q freebsd-x64 $BUNDLEDVERSIONS; then
|
||||||
echo "Extra platforms already enabled"
|
echo "BSD already enabled"
|
||||||
else
|
else
|
||||||
echo "Enabling extra platform support"
|
echo "Enabling BSD support"
|
||||||
sed -i.ORI 's/osx-x64/osx-x64;freebsd-x64;linux-x86/' $BUNDLEDVERSIONS
|
sed -i.ORI 's/osx-x64/osx-x64;freebsd-x64/' $BUNDLEDVERSIONS
|
||||||
fi
|
fi
|
||||||
displayName: Enable Extra Platform Support
|
displayName: Enable FreeBSD Support
|
||||||
- bash: ./build.sh --backend --enable-extra-platforms
|
- bash: ./build.sh --backend --enable-bsd
|
||||||
displayName: Build Radarr Backend
|
displayName: Build Radarr Backend
|
||||||
- bash: |
|
- bash: |
|
||||||
find ${OUTPUTFOLDER} -type f ! -path "*/publish/*" -exec rm -rf {} \;
|
find ${OUTPUTFOLDER} -type f ! -path "*/publish/*" -exec rm -rf {} \;
|
||||||
@@ -118,28 +119,24 @@ stages:
|
|||||||
displayName: Publish Backend
|
displayName: Publish Backend
|
||||||
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||||||
- publish: '$(testsFolder)/net6.0/win-x64/publish'
|
- publish: '$(testsFolder)/net6.0/win-x64/publish'
|
||||||
artifact: win-x64-tests
|
artifact: WindowsCoreTests
|
||||||
displayName: Publish win-x64 Test Package
|
displayName: Publish Windows Test Package
|
||||||
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||||||
- publish: '$(testsFolder)/net6.0/linux-x64/publish'
|
- publish: '$(testsFolder)/net6.0/linux-x64/publish'
|
||||||
artifact: linux-x64-tests
|
artifact: LinuxCoreTests
|
||||||
displayName: Publish linux-x64 Test Package
|
displayName: Publish Linux Test Package
|
||||||
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
|
||||||
- publish: '$(testsFolder)/net6.0/linux-x86/publish'
|
|
||||||
artifact: linux-x86-tests
|
|
||||||
displayName: Publish linux-x86 Test Package
|
|
||||||
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||||||
- publish: '$(testsFolder)/net6.0/linux-musl-x64/publish'
|
- publish: '$(testsFolder)/net6.0/linux-musl-x64/publish'
|
||||||
artifact: linux-musl-x64-tests
|
artifact: LinuxMuslCoreTests
|
||||||
displayName: Publish linux-musl-x64 Test Package
|
displayName: Publish Linux Musl Test Package
|
||||||
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||||||
- publish: '$(testsFolder)/net6.0/freebsd-x64/publish'
|
- publish: '$(testsFolder)/net6.0/freebsd-x64/publish'
|
||||||
artifact: freebsd-x64-tests
|
artifact: FreebsdCoreTests
|
||||||
displayName: Publish freebsd-x64 Test Package
|
displayName: Publish FreeBSD Test Package
|
||||||
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||||||
- publish: '$(testsFolder)/net6.0/osx-x64/publish'
|
- publish: '$(testsFolder)/net6.0/osx-x64/publish'
|
||||||
artifact: osx-x64-tests
|
artifact: MacCoreTests
|
||||||
displayName: Publish osx-x64 Test Package
|
displayName: Publish MacOS Test Package
|
||||||
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||||||
|
|
||||||
- stage: Build_Frontend
|
- stage: Build_Frontend
|
||||||
@@ -173,6 +170,7 @@ stages:
|
|||||||
key: 'yarn | "$(osName)" | yarn.lock'
|
key: 'yarn | "$(osName)" | yarn.lock'
|
||||||
restoreKeys: |
|
restoreKeys: |
|
||||||
yarn | "$(osName)"
|
yarn | "$(osName)"
|
||||||
|
yarn
|
||||||
path: $(yarnCacheFolder)
|
path: $(yarnCacheFolder)
|
||||||
displayName: Cache Yarn packages
|
displayName: Cache Yarn packages
|
||||||
- bash: ./build.sh --frontend
|
- bash: ./build.sh --frontend
|
||||||
@@ -242,7 +240,7 @@ stages:
|
|||||||
artifactName: WindowsFrontend
|
artifactName: WindowsFrontend
|
||||||
targetPath: _output
|
targetPath: _output
|
||||||
displayName: Fetch Frontend
|
displayName: Fetch Frontend
|
||||||
- bash: ./build.sh --packages --enable-extra-platforms
|
- bash: ./build.sh --packages --enable-bsd
|
||||||
displayName: Create Packages
|
displayName: Create Packages
|
||||||
- bash: |
|
- bash: |
|
||||||
find . -name "ffprobe" -exec chmod a+x {} \;
|
find . -name "ffprobe" -exec chmod a+x {} \;
|
||||||
@@ -250,28 +248,28 @@ stages:
|
|||||||
find . -name "Radarr.Update" -exec chmod a+x {} \;
|
find . -name "Radarr.Update" -exec chmod a+x {} \;
|
||||||
displayName: Set executable bits
|
displayName: Set executable bits
|
||||||
- task: ArchiveFiles@2
|
- task: ArchiveFiles@2
|
||||||
displayName: Create win-x64 zip
|
displayName: Create Windows Core zip
|
||||||
inputs:
|
inputs:
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).windows-core-x64.zip'
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).windows-core-x64.zip'
|
||||||
archiveType: 'zip'
|
archiveType: 'zip'
|
||||||
includeRootFolder: false
|
includeRootFolder: false
|
||||||
rootFolderOrFile: $(artifactsFolder)/win-x64/net6.0
|
rootFolderOrFile: $(artifactsFolder)/win-x64/net6.0
|
||||||
- task: ArchiveFiles@2
|
- task: ArchiveFiles@2
|
||||||
displayName: Create win-x86 zip
|
displayName: Create Windows x86 Core zip
|
||||||
inputs:
|
inputs:
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).windows-core-x86.zip'
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).windows-core-x86.zip'
|
||||||
archiveType: 'zip'
|
archiveType: 'zip'
|
||||||
includeRootFolder: false
|
includeRootFolder: false
|
||||||
rootFolderOrFile: $(artifactsFolder)/win-x86/net6.0
|
rootFolderOrFile: $(artifactsFolder)/win-x86/net6.0
|
||||||
- task: ArchiveFiles@2
|
- task: ArchiveFiles@2
|
||||||
displayName: Create osx-x64 app
|
displayName: Create MacOS x64 Core app
|
||||||
inputs:
|
inputs:
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-app-core-x64.zip'
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-app-core-x64.zip'
|
||||||
archiveType: 'zip'
|
archiveType: 'zip'
|
||||||
includeRootFolder: false
|
includeRootFolder: false
|
||||||
rootFolderOrFile: $(artifactsFolder)/osx-x64-app/net6.0
|
rootFolderOrFile: $(artifactsFolder)/osx-x64-app/net6.0
|
||||||
- task: ArchiveFiles@2
|
- task: ArchiveFiles@2
|
||||||
displayName: Create osx-x64 tar
|
displayName: Create MacOS x64 Core tar
|
||||||
inputs:
|
inputs:
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-core-x64.tar.gz'
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-core-x64.tar.gz'
|
||||||
archiveType: 'tar'
|
archiveType: 'tar'
|
||||||
@@ -279,14 +277,14 @@ stages:
|
|||||||
includeRootFolder: false
|
includeRootFolder: false
|
||||||
rootFolderOrFile: $(artifactsFolder)/osx-x64/net6.0
|
rootFolderOrFile: $(artifactsFolder)/osx-x64/net6.0
|
||||||
- task: ArchiveFiles@2
|
- task: ArchiveFiles@2
|
||||||
displayName: Create osx-arm64 app
|
displayName: Create MacOS arm64 Core app
|
||||||
inputs:
|
inputs:
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-app-core-arm64.zip'
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-app-core-arm64.zip'
|
||||||
archiveType: 'zip'
|
archiveType: 'zip'
|
||||||
includeRootFolder: false
|
includeRootFolder: false
|
||||||
rootFolderOrFile: $(artifactsFolder)/osx-arm64-app/net6.0
|
rootFolderOrFile: $(artifactsFolder)/osx-arm64-app/net6.0
|
||||||
- task: ArchiveFiles@2
|
- task: ArchiveFiles@2
|
||||||
displayName: Create osx-arm64 tar
|
displayName: Create MacOS arm64 Core tar
|
||||||
inputs:
|
inputs:
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-core-arm64.tar.gz'
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-core-arm64.tar.gz'
|
||||||
archiveType: 'tar'
|
archiveType: 'tar'
|
||||||
@@ -294,7 +292,7 @@ stages:
|
|||||||
includeRootFolder: false
|
includeRootFolder: false
|
||||||
rootFolderOrFile: $(artifactsFolder)/osx-arm64/net6.0
|
rootFolderOrFile: $(artifactsFolder)/osx-arm64/net6.0
|
||||||
- task: ArchiveFiles@2
|
- task: ArchiveFiles@2
|
||||||
displayName: Create linux-x64 tar
|
displayName: Create Linux Core tar
|
||||||
inputs:
|
inputs:
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-x64.tar.gz'
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-x64.tar.gz'
|
||||||
archiveType: 'tar'
|
archiveType: 'tar'
|
||||||
@@ -302,7 +300,7 @@ stages:
|
|||||||
includeRootFolder: false
|
includeRootFolder: false
|
||||||
rootFolderOrFile: $(artifactsFolder)/linux-x64/net6.0
|
rootFolderOrFile: $(artifactsFolder)/linux-x64/net6.0
|
||||||
- task: ArchiveFiles@2
|
- task: ArchiveFiles@2
|
||||||
displayName: Create linux-musl-x64 tar
|
displayName: Create Linux Musl Core tar
|
||||||
inputs:
|
inputs:
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-musl-core-x64.tar.gz'
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-musl-core-x64.tar.gz'
|
||||||
archiveType: 'tar'
|
archiveType: 'tar'
|
||||||
@@ -310,15 +308,7 @@ stages:
|
|||||||
includeRootFolder: false
|
includeRootFolder: false
|
||||||
rootFolderOrFile: $(artifactsFolder)/linux-musl-x64/net6.0
|
rootFolderOrFile: $(artifactsFolder)/linux-musl-x64/net6.0
|
||||||
- task: ArchiveFiles@2
|
- task: ArchiveFiles@2
|
||||||
displayName: Create linux-x86 tar
|
displayName: Create ARM32 Linux Core tar
|
||||||
inputs:
|
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-x86.tar.gz'
|
|
||||||
archiveType: 'tar'
|
|
||||||
tarCompression: 'gz'
|
|
||||||
includeRootFolder: false
|
|
||||||
rootFolderOrFile: $(artifactsFolder)/linux-x86/net6.0
|
|
||||||
- task: ArchiveFiles@2
|
|
||||||
displayName: Create linux-arm tar
|
|
||||||
inputs:
|
inputs:
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-arm.tar.gz'
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-arm.tar.gz'
|
||||||
archiveType: 'tar'
|
archiveType: 'tar'
|
||||||
@@ -326,7 +316,7 @@ stages:
|
|||||||
includeRootFolder: false
|
includeRootFolder: false
|
||||||
rootFolderOrFile: $(artifactsFolder)/linux-arm/net6.0
|
rootFolderOrFile: $(artifactsFolder)/linux-arm/net6.0
|
||||||
- task: ArchiveFiles@2
|
- task: ArchiveFiles@2
|
||||||
displayName: Create linux-musl-arm tar
|
displayName: Create ARM32 Linux Musl Core tar
|
||||||
inputs:
|
inputs:
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-musl-core-arm.tar.gz'
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-musl-core-arm.tar.gz'
|
||||||
archiveType: 'tar'
|
archiveType: 'tar'
|
||||||
@@ -334,7 +324,7 @@ stages:
|
|||||||
includeRootFolder: false
|
includeRootFolder: false
|
||||||
rootFolderOrFile: $(artifactsFolder)/linux-musl-arm/net6.0
|
rootFolderOrFile: $(artifactsFolder)/linux-musl-arm/net6.0
|
||||||
- task: ArchiveFiles@2
|
- task: ArchiveFiles@2
|
||||||
displayName: Create linux-arm64 tar
|
displayName: Create ARM64 Linux Core tar
|
||||||
inputs:
|
inputs:
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-arm64.tar.gz'
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-arm64.tar.gz'
|
||||||
archiveType: 'tar'
|
archiveType: 'tar'
|
||||||
@@ -342,7 +332,7 @@ stages:
|
|||||||
includeRootFolder: false
|
includeRootFolder: false
|
||||||
rootFolderOrFile: $(artifactsFolder)/linux-arm64/net6.0
|
rootFolderOrFile: $(artifactsFolder)/linux-arm64/net6.0
|
||||||
- task: ArchiveFiles@2
|
- task: ArchiveFiles@2
|
||||||
displayName: Create linux-musl-arm64 tar
|
displayName: Create ARM64 Linux Musl Core tar
|
||||||
inputs:
|
inputs:
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-musl-core-arm64.tar.gz'
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-musl-core-arm64.tar.gz'
|
||||||
archiveType: 'tar'
|
archiveType: 'tar'
|
||||||
@@ -350,7 +340,7 @@ stages:
|
|||||||
includeRootFolder: false
|
includeRootFolder: false
|
||||||
rootFolderOrFile: $(artifactsFolder)/linux-musl-arm64/net6.0
|
rootFolderOrFile: $(artifactsFolder)/linux-musl-arm64/net6.0
|
||||||
- task: ArchiveFiles@2
|
- task: ArchiveFiles@2
|
||||||
displayName: Create freebsd-x64 tar
|
displayName: Create FreeBSD Core Core tar
|
||||||
inputs:
|
inputs:
|
||||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).freebsd-core-x64.tar.gz'
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).freebsd-core-x64.tar.gz'
|
||||||
archiveType: 'tar'
|
archiveType: 'tar'
|
||||||
@@ -417,22 +407,22 @@ stages:
|
|||||||
matrix:
|
matrix:
|
||||||
MacCore:
|
MacCore:
|
||||||
osName: 'Mac'
|
osName: 'Mac'
|
||||||
testName: 'osx-x64'
|
testName: 'MacCore'
|
||||||
poolName: 'Azure Pipelines'
|
poolName: 'Azure Pipelines'
|
||||||
imageName: ${{ variables.macImage }}
|
imageName: ${{ variables.macImage }}
|
||||||
WindowsCore:
|
WindowsCore:
|
||||||
osName: 'Windows'
|
osName: 'Windows'
|
||||||
testName: 'win-x64'
|
testName: 'WindowsCore'
|
||||||
poolName: 'Azure Pipelines'
|
poolName: 'Azure Pipelines'
|
||||||
imageName: ${{ variables.windowsImage }}
|
imageName: ${{ variables.windowsImage }}
|
||||||
LinuxCore:
|
LinuxCore:
|
||||||
osName: 'Linux'
|
osName: 'Linux'
|
||||||
testName: 'linux-x64'
|
testName: 'LinuxCore'
|
||||||
poolName: 'Azure Pipelines'
|
poolName: 'Azure Pipelines'
|
||||||
imageName: ${{ variables.linuxImage }}
|
imageName: ${{ variables.linuxImage }}
|
||||||
FreebsdCore:
|
FreebsdCore:
|
||||||
osName: 'Linux'
|
osName: 'Linux'
|
||||||
testName: 'freebsd-x64'
|
testName: 'FreebsdCore'
|
||||||
poolName: 'FreeBSD'
|
poolName: 'FreeBSD'
|
||||||
imageName:
|
imageName:
|
||||||
|
|
||||||
@@ -451,7 +441,7 @@ stages:
|
|||||||
displayName: Download Test Artifact
|
displayName: Download Test Artifact
|
||||||
inputs:
|
inputs:
|
||||||
buildType: 'current'
|
buildType: 'current'
|
||||||
artifactName: '$(testName)-tests'
|
artifactName: '$(testName)Tests'
|
||||||
targetPath: $(testsFolder)
|
targetPath: $(testsFolder)
|
||||||
- powershell: Set-Service SCardSvr -StartupType Manual
|
- powershell: Set-Service SCardSvr -StartupType Manual
|
||||||
displayName: Enable Windows Test Service
|
displayName: Enable Windows Test Service
|
||||||
@@ -485,12 +475,8 @@ stages:
|
|||||||
matrix:
|
matrix:
|
||||||
alpine:
|
alpine:
|
||||||
testName: 'Musl Net Core'
|
testName: 'Musl Net Core'
|
||||||
artifactName: linux-musl-x64-tests
|
artifactName: LinuxMuslCoreTests
|
||||||
containerImage: ghcr.io/servarr/testimages:alpine
|
containerImage: ghcr.io/servarr/testimages:alpine
|
||||||
linux-x86:
|
|
||||||
testName: 'linux-x86'
|
|
||||||
artifactName: linux-x86-tests
|
|
||||||
containerImage: ghcr.io/servarr/testimages:linux-x86
|
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: ${{ variables.linuxImage }}
|
vmImage: ${{ variables.linuxImage }}
|
||||||
@@ -501,15 +487,9 @@ stages:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- task: UseDotNet@2
|
- task: UseDotNet@2
|
||||||
displayName: 'Install .NET'
|
displayName: 'Install .net core'
|
||||||
inputs:
|
inputs:
|
||||||
version: $(dotnetVersion)
|
version: $(dotnetVersion)
|
||||||
condition: and(succeeded(), ne(variables['testName'], 'linux-x86'))
|
|
||||||
- bash: |
|
|
||||||
SDKURL=$(curl -s https://api.github.com/repos/Servarr/dotnet-linux-x86/releases | jq -rc '.[].assets[].browser_download_url' | grep sdk-${DOTNETVERSION}.*gz$)
|
|
||||||
curl -fsSL $SDKURL | tar xzf - -C /opt/dotnet
|
|
||||||
displayName: 'Install .NET'
|
|
||||||
condition: and(succeeded(), eq(variables['testName'], 'linux-x86'))
|
|
||||||
- checkout: none
|
- checkout: none
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: DownloadPipelineArtifact@2
|
||||||
displayName: Download Test Artifact
|
displayName: Download Test Artifact
|
||||||
@@ -535,61 +515,6 @@ stages:
|
|||||||
testResultsFiles: '**/TestResult.xml'
|
testResultsFiles: '**/TestResult.xml'
|
||||||
testRunTitle: '$(testName) Unit Tests'
|
testRunTitle: '$(testName) Unit Tests'
|
||||||
failTaskOnFailedTests: true
|
failTaskOnFailedTests: true
|
||||||
|
|
||||||
- job: Unit_LinuxCore_Postgres
|
|
||||||
displayName: Unit Native LinuxCore with Postgres Database
|
|
||||||
dependsOn: Prepare
|
|
||||||
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendNotUpdated'], '0'))
|
|
||||||
variables:
|
|
||||||
pattern: 'Radarr.*.linux-core-x64.tar.gz'
|
|
||||||
artifactName: linux-x64-tests
|
|
||||||
Radarr__Postgres__Host: 'localhost'
|
|
||||||
Radarr__Postgres__Port: '5432'
|
|
||||||
Radarr__Postgres__User: 'radarr'
|
|
||||||
Radarr__Postgres__Password: 'radarr'
|
|
||||||
|
|
||||||
pool:
|
|
||||||
vmImage: 'ubuntu-18.04'
|
|
||||||
|
|
||||||
timeoutInMinutes: 10
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- task: UseDotNet@2
|
|
||||||
displayName: 'Install .net core'
|
|
||||||
inputs:
|
|
||||||
version: $(dotnetVersion)
|
|
||||||
- checkout: none
|
|
||||||
- task: DownloadPipelineArtifact@2
|
|
||||||
displayName: Download Test Artifact
|
|
||||||
inputs:
|
|
||||||
buildType: 'current'
|
|
||||||
artifactName: $(artifactName)
|
|
||||||
targetPath: $(testsFolder)
|
|
||||||
- bash: |
|
|
||||||
chmod a+x _tests/ffprobe
|
|
||||||
displayName: Make ffprobe Executable
|
|
||||||
- bash: find ${TESTSFOLDER} -name "Radarr.Test.Dummy" -exec chmod a+x {} \;
|
|
||||||
displayName: Make Test Dummy Executable
|
|
||||||
condition: and(succeeded(), ne(variables['osName'], 'Windows'))
|
|
||||||
- bash: |
|
|
||||||
docker run -d --name=postgres14 \
|
|
||||||
-e POSTGRES_PASSWORD=radarr \
|
|
||||||
-e POSTGRES_USER=radarr \
|
|
||||||
-p 5432:5432/tcp \
|
|
||||||
postgres:14
|
|
||||||
displayName: Start postgres
|
|
||||||
- bash: |
|
|
||||||
chmod a+x ${TESTSFOLDER}/test.sh
|
|
||||||
ls -lR ${TESTSFOLDER}
|
|
||||||
${TESTSFOLDER}/test.sh Linux Unit Test
|
|
||||||
displayName: Run Tests
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
displayName: Publish Test Results
|
|
||||||
inputs:
|
|
||||||
testResultsFormat: 'NUnit'
|
|
||||||
testResultsFiles: '**/TestResult.xml'
|
|
||||||
testRunTitle: 'LinuxCore Postgres Unit Tests'
|
|
||||||
failTaskOnFailedTests: true
|
|
||||||
|
|
||||||
- stage: Integration
|
- stage: Integration
|
||||||
displayName: Integration
|
displayName: Integration
|
||||||
@@ -617,17 +542,17 @@ stages:
|
|||||||
matrix:
|
matrix:
|
||||||
MacCore:
|
MacCore:
|
||||||
osName: 'Mac'
|
osName: 'Mac'
|
||||||
testName: 'osx-x64'
|
testName: 'MacCore'
|
||||||
imageName: ${{ variables.macImage }}
|
imageName: ${{ variables.macImage }}
|
||||||
pattern: 'Radarr.*.osx-core-x64.tar.gz'
|
pattern: 'Radarr.*.osx-core-x64.tar.gz'
|
||||||
WindowsCore:
|
WindowsCore:
|
||||||
osName: 'Windows'
|
osName: 'Windows'
|
||||||
testName: 'win-x64'
|
testName: 'WindowsCore'
|
||||||
imageName: ${{ variables.windowsImage }}
|
imageName: ${{ variables.windowsImage }}
|
||||||
pattern: 'Radarr.*.windows-core-x64.zip'
|
pattern: 'Radarr.*.windows-core-x64.zip'
|
||||||
LinuxCore:
|
LinuxCore:
|
||||||
osName: 'Linux'
|
osName: 'Linux'
|
||||||
testName: 'linux-x64'
|
testName: 'LinuxCore'
|
||||||
imageName: ${{ variables.linuxImage }}
|
imageName: ${{ variables.linuxImage }}
|
||||||
pattern: 'Radarr.*.linux-core-x64.tar.gz'
|
pattern: 'Radarr.*.linux-core-x64.tar.gz'
|
||||||
|
|
||||||
@@ -644,7 +569,7 @@ stages:
|
|||||||
displayName: Download Test Artifact
|
displayName: Download Test Artifact
|
||||||
inputs:
|
inputs:
|
||||||
buildType: 'current'
|
buildType: 'current'
|
||||||
artifactName: '$(testName)-tests'
|
artifactName: '$(testName)Tests'
|
||||||
targetPath: $(testsFolder)
|
targetPath: $(testsFolder)
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: DownloadPipelineArtifact@2
|
||||||
displayName: Download Build Artifact
|
displayName: Download Build Artifact
|
||||||
@@ -674,67 +599,6 @@ stages:
|
|||||||
failTaskOnFailedTests: true
|
failTaskOnFailedTests: true
|
||||||
displayName: Publish Test Results
|
displayName: Publish Test Results
|
||||||
|
|
||||||
- job: Integration_LinuxCore_Postgres
|
|
||||||
displayName: Integration Native LinuxCore with Postgres Database
|
|
||||||
dependsOn: Prepare
|
|
||||||
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendNotUpdated'], '0'))
|
|
||||||
variables:
|
|
||||||
pattern: 'Radarr.*.linux-core-x64.tar.gz'
|
|
||||||
Radarr__Postgres__Host: 'localhost'
|
|
||||||
Radarr__Postgres__Port: '5432'
|
|
||||||
Radarr__Postgres__User: 'radarr'
|
|
||||||
Radarr__Postgres__Password: 'radarr'
|
|
||||||
|
|
||||||
pool:
|
|
||||||
vmImage: 'ubuntu-18.04'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- task: UseDotNet@2
|
|
||||||
displayName: 'Install .net core'
|
|
||||||
inputs:
|
|
||||||
version: $(dotnetVersion)
|
|
||||||
- checkout: none
|
|
||||||
- task: DownloadPipelineArtifact@2
|
|
||||||
displayName: Download Test Artifact
|
|
||||||
inputs:
|
|
||||||
buildType: 'current'
|
|
||||||
artifactName: 'linux-x64-tests'
|
|
||||||
targetPath: $(testsFolder)
|
|
||||||
- task: DownloadPipelineArtifact@2
|
|
||||||
displayName: Download Build Artifact
|
|
||||||
inputs:
|
|
||||||
buildType: 'current'
|
|
||||||
artifactName: Packages
|
|
||||||
itemPattern: '**/$(pattern)'
|
|
||||||
targetPath: $(Build.ArtifactStagingDirectory)
|
|
||||||
- task: ExtractFiles@1
|
|
||||||
inputs:
|
|
||||||
archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/**/$(pattern)'
|
|
||||||
destinationFolder: '$(Build.ArtifactStagingDirectory)/bin'
|
|
||||||
displayName: Extract Package
|
|
||||||
- bash: |
|
|
||||||
mkdir -p ./bin/
|
|
||||||
cp -r -v ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin/Radarr/. ./bin/
|
|
||||||
displayName: Move Package Contents
|
|
||||||
- bash: |
|
|
||||||
docker run -d --name=postgres14 \
|
|
||||||
-e POSTGRES_PASSWORD=radarr \
|
|
||||||
-e POSTGRES_USER=radarr \
|
|
||||||
-p 5432:5432/tcp \
|
|
||||||
postgres:14
|
|
||||||
displayName: Start postgres
|
|
||||||
- bash: |
|
|
||||||
chmod a+x ${TESTSFOLDER}/test.sh
|
|
||||||
${TESTSFOLDER}/test.sh Linux Integration Test
|
|
||||||
displayName: Run Integration Tests
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
inputs:
|
|
||||||
testResultsFormat: 'NUnit'
|
|
||||||
testResultsFiles: '**/TestResult.xml'
|
|
||||||
testRunTitle: 'Integration LinuxCore Postgres Database Integration Tests'
|
|
||||||
failTaskOnFailedTests: true
|
|
||||||
displayName: Publish Test Results
|
|
||||||
|
|
||||||
- job: Integration_FreeBSD
|
- job: Integration_FreeBSD
|
||||||
displayName: Integration Native FreeBSD
|
displayName: Integration Native FreeBSD
|
||||||
dependsOn: Prepare
|
dependsOn: Prepare
|
||||||
@@ -752,7 +616,7 @@ stages:
|
|||||||
displayName: Download Test Artifact
|
displayName: Download Test Artifact
|
||||||
inputs:
|
inputs:
|
||||||
buildType: 'current'
|
buildType: 'current'
|
||||||
artifactName: 'freebsd-x64-tests'
|
artifactName: 'FreebsdCoreTests'
|
||||||
targetPath: $(testsFolder)
|
targetPath: $(testsFolder)
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: DownloadPipelineArtifact@2
|
||||||
displayName: Download Build Artifact
|
displayName: Download Build Artifact
|
||||||
@@ -788,15 +652,10 @@ stages:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
alpine:
|
alpine:
|
||||||
testName: 'linux-musl-x64'
|
testName: 'Musl Net Core'
|
||||||
artifactName: linux-musl-x64-tests
|
artifactName: LinuxMuslCoreTests
|
||||||
containerImage: ghcr.io/servarr/testimages:alpine
|
containerImage: ghcr.io/servarr/testimages:alpine
|
||||||
pattern: 'Radarr.*.linux-musl-core-x64.tar.gz'
|
pattern: 'Radarr.*.linux-musl-core-x64.tar.gz'
|
||||||
linux-x86:
|
|
||||||
testName: 'linux-x86'
|
|
||||||
artifactName: linux-x86-tests
|
|
||||||
containerImage: ghcr.io/servarr/testimages:linux-x86
|
|
||||||
pattern: 'Radarr.*.linux-core-x86.tar.gz'
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: ${{ variables.linuxImage }}
|
vmImage: ${{ variables.linuxImage }}
|
||||||
|
|
||||||
@@ -806,15 +665,9 @@ stages:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- task: UseDotNet@2
|
- task: UseDotNet@2
|
||||||
displayName: 'Install .NET'
|
displayName: 'Install .net core'
|
||||||
inputs:
|
inputs:
|
||||||
version: $(dotnetVersion)
|
version: $(dotnetVersion)
|
||||||
condition: and(succeeded(), ne(variables['testName'], 'linux-x86'))
|
|
||||||
- bash: |
|
|
||||||
SDKURL=$(curl -s https://api.github.com/repos/Servarr/dotnet-linux-x86/releases | jq -rc '.[].assets[].browser_download_url' | grep sdk-${DOTNETVERSION}.*gz$)
|
|
||||||
curl -fsSL $SDKURL | tar xzf - -C /opt/dotnet
|
|
||||||
displayName: 'Install .NET'
|
|
||||||
condition: and(succeeded(), eq(variables['testName'], 'linux-x86'))
|
|
||||||
- checkout: none
|
- checkout: none
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: DownloadPipelineArtifact@2
|
||||||
displayName: Download Test Artifact
|
displayName: Download Test Artifact
|
||||||
@@ -860,19 +713,16 @@ stages:
|
|||||||
matrix:
|
matrix:
|
||||||
Linux:
|
Linux:
|
||||||
osName: 'Linux'
|
osName: 'Linux'
|
||||||
artifactName: 'linux-x64'
|
|
||||||
imageName: ${{ variables.linuxImage }}
|
imageName: ${{ variables.linuxImage }}
|
||||||
pattern: 'Radarr.*.linux-core-x64.tar.gz'
|
pattern: 'Radarr.*.linux-core-x64.tar.gz'
|
||||||
failBuild: true
|
failBuild: true
|
||||||
Mac:
|
Mac:
|
||||||
osName: 'Mac'
|
osName: 'Mac'
|
||||||
artifactName: 'osx-x64'
|
|
||||||
imageName: ${{ variables.macImage }}
|
imageName: ${{ variables.macImage }}
|
||||||
pattern: 'Radarr.*.osx-core-x64.tar.gz'
|
pattern: 'Radarr.*.osx-core-x64.tar.gz'
|
||||||
failBuild: true
|
failBuild: true
|
||||||
Windows:
|
Windows:
|
||||||
osName: 'Windows'
|
osName: 'Windows'
|
||||||
artifactName: 'win-x64'
|
|
||||||
imageName: ${{ variables.windowsImage }}
|
imageName: ${{ variables.windowsImage }}
|
||||||
pattern: 'Radarr.*.windows-core-x64.zip'
|
pattern: 'Radarr.*.windows-core-x64.zip'
|
||||||
failBuild: true
|
failBuild: true
|
||||||
@@ -890,7 +740,7 @@ stages:
|
|||||||
displayName: Download Test Artifact
|
displayName: Download Test Artifact
|
||||||
inputs:
|
inputs:
|
||||||
buildType: 'current'
|
buildType: 'current'
|
||||||
artifactName: '$(artifactName)-tests'
|
artifactName: '$(osName)CoreTests'
|
||||||
targetPath: $(testsFolder)
|
targetPath: $(testsFolder)
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: DownloadPipelineArtifact@2
|
||||||
displayName: Download Build Artifact
|
displayName: Download Build Artifact
|
||||||
@@ -975,6 +825,7 @@ stages:
|
|||||||
key: 'yarn | "$(osName)" | yarn.lock'
|
key: 'yarn | "$(osName)" | yarn.lock'
|
||||||
restoreKeys: |
|
restoreKeys: |
|
||||||
yarn | "$(osName)"
|
yarn | "$(osName)"
|
||||||
|
yarn
|
||||||
path: $(yarnCacheFolder)
|
path: $(yarnCacheFolder)
|
||||||
displayName: Cache Yarn packages
|
displayName: Cache Yarn packages
|
||||||
- bash: ./build.sh --lint
|
- bash: ./build.sh --lint
|
||||||
|
|||||||
@@ -25,22 +25,14 @@ UpdateVersionNumber()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
EnableExtraPlatformsInSDK()
|
EnableBsdSupport()
|
||||||
{
|
{
|
||||||
SDK_PATH=$(dotnet --list-sdks | grep -P '6\.\d\.\d+' | head -1 | sed 's/\(6\.[0-9]*\.[0-9]*\).*\[\(.*\)\]/\2\/\1/g')
|
#todo enable sdk with
|
||||||
BUNDLEDVERSIONS="${SDK_PATH}/Microsoft.NETCoreSdk.BundledVersions.props"
|
#SDK_PATH=$(dotnet --list-sdks | grep -P '5\.\d\.\d+' | head -1 | sed 's/\(5\.[0-9]*\.[0-9]*\).*\[\(.*\)\]/\2\/\1/g')
|
||||||
if grep -q freebsd-x64 $BUNDLEDVERSIONS; then
|
# BUNDLED_VERSIONS="${SDK_PATH}/Microsoft.NETCoreSdk.BundledVersions.props"
|
||||||
echo "Extra platforms already enabled"
|
|
||||||
else
|
|
||||||
echo "Enabling extra platform support"
|
|
||||||
sed -i.ORI 's/osx-x64/osx-x64;freebsd-x64;linux-x86/' $BUNDLEDVERSIONS
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
EnableExtraPlatforms()
|
|
||||||
{
|
|
||||||
if grep -qv freebsd-x64 src/Directory.Build.props; then
|
if grep -qv freebsd-x64 src/Directory.Build.props; then
|
||||||
sed -i'' -e "s^<RuntimeIdentifiers>\(.*\)</RuntimeIdentifiers>^<RuntimeIdentifiers>\1;freebsd-x64;linux-x86</RuntimeIdentifiers>^g" src/Directory.Build.props
|
sed -i'' -e "s^<RuntimeIdentifiers>\(.*\)</RuntimeIdentifiers>^<RuntimeIdentifiers>\1;freebsd-x64</RuntimeIdentifiers>^g" src/Directory.Build.props
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -300,8 +292,7 @@ if [ $# -eq 0 ]; then
|
|||||||
PACKAGES=YES
|
PACKAGES=YES
|
||||||
INSTALLER=NO
|
INSTALLER=NO
|
||||||
LINT=YES
|
LINT=YES
|
||||||
ENABLE_EXTRA_PLATFORMS=NO
|
ENABLE_BSD=NO
|
||||||
ENABLE_EXTRA_PLATFORMS_IN_SDK=NO
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]
|
while [[ $# -gt 0 ]]
|
||||||
@@ -313,12 +304,8 @@ case $key in
|
|||||||
BACKEND=YES
|
BACKEND=YES
|
||||||
shift # past argument
|
shift # past argument
|
||||||
;;
|
;;
|
||||||
--enable-bsd|--enable-extra-platforms)
|
--enable-bsd)
|
||||||
ENABLE_EXTRA_PLATFORMS=YES
|
ENABLE_BSD=YES
|
||||||
shift # past argument
|
|
||||||
;;
|
|
||||||
--enable-extra-platforms-in-sdk)
|
|
||||||
ENABLE_EXTRA_PLATFORMS_IN_SDK=YES
|
|
||||||
shift # past argument
|
shift # past argument
|
||||||
;;
|
;;
|
||||||
-r|--runtime)
|
-r|--runtime)
|
||||||
@@ -362,17 +349,12 @@ esac
|
|||||||
done
|
done
|
||||||
set -- "${POSITIONAL[@]}" # restore positional parameters
|
set -- "${POSITIONAL[@]}" # restore positional parameters
|
||||||
|
|
||||||
if [ "$ENABLE_EXTRA_PLATFORMS_IN_SDK" = "YES" ];
|
|
||||||
then
|
|
||||||
EnableExtraPlatformsInSDK
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$BACKEND" = "YES" ];
|
if [ "$BACKEND" = "YES" ];
|
||||||
then
|
then
|
||||||
UpdateVersionNumber
|
UpdateVersionNumber
|
||||||
if [ "$ENABLE_EXTRA_PLATFORMS" = "YES" ];
|
if [ "$ENABLE_BSD" = "YES" ];
|
||||||
then
|
then
|
||||||
EnableExtraPlatforms
|
EnableBsdSupport
|
||||||
fi
|
fi
|
||||||
Build
|
Build
|
||||||
if [[ -z "$RID" || -z "$FRAMEWORK" ]];
|
if [[ -z "$RID" || -z "$FRAMEWORK" ]];
|
||||||
@@ -382,10 +364,9 @@ then
|
|||||||
PackageTests "net6.0" "linux-x64"
|
PackageTests "net6.0" "linux-x64"
|
||||||
PackageTests "net6.0" "linux-musl-x64"
|
PackageTests "net6.0" "linux-musl-x64"
|
||||||
PackageTests "net6.0" "osx-x64"
|
PackageTests "net6.0" "osx-x64"
|
||||||
if [ "$ENABLE_EXTRA_PLATFORMS" = "YES" ];
|
if [ "$ENABLE_BSD" = "YES" ];
|
||||||
then
|
then
|
||||||
PackageTests "net6.0" "freebsd-x64"
|
PackageTests "net6.0" "freebsd-x64"
|
||||||
PackageTests "net6.0" "linux-x86"
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
PackageTests "$FRAMEWORK" "$RID"
|
PackageTests "$FRAMEWORK" "$RID"
|
||||||
@@ -424,10 +405,9 @@ then
|
|||||||
Package "net6.0" "linux-musl-arm"
|
Package "net6.0" "linux-musl-arm"
|
||||||
Package "net6.0" "osx-x64"
|
Package "net6.0" "osx-x64"
|
||||||
Package "net6.0" "osx-arm64"
|
Package "net6.0" "osx-arm64"
|
||||||
if [ "$ENABLE_EXTRA_PLATFORMS" = "YES" ];
|
if [ "$ENABLE_BSD" = "YES" ];
|
||||||
then
|
then
|
||||||
Package "net6.0" "freebsd-x64"
|
Package "net6.0" "freebsd-x64"
|
||||||
Package "net6.0" "linux-x86"
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
Package "$FRAMEWORK" "$RID"
|
Package "$FRAMEWORK" "$RID"
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ module.exports = (env) => {
|
|||||||
{
|
{
|
||||||
loader: 'url-loader',
|
loader: 'url-loader',
|
||||||
options: {
|
options: {
|
||||||
limit: 24096,
|
limit: 10240,
|
||||||
mimetype: 'application/font-woff',
|
mimetype: 'application/font-woff',
|
||||||
emitFile: false,
|
emitFile: false,
|
||||||
name: 'Content/Fonts/[name].[ext]'
|
name: 'Content/Fonts/[name].[ext]'
|
||||||
@@ -233,12 +233,11 @@ module.exports = (env) => {
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
test: /\.(ttf|eot|eot?#iefix|gif|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
test: /\.(ttf|eot|eot?#iefix|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
||||||
use: [
|
use: [
|
||||||
{
|
{
|
||||||
loader: 'file-loader',
|
loader: 'file-loader',
|
||||||
options: {
|
options: {
|
||||||
limit: 24096,
|
|
||||||
emitFile: false,
|
emitFile: false,
|
||||||
name: 'Content/Fonts/[name].[ext]'
|
name: 'Content/Fonts/[name].[ext]'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,13 +181,12 @@ class Blocklist extends Component {
|
|||||||
>
|
>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{
|
{
|
||||||
items.map((item, index) => {
|
items.map((item) => {
|
||||||
return (
|
return (
|
||||||
<BlocklistRowConnector
|
<BlocklistRowConnector
|
||||||
key={item.id}
|
key={item.id}
|
||||||
isSelected={selectedState[item.id] || false}
|
isSelected={selectedState[item.id] || false}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
index={index}
|
|
||||||
{...item}
|
{...item}
|
||||||
onSelectedChange={this.onSelectedChange}
|
onSelectedChange={this.onSelectedChange}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -179,16 +179,6 @@ class HistoryRow extends Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name === 'sourceTitle') {
|
|
||||||
return (
|
|
||||||
<TableRowCell
|
|
||||||
key={name}
|
|
||||||
>
|
|
||||||
{sourceTitle}
|
|
||||||
</TableRowCell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name === 'details') {
|
if (name === 'details') {
|
||||||
return (
|
return (
|
||||||
<TableRowCell
|
<TableRowCell
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
import HeartRating from 'Components/HeartRating';
|
||||||
import Icon from 'Components/Icon';
|
import Icon from 'Components/Icon';
|
||||||
import Label from 'Components/Label';
|
import Label from 'Components/Label';
|
||||||
import Link from 'Components/Link/Link';
|
import Link from 'Components/Link/Link';
|
||||||
import TmdbRating from 'Components/TmdbRating';
|
|
||||||
import Tooltip from 'Components/Tooltip/Tooltip';
|
import Tooltip from 'Components/Tooltip/Tooltip';
|
||||||
import { icons, kinds, sizes, tooltipPositions } from 'Helpers/Props';
|
import { icons, kinds, sizes, tooltipPositions } from 'Helpers/Props';
|
||||||
import MovieDetailsLinks from 'Movie/Details/MovieDetailsLinks';
|
import MovieDetailsLinks from 'Movie/Details/MovieDetailsLinks';
|
||||||
@@ -190,7 +190,7 @@ class AddNewMovieSearchResult extends Component {
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Label size={sizes.LARGE}>
|
<Label size={sizes.LARGE}>
|
||||||
<TmdbRating
|
<HeartRating
|
||||||
ratings={ratings}
|
ratings={ratings}
|
||||||
iconSize={13}
|
iconSize={13}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
.container {
|
.movie {
|
||||||
display: flex;
|
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
@@ -7,19 +6,3 @@
|
|||||||
background-color: $menuItemHoverBackgroundColor;
|
background-color: $menuItemHoverBackgroundColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.movie {
|
|
||||||
flex: 1 0 0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tmdbLink {
|
|
||||||
composes: link from '~Components/Link/Link.css';
|
|
||||||
|
|
||||||
margin-left: auto;
|
|
||||||
color: $textColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tmdbLinkIcon {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import Icon from 'Components/Icon';
|
|
||||||
import Link from 'Components/Link/Link';
|
import Link from 'Components/Link/Link';
|
||||||
import { icons } from 'Helpers/Props';
|
|
||||||
import ImportMovieTitle from './ImportMovieTitle';
|
import ImportMovieTitle from './ImportMovieTitle';
|
||||||
import styles from './ImportMovieSearchResult.css';
|
import styles from './ImportMovieSearchResult.css';
|
||||||
|
|
||||||
@@ -20,7 +18,6 @@ class ImportMovieSearchResult extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
tmdbId,
|
|
||||||
title,
|
title,
|
||||||
year,
|
year,
|
||||||
studio,
|
studio,
|
||||||
@@ -28,30 +25,17 @@ class ImportMovieSearchResult extends Component {
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<Link
|
||||||
<Link
|
className={styles.movie}
|
||||||
className={styles.movie}
|
onPress={this.onPress}
|
||||||
onPress={this.onPress}
|
>
|
||||||
>
|
<ImportMovieTitle
|
||||||
<ImportMovieTitle
|
title={title}
|
||||||
title={title}
|
year={year}
|
||||||
year={year}
|
network={studio}
|
||||||
network={studio}
|
isExistingMovie={isExistingMovie}
|
||||||
isExistingMovie={isExistingMovie}
|
/>
|
||||||
/>
|
</Link>
|
||||||
</Link>
|
|
||||||
|
|
||||||
<Link
|
|
||||||
className={styles.tmdbLink}
|
|
||||||
to={`https://www.themoviedb.org/movie/${tmdbId}`}
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
className={styles.tmdbLinkIcon}
|
|
||||||
name={icons.EXTERNAL_LINK}
|
|
||||||
size={16}
|
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import AppRoutes from './AppRoutes';
|
|||||||
|
|
||||||
function App({ store, history }) {
|
function App({ store, history }) {
|
||||||
return (
|
return (
|
||||||
<DocumentTitle title={window.Radarr.instanceName}>
|
<DocumentTitle title="Radarr">
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<ConnectedRouter history={history}>
|
<ConnectedRouter history={history}>
|
||||||
<PageConnector>
|
<PageConnector>
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import QueueConnector from 'Activity/Queue/QueueConnector';
|
|||||||
import AddNewMovieConnector from 'AddMovie/AddNewMovie/AddNewMovieConnector';
|
import AddNewMovieConnector from 'AddMovie/AddNewMovie/AddNewMovieConnector';
|
||||||
import ImportMovies from 'AddMovie/ImportMovie/ImportMovies';
|
import ImportMovies from 'AddMovie/ImportMovie/ImportMovies';
|
||||||
import CalendarPageConnector from 'Calendar/CalendarPageConnector';
|
import CalendarPageConnector from 'Calendar/CalendarPageConnector';
|
||||||
import CollectionConnector from 'Collection/CollectionConnector';
|
|
||||||
import NotFound from 'Components/NotFound';
|
import NotFound from 'Components/NotFound';
|
||||||
import Switch from 'Components/Router/Switch';
|
import Switch from 'Components/Router/Switch';
|
||||||
import DiscoverMovieConnector from 'DiscoverMovie/DiscoverMovieConnector';
|
import DiscoverMovieConnector from 'DiscoverMovie/DiscoverMovieConnector';
|
||||||
@@ -73,11 +72,6 @@ function AppRoutes(props) {
|
|||||||
component={AddNewMovieConnector}
|
component={AddNewMovieConnector}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
|
||||||
path="/collections"
|
|
||||||
component={CollectionConnector}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path="/add/import"
|
path="/add/import"
|
||||||
component={ImportMovies}
|
component={ImportMovies}
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import Modal from 'Components/Modal/Modal';
|
|
||||||
import AddNewCollectionMovieModalContentConnector from './AddNewCollectionMovieModalContentConnector';
|
|
||||||
|
|
||||||
function AddNewCollectionMovieModal(props) {
|
|
||||||
const {
|
|
||||||
isOpen,
|
|
||||||
onModalClose,
|
|
||||||
...otherProps
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
isOpen={isOpen}
|
|
||||||
onModalClose={onModalClose}
|
|
||||||
>
|
|
||||||
<AddNewCollectionMovieModalContentConnector
|
|
||||||
{...otherProps}
|
|
||||||
onModalClose={onModalClose}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
AddNewCollectionMovieModal.propTypes = {
|
|
||||||
isOpen: PropTypes.bool.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AddNewCollectionMovieModal;
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
.container {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.year {
|
|
||||||
margin-left: 5px;
|
|
||||||
color: $disabledColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.poster {
|
|
||||||
flex: 0 0 170px;
|
|
||||||
margin-right: 20px;
|
|
||||||
height: 250px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overview {
|
|
||||||
margin-bottom: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.labelIcon {
|
|
||||||
margin-left: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchForMissingMovieLabelContainer {
|
|
||||||
display: flex;
|
|
||||||
margin-top: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchForMissingMovieLabel {
|
|
||||||
margin-right: 8px;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchForMissingMovieContainer {
|
|
||||||
composes: container from '~Components/Form/CheckInput.css';
|
|
||||||
|
|
||||||
flex: 0 1 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchForMissingMovieInput {
|
|
||||||
composes: input from '~Components/Form/CheckInput.css';
|
|
||||||
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.modalFooter {
|
|
||||||
composes: modalFooter from '~Components/Modal/ModalFooter.css';
|
|
||||||
}
|
|
||||||
|
|
||||||
.addButton {
|
|
||||||
@add-mixin truncate;
|
|
||||||
composes: button from '~Components/Link/SpinnerButton.css';
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: $breakpointSmall) {
|
|
||||||
.modalFooter {
|
|
||||||
display: block;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.addButton {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,204 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import CheckInput from 'Components/Form/CheckInput';
|
|
||||||
import Form from 'Components/Form/Form';
|
|
||||||
import FormGroup from 'Components/Form/FormGroup';
|
|
||||||
import FormInputGroup from 'Components/Form/FormInputGroup';
|
|
||||||
import FormLabel from 'Components/Form/FormLabel';
|
|
||||||
import SpinnerButton from 'Components/Link/SpinnerButton';
|
|
||||||
import ModalBody from 'Components/Modal/ModalBody';
|
|
||||||
import ModalContent from 'Components/Modal/ModalContent';
|
|
||||||
import ModalFooter from 'Components/Modal/ModalFooter';
|
|
||||||
import ModalHeader from 'Components/Modal/ModalHeader';
|
|
||||||
import { inputTypes, kinds } from 'Helpers/Props';
|
|
||||||
import MoviePoster from 'Movie/MoviePoster';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import styles from './AddNewCollectionMovieModalContent.css';
|
|
||||||
|
|
||||||
class AddNewCollectionMovieModalContent extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onQualityProfileIdChange = ({ value }) => {
|
|
||||||
this.props.onInputChange({ name: 'qualityProfileId', value: parseInt(value) });
|
|
||||||
};
|
|
||||||
|
|
||||||
onAddMoviePress = () => {
|
|
||||||
this.props.onAddMoviePress();
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
title,
|
|
||||||
year,
|
|
||||||
overview,
|
|
||||||
images,
|
|
||||||
isAdding,
|
|
||||||
folder,
|
|
||||||
tags,
|
|
||||||
isSmallScreen,
|
|
||||||
isWindows,
|
|
||||||
onModalClose,
|
|
||||||
onInputChange,
|
|
||||||
rootFolderPath,
|
|
||||||
monitor,
|
|
||||||
qualityProfileId,
|
|
||||||
minimumAvailability,
|
|
||||||
searchForMovie
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ModalContent onModalClose={onModalClose}>
|
|
||||||
<ModalHeader>
|
|
||||||
{title}
|
|
||||||
|
|
||||||
{
|
|
||||||
!title.contains(year) && !!year &&
|
|
||||||
<span className={styles.year}>({year})</span>
|
|
||||||
}
|
|
||||||
</ModalHeader>
|
|
||||||
|
|
||||||
<ModalBody>
|
|
||||||
<div className={styles.container}>
|
|
||||||
{
|
|
||||||
!isSmallScreen &&
|
|
||||||
<div className={styles.poster}>
|
|
||||||
<MoviePoster
|
|
||||||
className={styles.poster}
|
|
||||||
images={images}
|
|
||||||
size={250}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
<div className={styles.info}>
|
|
||||||
<div className={styles.overview}>
|
|
||||||
{overview}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Form>
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('RootFolder')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.ROOT_FOLDER_SELECT}
|
|
||||||
name="rootFolderPath"
|
|
||||||
valueOptions={{
|
|
||||||
movieFolder: folder,
|
|
||||||
isWindows
|
|
||||||
}}
|
|
||||||
selectedValueOptions={{
|
|
||||||
movieFolder: folder,
|
|
||||||
isWindows
|
|
||||||
}}
|
|
||||||
helpText={translate('SubfolderWillBeCreatedAutomaticallyInterp', [folder])}
|
|
||||||
onChange={onInputChange}
|
|
||||||
{...rootFolderPath}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>
|
|
||||||
{translate('Monitor')}
|
|
||||||
</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.MOVIE_MONITORED_SELECT}
|
|
||||||
name="monitor"
|
|
||||||
onChange={onInputChange}
|
|
||||||
{...monitor}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('MinimumAvailability')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.AVAILABILITY_SELECT}
|
|
||||||
name="minimumAvailability"
|
|
||||||
onChange={onInputChange}
|
|
||||||
{...minimumAvailability}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('QualityProfile')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.QUALITY_PROFILE_SELECT}
|
|
||||||
name="qualityProfileId"
|
|
||||||
onChange={this.onQualityProfileIdChange}
|
|
||||||
{...qualityProfileId}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('Tags')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.TAG}
|
|
||||||
name="tags"
|
|
||||||
onChange={onInputChange}
|
|
||||||
{...tags}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
</Form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ModalBody>
|
|
||||||
|
|
||||||
<ModalFooter className={styles.modalFooter}>
|
|
||||||
<label className={styles.searchForMissingMovieLabelContainer}>
|
|
||||||
<span className={styles.searchForMissingMovieLabel}>
|
|
||||||
{translate('StartSearchForMissingMovie')}
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<CheckInput
|
|
||||||
containerClassName={styles.searchForMissingMovieContainer}
|
|
||||||
className={styles.searchForMissingMovieInput}
|
|
||||||
name="searchForMovie"
|
|
||||||
onChange={onInputChange}
|
|
||||||
{...searchForMovie}
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<SpinnerButton
|
|
||||||
className={styles.addButton}
|
|
||||||
kind={kinds.SUCCESS}
|
|
||||||
isSpinning={isAdding}
|
|
||||||
onPress={this.onAddMoviePress}
|
|
||||||
>
|
|
||||||
{translate('AddMovie')}
|
|
||||||
</SpinnerButton>
|
|
||||||
</ModalFooter>
|
|
||||||
</ModalContent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AddNewCollectionMovieModalContent.propTypes = {
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
year: PropTypes.number.isRequired,
|
|
||||||
overview: PropTypes.string,
|
|
||||||
images: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
isAdding: PropTypes.bool.isRequired,
|
|
||||||
addError: PropTypes.object,
|
|
||||||
rootFolderPath: PropTypes.object,
|
|
||||||
monitor: PropTypes.object.isRequired,
|
|
||||||
qualityProfileId: PropTypes.object,
|
|
||||||
minimumAvailability: PropTypes.object.isRequired,
|
|
||||||
searchForMovie: PropTypes.object.isRequired,
|
|
||||||
folder: PropTypes.string.isRequired,
|
|
||||||
tags: PropTypes.object.isRequired,
|
|
||||||
isSmallScreen: PropTypes.bool.isRequired,
|
|
||||||
isWindows: PropTypes.bool.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired,
|
|
||||||
onInputChange: PropTypes.func.isRequired,
|
|
||||||
onAddMoviePress: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AddNewCollectionMovieModalContent;
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import { addMovie, setMovieCollectionValue } from 'Store/Actions/movieCollectionActions';
|
|
||||||
import createCollectionSelector from 'Store/Selectors/createCollectionSelector';
|
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
|
||||||
import createSystemStatusSelector from 'Store/Selectors/createSystemStatusSelector';
|
|
||||||
import selectSettings from 'Store/Selectors/selectSettings';
|
|
||||||
import AddNewMovieModalContent from './AddNewCollectionMovieModalContent';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
(state) => state.movieCollections,
|
|
||||||
createCollectionSelector(),
|
|
||||||
createDimensionsSelector(),
|
|
||||||
createSystemStatusSelector(),
|
|
||||||
(discoverMovieState, collection, dimensions, systemStatus) => {
|
|
||||||
const {
|
|
||||||
isAdding,
|
|
||||||
addError,
|
|
||||||
pendingChanges
|
|
||||||
} = discoverMovieState;
|
|
||||||
|
|
||||||
const collectionDefaults = {
|
|
||||||
rootFolderPath: collection.rootFolderPath,
|
|
||||||
monitor: 'movieOnly',
|
|
||||||
qualityProfileId: collection.qualityProfileId,
|
|
||||||
minimumAvailability: collection.minimumAvailability,
|
|
||||||
searchForMovie: collection.searchOnAdd,
|
|
||||||
tags: []
|
|
||||||
};
|
|
||||||
|
|
||||||
const {
|
|
||||||
settings,
|
|
||||||
validationErrors,
|
|
||||||
validationWarnings
|
|
||||||
} = selectSettings(collectionDefaults, pendingChanges, addError);
|
|
||||||
|
|
||||||
return {
|
|
||||||
isAdding,
|
|
||||||
addError,
|
|
||||||
isSmallScreen: dimensions.isSmallScreen,
|
|
||||||
validationErrors,
|
|
||||||
validationWarnings,
|
|
||||||
isWindows: systemStatus.isWindows,
|
|
||||||
...settings
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
addMovie,
|
|
||||||
setMovieCollectionValue
|
|
||||||
};
|
|
||||||
|
|
||||||
class AddNewCollectionMovieModalContentConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onInputChange = ({ name, value }) => {
|
|
||||||
this.props.setMovieCollectionValue({ name, value });
|
|
||||||
};
|
|
||||||
|
|
||||||
onAddMoviePress = () => {
|
|
||||||
const {
|
|
||||||
tmdbId,
|
|
||||||
title,
|
|
||||||
rootFolderPath,
|
|
||||||
monitor,
|
|
||||||
qualityProfileId,
|
|
||||||
minimumAvailability,
|
|
||||||
searchForMovie,
|
|
||||||
tags
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
this.props.addMovie({
|
|
||||||
tmdbId,
|
|
||||||
title,
|
|
||||||
rootFolderPath: rootFolderPath.value,
|
|
||||||
monitor: monitor.value,
|
|
||||||
qualityProfileId: qualityProfileId.value,
|
|
||||||
minimumAvailability: minimumAvailability.value,
|
|
||||||
searchForMovie: searchForMovie.value,
|
|
||||||
tags: tags.value
|
|
||||||
});
|
|
||||||
|
|
||||||
this.props.onModalClose(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<AddNewMovieModalContent
|
|
||||||
{...this.props}
|
|
||||||
onInputChange={this.onInputChange}
|
|
||||||
onAddMoviePress={this.onAddMoviePress}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AddNewCollectionMovieModalContentConnector.propTypes = {
|
|
||||||
tmdbId: PropTypes.number.isRequired,
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
rootFolderPath: PropTypes.object,
|
|
||||||
monitor: PropTypes.object.isRequired,
|
|
||||||
qualityProfileId: PropTypes.object,
|
|
||||||
minimumAvailability: PropTypes.object.isRequired,
|
|
||||||
searchForMovie: PropTypes.object.isRequired,
|
|
||||||
tags: PropTypes.object.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired,
|
|
||||||
addMovie: PropTypes.func.isRequired,
|
|
||||||
setMovieCollectionValue: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(AddNewCollectionMovieModalContentConnector);
|
|
||||||
@@ -1,403 +0,0 @@
|
|||||||
import _ from 'lodash';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
|
||||||
import PageContent from 'Components/Page/PageContent';
|
|
||||||
import PageContentBody from 'Components/Page/PageContentBody';
|
|
||||||
import PageJumpBar from 'Components/Page/PageJumpBar';
|
|
||||||
import PageToolbar from 'Components/Page/Toolbar/PageToolbar';
|
|
||||||
import PageToolbarButton from 'Components/Page/Toolbar/PageToolbarButton';
|
|
||||||
import PageToolbarSection from 'Components/Page/Toolbar/PageToolbarSection';
|
|
||||||
import PageToolbarSeparator from 'Components/Page/Toolbar/PageToolbarSeparator';
|
|
||||||
import { align, icons, sortDirections } from 'Helpers/Props';
|
|
||||||
import styles from 'Movie/Index/MovieIndex.css';
|
|
||||||
import hasDifferentItemsOrOrder from 'Utilities/Object/hasDifferentItemsOrOrder';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import getSelectedIds from 'Utilities/Table/getSelectedIds';
|
|
||||||
import selectAll from 'Utilities/Table/selectAll';
|
|
||||||
import toggleSelected from 'Utilities/Table/toggleSelected';
|
|
||||||
import CollectionFooter from './CollectionFooter';
|
|
||||||
import CollectionFilterMenu from './Menus/CollectionFilterMenu';
|
|
||||||
import CollectionSortMenu from './Menus/CollectionSortMenu';
|
|
||||||
import NoCollection from './NoCollection';
|
|
||||||
import CollectionOverviewsConnector from './Overview/CollectionOverviewsConnector';
|
|
||||||
import CollectionOverviewOptionsModal from './Overview/Options/CollectionOverviewOptionsModal';
|
|
||||||
|
|
||||||
function getViewComponent(view) {
|
|
||||||
return CollectionOverviewsConnector;
|
|
||||||
}
|
|
||||||
|
|
||||||
class Collection extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
constructor(props, context) {
|
|
||||||
super(props, context);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
scroller: null,
|
|
||||||
jumpBarItems: { order: [] },
|
|
||||||
jumpToCharacter: null,
|
|
||||||
isPosterOptionsModalOpen: false,
|
|
||||||
isOverviewOptionsModalOpen: false,
|
|
||||||
isConfirmSearchModalOpen: false,
|
|
||||||
searchType: null,
|
|
||||||
allSelected: false,
|
|
||||||
allUnselected: false,
|
|
||||||
lastToggled: null,
|
|
||||||
selectedState: {}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
this.setJumpBarItems();
|
|
||||||
this.setSelectedState();
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
|
||||||
const {
|
|
||||||
items,
|
|
||||||
sortKey,
|
|
||||||
sortDirection
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
if (sortKey !== prevProps.sortKey ||
|
|
||||||
sortDirection !== prevProps.sortDirection ||
|
|
||||||
hasDifferentItemsOrOrder(prevProps.items, items)
|
|
||||||
) {
|
|
||||||
this.setJumpBarItems();
|
|
||||||
this.setSelectedState();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.state.jumpToCharacter != null) {
|
|
||||||
this.setState({ jumpToCharacter: null });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Control
|
|
||||||
|
|
||||||
setScrollerRef = (ref) => {
|
|
||||||
this.setState({ scroller: ref });
|
|
||||||
};
|
|
||||||
|
|
||||||
getSelectedIds = () => {
|
|
||||||
if (this.state.allUnselected) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
return getSelectedIds(this.state.selectedState);
|
|
||||||
};
|
|
||||||
|
|
||||||
setSelectedState() {
|
|
||||||
const {
|
|
||||||
items
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
selectedState
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
const newSelectedState = {};
|
|
||||||
|
|
||||||
items.forEach((collection) => {
|
|
||||||
const isItemSelected = selectedState[collection.id];
|
|
||||||
|
|
||||||
if (isItemSelected) {
|
|
||||||
newSelectedState[collection.id] = isItemSelected;
|
|
||||||
} else {
|
|
||||||
newSelectedState[collection.id] = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const selectedCount = getSelectedIds(newSelectedState).length;
|
|
||||||
const newStateCount = Object.keys(newSelectedState).length;
|
|
||||||
let isAllSelected = false;
|
|
||||||
let isAllUnselected = false;
|
|
||||||
|
|
||||||
if (selectedCount === 0) {
|
|
||||||
isAllUnselected = true;
|
|
||||||
} else if (selectedCount === newStateCount) {
|
|
||||||
isAllSelected = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setState({ selectedState: newSelectedState, allSelected: isAllSelected, allUnselected: isAllUnselected });
|
|
||||||
}
|
|
||||||
|
|
||||||
setJumpBarItems() {
|
|
||||||
const {
|
|
||||||
items,
|
|
||||||
sortKey,
|
|
||||||
sortDirection
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
// Reset if not sorting by sortTitle
|
|
||||||
if (sortKey !== 'sortTitle') {
|
|
||||||
this.setState({ jumpBarItems: { order: [] } });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const characters = _.reduce(items, (acc, item) => {
|
|
||||||
let char = item.sortTitle.charAt(0);
|
|
||||||
|
|
||||||
if (!isNaN(char)) {
|
|
||||||
char = '#';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (char in acc) {
|
|
||||||
acc[char] = acc[char] + 1;
|
|
||||||
} else {
|
|
||||||
acc[char] = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return acc;
|
|
||||||
}, {});
|
|
||||||
|
|
||||||
const order = Object.keys(characters).sort();
|
|
||||||
|
|
||||||
// Reverse if sorting descending
|
|
||||||
if (sortDirection === sortDirections.DESCENDING) {
|
|
||||||
order.reverse();
|
|
||||||
}
|
|
||||||
|
|
||||||
const jumpBarItems = {
|
|
||||||
characters,
|
|
||||||
order
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setState({ jumpBarItems });
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onOverviewOptionsPress = () => {
|
|
||||||
this.setState({ isOverviewOptionsModalOpen: true });
|
|
||||||
};
|
|
||||||
|
|
||||||
onOverviewOptionsModalClose = () => {
|
|
||||||
this.setState({ isOverviewOptionsModalOpen: false });
|
|
||||||
};
|
|
||||||
|
|
||||||
onJumpBarItemPress = (jumpToCharacter) => {
|
|
||||||
this.setState({ jumpToCharacter });
|
|
||||||
};
|
|
||||||
|
|
||||||
onSelectAllChange = ({ value }) => {
|
|
||||||
this.setState(selectAll(this.state.selectedState, value));
|
|
||||||
};
|
|
||||||
|
|
||||||
onSelectAllPress = () => {
|
|
||||||
this.onSelectAllChange({ value: !this.state.allSelected });
|
|
||||||
};
|
|
||||||
|
|
||||||
onRefreshMovieCollectionsPress = () => {
|
|
||||||
this.props.onRefreshMovieCollectionsPress();
|
|
||||||
};
|
|
||||||
|
|
||||||
onSelectedChange = ({ id, value, shiftKey = false }) => {
|
|
||||||
this.setState((state) => {
|
|
||||||
return toggleSelected(state, this.props.items, id, value, shiftKey, 'id');
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
onUpdateSelectedPress = (changes) => {
|
|
||||||
this.props.onUpdateSelectedPress({
|
|
||||||
collectionIds: this.getSelectedIds(),
|
|
||||||
...changes
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
isFetching,
|
|
||||||
isPopulated,
|
|
||||||
error,
|
|
||||||
totalItems,
|
|
||||||
items,
|
|
||||||
selectedFilterKey,
|
|
||||||
filters,
|
|
||||||
customFilters,
|
|
||||||
sortKey,
|
|
||||||
sortDirection,
|
|
||||||
view,
|
|
||||||
onSortSelect,
|
|
||||||
onFilterSelect,
|
|
||||||
onScroll,
|
|
||||||
isRefreshingCollections,
|
|
||||||
isSaving,
|
|
||||||
isAdding,
|
|
||||||
...otherProps
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
scroller,
|
|
||||||
jumpBarItems,
|
|
||||||
jumpToCharacter,
|
|
||||||
isOverviewOptionsModalOpen,
|
|
||||||
selectedState,
|
|
||||||
allSelected,
|
|
||||||
allUnselected
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
const selectedMovieIds = this.getSelectedIds();
|
|
||||||
|
|
||||||
const ViewComponent = getViewComponent(view);
|
|
||||||
const isLoaded = !!(!error && isPopulated && items.length && scroller);
|
|
||||||
const hasNoCollection = !totalItems;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PageContent>
|
|
||||||
<PageToolbar>
|
|
||||||
<PageToolbarSection>
|
|
||||||
<PageToolbarButton
|
|
||||||
label={translate('RefreshCollections')}
|
|
||||||
iconName={icons.REFRESH}
|
|
||||||
isSpinning={isRefreshingCollections}
|
|
||||||
isDisabled={hasNoCollection}
|
|
||||||
onPress={this.onRefreshMovieCollectionsPress}
|
|
||||||
/>
|
|
||||||
<PageToolbarButton
|
|
||||||
label={allSelected ? translate('UnselectAll') : translate('SelectAll')}
|
|
||||||
iconName={icons.CHECK_SQUARE}
|
|
||||||
isDisabled={hasNoCollection}
|
|
||||||
onPress={this.onSelectAllPress}
|
|
||||||
/>
|
|
||||||
</PageToolbarSection>
|
|
||||||
|
|
||||||
<PageToolbarSection
|
|
||||||
alignContent={align.RIGHT}
|
|
||||||
collapseButtons={false}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
view === 'overview' ?
|
|
||||||
<PageToolbarButton
|
|
||||||
label={translate('Options')}
|
|
||||||
iconName={icons.OVERVIEW}
|
|
||||||
onPress={this.onOverviewOptionsPress}
|
|
||||||
/> :
|
|
||||||
null
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
(view === 'posters' || view === 'overview') &&
|
|
||||||
<PageToolbarSeparator />
|
|
||||||
}
|
|
||||||
|
|
||||||
<CollectionSortMenu
|
|
||||||
sortKey={sortKey}
|
|
||||||
sortDirection={sortDirection}
|
|
||||||
isDisabled={hasNoCollection}
|
|
||||||
onSortSelect={onSortSelect}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<CollectionFilterMenu
|
|
||||||
selectedFilterKey={selectedFilterKey}
|
|
||||||
filters={filters}
|
|
||||||
customFilters={customFilters}
|
|
||||||
isDisabled={hasNoCollection}
|
|
||||||
onFilterSelect={onFilterSelect}
|
|
||||||
/>
|
|
||||||
</PageToolbarSection>
|
|
||||||
</PageToolbar>
|
|
||||||
|
|
||||||
<div className={styles.pageContentBodyWrapper}>
|
|
||||||
<PageContentBody
|
|
||||||
registerScroller={this.setScrollerRef}
|
|
||||||
className={styles.contentBody}
|
|
||||||
innerClassName={styles[`${view}InnerContentBody`]}
|
|
||||||
onScroll={onScroll}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
isFetching && !isPopulated &&
|
|
||||||
<LoadingIndicator />
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
!isFetching && !!error &&
|
|
||||||
<div>
|
|
||||||
{translate('UnableToLoadCollections')}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
isLoaded &&
|
|
||||||
<div className={styles.contentBodyContainer}>
|
|
||||||
<ViewComponent
|
|
||||||
scroller={scroller}
|
|
||||||
items={items}
|
|
||||||
filters={filters}
|
|
||||||
sortKey={sortKey}
|
|
||||||
sortDirection={sortDirection}
|
|
||||||
jumpToCharacter={jumpToCharacter}
|
|
||||||
allSelected={allSelected}
|
|
||||||
allUnselected={allUnselected}
|
|
||||||
onSelectedChange={this.onSelectedChange}
|
|
||||||
onSelectAllChange={this.onSelectAllChange}
|
|
||||||
selectedState={selectedState}
|
|
||||||
{...otherProps}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
!error && isPopulated && !items.length &&
|
|
||||||
<NoCollection totalItems={totalItems} />
|
|
||||||
}
|
|
||||||
</PageContentBody>
|
|
||||||
|
|
||||||
{
|
|
||||||
isLoaded && !!jumpBarItems.order.length &&
|
|
||||||
<PageJumpBar
|
|
||||||
items={jumpBarItems}
|
|
||||||
onItemPress={this.onJumpBarItemPress}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{
|
|
||||||
isLoaded &&
|
|
||||||
<CollectionFooter
|
|
||||||
selectedIds={selectedMovieIds}
|
|
||||||
isSaving={isSaving}
|
|
||||||
isAdding={isAdding}
|
|
||||||
onUpdateSelectedPress={this.onUpdateSelectedPress}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
|
|
||||||
<CollectionOverviewOptionsModal
|
|
||||||
isOpen={isOverviewOptionsModalOpen}
|
|
||||||
onModalClose={this.onOverviewOptionsModalClose}
|
|
||||||
/>
|
|
||||||
</PageContent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Collection.propTypes = {
|
|
||||||
isFetching: PropTypes.bool.isRequired,
|
|
||||||
isPopulated: PropTypes.bool.isRequired,
|
|
||||||
isSaving: PropTypes.bool.isRequired,
|
|
||||||
isAdding: PropTypes.bool.isRequired,
|
|
||||||
error: PropTypes.object,
|
|
||||||
totalItems: PropTypes.number.isRequired,
|
|
||||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
selectedFilterKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
||||||
filters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
customFilters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
sortKey: PropTypes.string,
|
|
||||||
sortDirection: PropTypes.oneOf(sortDirections.all),
|
|
||||||
view: PropTypes.string.isRequired,
|
|
||||||
isRefreshingCollections: PropTypes.bool.isRequired,
|
|
||||||
isSmallScreen: PropTypes.bool.isRequired,
|
|
||||||
onSortSelect: PropTypes.func.isRequired,
|
|
||||||
onFilterSelect: PropTypes.func.isRequired,
|
|
||||||
onScroll: PropTypes.func.isRequired,
|
|
||||||
onUpdateSelectedPress: PropTypes.func.isRequired,
|
|
||||||
onRefreshMovieCollectionsPress: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Collection;
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import * as commandNames from 'Commands/commandNames';
|
|
||||||
import withScrollPosition from 'Components/withScrollPosition';
|
|
||||||
import { executeCommand } from 'Store/Actions/commandActions';
|
|
||||||
import { saveMovieCollections, setMovieCollectionsFilter, setMovieCollectionsSort } from 'Store/Actions/movieCollectionActions';
|
|
||||||
import { fetchRootFolders } from 'Store/Actions/rootFolderActions';
|
|
||||||
import scrollPositions from 'Store/scrollPositions';
|
|
||||||
import createCollectionClientSideCollectionItemsSelector from 'Store/Selectors/createCollectionClientSideCollectionItemsSelector';
|
|
||||||
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
|
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
|
||||||
import { registerPagePopulator, unregisterPagePopulator } from 'Utilities/pagePopulator';
|
|
||||||
import Collection from './Collection';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
createCollectionClientSideCollectionItemsSelector('movieCollections'),
|
|
||||||
createCommandExecutingSelector(commandNames.REFRESH_COLLECTIONS),
|
|
||||||
createDimensionsSelector(),
|
|
||||||
(
|
|
||||||
collections,
|
|
||||||
isRefreshingCollections,
|
|
||||||
dimensionsState
|
|
||||||
) => {
|
|
||||||
return {
|
|
||||||
...collections,
|
|
||||||
isRefreshingCollections,
|
|
||||||
isSmallScreen: dimensionsState.isSmallScreen
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createMapDispatchToProps(dispatch, props) {
|
|
||||||
return {
|
|
||||||
dispatchFetchRootFolders() {
|
|
||||||
dispatch(fetchRootFolders());
|
|
||||||
},
|
|
||||||
onUpdateSelectedPress(payload) {
|
|
||||||
dispatch(saveMovieCollections(payload));
|
|
||||||
},
|
|
||||||
onSortSelect(sortKey) {
|
|
||||||
dispatch(setMovieCollectionsSort({ sortKey }));
|
|
||||||
},
|
|
||||||
onFilterSelect(selectedFilterKey) {
|
|
||||||
dispatch(setMovieCollectionsFilter({ selectedFilterKey }));
|
|
||||||
},
|
|
||||||
onRefreshMovieCollectionsPress() {
|
|
||||||
dispatch(executeCommand({
|
|
||||||
name: commandNames.REFRESH_COLLECTIONS
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
class CollectionConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
registerPagePopulator(this.repopulate);
|
|
||||||
this.props.dispatchFetchRootFolders();
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillUnmount() {
|
|
||||||
unregisterPagePopulator(this.repopulate);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onScroll = ({ scrollTop }) => {
|
|
||||||
scrollPositions.movieCollections = scrollTop;
|
|
||||||
};
|
|
||||||
|
|
||||||
onUpdateSelectedPress = (payload) => {
|
|
||||||
this.props.onUpdateSelectedPress(payload);
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<Collection
|
|
||||||
{...this.props}
|
|
||||||
onViewSelect={this.onViewSelect}
|
|
||||||
onScroll={this.onScroll}
|
|
||||||
onUpdateSelectedPress={this.onUpdateSelectedPress}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionConnector.propTypes = {
|
|
||||||
isSmallScreen: PropTypes.bool.isRequired,
|
|
||||||
view: PropTypes.string.isRequired,
|
|
||||||
onUpdateSelectedPress: PropTypes.func.isRequired,
|
|
||||||
dispatchFetchRootFolders: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default withScrollPosition(
|
|
||||||
connect(createMapStateToProps, createMapDispatchToProps)(CollectionConnector),
|
|
||||||
'movieCollections'
|
|
||||||
);
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import FilterModal from 'Components/Filter/FilterModal';
|
|
||||||
import { setMovieCollectionsFilter } from 'Store/Actions/movieCollectionActions';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
(state) => state.movieCollections.items,
|
|
||||||
(state) => state.movieCollections.filterBuilderProps,
|
|
||||||
(sectionItems, filterBuilderProps) => {
|
|
||||||
return {
|
|
||||||
sectionItems,
|
|
||||||
filterBuilderProps,
|
|
||||||
customFilterType: 'movieCollections'
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
dispatchSetFilter: setMovieCollectionsFilter
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(FilterModal);
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
.inputContainer {
|
|
||||||
margin-right: 20px;
|
|
||||||
min-width: 150px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonContainer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonContainerContent {
|
|
||||||
flex-grow: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttons {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.addSelectedButton {
|
|
||||||
composes: button from '~Components/Link/SpinnerButton.css';
|
|
||||||
|
|
||||||
margin-right: 10px;
|
|
||||||
height: 35px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.excludeSelectedButton {
|
|
||||||
composes: button from '~Components/Link/SpinnerButton.css';
|
|
||||||
|
|
||||||
margin-left: 25px;
|
|
||||||
height: 35px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: $breakpointSmall) {
|
|
||||||
.inputContainer {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonContainer {
|
|
||||||
justify-content: flex-start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonContainerContent {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttons {
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.selectedMovieLabel {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,231 +0,0 @@
|
|||||||
import _ from 'lodash';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import AvailabilitySelectInput from 'Components/Form/AvailabilitySelectInput';
|
|
||||||
import QualityProfileSelectInputConnector from 'Components/Form/QualityProfileSelectInputConnector';
|
|
||||||
import RootFolderSelectInputConnector from 'Components/Form/RootFolderSelectInputConnector';
|
|
||||||
import SelectInput from 'Components/Form/SelectInput';
|
|
||||||
import SpinnerButton from 'Components/Link/SpinnerButton';
|
|
||||||
import PageContentFooter from 'Components/Page/PageContentFooter';
|
|
||||||
import { kinds } from 'Helpers/Props';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import CollectionFooterLabel from './CollectionFooterLabel';
|
|
||||||
import styles from './CollectionFooter.css';
|
|
||||||
|
|
||||||
const NO_CHANGE = 'noChange';
|
|
||||||
|
|
||||||
class CollectionFooter extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
constructor(props, context) {
|
|
||||||
super(props, context);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
monitor: NO_CHANGE,
|
|
||||||
monitored: NO_CHANGE,
|
|
||||||
qualityProfileId: NO_CHANGE,
|
|
||||||
minimumAvailability: NO_CHANGE,
|
|
||||||
rootFolderPath: NO_CHANGE,
|
|
||||||
destinationRootFolder: null
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
|
||||||
const {
|
|
||||||
isSaving,
|
|
||||||
saveError
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const newState = {};
|
|
||||||
if (prevProps.isSaving && !isSaving && !saveError) {
|
|
||||||
this.setState({
|
|
||||||
monitored: NO_CHANGE,
|
|
||||||
monitor: NO_CHANGE,
|
|
||||||
qualityProfileId: NO_CHANGE,
|
|
||||||
rootFolderPath: NO_CHANGE,
|
|
||||||
minimumAvailability: NO_CHANGE
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_.isEmpty(newState)) {
|
|
||||||
this.setState(newState);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onInputChange = ({ name, value }) => {
|
|
||||||
this.setState({ [name]: value });
|
|
||||||
};
|
|
||||||
|
|
||||||
onUpdateSelectedPress = () => {
|
|
||||||
const {
|
|
||||||
monitor,
|
|
||||||
monitored,
|
|
||||||
qualityProfileId,
|
|
||||||
minimumAvailability
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
const changes = {};
|
|
||||||
|
|
||||||
if (monitored !== NO_CHANGE) {
|
|
||||||
changes.monitored = monitored === 'monitored';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (monitor !== NO_CHANGE) {
|
|
||||||
changes.monitor = monitor;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qualityProfileId !== NO_CHANGE) {
|
|
||||||
changes.qualityProfileId = qualityProfileId;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (minimumAvailability !== NO_CHANGE) {
|
|
||||||
changes.minimumAvailability = minimumAvailability;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.props.onUpdateSelectedPress(changes);
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
selectedIds,
|
|
||||||
isSaving
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
monitored,
|
|
||||||
monitor,
|
|
||||||
qualityProfileId,
|
|
||||||
minimumAvailability,
|
|
||||||
rootFolderPath
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
const monitoredOptions = [
|
|
||||||
{ key: NO_CHANGE, value: translate('NoChange'), disabled: true },
|
|
||||||
{ key: 'monitored', value: translate('Monitored') },
|
|
||||||
{ key: 'unmonitored', value: translate('Unmonitored') }
|
|
||||||
];
|
|
||||||
|
|
||||||
const selectedCount = selectedIds.length;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PageContentFooter>
|
|
||||||
<div className={styles.inputContainer}>
|
|
||||||
<CollectionFooterLabel
|
|
||||||
label={translate('MonitorCollection')}
|
|
||||||
isSaving={isSaving}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<SelectInput
|
|
||||||
name="monitored"
|
|
||||||
value={monitored}
|
|
||||||
values={monitoredOptions}
|
|
||||||
isDisabled={!selectedCount}
|
|
||||||
onChange={this.onInputChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.inputContainer}>
|
|
||||||
<CollectionFooterLabel
|
|
||||||
label={translate('MonitorMovies')}
|
|
||||||
isSaving={isSaving}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<SelectInput
|
|
||||||
name="monitor"
|
|
||||||
value={monitor}
|
|
||||||
values={monitoredOptions}
|
|
||||||
isDisabled={!selectedCount}
|
|
||||||
onChange={this.onInputChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.inputContainer}>
|
|
||||||
<CollectionFooterLabel
|
|
||||||
label={translate('QualityProfile')}
|
|
||||||
isSaving={isSaving && qualityProfileId !== NO_CHANGE}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<QualityProfileSelectInputConnector
|
|
||||||
name="qualityProfileId"
|
|
||||||
value={qualityProfileId}
|
|
||||||
includeNoChange={true}
|
|
||||||
isDisabled={!selectedCount}
|
|
||||||
onChange={this.onInputChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.inputContainer}>
|
|
||||||
<CollectionFooterLabel
|
|
||||||
label={translate('MinimumAvailability')}
|
|
||||||
isSaving={isSaving && minimumAvailability !== NO_CHANGE}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<AvailabilitySelectInput
|
|
||||||
name="minimumAvailability"
|
|
||||||
value={minimumAvailability}
|
|
||||||
includeNoChange={true}
|
|
||||||
isDisabled={!selectedCount}
|
|
||||||
onChange={this.onInputChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.inputContainer}>
|
|
||||||
<CollectionFooterLabel
|
|
||||||
label={translate('RootFolder')}
|
|
||||||
isSaving={isSaving && rootFolderPath !== NO_CHANGE}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<RootFolderSelectInputConnector
|
|
||||||
name="rootFolderPath"
|
|
||||||
value={rootFolderPath}
|
|
||||||
includeNoChange={true}
|
|
||||||
isDisabled={!selectedCount}
|
|
||||||
selectedValueOptions={{ includeFreeSpace: false }}
|
|
||||||
onChange={this.onInputChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.buttonContainer}>
|
|
||||||
<div className={styles.buttonContainerContent}>
|
|
||||||
<CollectionFooterLabel
|
|
||||||
label={translate('CollectionsSelectedInterp', [selectedCount])}
|
|
||||||
isSaving={false}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className={styles.buttons}>
|
|
||||||
<div>
|
|
||||||
<SpinnerButton
|
|
||||||
className={styles.addSelectedButton}
|
|
||||||
kind={kinds.PRIMARY}
|
|
||||||
isSpinning={isSaving}
|
|
||||||
isDisabled={!selectedCount || isSaving}
|
|
||||||
onPress={this.onUpdateSelectedPress}
|
|
||||||
>
|
|
||||||
{translate('UpdateSelected')}
|
|
||||||
</SpinnerButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</PageContentFooter>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionFooter.propTypes = {
|
|
||||||
selectedIds: PropTypes.arrayOf(PropTypes.number).isRequired,
|
|
||||||
isAdding: PropTypes.bool.isRequired,
|
|
||||||
isSaving: PropTypes.bool.isRequired,
|
|
||||||
saveError: PropTypes.object,
|
|
||||||
onUpdateSelectedPress: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionFooter;
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
.label {
|
|
||||||
margin-bottom: 3px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.savingIcon {
|
|
||||||
margin-left: 8px;
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import SpinnerIcon from 'Components/SpinnerIcon';
|
|
||||||
import { icons } from 'Helpers/Props';
|
|
||||||
import styles from './CollectionFooterLabel.css';
|
|
||||||
|
|
||||||
function CollectionFooterLabel(props) {
|
|
||||||
const {
|
|
||||||
className,
|
|
||||||
label,
|
|
||||||
isSaving
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={className}>
|
|
||||||
{label}
|
|
||||||
|
|
||||||
{
|
|
||||||
isSaving &&
|
|
||||||
<SpinnerIcon
|
|
||||||
className={styles.savingIcon}
|
|
||||||
name={icons.SPINNER}
|
|
||||||
isSpinning={true}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionFooterLabel.propTypes = {
|
|
||||||
className: PropTypes.string.isRequired,
|
|
||||||
label: PropTypes.string.isRequired,
|
|
||||||
isSaving: PropTypes.bool.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
CollectionFooterLabel.defaultProps = {
|
|
||||||
className: styles.label
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionFooterLabel;
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import createAllMoviesSelector from 'Store/Selectors/createAllMoviesSelector';
|
|
||||||
import createCollectionSelector from 'Store/Selectors/createCollectionSelector';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
createCollectionSelector(),
|
|
||||||
createAllMoviesSelector(),
|
|
||||||
(
|
|
||||||
collection,
|
|
||||||
allMovies
|
|
||||||
) => {
|
|
||||||
// If a movie is deleted this selector may fire before the parent
|
|
||||||
// selecors, which will result in an undefined movie, if that happens
|
|
||||||
// we want to return early here and again in the render function to avoid
|
|
||||||
// trying to show a movie that has no information available.
|
|
||||||
|
|
||||||
if (!collection) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
let allGenres = [];
|
|
||||||
let libraryMovies = 0;
|
|
||||||
|
|
||||||
collection.movies.forEach((movie) => {
|
|
||||||
allGenres = allGenres.concat(movie.genres);
|
|
||||||
|
|
||||||
if (allMovies.find((libraryMovie) => libraryMovie.tmdbId === movie.tmdbId)) {
|
|
||||||
libraryMovies++;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
...collection,
|
|
||||||
genres: Array.from(new Set(allGenres)).slice(0, 3),
|
|
||||||
missingMovies: collection.movies.length - libraryMovies
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
class CollectionItemConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
id,
|
|
||||||
component: ItemComponent,
|
|
||||||
...otherProps
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
if (!id) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ItemComponent
|
|
||||||
{...otherProps}
|
|
||||||
id={id}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionItemConnector.propTypes = {
|
|
||||||
id: PropTypes.number,
|
|
||||||
component: PropTypes.elementType.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps)(CollectionItemConnector);
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import Modal from 'Components/Modal/Modal';
|
|
||||||
import EditCollectionModalContentConnector from './EditCollectionModalContentConnector';
|
|
||||||
|
|
||||||
function EditCollectionModal({ isOpen, onModalClose, ...otherProps }) {
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
isOpen={isOpen}
|
|
||||||
onModalClose={onModalClose}
|
|
||||||
>
|
|
||||||
<EditCollectionModalContentConnector
|
|
||||||
{...otherProps}
|
|
||||||
onModalClose={onModalClose}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
EditCollectionModal.propTypes = {
|
|
||||||
isOpen: PropTypes.bool.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default EditCollectionModal;
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { clearPendingChanges } from 'Store/Actions/baseActions';
|
|
||||||
import EditCollectionModal from './EditCollectionModal';
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
clearPendingChanges
|
|
||||||
};
|
|
||||||
|
|
||||||
class EditCollectionModalConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onModalClose = () => {
|
|
||||||
this.props.clearPendingChanges({ section: 'movieCollections' });
|
|
||||||
this.props.onModalClose();
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<EditCollectionModal
|
|
||||||
{...this.props}
|
|
||||||
onModalClose={this.onModalClose}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EditCollectionModalConnector.propTypes = {
|
|
||||||
onModalClose: PropTypes.func.isRequired,
|
|
||||||
clearPendingChanges: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(undefined, mapDispatchToProps)(EditCollectionModalConnector);
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
.container {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.poster {
|
|
||||||
flex: 0 0 170px;
|
|
||||||
margin-right: 20px;
|
|
||||||
height: 250px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overview {
|
|
||||||
margin-bottom: 30px;
|
|
||||||
}
|
|
||||||
@@ -1,178 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import Form from 'Components/Form/Form';
|
|
||||||
import FormGroup from 'Components/Form/FormGroup';
|
|
||||||
import FormInputGroup from 'Components/Form/FormInputGroup';
|
|
||||||
import FormLabel from 'Components/Form/FormLabel';
|
|
||||||
import Button from 'Components/Link/Button';
|
|
||||||
import SpinnerButton from 'Components/Link/SpinnerButton';
|
|
||||||
import ModalBody from 'Components/Modal/ModalBody';
|
|
||||||
import ModalContent from 'Components/Modal/ModalContent';
|
|
||||||
import ModalFooter from 'Components/Modal/ModalFooter';
|
|
||||||
import ModalHeader from 'Components/Modal/ModalHeader';
|
|
||||||
import { inputTypes } from 'Helpers/Props';
|
|
||||||
import MoviePoster from 'Movie/MoviePoster';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import styles from './EditCollectionModalContent.css';
|
|
||||||
|
|
||||||
class EditCollectionModalContent extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onSavePress = () => {
|
|
||||||
const {
|
|
||||||
onSavePress
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
onSavePress(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
title,
|
|
||||||
images,
|
|
||||||
overview,
|
|
||||||
item,
|
|
||||||
isSaving,
|
|
||||||
onInputChange,
|
|
||||||
onModalClose,
|
|
||||||
isSmallScreen,
|
|
||||||
...otherProps
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
monitored,
|
|
||||||
qualityProfileId,
|
|
||||||
minimumAvailability,
|
|
||||||
// Id,
|
|
||||||
rootFolderPath,
|
|
||||||
searchOnAdd
|
|
||||||
} = item;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ModalContent onModalClose={onModalClose}>
|
|
||||||
<ModalHeader>
|
|
||||||
{translate('Edit')} - {title}
|
|
||||||
</ModalHeader>
|
|
||||||
|
|
||||||
<ModalBody>
|
|
||||||
<div className={styles.container}>
|
|
||||||
{
|
|
||||||
!isSmallScreen &&
|
|
||||||
<div className={styles.poster}>
|
|
||||||
<MoviePoster
|
|
||||||
className={styles.poster}
|
|
||||||
images={images}
|
|
||||||
size={250}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
<div className={styles.info}>
|
|
||||||
<div className={styles.overview}>
|
|
||||||
{overview}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Form
|
|
||||||
{...otherProps}
|
|
||||||
>
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('Monitored')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.CHECK}
|
|
||||||
name="monitored"
|
|
||||||
helpText={translate('MonitoredCollectionHelpText')}
|
|
||||||
{...monitored}
|
|
||||||
onChange={onInputChange}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('MinimumAvailability')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.AVAILABILITY_SELECT}
|
|
||||||
name="minimumAvailability"
|
|
||||||
{...minimumAvailability}
|
|
||||||
onChange={onInputChange}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('QualityProfile')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.QUALITY_PROFILE_SELECT}
|
|
||||||
name="qualityProfileId"
|
|
||||||
{...qualityProfileId}
|
|
||||||
onChange={onInputChange}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('Folder')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.ROOT_FOLDER_SELECT}
|
|
||||||
name="rootFolderPath"
|
|
||||||
{...rootFolderPath}
|
|
||||||
includeMissingValue={true}
|
|
||||||
onChange={onInputChange}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('SearchOnAdd')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.CHECK}
|
|
||||||
name="searchOnAdd"
|
|
||||||
helpText={translate('SearchOnAddCollectionHelpText')}
|
|
||||||
{...searchOnAdd}
|
|
||||||
onChange={onInputChange}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
</Form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ModalBody>
|
|
||||||
|
|
||||||
<ModalFooter>
|
|
||||||
<Button
|
|
||||||
onPress={onModalClose}
|
|
||||||
>
|
|
||||||
{translate('Cancel')}
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<SpinnerButton
|
|
||||||
isSpinning={isSaving}
|
|
||||||
onPress={this.onSavePress}
|
|
||||||
>
|
|
||||||
{translate('Save')}
|
|
||||||
</SpinnerButton>
|
|
||||||
</ModalFooter>
|
|
||||||
</ModalContent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EditCollectionModalContent.propTypes = {
|
|
||||||
collectionId: PropTypes.number.isRequired,
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
overview: PropTypes.string.isRequired,
|
|
||||||
images: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
item: PropTypes.object.isRequired,
|
|
||||||
isSaving: PropTypes.bool.isRequired,
|
|
||||||
isPathChanging: PropTypes.bool.isRequired,
|
|
||||||
isSmallScreen: PropTypes.bool.isRequired,
|
|
||||||
onInputChange: PropTypes.func.isRequired,
|
|
||||||
onSavePress: PropTypes.func.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default EditCollectionModalContent;
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import { saveMovieCollection, setMovieCollectionValue } from 'Store/Actions/movieCollectionActions';
|
|
||||||
import createCollectionSelector from 'Store/Selectors/createCollectionSelector';
|
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
|
||||||
import selectSettings from 'Store/Selectors/selectSettings';
|
|
||||||
import EditCollectionModalContent from './EditCollectionModalContent';
|
|
||||||
|
|
||||||
function createIsPathChangingSelector() {
|
|
||||||
return createSelector(
|
|
||||||
(state) => state.movieCollections.pendingChanges,
|
|
||||||
createCollectionSelector(),
|
|
||||||
(pendingChanges, collection) => {
|
|
||||||
const rootFolderPath = pendingChanges.rootFolderPath;
|
|
||||||
|
|
||||||
if (rootFolderPath == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return collection.rootFolderPath !== rootFolderPath;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
(state) => state.movieCollections,
|
|
||||||
createCollectionSelector(),
|
|
||||||
createIsPathChangingSelector(),
|
|
||||||
createDimensionsSelector(),
|
|
||||||
(moviesState, collection, isPathChanging, dimensions) => {
|
|
||||||
const {
|
|
||||||
isSaving,
|
|
||||||
saveError,
|
|
||||||
pendingChanges
|
|
||||||
} = moviesState;
|
|
||||||
|
|
||||||
const movieSettings = {
|
|
||||||
monitored: collection.monitored,
|
|
||||||
qualityProfileId: collection.qualityProfileId,
|
|
||||||
minimumAvailability: collection.minimumAvailability,
|
|
||||||
rootFolderPath: collection.rootFolderPath,
|
|
||||||
searchOnAdd: collection.searchOnAdd
|
|
||||||
};
|
|
||||||
|
|
||||||
const settings = selectSettings(movieSettings, pendingChanges, saveError);
|
|
||||||
|
|
||||||
return {
|
|
||||||
title: collection.title,
|
|
||||||
images: collection.images,
|
|
||||||
overview: collection.overview,
|
|
||||||
isSaving,
|
|
||||||
saveError,
|
|
||||||
isPathChanging,
|
|
||||||
originalPath: collection.path,
|
|
||||||
item: settings.settings,
|
|
||||||
isSmallScreen: dimensions.isSmallScreen,
|
|
||||||
...settings
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
dispatchSetMovieCollectionValue: setMovieCollectionValue,
|
|
||||||
dispatchSaveMovieCollection: saveMovieCollection
|
|
||||||
};
|
|
||||||
|
|
||||||
class EditCollectionModalContentConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
componentDidUpdate(prevProps, prevState) {
|
|
||||||
if (prevProps.isSaving && !this.props.isSaving && !this.props.saveError) {
|
|
||||||
this.props.onModalClose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onInputChange = ({ name, value }) => {
|
|
||||||
this.props.dispatchSetMovieCollectionValue({ name, value });
|
|
||||||
};
|
|
||||||
|
|
||||||
onSavePress = () => {
|
|
||||||
this.props.dispatchSaveMovieCollection({
|
|
||||||
id: this.props.collectionId
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<EditCollectionModalContent
|
|
||||||
{...this.props}
|
|
||||||
onInputChange={this.onInputChange}
|
|
||||||
onSavePress={this.onSavePress}
|
|
||||||
onMoveMoviePress={this.onMoveMoviePress}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EditCollectionModalContentConnector.propTypes = {
|
|
||||||
collectionId: PropTypes.number,
|
|
||||||
isSaving: PropTypes.bool.isRequired,
|
|
||||||
saveError: PropTypes.object,
|
|
||||||
dispatchSetMovieCollectionValue: PropTypes.func.isRequired,
|
|
||||||
dispatchSaveMovieCollection: PropTypes.func.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(EditCollectionModalContentConnector);
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import CollectionFilterModalConnector from 'Collection/CollectionFilterModalConnector';
|
|
||||||
import FilterMenu from 'Components/Menu/FilterMenu';
|
|
||||||
import { align } from 'Helpers/Props';
|
|
||||||
|
|
||||||
function CollectionFilterMenu(props) {
|
|
||||||
const {
|
|
||||||
selectedFilterKey,
|
|
||||||
filters,
|
|
||||||
customFilters,
|
|
||||||
isDisabled,
|
|
||||||
onFilterSelect
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<FilterMenu
|
|
||||||
alignMenu={align.RIGHT}
|
|
||||||
isDisabled={isDisabled}
|
|
||||||
selectedFilterKey={selectedFilterKey}
|
|
||||||
filters={filters}
|
|
||||||
customFilters={customFilters}
|
|
||||||
filterModalConnectorComponent={CollectionFilterModalConnector}
|
|
||||||
onFilterSelect={onFilterSelect}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionFilterMenu.propTypes = {
|
|
||||||
selectedFilterKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
||||||
filters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
customFilters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
isDisabled: PropTypes.bool.isRequired,
|
|
||||||
onFilterSelect: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
CollectionFilterMenu.defaultProps = {
|
|
||||||
showCustomFilters: false
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionFilterMenu;
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import MenuContent from 'Components/Menu/MenuContent';
|
|
||||||
import SortMenu from 'Components/Menu/SortMenu';
|
|
||||||
import SortMenuItem from 'Components/Menu/SortMenuItem';
|
|
||||||
import { align, sortDirections } from 'Helpers/Props';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
|
|
||||||
function CollectionSortMenu(props) {
|
|
||||||
const {
|
|
||||||
sortKey,
|
|
||||||
sortDirection,
|
|
||||||
isDisabled,
|
|
||||||
onSortSelect
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<SortMenu
|
|
||||||
isDisabled={isDisabled}
|
|
||||||
alignMenu={align.RIGHT}
|
|
||||||
>
|
|
||||||
<MenuContent>
|
|
||||||
<SortMenuItem
|
|
||||||
name="sortTitle"
|
|
||||||
sortKey={sortKey}
|
|
||||||
sortDirection={sortDirection}
|
|
||||||
onPress={onSortSelect}
|
|
||||||
>
|
|
||||||
{translate('Title')}
|
|
||||||
</SortMenuItem>
|
|
||||||
</MenuContent>
|
|
||||||
</SortMenu>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionSortMenu.propTypes = {
|
|
||||||
sortKey: PropTypes.string,
|
|
||||||
sortDirection: PropTypes.oneOf(sortDirections.all),
|
|
||||||
isDisabled: PropTypes.bool.isRequired,
|
|
||||||
onSortSelect: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionSortMenu;
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
.message {
|
|
||||||
margin-top: 10px;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonContainer {
|
|
||||||
margin-top: 20px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import Button from 'Components/Link/Button';
|
|
||||||
import { kinds } from 'Helpers/Props';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import styles from './NoCollection.css';
|
|
||||||
|
|
||||||
function NoCollection(props) {
|
|
||||||
const { totalItems } = props;
|
|
||||||
|
|
||||||
if (totalItems > 0) {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<div className={styles.message}>
|
|
||||||
{translate('AllCollectionsHiddenDueToFilter')}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<div className={styles.message}>
|
|
||||||
{translate('NoCollections')}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.buttonContainer}>
|
|
||||||
<Button
|
|
||||||
to="/add/import"
|
|
||||||
kind={kinds.PRIMARY}
|
|
||||||
>
|
|
||||||
{translate('ImportExistingMovies')}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.buttonContainer}>
|
|
||||||
<Button
|
|
||||||
to="/add/new"
|
|
||||||
kind={kinds.PRIMARY}
|
|
||||||
>
|
|
||||||
{translate('AddNewMovie')}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
NoCollection.propTypes = {
|
|
||||||
totalItems: PropTypes.number.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default NoCollection;
|
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
$hoverScale: 1.05;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
border-radius: 5px;
|
|
||||||
transition: all 200ms ease-in;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
z-index: 2;
|
|
||||||
box-shadow: 0 0 10px $black;
|
|
||||||
transition: all 200ms ease-in;
|
|
||||||
|
|
||||||
.poster {
|
|
||||||
opacity: 0.5;
|
|
||||||
transition: opacity 100ms linear 100ms;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overlayTitle {
|
|
||||||
opacity: 1;
|
|
||||||
transition: opacity 100ms linear 100ms;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.posterContainer {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.poster {
|
|
||||||
position: relative;
|
|
||||||
display: block;
|
|
||||||
background-color: $defaultColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overlay {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
flex-direction: column;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overlayTitle {
|
|
||||||
padding: 5px;
|
|
||||||
color: $offWhite;
|
|
||||||
text-align: left;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 15px;
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
@add-mixin truncate;
|
|
||||||
|
|
||||||
background-color: #fafbfc;
|
|
||||||
text-align: center;
|
|
||||||
font-size: $smallFontSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
.controls {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 10px;
|
|
||||||
left: 10px;
|
|
||||||
z-index: 3;
|
|
||||||
border-radius: 4px;
|
|
||||||
background-color: #707070;
|
|
||||||
color: $white;
|
|
||||||
font-size: $smallFontSize;
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action {
|
|
||||||
composes: button from '~Components/Link/IconButton.css';
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: $radarrYellow;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: $breakpointSmall) {
|
|
||||||
.container {
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.editorSelect {
|
|
||||||
position: absolute;
|
|
||||||
top: 10px;
|
|
||||||
z-index: 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.externalLinks {
|
|
||||||
margin-left: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.link {
|
|
||||||
composes: link from '~Components/Link/Link.css';
|
|
||||||
|
|
||||||
position: relative;
|
|
||||||
display: block;
|
|
||||||
background-color: $defaultColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.monitorToggleButton {
|
|
||||||
composes: toggleButton from '~Components/MonitorToggleButton.css';
|
|
||||||
|
|
||||||
width: 25px;
|
|
||||||
color: $white;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: $iconButtonHoverLightColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,191 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import Link from 'Components/Link/Link';
|
|
||||||
import MonitorToggleButton from 'Components/MonitorToggleButton';
|
|
||||||
import EditMovieModalConnector from 'Movie/Edit/EditMovieModalConnector';
|
|
||||||
import MovieIndexProgressBar from 'Movie/Index/ProgressBar/MovieIndexProgressBar';
|
|
||||||
import MoviePoster from 'Movie/MoviePoster';
|
|
||||||
import AddNewCollectionMovieModal from './../AddNewCollectionMovieModal';
|
|
||||||
import styles from './CollectionMovie.css';
|
|
||||||
|
|
||||||
class CollectionMovie extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
constructor(props, context) {
|
|
||||||
super(props, context);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
hasPosterError: false,
|
|
||||||
isEditMovieModalOpen: false,
|
|
||||||
isNewAddMovieModalOpen: false
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onEditMoviePress = () => {
|
|
||||||
this.setState({ isEditMovieModalOpen: true });
|
|
||||||
};
|
|
||||||
|
|
||||||
onEditMovieModalClose = () => {
|
|
||||||
this.setState({ isEditMovieModalOpen: false });
|
|
||||||
};
|
|
||||||
|
|
||||||
onAddMoviePress = () => {
|
|
||||||
this.setState({ isNewAddMovieModalOpen: true });
|
|
||||||
};
|
|
||||||
|
|
||||||
onAddMovieModalClose = () => {
|
|
||||||
this.setState({ isNewAddMovieModalOpen: false });
|
|
||||||
};
|
|
||||||
|
|
||||||
onPosterLoad = () => {
|
|
||||||
if (this.state.hasPosterError) {
|
|
||||||
this.setState({ hasPosterError: false });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onPosterLoadError = () => {
|
|
||||||
if (!this.state.hasPosterError) {
|
|
||||||
this.setState({ hasPosterError: true });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
id,
|
|
||||||
title,
|
|
||||||
overview,
|
|
||||||
year,
|
|
||||||
tmdbId,
|
|
||||||
images,
|
|
||||||
monitored,
|
|
||||||
hasFile,
|
|
||||||
folder,
|
|
||||||
isAvailable,
|
|
||||||
isExistingMovie,
|
|
||||||
posterWidth,
|
|
||||||
posterHeight,
|
|
||||||
detailedProgressBar,
|
|
||||||
onMonitorTogglePress,
|
|
||||||
collectionId
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
isEditMovieModalOpen,
|
|
||||||
isNewAddMovieModalOpen
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
const linkProps = id ? { to: `/movie/${tmdbId}` } : { onPress: this.onAddMoviePress };
|
|
||||||
|
|
||||||
const elementStyle = {
|
|
||||||
width: `${posterWidth}px`,
|
|
||||||
height: `${posterHeight}px`,
|
|
||||||
borderRadius: '5px'
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={styles.content}>
|
|
||||||
<div className={styles.posterContainer}>
|
|
||||||
{
|
|
||||||
isExistingMovie &&
|
|
||||||
<div className={styles.editorSelect}>
|
|
||||||
<MonitorToggleButton
|
|
||||||
className={styles.monitorToggleButton}
|
|
||||||
monitored={monitored}
|
|
||||||
size={20}
|
|
||||||
onPress={onMonitorTogglePress}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
<Link
|
|
||||||
className={styles.link}
|
|
||||||
style={elementStyle}
|
|
||||||
{...linkProps}
|
|
||||||
>
|
|
||||||
<MoviePoster
|
|
||||||
className={styles.poster}
|
|
||||||
style={elementStyle}
|
|
||||||
images={images}
|
|
||||||
size={250}
|
|
||||||
lazy={false}
|
|
||||||
overflow={true}
|
|
||||||
onError={this.onPosterLoadError}
|
|
||||||
onLoad={this.onPosterLoad}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className={styles.overlay}>
|
|
||||||
<div className={styles.overlayTitle}>
|
|
||||||
{title}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{
|
|
||||||
id &&
|
|
||||||
<div className={styles.overlayStatus}>
|
|
||||||
<MovieIndexProgressBar
|
|
||||||
monitored={monitored}
|
|
||||||
hasFile={hasFile}
|
|
||||||
status={status}
|
|
||||||
bottomRadius={true}
|
|
||||||
posterWidth={posterWidth}
|
|
||||||
detailedProgressBar={detailedProgressBar}
|
|
||||||
isAvailable={isAvailable}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<AddNewCollectionMovieModal
|
|
||||||
isOpen={isNewAddMovieModalOpen && !isExistingMovie}
|
|
||||||
tmdbId={tmdbId}
|
|
||||||
title={title}
|
|
||||||
year={year}
|
|
||||||
overview={overview}
|
|
||||||
images={images}
|
|
||||||
folder={folder}
|
|
||||||
onModalClose={this.onAddMovieModalClose}
|
|
||||||
collectionId={collectionId}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<EditMovieModalConnector
|
|
||||||
isOpen={isEditMovieModalOpen}
|
|
||||||
movieId={id}
|
|
||||||
onModalClose={this.onEditMovieModalClose}
|
|
||||||
onDeleteMoviePress={this.onDeleteMoviePress}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionMovie.propTypes = {
|
|
||||||
id: PropTypes.number,
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
year: PropTypes.number.isRequired,
|
|
||||||
overview: PropTypes.string.isRequired,
|
|
||||||
monitored: PropTypes.bool,
|
|
||||||
collectionId: PropTypes.number.isRequired,
|
|
||||||
hasFile: PropTypes.bool,
|
|
||||||
folder: PropTypes.string,
|
|
||||||
isAvailable: PropTypes.bool,
|
|
||||||
images: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
posterWidth: PropTypes.number.isRequired,
|
|
||||||
posterHeight: PropTypes.number.isRequired,
|
|
||||||
detailedProgressBar: PropTypes.bool.isRequired,
|
|
||||||
isExistingMovie: PropTypes.bool,
|
|
||||||
tmdbId: PropTypes.number.isRequired,
|
|
||||||
imdbId: PropTypes.string,
|
|
||||||
youTubeTrailerId: PropTypes.string,
|
|
||||||
onMonitorTogglePress: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionMovie;
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import { toggleMovieMonitored } from 'Store/Actions/movieActions';
|
|
||||||
import createCollectionExistingMovieSelector from 'Store/Selectors/createCollectionExistingMovieSelector';
|
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
|
||||||
import CollectionMovie from './CollectionMovie';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
createDimensionsSelector(),
|
|
||||||
createCollectionExistingMovieSelector(),
|
|
||||||
(dimensions, existingMovie) => {
|
|
||||||
return {
|
|
||||||
isSmallScreen: dimensions.isSmallScreen,
|
|
||||||
isExistingMovie: !!existingMovie,
|
|
||||||
...existingMovie
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
toggleMovieMonitored
|
|
||||||
};
|
|
||||||
|
|
||||||
class CollectionMovieConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onMonitorTogglePress = (monitored) => {
|
|
||||||
this.props.toggleMovieMonitored({
|
|
||||||
movieId: this.props.id,
|
|
||||||
monitored
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<CollectionMovie
|
|
||||||
{...this.props}
|
|
||||||
onMonitorTogglePress={this.onMonitorTogglePress}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionMovieConnector.propTypes = {
|
|
||||||
id: PropTypes.number,
|
|
||||||
monitored: PropTypes.bool,
|
|
||||||
toggleMovieMonitored: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(CollectionMovieConnector);
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
.movie {
|
|
||||||
display: flex;
|
|
||||||
align-items: stretch;
|
|
||||||
overflow: hidden;
|
|
||||||
margin: 2px 4px;
|
|
||||||
border: 1px solid $borderColor;
|
|
||||||
border-radius: 4px;
|
|
||||||
background-color: #eee;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
.movieTitle {
|
|
||||||
padding: 0 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.movieStatus {
|
|
||||||
padding: 0 4px;
|
|
||||||
border-left: 4px;
|
|
||||||
border-left-style: solid;
|
|
||||||
background-color: $white;
|
|
||||||
color: $defaultColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.primary {
|
|
||||||
border-color: $primaryColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.danger {
|
|
||||||
border-color: $dangerColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.success {
|
|
||||||
border-color: $successColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.purple {
|
|
||||||
border-color: $purple;
|
|
||||||
}
|
|
||||||
|
|
||||||
.warning {
|
|
||||||
border-color: $warningColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
border-color: $infoColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.queue {
|
|
||||||
border-color: $queueColor;
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
import classNames from 'classnames';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import MonitorToggleButton from 'Components/MonitorToggleButton';
|
|
||||||
import getStatusStyle from 'Utilities/Movie/getStatusStyle';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import styles from './CollectionMovieLabel.css';
|
|
||||||
|
|
||||||
class CollectionMovieLabel extends Component {
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
id,
|
|
||||||
title,
|
|
||||||
status,
|
|
||||||
monitored,
|
|
||||||
isAvailable,
|
|
||||||
hasFile,
|
|
||||||
onMonitorTogglePress,
|
|
||||||
isSaving
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={styles.movie}>
|
|
||||||
<div className={styles.movieTitle}>
|
|
||||||
{
|
|
||||||
id &&
|
|
||||||
<MonitorToggleButton
|
|
||||||
monitored={monitored}
|
|
||||||
isSaving={isSaving}
|
|
||||||
onPress={onMonitorTogglePress}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
|
|
||||||
<span>
|
|
||||||
{
|
|
||||||
title
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{
|
|
||||||
id &&
|
|
||||||
<div
|
|
||||||
className={classNames(
|
|
||||||
styles.movieStatus,
|
|
||||||
styles[getStatusStyle(status, monitored, hasFile, isAvailable, 'kinds')]
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
hasFile ? translate('Downloaded') : translate('Missing')
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionMovieLabel.propTypes = {
|
|
||||||
id: PropTypes.number,
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
status: PropTypes.string,
|
|
||||||
isAvailable: PropTypes.bool,
|
|
||||||
monitored: PropTypes.bool,
|
|
||||||
hasFile: PropTypes.bool,
|
|
||||||
isSaving: PropTypes.bool.isRequired,
|
|
||||||
movieFile: PropTypes.object,
|
|
||||||
movieFileId: PropTypes.number,
|
|
||||||
onMonitorTogglePress: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
CollectionMovieLabel.defaultProps = {
|
|
||||||
isSaving: false,
|
|
||||||
statistics: {
|
|
||||||
episodeFileCount: 0,
|
|
||||||
totalEpisodeCount: 0,
|
|
||||||
percentOfEpisodes: 0
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionMovieLabel;
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import { toggleMovieMonitored } from 'Store/Actions/movieActions';
|
|
||||||
import createCollectionExistingMovieSelector from 'Store/Selectors/createCollectionExistingMovieSelector';
|
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
|
||||||
import CollectionMovieLabel from './CollectionMovieLabel';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
createDimensionsSelector(),
|
|
||||||
createCollectionExistingMovieSelector(),
|
|
||||||
(dimensions, existingMovie) => {
|
|
||||||
return {
|
|
||||||
isSmallScreen: dimensions.isSmallScreen,
|
|
||||||
isExistingMovie: !!existingMovie,
|
|
||||||
...existingMovie
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
toggleMovieMonitored
|
|
||||||
};
|
|
||||||
|
|
||||||
class CollectionMovieLabelConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onMonitorTogglePress = (monitored) => {
|
|
||||||
this.props.toggleMovieMonitored({
|
|
||||||
movieId: this.props.id,
|
|
||||||
monitored
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<CollectionMovieLabel
|
|
||||||
{...this.props}
|
|
||||||
onMonitorTogglePress={this.onMonitorTogglePress}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionMovieLabelConnector.propTypes = {
|
|
||||||
id: PropTypes.number,
|
|
||||||
monitored: PropTypes.bool,
|
|
||||||
toggleMovieMonitored: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(CollectionMovieLabelConnector);
|
|
||||||
@@ -1,137 +0,0 @@
|
|||||||
$hoverScale: 1.05;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.editorSelect {
|
|
||||||
position: relative;
|
|
||||||
top: 0;
|
|
||||||
left: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.titleRow {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toggleMonitoredContainer {
|
|
||||||
align-self: center;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.titleContainer {
|
|
||||||
display: flex;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sliderContainer {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.labelsContainer {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.moviesContainer {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.movie {
|
|
||||||
padding: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
display: flex;
|
|
||||||
flex: 1 0 1px;
|
|
||||||
flex-direction: column;
|
|
||||||
overflow: hidden;
|
|
||||||
padding-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
@add-mixin truncate;
|
|
||||||
|
|
||||||
font-weight: 300;
|
|
||||||
font-size: 30px;
|
|
||||||
line-height: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.actions {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.details {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
flex: 1 0 auto;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.defaults {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
font-weight: 300;
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detailsLabel {
|
|
||||||
composes: label from '~Components/Label.css';
|
|
||||||
|
|
||||||
margin: 5px 10px 5px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.path,
|
|
||||||
.status,
|
|
||||||
.genres,
|
|
||||||
.qualityProfileName {
|
|
||||||
margin-left: 8px;
|
|
||||||
font-weight: 300;
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overview {
|
|
||||||
overflow: hidden;
|
|
||||||
min-height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.monitorToggleButton {
|
|
||||||
composes: toggleButton from '~Components/MonitorToggleButton.css';
|
|
||||||
|
|
||||||
width: 25px;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: $iconButtonHoverLightColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: $breakpointSmall) {
|
|
||||||
.navigationButtons {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
@add-mixin truncate;
|
|
||||||
|
|
||||||
font-weight: 300;
|
|
||||||
font-size: 22px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toggleMonitoredContainer {
|
|
||||||
align-self: center;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.monitorToggleButton {
|
|
||||||
composes: toggleButton from '~Components/MonitorToggleButton.css';
|
|
||||||
|
|
||||||
width: 20px;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: $iconButtonHoverLightColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,340 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import Slider from 'react-slick';
|
|
||||||
import TextTruncate from 'react-text-truncate';
|
|
||||||
import EditCollectionModalConnector from 'Collection/Edit/EditCollectionModalConnector';
|
|
||||||
import CheckInput from 'Components/Form/CheckInput';
|
|
||||||
import Icon from 'Components/Icon';
|
|
||||||
import Label from 'Components/Label';
|
|
||||||
import IconButton from 'Components/Link/IconButton';
|
|
||||||
import MonitorToggleButton from 'Components/MonitorToggleButton';
|
|
||||||
import { icons, sizes } from 'Helpers/Props';
|
|
||||||
import QualityProfileNameConnector from 'Settings/Profiles/Quality/QualityProfileNameConnector';
|
|
||||||
import dimensions from 'Styles/Variables/dimensions';
|
|
||||||
import fonts from 'Styles/Variables/fonts';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import CollectionMovieConnector from './CollectionMovieConnector';
|
|
||||||
import CollectionMovieLabelConnector from './CollectionMovieLabelConnector';
|
|
||||||
import styles from './CollectionOverview.css';
|
|
||||||
|
|
||||||
import 'slick-carousel/slick/slick.css';
|
|
||||||
import 'slick-carousel/slick/slick-theme.css';
|
|
||||||
|
|
||||||
const columnPadding = parseInt(dimensions.movieIndexColumnPadding);
|
|
||||||
const columnPaddingSmallScreen = parseInt(dimensions.movieIndexColumnPaddingSmallScreen);
|
|
||||||
const defaultFontSize = parseInt(fonts.defaultFontSize);
|
|
||||||
const lineHeight = parseFloat(fonts.lineHeight);
|
|
||||||
|
|
||||||
// Hardcoded height beased on line-height of 32 + bottom margin of 10. 19 + 5 for List Row
|
|
||||||
// Less side-effecty than using react-measure.
|
|
||||||
const titleRowHeight = 100;
|
|
||||||
|
|
||||||
function getContentHeight(rowHeight, isSmallScreen) {
|
|
||||||
const padding = isSmallScreen ? columnPaddingSmallScreen : columnPadding;
|
|
||||||
|
|
||||||
return rowHeight - padding;
|
|
||||||
}
|
|
||||||
|
|
||||||
class CollectionOverview extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
constructor(props, context) {
|
|
||||||
super(props, context);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
isEditCollectionModalOpen: false,
|
|
||||||
isNewAddMovieModalOpen: false
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Control
|
|
||||||
|
|
||||||
setSliderRef = (ref) => {
|
|
||||||
this.setState({ slider: ref });
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onPress = () => {
|
|
||||||
this.setState({ isNewAddMovieModalOpen: true });
|
|
||||||
};
|
|
||||||
|
|
||||||
onEditCollectionPress = () => {
|
|
||||||
this.setState({ isEditCollectionModalOpen: true });
|
|
||||||
};
|
|
||||||
|
|
||||||
onEditCollectionModalClose = () => {
|
|
||||||
this.setState({ isEditCollectionModalOpen: false });
|
|
||||||
};
|
|
||||||
|
|
||||||
onAddMovieModalClose = () => {
|
|
||||||
this.setState({ isNewAddMovieModalOpen: false });
|
|
||||||
};
|
|
||||||
|
|
||||||
onChange = ({ value, shiftKey }) => {
|
|
||||||
const {
|
|
||||||
id,
|
|
||||||
onSelectedChange
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
onSelectedChange({ id, value, shiftKey });
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
monitored,
|
|
||||||
qualityProfileId,
|
|
||||||
rootFolderPath,
|
|
||||||
genres,
|
|
||||||
id,
|
|
||||||
title,
|
|
||||||
movies,
|
|
||||||
overview,
|
|
||||||
missingMovies,
|
|
||||||
posterHeight,
|
|
||||||
posterWidth,
|
|
||||||
rowHeight,
|
|
||||||
isSmallScreen,
|
|
||||||
isSelected,
|
|
||||||
onMonitorTogglePress
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
showDetails,
|
|
||||||
showOverview,
|
|
||||||
showPosters,
|
|
||||||
detailedProgressBar
|
|
||||||
} = this.props.overviewOptions;
|
|
||||||
|
|
||||||
const {
|
|
||||||
isEditCollectionModalOpen
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
const contentHeight = getContentHeight(rowHeight, isSmallScreen);
|
|
||||||
const overviewHeight = contentHeight - titleRowHeight - posterHeight;
|
|
||||||
|
|
||||||
const sliderSettings = {
|
|
||||||
arrows: false,
|
|
||||||
dots: false,
|
|
||||||
infinite: false,
|
|
||||||
slidesToShow: 1,
|
|
||||||
slidesToScroll: 1,
|
|
||||||
variableWidth: true
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={styles.container}>
|
|
||||||
<div className={styles.content}>
|
|
||||||
<div className={styles.editorSelect}>
|
|
||||||
<CheckInput
|
|
||||||
className={styles.checkInput}
|
|
||||||
name={id.toString()}
|
|
||||||
value={isSelected}
|
|
||||||
onChange={this.onChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className={styles.info} style={{ maxHeight: contentHeight }}>
|
|
||||||
|
|
||||||
<div className={styles.titleRow}>
|
|
||||||
<div className={styles.titleContainer}>
|
|
||||||
<div className={styles.toggleMonitoredContainer}>
|
|
||||||
<MonitorToggleButton
|
|
||||||
className={styles.monitorToggleButton}
|
|
||||||
monitored={monitored}
|
|
||||||
size={isSmallScreen ? 20 : 25}
|
|
||||||
onPress={onMonitorTogglePress}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className={styles.title}>
|
|
||||||
{title}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<IconButton
|
|
||||||
name={icons.EDIT}
|
|
||||||
title={translate('EditCollection')}
|
|
||||||
onPress={this.onEditCollectionPress}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{
|
|
||||||
showPosters &&
|
|
||||||
<div className={styles.navigationButtons}>
|
|
||||||
<IconButton
|
|
||||||
name={icons.ARROW_LEFT}
|
|
||||||
title={translate('ScrollMovies')}
|
|
||||||
onPress={this.state.slider?.slickPrev}
|
|
||||||
size={20}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<IconButton
|
|
||||||
name={icons.ARROW_RIGHT}
|
|
||||||
title={translate('ScrollMovies')}
|
|
||||||
onPress={this.state.slider?.slickNext}
|
|
||||||
size={20}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{
|
|
||||||
showDetails &&
|
|
||||||
<div className={styles.defaults}>
|
|
||||||
<Label
|
|
||||||
className={styles.detailsLabel}
|
|
||||||
size={sizes.MEDIUM}
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
name={icons.DRIVE}
|
|
||||||
size={13}
|
|
||||||
/>
|
|
||||||
<span className={styles.status}>
|
|
||||||
{`${missingMovies} missing movie(s)`}
|
|
||||||
</span>
|
|
||||||
</Label>
|
|
||||||
|
|
||||||
{
|
|
||||||
!isSmallScreen &&
|
|
||||||
<Label
|
|
||||||
className={styles.detailsLabel}
|
|
||||||
size={sizes.MEDIUM}
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
name={icons.PROFILE}
|
|
||||||
size={13}
|
|
||||||
/>
|
|
||||||
<span className={styles.qualityProfileName}>
|
|
||||||
{
|
|
||||||
<QualityProfileNameConnector
|
|
||||||
qualityProfileId={qualityProfileId}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
</Label>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
!isSmallScreen &&
|
|
||||||
<Label
|
|
||||||
className={styles.detailsLabel}
|
|
||||||
size={sizes.MEDIUM}
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
name={icons.FOLDER}
|
|
||||||
size={13}
|
|
||||||
/>
|
|
||||||
<span className={styles.path}>
|
|
||||||
{rootFolderPath}
|
|
||||||
</span>
|
|
||||||
</Label>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
!isSmallScreen &&
|
|
||||||
<Label
|
|
||||||
className={styles.detailsLabel}
|
|
||||||
size={sizes.MEDIUM}
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
name={icons.PROFILE}
|
|
||||||
size={13}
|
|
||||||
/>
|
|
||||||
<span className={styles.genres}>
|
|
||||||
{genres.join(', ')}
|
|
||||||
</span>
|
|
||||||
</Label>
|
|
||||||
}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
showOverview &&
|
|
||||||
<div className={styles.details}>
|
|
||||||
<div className={styles.overview}>
|
|
||||||
<TextTruncate
|
|
||||||
line={Math.floor(overviewHeight / (defaultFontSize * lineHeight))}
|
|
||||||
text={overview}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
showPosters ?
|
|
||||||
<div className={styles.sliderContainer}>
|
|
||||||
<Slider ref={this.setSliderRef} {...sliderSettings}>
|
|
||||||
{movies.map((movie) => (
|
|
||||||
<div className={styles.movie} key={movie.tmdbId}>
|
|
||||||
<CollectionMovieConnector
|
|
||||||
key={movie.tmdbId}
|
|
||||||
posterWidth={posterWidth}
|
|
||||||
posterHeight={posterHeight}
|
|
||||||
detailedProgressBar={detailedProgressBar}
|
|
||||||
collectionId={id}
|
|
||||||
{...movie}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</Slider>
|
|
||||||
</div> :
|
|
||||||
<div className={styles.labelsContainer}>
|
|
||||||
{movies.map((movie) => (
|
|
||||||
<CollectionMovieLabelConnector
|
|
||||||
key={movie.tmdbId}
|
|
||||||
collectionId={id}
|
|
||||||
{...movie}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<EditCollectionModalConnector
|
|
||||||
isOpen={isEditCollectionModalOpen}
|
|
||||||
collectionId={id}
|
|
||||||
onModalClose={this.onEditCollectionModalClose}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionOverview.propTypes = {
|
|
||||||
id: PropTypes.number.isRequired,
|
|
||||||
monitored: PropTypes.bool.isRequired,
|
|
||||||
qualityProfileId: PropTypes.number.isRequired,
|
|
||||||
minimumAvailability: PropTypes.string.isRequired,
|
|
||||||
searchOnAdd: PropTypes.bool.isRequired,
|
|
||||||
rootFolderPath: PropTypes.string.isRequired,
|
|
||||||
tmdbId: PropTypes.number.isRequired,
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
overview: PropTypes.string.isRequired,
|
|
||||||
movies: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
genres: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
||||||
missingMovies: PropTypes.number.isRequired,
|
|
||||||
images: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
rowHeight: PropTypes.number.isRequired,
|
|
||||||
posterHeight: PropTypes.number.isRequired,
|
|
||||||
posterWidth: PropTypes.number.isRequired,
|
|
||||||
overviewOptions: PropTypes.object.isRequired,
|
|
||||||
showRelativeDates: PropTypes.bool.isRequired,
|
|
||||||
shortDateFormat: PropTypes.string.isRequired,
|
|
||||||
longDateFormat: PropTypes.string.isRequired,
|
|
||||||
timeFormat: PropTypes.string.isRequired,
|
|
||||||
isSmallScreen: PropTypes.bool.isRequired,
|
|
||||||
isSelected: PropTypes.bool,
|
|
||||||
onMonitorTogglePress: PropTypes.func.isRequired,
|
|
||||||
onSelectedChange: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionOverview;
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import { toggleCollectionMonitored } from 'Store/Actions/movieCollectionActions';
|
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
|
||||||
import CollectionOverview from './CollectionOverview';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
createDimensionsSelector(),
|
|
||||||
(dimensions) => {
|
|
||||||
return {
|
|
||||||
isSmallScreen: dimensions.isSmallScreen
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
toggleCollectionMonitored
|
|
||||||
};
|
|
||||||
|
|
||||||
class CollectionOverviewConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onMonitorTogglePress = (monitored) => {
|
|
||||||
this.props.toggleCollectionMonitored({
|
|
||||||
collectionId: this.props.collectionId,
|
|
||||||
monitored
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<CollectionOverview
|
|
||||||
{...this.props}
|
|
||||||
onMonitorTogglePress={this.onMonitorTogglePress}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionOverviewConnector.propTypes = {
|
|
||||||
collectionId: PropTypes.number.isRequired,
|
|
||||||
monitored: PropTypes.bool.isRequired,
|
|
||||||
toggleCollectionMonitored: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(CollectionOverviewConnector);
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
.grid {
|
|
||||||
flex: 1 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container {
|
|
||||||
&:hover {
|
|
||||||
.content {
|
|
||||||
background-color: $tableRowHoverBackgroundColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.externalLinks {
|
|
||||||
margin-right: 0.5em;
|
|
||||||
}
|
|
||||||
@@ -1,272 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { Grid, WindowScroller } from 'react-virtualized';
|
|
||||||
import CollectionItemConnector from 'Collection/CollectionItemConnector';
|
|
||||||
import Measure from 'Components/Measure';
|
|
||||||
import dimensions from 'Styles/Variables/dimensions';
|
|
||||||
import getIndexOfFirstCharacter from 'Utilities/Array/getIndexOfFirstCharacter';
|
|
||||||
import hasDifferentItemsOrOrder from 'Utilities/Object/hasDifferentItemsOrOrder';
|
|
||||||
import CollectionOverviewConnector from './CollectionOverviewConnector';
|
|
||||||
import styles from './CollectionOverviews.css';
|
|
||||||
|
|
||||||
// Poster container dimensions
|
|
||||||
const columnPadding = parseInt(dimensions.movieIndexColumnPadding);
|
|
||||||
const columnPaddingSmallScreen = parseInt(dimensions.movieIndexColumnPaddingSmallScreen);
|
|
||||||
|
|
||||||
function calculatePosterWidth(posterSize, isSmallScreen) {
|
|
||||||
const maxiumPosterWidth = isSmallScreen ? 152 : 162;
|
|
||||||
|
|
||||||
if (posterSize === 'large') {
|
|
||||||
return maxiumPosterWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (posterSize === 'medium') {
|
|
||||||
return Math.floor(maxiumPosterWidth * 0.75);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Math.floor(maxiumPosterWidth * 0.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
function calculateRowHeight(posterHeight, sortKey, isSmallScreen, overviewOptions) {
|
|
||||||
|
|
||||||
const heights = [
|
|
||||||
overviewOptions.showPosters ? posterHeight : 75,
|
|
||||||
isSmallScreen ? columnPaddingSmallScreen : columnPadding
|
|
||||||
];
|
|
||||||
|
|
||||||
return heights.reduce((acc, height) => acc + height + 80, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
function calculatePosterHeight(posterWidth) {
|
|
||||||
return Math.ceil((250 / 170) * posterWidth);
|
|
||||||
}
|
|
||||||
|
|
||||||
class CollectionOverviews extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
constructor(props, context) {
|
|
||||||
super(props, context);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
width: 0,
|
|
||||||
columnCount: 1,
|
|
||||||
posterWidth: 162,
|
|
||||||
posterHeight: 238,
|
|
||||||
rowHeight: calculateRowHeight(238, null, props.isSmallScreen, {})
|
|
||||||
};
|
|
||||||
|
|
||||||
this._grid = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidUpdate(prevProps, prevState) {
|
|
||||||
const {
|
|
||||||
items,
|
|
||||||
sortKey,
|
|
||||||
overviewOptions,
|
|
||||||
jumpToCharacter,
|
|
||||||
scrollTop,
|
|
||||||
isSmallScreen
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
width,
|
|
||||||
rowHeight,
|
|
||||||
scrollRestored
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
if (prevProps.sortKey !== sortKey ||
|
|
||||||
prevProps.overviewOptions !== overviewOptions) {
|
|
||||||
this.calculateGrid(this.state.width, isSmallScreen);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
this._grid &&
|
|
||||||
(prevState.width !== width ||
|
|
||||||
prevState.rowHeight !== rowHeight ||
|
|
||||||
hasDifferentItemsOrOrder(prevProps.items, items) ||
|
|
||||||
prevProps.overviewOptions !== overviewOptions)) {
|
|
||||||
// recomputeGridSize also forces Grid to discard its cache of rendered cells
|
|
||||||
this._grid.recomputeGridSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._grid && scrollTop !== 0 && !scrollRestored) {
|
|
||||||
this.setState({ scrollRestored: true });
|
|
||||||
this._grid.scrollToPosition({ scrollTop });
|
|
||||||
}
|
|
||||||
|
|
||||||
if (jumpToCharacter != null && jumpToCharacter !== prevProps.jumpToCharacter) {
|
|
||||||
const index = getIndexOfFirstCharacter(items, jumpToCharacter);
|
|
||||||
|
|
||||||
if (this._grid && index != null) {
|
|
||||||
|
|
||||||
this._grid.scrollToCell({
|
|
||||||
rowIndex: index,
|
|
||||||
columnIndex: 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Control
|
|
||||||
|
|
||||||
setGridRef = (ref) => {
|
|
||||||
this._grid = ref;
|
|
||||||
};
|
|
||||||
|
|
||||||
calculateGrid = (width = this.state.width, isSmallScreen) => {
|
|
||||||
const {
|
|
||||||
sortKey,
|
|
||||||
overviewOptions
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const posterWidth = calculatePosterWidth(overviewOptions.size, isSmallScreen);
|
|
||||||
const posterHeight = calculatePosterHeight(posterWidth);
|
|
||||||
const rowHeight = calculateRowHeight(posterHeight, sortKey, isSmallScreen, overviewOptions);
|
|
||||||
|
|
||||||
this.setState({
|
|
||||||
width,
|
|
||||||
posterWidth,
|
|
||||||
posterHeight,
|
|
||||||
rowHeight
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
cellRenderer = ({ key, rowIndex, style }) => {
|
|
||||||
const {
|
|
||||||
items,
|
|
||||||
sortKey,
|
|
||||||
overviewOptions,
|
|
||||||
showRelativeDates,
|
|
||||||
shortDateFormat,
|
|
||||||
longDateFormat,
|
|
||||||
timeFormat,
|
|
||||||
isSmallScreen,
|
|
||||||
selectedState,
|
|
||||||
onSelectedChange
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
posterWidth,
|
|
||||||
posterHeight,
|
|
||||||
rowHeight
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
const collection = items[rowIndex];
|
|
||||||
|
|
||||||
if (!collection) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={styles.container}
|
|
||||||
key={key}
|
|
||||||
style={style}
|
|
||||||
>
|
|
||||||
<CollectionItemConnector
|
|
||||||
key={collection.id}
|
|
||||||
component={CollectionOverviewConnector}
|
|
||||||
sortKey={sortKey}
|
|
||||||
posterWidth={posterWidth}
|
|
||||||
posterHeight={posterHeight}
|
|
||||||
rowHeight={rowHeight}
|
|
||||||
overviewOptions={overviewOptions}
|
|
||||||
showRelativeDates={showRelativeDates}
|
|
||||||
shortDateFormat={shortDateFormat}
|
|
||||||
longDateFormat={longDateFormat}
|
|
||||||
timeFormat={timeFormat}
|
|
||||||
isSmallScreen={isSmallScreen}
|
|
||||||
collectionId={collection.id}
|
|
||||||
isSelected={selectedState[collection.id]}
|
|
||||||
onSelectedChange={onSelectedChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onMeasure = ({ width }) => {
|
|
||||||
this.calculateGrid(width, this.props.isSmallScreen);
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
isSmallScreen,
|
|
||||||
scroller,
|
|
||||||
items,
|
|
||||||
selectedState
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
width,
|
|
||||||
rowHeight
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Measure
|
|
||||||
whitelist={['width']}
|
|
||||||
onMeasure={this.onMeasure}
|
|
||||||
>
|
|
||||||
<WindowScroller
|
|
||||||
scrollElement={isSmallScreen ? undefined : scroller}
|
|
||||||
>
|
|
||||||
{({ height, registerChild, onChildScroll, scrollTop }) => {
|
|
||||||
if (!height) {
|
|
||||||
return <div />;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div ref={registerChild}>
|
|
||||||
<Grid
|
|
||||||
ref={this.setGridRef}
|
|
||||||
className={styles.grid}
|
|
||||||
autoHeight={true}
|
|
||||||
height={height}
|
|
||||||
columnCount={1}
|
|
||||||
columnWidth={width}
|
|
||||||
rowCount={items.length}
|
|
||||||
rowHeight={rowHeight}
|
|
||||||
width={width}
|
|
||||||
onScroll={onChildScroll}
|
|
||||||
scrollTop={scrollTop}
|
|
||||||
overscanRowCount={2}
|
|
||||||
cellRenderer={this.cellRenderer}
|
|
||||||
selectedState={selectedState}
|
|
||||||
scrollToAlignment={'start'}
|
|
||||||
isScrollingOptout={true}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</WindowScroller>
|
|
||||||
</Measure>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionOverviews.propTypes = {
|
|
||||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
sortKey: PropTypes.string,
|
|
||||||
overviewOptions: PropTypes.object.isRequired,
|
|
||||||
jumpToCharacter: PropTypes.string,
|
|
||||||
scrollTop: PropTypes.number.isRequired,
|
|
||||||
scroller: PropTypes.instanceOf(Element).isRequired,
|
|
||||||
showRelativeDates: PropTypes.bool.isRequired,
|
|
||||||
shortDateFormat: PropTypes.string.isRequired,
|
|
||||||
longDateFormat: PropTypes.string.isRequired,
|
|
||||||
isSmallScreen: PropTypes.bool.isRequired,
|
|
||||||
timeFormat: PropTypes.string.isRequired,
|
|
||||||
selectedState: PropTypes.object.isRequired,
|
|
||||||
onSelectedChange: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionOverviews;
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
|
||||||
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
|
|
||||||
import CollectionOverviews from './CollectionOverviews';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
(state) => state.movieCollections.overviewOptions,
|
|
||||||
createUISettingsSelector(),
|
|
||||||
createDimensionsSelector(),
|
|
||||||
(overviewOptions, uiSettings, dimensions) => {
|
|
||||||
return {
|
|
||||||
overviewOptions,
|
|
||||||
showRelativeDates: uiSettings.showRelativeDates,
|
|
||||||
shortDateFormat: uiSettings.shortDateFormat,
|
|
||||||
longDateFormat: uiSettings.longDateFormat,
|
|
||||||
timeFormat: uiSettings.timeFormat,
|
|
||||||
isSmallScreen: dimensions.isSmallScreen
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps)(CollectionOverviews);
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import Modal from 'Components/Modal/Modal';
|
|
||||||
import CollectionOverviewOptionsModalContentConnector from './CollectionOverviewOptionsModalContentConnector';
|
|
||||||
|
|
||||||
function CollectionOverviewOptionsModal({ isOpen, onModalClose, ...otherProps }) {
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
isOpen={isOpen}
|
|
||||||
onModalClose={onModalClose}
|
|
||||||
>
|
|
||||||
<CollectionOverviewOptionsModalContentConnector
|
|
||||||
{...otherProps}
|
|
||||||
onModalClose={onModalClose}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionOverviewOptionsModal.propTypes = {
|
|
||||||
isOpen: PropTypes.bool.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionOverviewOptionsModal;
|
|
||||||
@@ -1,205 +0,0 @@
|
|||||||
import _ from 'lodash';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import Form from 'Components/Form/Form';
|
|
||||||
import FormGroup from 'Components/Form/FormGroup';
|
|
||||||
import FormInputGroup from 'Components/Form/FormInputGroup';
|
|
||||||
import FormLabel from 'Components/Form/FormLabel';
|
|
||||||
import Button from 'Components/Link/Button';
|
|
||||||
import ModalBody from 'Components/Modal/ModalBody';
|
|
||||||
import ModalContent from 'Components/Modal/ModalContent';
|
|
||||||
import ModalFooter from 'Components/Modal/ModalFooter';
|
|
||||||
import ModalHeader from 'Components/Modal/ModalHeader';
|
|
||||||
import { inputTypes } from 'Helpers/Props';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
|
|
||||||
const posterSizeOptions = [
|
|
||||||
{ key: 'small', value: translate('Small') },
|
|
||||||
{ key: 'medium', value: translate('Medium') },
|
|
||||||
{ key: 'large', value: translate('Large') }
|
|
||||||
];
|
|
||||||
|
|
||||||
class CollectionOverviewOptionsModalContent extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
constructor(props, context) {
|
|
||||||
super(props, context);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
detailedProgressBar: props.detailedProgressBar,
|
|
||||||
size: props.size,
|
|
||||||
showDetails: props.showDetails,
|
|
||||||
showOverview: props.showOverview,
|
|
||||||
showPosters: props.showPosters
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
|
||||||
const {
|
|
||||||
detailedProgressBar,
|
|
||||||
size,
|
|
||||||
showDetails,
|
|
||||||
showOverview,
|
|
||||||
showPosters
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const state = {};
|
|
||||||
|
|
||||||
if (detailedProgressBar !== prevProps.detailedProgressBar) {
|
|
||||||
state.detailedProgressBar = detailedProgressBar;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (size !== prevProps.size) {
|
|
||||||
state.size = size;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showDetails !== prevProps.showDetails) {
|
|
||||||
state.showDetails = showDetails;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showOverview !== prevProps.showOverview) {
|
|
||||||
state.showOverview = showOverview;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showPosters !== prevProps.showPosters) {
|
|
||||||
state.showPosters = showPosters;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_.isEmpty(state)) {
|
|
||||||
this.setState(state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onChangeOverviewOption = ({ name, value }) => {
|
|
||||||
this.setState({
|
|
||||||
[name]: value
|
|
||||||
}, () => {
|
|
||||||
this.props.onChangeOverviewOption({ [name]: value });
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
onChangeOption = ({ name, value }) => {
|
|
||||||
this.setState({
|
|
||||||
[name]: value
|
|
||||||
}, () => {
|
|
||||||
this.props.onChangeOption({
|
|
||||||
[name]: value
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
onModalClose
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
size,
|
|
||||||
detailedProgressBar,
|
|
||||||
showDetails,
|
|
||||||
showPosters,
|
|
||||||
showOverview
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ModalContent onModalClose={onModalClose}>
|
|
||||||
<ModalHeader>
|
|
||||||
{translate('CollectionOptions')}
|
|
||||||
</ModalHeader>
|
|
||||||
|
|
||||||
<ModalBody>
|
|
||||||
<Form>
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('PosterSize')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.SELECT}
|
|
||||||
name="size"
|
|
||||||
value={size}
|
|
||||||
values={posterSizeOptions}
|
|
||||||
onChange={this.onChangeOverviewOption}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('DetailedProgressBar')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.CHECK}
|
|
||||||
name="detailedProgressBar"
|
|
||||||
value={detailedProgressBar}
|
|
||||||
helpText={translate('DetailedProgressBarHelpText')}
|
|
||||||
onChange={this.onChangeOverviewOption}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('ShowCollectionDetails')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.CHECK}
|
|
||||||
name="showDetails"
|
|
||||||
value={showDetails}
|
|
||||||
helpText={translate('CollectionShowDetailsHelpText')}
|
|
||||||
onChange={this.onChangeOverviewOption}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('ShowOverview')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.CHECK}
|
|
||||||
name="showOverview"
|
|
||||||
value={showOverview}
|
|
||||||
helpText={translate('CollectionShowOverviewsHelpText')}
|
|
||||||
onChange={this.onChangeOverviewOption}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('ShowPosters')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.CHECK}
|
|
||||||
name="showPosters"
|
|
||||||
value={showPosters}
|
|
||||||
helpText={translate('CollectionShowPostersHelpText')}
|
|
||||||
onChange={this.onChangeOverviewOption}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
</Form>
|
|
||||||
</ModalBody>
|
|
||||||
|
|
||||||
<ModalFooter>
|
|
||||||
<Button
|
|
||||||
onPress={onModalClose}
|
|
||||||
>
|
|
||||||
{translate('Close')}
|
|
||||||
</Button>
|
|
||||||
</ModalFooter>
|
|
||||||
</ModalContent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionOverviewOptionsModalContent.propTypes = {
|
|
||||||
detailedProgressBar: PropTypes.bool.isRequired,
|
|
||||||
size: PropTypes.string.isRequired,
|
|
||||||
showDetails: PropTypes.bool.isRequired,
|
|
||||||
showOverview: PropTypes.bool.isRequired,
|
|
||||||
showPosters: PropTypes.bool.isRequired,
|
|
||||||
onChangeOverviewOption: PropTypes.func.isRequired,
|
|
||||||
onChangeOption: PropTypes.func.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionOverviewOptionsModalContent;
|
|
||||||
-29
@@ -1,29 +0,0 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import { setMovieCollectionsOption, setMovieCollectionsOverviewOption } from 'Store/Actions/movieCollectionActions';
|
|
||||||
import CollectionOverviewOptionsModalContent from './CollectionOverviewOptionsModalContent';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
(state) => state.movieCollections,
|
|
||||||
(movieCollections) => {
|
|
||||||
return {
|
|
||||||
...movieCollections.options,
|
|
||||||
...movieCollections.overviewOptions
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createMapDispatchToProps(dispatch, props) {
|
|
||||||
return {
|
|
||||||
onChangeOverviewOption(payload) {
|
|
||||||
dispatch(setMovieCollectionsOverviewOption(payload));
|
|
||||||
},
|
|
||||||
onChangeOption(payload) {
|
|
||||||
dispatch(setMovieCollectionsOption(payload));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, createMapDispatchToProps)(CollectionOverviewOptionsModalContent);
|
|
||||||
@@ -10,7 +10,6 @@ export const DOWNLOADED_MOVIES_SCAN = 'DownloadedMoviesScan';
|
|||||||
export const INTERACTIVE_IMPORT = 'ManualImport';
|
export const INTERACTIVE_IMPORT = 'ManualImport';
|
||||||
export const MISSING_MOVIES_SEARCH = 'MissingMoviesSearch';
|
export const MISSING_MOVIES_SEARCH = 'MissingMoviesSearch';
|
||||||
export const MOVE_MOVIE = 'MoveMovie';
|
export const MOVE_MOVIE = 'MoveMovie';
|
||||||
export const REFRESH_COLLECTIONS = 'RefreshCollections';
|
|
||||||
export const REFRESH_MOVIE = 'RefreshMovie';
|
export const REFRESH_MOVIE = 'RefreshMovie';
|
||||||
export const RENAME_FILES = 'RenameFiles';
|
export const RENAME_FILES = 'RenameFiles';
|
||||||
export const RENAME_MOVIE = 'RenameMovie';
|
export const RENAME_MOVIE = 'RenameMovie';
|
||||||
|
|||||||
@@ -161,7 +161,6 @@ class DateFilterBuilderRowValue extends Component {
|
|||||||
<TextInput
|
<TextInput
|
||||||
name={NAME}
|
name={NAME}
|
||||||
value={filterValue}
|
value={filterValue}
|
||||||
type="date"
|
|
||||||
placeholder="yyyy-mm-dd"
|
placeholder="yyyy-mm-dd"
|
||||||
onChange={this.onValueChange}
|
onChange={this.onValueChange}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import monitorOptions from 'Utilities/Movie/monitorOptions';
|
import translate from 'Utilities/String/translate';
|
||||||
import SelectInput from './SelectInput';
|
import SelectInput from './SelectInput';
|
||||||
|
|
||||||
|
const monitorTypesOptions = [
|
||||||
|
{ key: 'true', value: translate('Yes') },
|
||||||
|
{ key: 'false', value: translate('No') }
|
||||||
|
];
|
||||||
|
|
||||||
function MovieMonitoredSelectInput(props) {
|
function MovieMonitoredSelectInput(props) {
|
||||||
const values = [...monitorOptions];
|
const values = [...monitorTypesOptions];
|
||||||
|
|
||||||
const {
|
const {
|
||||||
includeNoChange,
|
includeNoChange,
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
.image {
|
||||||
|
align-content: center;
|
||||||
|
margin-right: 5px;
|
||||||
|
vertical-align: -0.125em;
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -22,11 +22,11 @@ class ImdbRating extends PureComponent {
|
|||||||
let ratingString = '0.0';
|
let ratingString = '0.0';
|
||||||
|
|
||||||
if (rating) {
|
if (rating) {
|
||||||
ratingString = `${rating.value.toFixed(1)}`;
|
ratingString = `${rating.value}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span title={`${rating ? rating.votes : 0} votes`}>
|
<span title={`${rating.votes} votes`}>
|
||||||
{
|
{
|
||||||
!hideIcon &&
|
!hideIcon &&
|
||||||
<img
|
<img
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { createSelector } from 'reselect';
|
|||||||
import { saveDimensions, setIsSidebarVisible } from 'Store/Actions/appActions';
|
import { saveDimensions, setIsSidebarVisible } from 'Store/Actions/appActions';
|
||||||
import { fetchCustomFilters } from 'Store/Actions/customFilterActions';
|
import { fetchCustomFilters } from 'Store/Actions/customFilterActions';
|
||||||
import { fetchMovies } from 'Store/Actions/movieActions';
|
import { fetchMovies } from 'Store/Actions/movieActions';
|
||||||
import { fetchMovieCollections } from 'Store/Actions/movieCollectionActions';
|
|
||||||
import { fetchImportLists, fetchIndexerFlags, fetchLanguages, fetchQualityProfiles, fetchUISettings } from 'Store/Actions/settingsActions';
|
import { fetchImportLists, fetchIndexerFlags, fetchLanguages, fetchQualityProfiles, fetchUISettings } from 'Store/Actions/settingsActions';
|
||||||
import { fetchStatus } from 'Store/Actions/systemActions';
|
import { fetchStatus } from 'Store/Actions/systemActions';
|
||||||
import { fetchTags } from 'Store/Actions/tagActions';
|
import { fetchTags } from 'Store/Actions/tagActions';
|
||||||
@@ -52,7 +51,6 @@ const selectIsPopulated = createSelector(
|
|||||||
(state) => state.settings.indexerFlags.isPopulated,
|
(state) => state.settings.indexerFlags.isPopulated,
|
||||||
(state) => state.settings.importLists.isPopulated,
|
(state) => state.settings.importLists.isPopulated,
|
||||||
(state) => state.system.status.isPopulated,
|
(state) => state.system.status.isPopulated,
|
||||||
(state) => state.movieCollections.isPopulated,
|
|
||||||
(
|
(
|
||||||
customFiltersIsPopulated,
|
customFiltersIsPopulated,
|
||||||
tagsIsPopulated,
|
tagsIsPopulated,
|
||||||
@@ -61,8 +59,7 @@ const selectIsPopulated = createSelector(
|
|||||||
languagesIsPopulated,
|
languagesIsPopulated,
|
||||||
indexerFlagsIsPopulated,
|
indexerFlagsIsPopulated,
|
||||||
importListsIsPopulated,
|
importListsIsPopulated,
|
||||||
systemStatusIsPopulated,
|
systemStatusIsPopulated
|
||||||
movieCollectionsIsPopulated
|
|
||||||
) => {
|
) => {
|
||||||
return (
|
return (
|
||||||
customFiltersIsPopulated &&
|
customFiltersIsPopulated &&
|
||||||
@@ -72,8 +69,7 @@ const selectIsPopulated = createSelector(
|
|||||||
languagesIsPopulated &&
|
languagesIsPopulated &&
|
||||||
indexerFlagsIsPopulated &&
|
indexerFlagsIsPopulated &&
|
||||||
importListsIsPopulated &&
|
importListsIsPopulated &&
|
||||||
systemStatusIsPopulated &&
|
systemStatusIsPopulated
|
||||||
movieCollectionsIsPopulated
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -87,7 +83,6 @@ const selectErrors = createSelector(
|
|||||||
(state) => state.settings.indexerFlags.error,
|
(state) => state.settings.indexerFlags.error,
|
||||||
(state) => state.settings.importLists.error,
|
(state) => state.settings.importLists.error,
|
||||||
(state) => state.system.status.error,
|
(state) => state.system.status.error,
|
||||||
(state) => state.movieCollections.error,
|
|
||||||
(
|
(
|
||||||
customFiltersError,
|
customFiltersError,
|
||||||
tagsError,
|
tagsError,
|
||||||
@@ -96,8 +91,7 @@ const selectErrors = createSelector(
|
|||||||
languagesError,
|
languagesError,
|
||||||
indexerFlagsError,
|
indexerFlagsError,
|
||||||
importListsError,
|
importListsError,
|
||||||
systemStatusError,
|
systemStatusError
|
||||||
movieCollectionsError
|
|
||||||
) => {
|
) => {
|
||||||
const hasError = !!(
|
const hasError = !!(
|
||||||
customFiltersError ||
|
customFiltersError ||
|
||||||
@@ -107,8 +101,7 @@ const selectErrors = createSelector(
|
|||||||
languagesError ||
|
languagesError ||
|
||||||
indexerFlagsError ||
|
indexerFlagsError ||
|
||||||
importListsError ||
|
importListsError ||
|
||||||
systemStatusError ||
|
systemStatusError
|
||||||
movieCollectionsError
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -120,8 +113,7 @@ const selectErrors = createSelector(
|
|||||||
languagesError,
|
languagesError,
|
||||||
indexerFlagsError,
|
indexerFlagsError,
|
||||||
importListsError,
|
importListsError,
|
||||||
systemStatusError,
|
systemStatusError
|
||||||
movieCollectionsError
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -156,9 +148,6 @@ function createMapDispatchToProps(dispatch, props) {
|
|||||||
dispatchFetchMovies() {
|
dispatchFetchMovies() {
|
||||||
dispatch(fetchMovies());
|
dispatch(fetchMovies());
|
||||||
},
|
},
|
||||||
dispatchFetchMovieCollections() {
|
|
||||||
dispatch(fetchMovieCollections());
|
|
||||||
},
|
|
||||||
dispatchFetchCustomFilters() {
|
dispatchFetchCustomFilters() {
|
||||||
dispatch(fetchCustomFilters());
|
dispatch(fetchCustomFilters());
|
||||||
},
|
},
|
||||||
@@ -208,7 +197,6 @@ class PageConnector extends Component {
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (!this.props.isPopulated) {
|
if (!this.props.isPopulated) {
|
||||||
this.props.dispatchFetchMovies();
|
this.props.dispatchFetchMovies();
|
||||||
this.props.dispatchFetchMovieCollections();
|
|
||||||
this.props.dispatchFetchCustomFilters();
|
this.props.dispatchFetchCustomFilters();
|
||||||
this.props.dispatchFetchTags();
|
this.props.dispatchFetchTags();
|
||||||
this.props.dispatchFetchQualityProfiles();
|
this.props.dispatchFetchQualityProfiles();
|
||||||
@@ -235,7 +223,6 @@ class PageConnector extends Component {
|
|||||||
isPopulated,
|
isPopulated,
|
||||||
hasError,
|
hasError,
|
||||||
dispatchFetchMovies,
|
dispatchFetchMovies,
|
||||||
dispatchFetchMovieCollections,
|
|
||||||
dispatchFetchTags,
|
dispatchFetchTags,
|
||||||
dispatchFetchQualityProfiles,
|
dispatchFetchQualityProfiles,
|
||||||
dispatchFetchLanguages,
|
dispatchFetchLanguages,
|
||||||
@@ -275,7 +262,6 @@ PageConnector.propTypes = {
|
|||||||
hasError: PropTypes.bool.isRequired,
|
hasError: PropTypes.bool.isRequired,
|
||||||
isSidebarVisible: PropTypes.bool.isRequired,
|
isSidebarVisible: PropTypes.bool.isRequired,
|
||||||
dispatchFetchMovies: PropTypes.func.isRequired,
|
dispatchFetchMovies: PropTypes.func.isRequired,
|
||||||
dispatchFetchMovieCollections: PropTypes.func.isRequired,
|
|
||||||
dispatchFetchCustomFilters: PropTypes.func.isRequired,
|
dispatchFetchCustomFilters: PropTypes.func.isRequired,
|
||||||
dispatchFetchTags: PropTypes.func.isRequired,
|
dispatchFetchTags: PropTypes.func.isRequired,
|
||||||
dispatchFetchQualityProfiles: PropTypes.func.isRequired,
|
dispatchFetchQualityProfiles: PropTypes.func.isRequired,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ function PageContent(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ErrorBoundary errorComponent={PageContentError}>
|
<ErrorBoundary errorComponent={PageContentError}>
|
||||||
<DocumentTitle title={title ? `${title} - ${window.Radarr.instanceName}` : window.Radarr.instanceName}>
|
<DocumentTitle title={title ? `${title} - Radarr` : 'Radarr'}>
|
||||||
<div className={className}>
|
<div className={className}>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,10 +33,6 @@ const links = [
|
|||||||
title: translate('ImportLibrary'),
|
title: translate('ImportLibrary'),
|
||||||
to: '/add/import'
|
to: '/add/import'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: translate('Collections'),
|
|
||||||
to: '/collections'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: translate('Discover'),
|
title: translate('Discover'),
|
||||||
to: '/add/discover'
|
to: '/add/discover'
|
||||||
|
|||||||
@@ -21,11 +21,9 @@ class RottenTomatoRating extends PureComponent {
|
|||||||
const rating = ratings.rottenTomatoes;
|
const rating = ratings.rottenTomatoes;
|
||||||
|
|
||||||
let ratingString = '0%';
|
let ratingString = '0%';
|
||||||
let ratingImage = rtFresh;
|
|
||||||
|
|
||||||
if (rating) {
|
if (rating) {
|
||||||
ratingString = `${rating.value}%`;
|
ratingString = `${rating.value}%`;
|
||||||
ratingImage = rating.value > 50 ? rtFresh : rtRotten;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -34,7 +32,7 @@ class RottenTomatoRating extends PureComponent {
|
|||||||
!hideIcon &&
|
!hideIcon &&
|
||||||
<img
|
<img
|
||||||
className={styles.image}
|
className={styles.image}
|
||||||
src={ratingImage}
|
src={rating.value > 50 ? rtFresh : rtRotten}
|
||||||
style={{
|
style={{
|
||||||
height: `${iconSize}px`
|
height: `${iconSize}px`
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -203,19 +203,6 @@ class SignalRConnector extends Component {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
handleCollection = (body) => {
|
|
||||||
const action = body.action;
|
|
||||||
const section = 'movieCollections';
|
|
||||||
|
|
||||||
console.log(body);
|
|
||||||
|
|
||||||
if (action === 'updated') {
|
|
||||||
this.props.dispatchUpdateItem({ section, ...body.resource });
|
|
||||||
} else if (action === 'deleted') {
|
|
||||||
this.props.dispatchRemoveItem({ section, id: body.resource.id });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
handleQueue = () => {
|
handleQueue = () => {
|
||||||
if (this.props.isQueuePopulated) {
|
if (this.props.isQueuePopulated) {
|
||||||
this.props.dispatchFetchQueue();
|
this.props.dispatchFetchQueue();
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class TmdbRating extends PureComponent {
|
|||||||
let ratingString = '0%';
|
let ratingString = '0%';
|
||||||
|
|
||||||
if (rating) {
|
if (rating) {
|
||||||
ratingString = `${(rating.value * 10).toFixed()}%`;
|
ratingString = `${rating.value * 10}%`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import SelectInput from 'Components/Form/SelectInput';
|
|||||||
import SpinnerButton from 'Components/Link/SpinnerButton';
|
import SpinnerButton from 'Components/Link/SpinnerButton';
|
||||||
import PageContentFooter from 'Components/Page/PageContentFooter';
|
import PageContentFooter from 'Components/Page/PageContentFooter';
|
||||||
import { kinds } from 'Helpers/Props';
|
import { kinds } from 'Helpers/Props';
|
||||||
import monitorOptions from 'Utilities/Movie/monitorOptions';
|
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import DiscoverMovieFooterLabel from './DiscoverMovieFooterLabel';
|
import DiscoverMovieFooterLabel from './DiscoverMovieFooterLabel';
|
||||||
import ExcludeMovieModal from './Exclusion/ExcludeMovieModal';
|
import ExcludeMovieModal from './Exclusion/ExcludeMovieModal';
|
||||||
@@ -138,6 +137,11 @@ class DiscoverMovieFooter extends Component {
|
|||||||
isExcludeMovieModalOpen
|
isExcludeMovieModalOpen
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
|
const monitoredOptions = [
|
||||||
|
{ key: true, value: translate('Monitored') },
|
||||||
|
{ key: false, value: translate('Unmonitored') }
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContentFooter>
|
<PageContentFooter>
|
||||||
<div className={styles.inputContainer}>
|
<div className={styles.inputContainer}>
|
||||||
@@ -149,7 +153,7 @@ class DiscoverMovieFooter extends Component {
|
|||||||
<SelectInput
|
<SelectInput
|
||||||
name="monitor"
|
name="monitor"
|
||||||
value={monitor}
|
value={monitor}
|
||||||
values={monitorOptions}
|
values={monitoredOptions}
|
||||||
isDisabled={!selectedCount}
|
isDisabled={!selectedCount}
|
||||||
onChange={onInputChange}
|
onChange={onInputChange}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import TmdbRating from 'Components/TmdbRating';
|
import HeartRating from 'Components/HeartRating';
|
||||||
import { getMovieStatusDetails } from 'Movie/MovieStatus';
|
import { getMovieStatusDetails } from 'Movie/MovieStatus';
|
||||||
import formatRuntime from 'Utilities/Date/formatRuntime';
|
import formatRuntime from 'Utilities/Date/formatRuntime';
|
||||||
import getRelativeDate from 'Utilities/Date/getRelativeDate';
|
import getRelativeDate from 'Utilities/Date/getRelativeDate';
|
||||||
@@ -111,7 +111,7 @@ function DiscoverMoviePosterInfo(props) {
|
|||||||
if (sortKey === 'ratings' && ratings) {
|
if (sortKey === 'ratings' && ratings) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.info}>
|
<div className={styles.info}>
|
||||||
<TmdbRating
|
<HeartRating
|
||||||
ratings={ratings}
|
ratings={ratings}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -129,7 +129,7 @@ DiscoverMoviePosterInfo.propTypes = {
|
|||||||
digitalRelease: PropTypes.string,
|
digitalRelease: PropTypes.string,
|
||||||
physicalRelease: PropTypes.string,
|
physicalRelease: PropTypes.string,
|
||||||
runtime: PropTypes.number,
|
runtime: PropTypes.number,
|
||||||
ratings: PropTypes.object.isRequired,
|
ratings: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
sortKey: PropTypes.string.isRequired,
|
sortKey: PropTypes.string.isRequired,
|
||||||
showRelativeDates: PropTypes.bool.isRequired,
|
showRelativeDates: PropTypes.bool.isRequired,
|
||||||
shortDateFormat: PropTypes.string.isRequired,
|
shortDateFormat: PropTypes.string.isRequired,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
import HeartRating from 'Components/HeartRating';
|
||||||
import Icon from 'Components/Icon';
|
import Icon from 'Components/Icon';
|
||||||
import ImportListListConnector from 'Components/ImportListListConnector';
|
import ImportListListConnector from 'Components/ImportListListConnector';
|
||||||
import IconButton from 'Components/Link/IconButton';
|
import IconButton from 'Components/Link/IconButton';
|
||||||
@@ -7,7 +8,6 @@ import Link from 'Components/Link/Link';
|
|||||||
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
|
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
|
||||||
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
|
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
|
||||||
import VirtualTableSelectCell from 'Components/Table/Cells/VirtualTableSelectCell';
|
import VirtualTableSelectCell from 'Components/Table/Cells/VirtualTableSelectCell';
|
||||||
import TmdbRating from 'Components/TmdbRating';
|
|
||||||
import Popover from 'Components/Tooltip/Popover';
|
import Popover from 'Components/Tooltip/Popover';
|
||||||
import AddNewDiscoverMovieModal from 'DiscoverMovie/AddNewDiscoverMovieModal';
|
import AddNewDiscoverMovieModal from 'DiscoverMovie/AddNewDiscoverMovieModal';
|
||||||
import ExcludeMovieModal from 'DiscoverMovie/Exclusion/ExcludeMovieModal';
|
import ExcludeMovieModal from 'DiscoverMovie/Exclusion/ExcludeMovieModal';
|
||||||
@@ -164,7 +164,7 @@ class DiscoverMovieRow extends Component {
|
|||||||
key={name}
|
key={name}
|
||||||
className={styles[name]}
|
className={styles[name]}
|
||||||
>
|
>
|
||||||
{collection ? collection.title : null }
|
{collection ? collection.name : null }
|
||||||
</VirtualTableRowCell>
|
</VirtualTableRowCell>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -245,7 +245,7 @@ class DiscoverMovieRow extends Component {
|
|||||||
key={name}
|
key={name}
|
||||||
className={styles[name]}
|
className={styles[name]}
|
||||||
>
|
>
|
||||||
<TmdbRating
|
<HeartRating
|
||||||
ratings={ratings}
|
ratings={ratings}
|
||||||
/>
|
/>
|
||||||
</VirtualTableRowCell>
|
</VirtualTableRowCell>
|
||||||
@@ -373,7 +373,7 @@ DiscoverMovieRow.propTypes = {
|
|||||||
digitalRelease: PropTypes.string,
|
digitalRelease: PropTypes.string,
|
||||||
runtime: PropTypes.number,
|
runtime: PropTypes.number,
|
||||||
genres: PropTypes.arrayOf(PropTypes.string).isRequired,
|
genres: PropTypes.arrayOf(PropTypes.string).isRequired,
|
||||||
ratings: PropTypes.object.isRequired,
|
ratings: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
certification: PropTypes.string,
|
certification: PropTypes.string,
|
||||||
collection: PropTypes.object,
|
collection: PropTypes.object,
|
||||||
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ const filterExistingFilesOptions = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const importModeOptions = [
|
const importModeOptions = [
|
||||||
{ key: 'chooseImportMode', value: translate('ChooseImportMode'), disabled: true },
|
|
||||||
{ key: 'move', value: translate('MoveFiles') },
|
{ key: 'move', value: translate('MoveFiles') },
|
||||||
{ key: 'copy', value: translate('HardlinkCopyFiles') }
|
{ key: 'copy', value: translate('HardlinkCopyFiles') }
|
||||||
];
|
];
|
||||||
|
|||||||
+2
-10
@@ -1,3 +1,4 @@
|
|||||||
|
import _ from 'lodash';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
@@ -100,18 +101,9 @@ class InteractiveImportModalContentConnector extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onImportSelectedPress = (selected, importMode) => {
|
onImportSelectedPress = (selected, importMode) => {
|
||||||
const {
|
|
||||||
items
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const files = [];
|
const files = [];
|
||||||
|
|
||||||
if (importMode === 'chooseImportMode') {
|
_.forEach(this.props.items, (item) => {
|
||||||
this.setState({ interactiveImportErrorMessage: 'An import mode must be selected' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
items.forEach((item) => {
|
|
||||||
const isSelected = selected.indexOf(item.id) > -1;
|
const isSelected = selected.indexOf(item.id) > -1;
|
||||||
|
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
|
|||||||
@@ -7,9 +7,3 @@
|
|||||||
.filteredMessage {
|
.filteredMessage {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.blankpad {
|
|
||||||
padding-top: 10px;
|
|
||||||
padding-bottom: 10px;
|
|
||||||
padding-left: 2em;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -127,21 +127,21 @@ function InteractiveSearchContent(props) {
|
|||||||
|
|
||||||
{
|
{
|
||||||
!isFetching && !!error &&
|
!isFetching && !!error &&
|
||||||
<div className={styles.blankpad}>
|
<div>
|
||||||
{translate('UnableToLoadResultsIntSearch')}
|
{translate('UnableToLoadResultsIntSearch')}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
!isFetching && isPopulated && !totalReleasesCount &&
|
!isFetching && isPopulated && !totalReleasesCount &&
|
||||||
<div className={styles.blankpad}>
|
<div>
|
||||||
{translate('NoResultsFound')}
|
{translate('NoResultsFound')}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
!!totalReleasesCount && isPopulated && !items.length &&
|
!!totalReleasesCount && isPopulated && !items.length &&
|
||||||
<div className={styles.blankpad}>
|
<div>
|
||||||
{translate('AllResultsHiddenFilter')}
|
{translate('AllResultsHiddenFilter')}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -159,7 +159,7 @@ function InteractiveSearchContent(props) {
|
|||||||
items.map((item) => {
|
items.map((item) => {
|
||||||
return (
|
return (
|
||||||
<InteractiveSearchRowConnector
|
<InteractiveSearchRowConnector
|
||||||
key={`${item.indexerId}-${item.guid}`}
|
key={item.guid}
|
||||||
{...item}
|
{...item}
|
||||||
searchPayload={searchPayload}
|
searchPayload={searchPayload}
|
||||||
longDateFormat={longDateFormat}
|
longDateFormat={longDateFormat}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import formatBytes from 'Utilities/Number/formatBytes';
|
|||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import selectAll from 'Utilities/Table/selectAll';
|
import selectAll from 'Utilities/Table/selectAll';
|
||||||
import toggleSelected from 'Utilities/Table/toggleSelected';
|
import toggleSelected from 'Utilities/Table/toggleSelected';
|
||||||
import MovieCollectionLabelConnector from './../MovieCollectionLabelConnector';
|
import MovieCollectionConnector from './../MovieCollectionConnector';
|
||||||
import MovieCastPostersConnector from './Credits/Cast/MovieCastPostersConnector';
|
import MovieCastPostersConnector from './Credits/Cast/MovieCastPostersConnector';
|
||||||
import MovieCrewPostersConnector from './Credits/Crew/MovieCrewPostersConnector';
|
import MovieCrewPostersConnector from './Credits/Crew/MovieCrewPostersConnector';
|
||||||
import MovieDetailsLinks from './MovieDetailsLinks';
|
import MovieDetailsLinks from './MovieDetailsLinks';
|
||||||
@@ -583,8 +583,10 @@ class MovieDetails extends Component {
|
|||||||
size={sizes.LARGE}
|
size={sizes.LARGE}
|
||||||
>
|
>
|
||||||
<div className={styles.collection}>
|
<div className={styles.collection}>
|
||||||
<MovieCollectionLabelConnector
|
<MovieCollectionConnector
|
||||||
tmdbId={collection.tmdbId}
|
tmdbId={collection.tmdbId}
|
||||||
|
name={collection.name}
|
||||||
|
movieId={id}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</InfoLabel>
|
</InfoLabel>
|
||||||
|
|||||||
@@ -102,21 +102,12 @@ function MovieIndexSortMenu(props) {
|
|||||||
</SortMenuItem>
|
</SortMenuItem>
|
||||||
|
|
||||||
<SortMenuItem
|
<SortMenuItem
|
||||||
name="imdbRating"
|
name="ratings"
|
||||||
sortKey={sortKey}
|
sortKey={sortKey}
|
||||||
sortDirection={sortDirection}
|
sortDirection={sortDirection}
|
||||||
onPress={onSortSelect}
|
onPress={onSortSelect}
|
||||||
>
|
>
|
||||||
{translate('ImdbRating')}
|
{translate('Ratings')}
|
||||||
</SortMenuItem>
|
|
||||||
|
|
||||||
<SortMenuItem
|
|
||||||
name="tmdbRating"
|
|
||||||
sortKey={sortKey}
|
|
||||||
sortDirection={sortDirection}
|
|
||||||
onPress={onSortSelect}
|
|
||||||
>
|
|
||||||
{translate('TmdbRating')}
|
|
||||||
</SortMenuItem>
|
</SortMenuItem>
|
||||||
|
|
||||||
<SortMenuItem
|
<SortMenuItem
|
||||||
|
|||||||
@@ -7,15 +7,6 @@
|
|||||||
transition: width 200ms ease;
|
transition: width 200ms ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.progressRadius {
|
|
||||||
composes: container from '~Components/ProgressBar.css';
|
|
||||||
|
|
||||||
border-radius: 0 0 5px 5px;
|
|
||||||
background-color: #5b5b5b;
|
|
||||||
color: $white;
|
|
||||||
transition: width 200ms ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.progressBar {
|
.progressBar {
|
||||||
composes: progressBar from '~Components/ProgressBar.css';
|
composes: progressBar from '~Components/ProgressBar.css';
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ function MovieIndexProgressBar(props) {
|
|||||||
isAvailable,
|
isAvailable,
|
||||||
posterWidth,
|
posterWidth,
|
||||||
detailedProgressBar,
|
detailedProgressBar,
|
||||||
bottomRadius,
|
|
||||||
queueStatus,
|
queueStatus,
|
||||||
queueState
|
queueState
|
||||||
} = props;
|
} = props;
|
||||||
@@ -41,7 +40,7 @@ function MovieIndexProgressBar(props) {
|
|||||||
return (
|
return (
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
className={styles.progressBar}
|
className={styles.progressBar}
|
||||||
containerClassName={bottomRadius ? styles.progressRadius : styles.progress}
|
containerClassName={styles.progress}
|
||||||
progress={progress}
|
progress={progress}
|
||||||
kind={getStatusStyle(status, monitored, hasFile, isAvailable, 'kinds', queueStatusText)}
|
kind={getStatusStyle(status, monitored, hasFile, isAvailable, 'kinds', queueStatusText)}
|
||||||
size={detailedProgressBar ? sizes.MEDIUM : sizes.SMALL}
|
size={detailedProgressBar ? sizes.MEDIUM : sizes.SMALL}
|
||||||
@@ -55,7 +54,6 @@ function MovieIndexProgressBar(props) {
|
|||||||
MovieIndexProgressBar.propTypes = {
|
MovieIndexProgressBar.propTypes = {
|
||||||
monitored: PropTypes.bool.isRequired,
|
monitored: PropTypes.bool.isRequired,
|
||||||
hasFile: PropTypes.bool.isRequired,
|
hasFile: PropTypes.bool.isRequired,
|
||||||
bottomRadius: PropTypes.bool,
|
|
||||||
isAvailable: PropTypes.bool.isRequired,
|
isAvailable: PropTypes.bool.isRequired,
|
||||||
status: PropTypes.string.isRequired,
|
status: PropTypes.string.isRequired,
|
||||||
posterWidth: PropTypes.number.isRequired,
|
posterWidth: PropTypes.number.isRequired,
|
||||||
@@ -64,8 +62,4 @@ MovieIndexProgressBar.propTypes = {
|
|||||||
queueState: PropTypes.string
|
queueState: PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
MovieIndexProgressBar.defaultProps = {
|
|
||||||
bottomRadius: false
|
|
||||||
};
|
|
||||||
|
|
||||||
export default MovieIndexProgressBar;
|
export default MovieIndexProgressBar;
|
||||||
|
|||||||
@@ -77,9 +77,7 @@
|
|||||||
flex: 0 0 120px;
|
flex: 0 0 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.imdbRating,
|
.ratings {
|
||||||
.tmdbRating,
|
|
||||||
.rottenTomatoesRating {
|
|
||||||
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';
|
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';
|
||||||
|
|
||||||
flex: 0 0 80px;
|
flex: 0 0 80px;
|
||||||
|
|||||||
@@ -84,9 +84,7 @@
|
|||||||
flex: 0 0 120px;
|
flex: 0 0 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.imdbRating,
|
.ratings {
|
||||||
.tmdbRating,
|
|
||||||
.rottenTomatoesRating {
|
|
||||||
composes: cell;
|
composes: cell;
|
||||||
|
|
||||||
flex: 0 0 80px;
|
flex: 0 0 80px;
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
import HeartRating from 'Components/HeartRating';
|
||||||
import Icon from 'Components/Icon';
|
import Icon from 'Components/Icon';
|
||||||
import ImdbRating from 'Components/ImdbRating';
|
|
||||||
import IconButton from 'Components/Link/IconButton';
|
import IconButton from 'Components/Link/IconButton';
|
||||||
import SpinnerIconButton from 'Components/Link/SpinnerIconButton';
|
import SpinnerIconButton from 'Components/Link/SpinnerIconButton';
|
||||||
import RottenTomatoRating from 'Components/RottenTomatoRating';
|
|
||||||
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
|
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
|
||||||
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
|
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
|
||||||
import VirtualTableSelectCell from 'Components/Table/Cells/VirtualTableSelectCell';
|
import VirtualTableSelectCell from 'Components/Table/Cells/VirtualTableSelectCell';
|
||||||
import TagListConnector from 'Components/TagListConnector';
|
import TagListConnector from 'Components/TagListConnector';
|
||||||
import TmdbRating from 'Components/TmdbRating';
|
|
||||||
import Tooltip from 'Components/Tooltip/Tooltip';
|
import Tooltip from 'Components/Tooltip/Tooltip';
|
||||||
import { icons, kinds } from 'Helpers/Props';
|
import { icons, kinds } from 'Helpers/Props';
|
||||||
import DeleteMovieModal from 'Movie/Delete/DeleteMovieModal';
|
import DeleteMovieModal from 'Movie/Delete/DeleteMovieModal';
|
||||||
@@ -172,7 +170,7 @@ class MovieIndexRow extends Component {
|
|||||||
key={name}
|
key={name}
|
||||||
className={styles[name]}
|
className={styles[name]}
|
||||||
>
|
>
|
||||||
{collection ? collection.title : null }
|
{collection ? collection.name : null }
|
||||||
</VirtualTableRowCell>
|
</VirtualTableRowCell>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -351,39 +349,13 @@ class MovieIndexRow extends Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name === 'tmdbRating') {
|
if (name === 'ratings') {
|
||||||
return (
|
return (
|
||||||
<VirtualTableRowCell
|
<VirtualTableRowCell
|
||||||
key={name}
|
key={name}
|
||||||
className={styles[name]}
|
className={styles[name]}
|
||||||
>
|
>
|
||||||
<TmdbRating
|
<HeartRating
|
||||||
ratings={ratings}
|
|
||||||
/>
|
|
||||||
</VirtualTableRowCell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name === 'rottenTomatoesRating') {
|
|
||||||
return (
|
|
||||||
<VirtualTableRowCell
|
|
||||||
key={name}
|
|
||||||
className={styles[name]}
|
|
||||||
>
|
|
||||||
<RottenTomatoRating
|
|
||||||
ratings={ratings}
|
|
||||||
/>
|
|
||||||
</VirtualTableRowCell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name === 'imdbRating') {
|
|
||||||
return (
|
|
||||||
<VirtualTableRowCell
|
|
||||||
key={name}
|
|
||||||
className={styles[name]}
|
|
||||||
>
|
|
||||||
<ImdbRating
|
|
||||||
ratings={ratings}
|
ratings={ratings}
|
||||||
/>
|
/>
|
||||||
</VirtualTableRowCell>
|
</VirtualTableRowCell>
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ class MovieIndexTable extends Component {
|
|||||||
component={MovieIndexRow}
|
component={MovieIndexRow}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
movieId={movie.id}
|
movieId={movie.id}
|
||||||
collectionId={movie.collectionId}
|
|
||||||
qualityProfileId={movie.qualityProfileId}
|
qualityProfileId={movie.qualityProfileId}
|
||||||
isSelected={selectedState[movie.id]}
|
isSelected={selectedState[movie.id]}
|
||||||
onSelectedChange={onSelectedChange}
|
onSelectedChange={onSelectedChange}
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import React, { Component } from 'react';
|
||||||
|
import MonitorToggleButton from 'Components/MonitorToggleButton';
|
||||||
|
import EditImportListModalConnector from 'Settings/ImportLists/ImportLists/EditImportListModalConnector';
|
||||||
|
import styles from './MovieCollection.css';
|
||||||
|
|
||||||
|
class MovieCollection extends Component {
|
||||||
|
|
||||||
|
//
|
||||||
|
// Lifecycle
|
||||||
|
|
||||||
|
constructor(props, context) {
|
||||||
|
super(props, context);
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
hasPosterError: false,
|
||||||
|
isEditImportListModalOpen: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
onAddImportListPress = (monitored) => {
|
||||||
|
if (this.props.collectionList) {
|
||||||
|
this.props.onMonitorTogglePress(monitored);
|
||||||
|
} else {
|
||||||
|
this.props.onMonitorTogglePress(monitored);
|
||||||
|
this.setState({ isEditImportListModalOpen: true });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onEditImportListModalClose = () => {
|
||||||
|
this.setState({ isEditImportListModalOpen: false });
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const {
|
||||||
|
name,
|
||||||
|
collectionList,
|
||||||
|
isSaving
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
const monitored = collectionList !== undefined && collectionList.enabled && collectionList.enableAuto;
|
||||||
|
const importListId = collectionList ? collectionList.id : 0;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<MonitorToggleButton
|
||||||
|
className={styles.monitorToggleButton}
|
||||||
|
monitored={monitored}
|
||||||
|
isSaving={isSaving}
|
||||||
|
size={15}
|
||||||
|
onPress={this.onAddImportListPress}
|
||||||
|
/>
|
||||||
|
{name}
|
||||||
|
<EditImportListModalConnector
|
||||||
|
id={importListId}
|
||||||
|
isOpen={this.state.isEditImportListModalOpen}
|
||||||
|
onModalClose={this.onEditImportListModalClose}
|
||||||
|
onDeleteImportListPress={this.onDeleteImportListPress}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MovieCollection.propTypes = {
|
||||||
|
tmdbId: PropTypes.number.isRequired,
|
||||||
|
name: PropTypes.string.isRequired,
|
||||||
|
collectionList: PropTypes.object,
|
||||||
|
isSaving: PropTypes.bool.isRequired,
|
||||||
|
onMonitorTogglePress: PropTypes.func.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MovieCollection;
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import React, { Component } from 'react';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { createSelector } from 'reselect';
|
||||||
|
import { saveImportList, selectImportListSchema, setImportListFieldValue, setImportListValue } from 'Store/Actions/settingsActions';
|
||||||
|
import createMovieCollectionListSelector from 'Store/Selectors/createMovieCollectionListSelector';
|
||||||
|
import createMovieSelector from 'Store/Selectors/createMovieSelector';
|
||||||
|
import MovieCollection from './MovieCollection';
|
||||||
|
|
||||||
|
function createMapStateToProps() {
|
||||||
|
return createSelector(
|
||||||
|
createMovieSelector(),
|
||||||
|
createMovieCollectionListSelector(),
|
||||||
|
(state) => state.settings.importLists,
|
||||||
|
(movie, collectionList, importLists) => {
|
||||||
|
const {
|
||||||
|
monitored,
|
||||||
|
qualityProfileId,
|
||||||
|
minimumAvailability
|
||||||
|
} = movie;
|
||||||
|
|
||||||
|
return {
|
||||||
|
collectionList,
|
||||||
|
monitored,
|
||||||
|
qualityProfileId,
|
||||||
|
minimumAvailability,
|
||||||
|
isSaving: importLists.isSaving
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapDispatchToProps = {
|
||||||
|
selectImportListSchema,
|
||||||
|
setImportListFieldValue,
|
||||||
|
setImportListValue,
|
||||||
|
saveImportList
|
||||||
|
};
|
||||||
|
|
||||||
|
class MovieCollectionConnector extends Component {
|
||||||
|
|
||||||
|
//
|
||||||
|
// Listeners
|
||||||
|
|
||||||
|
onMonitorTogglePress = (monitored) => {
|
||||||
|
if (this.props.collectionList) {
|
||||||
|
this.props.setImportListValue({ name: 'enabled', value: monitored });
|
||||||
|
this.props.setImportListValue({ name: 'enableAuto', value: monitored });
|
||||||
|
this.props.saveImportList({ id: this.props.collectionList.id });
|
||||||
|
} else {
|
||||||
|
this.props.selectImportListSchema({ implementation: 'TMDbCollectionImport', presetName: undefined });
|
||||||
|
this.props.setImportListFieldValue({ name: 'collectionId', value: this.props.tmdbId.toString() });
|
||||||
|
this.props.setImportListValue({ name: 'enabled', value: true });
|
||||||
|
this.props.setImportListValue({ name: 'enableAuto', value: true });
|
||||||
|
this.props.setImportListValue({ name: 'name', value: `${this.props.name} - ${this.props.tmdbId}` });
|
||||||
|
this.props.setImportListValue({ name: 'qualityProfileId', value: this.props.qualityProfileId });
|
||||||
|
this.props.setImportListValue({ name: 'monitored', value: this.props.monitored });
|
||||||
|
this.props.setImportListValue({ name: 'minimumAvailability', value: this.props.minimumAvailability });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// Render
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<MovieCollection
|
||||||
|
{...this.props}
|
||||||
|
onMonitorTogglePress={this.onMonitorTogglePress}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MovieCollectionConnector.propTypes = {
|
||||||
|
tmdbId: PropTypes.number.isRequired,
|
||||||
|
movieId: PropTypes.number.isRequired,
|
||||||
|
name: PropTypes.string.isRequired,
|
||||||
|
collectionList: PropTypes.object,
|
||||||
|
monitored: PropTypes.bool.isRequired,
|
||||||
|
qualityProfileId: PropTypes.number.isRequired,
|
||||||
|
minimumAvailability: PropTypes.string.isRequired,
|
||||||
|
isSaving: PropTypes.bool.isRequired,
|
||||||
|
selectImportListSchema: PropTypes.func.isRequired,
|
||||||
|
setImportListFieldValue: PropTypes.func.isRequired,
|
||||||
|
setImportListValue: PropTypes.func.isRequired,
|
||||||
|
saveImportList: PropTypes.func.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(createMapStateToProps, mapDispatchToProps)(MovieCollectionConnector);
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import MonitorToggleButton from 'Components/MonitorToggleButton';
|
|
||||||
import styles from './MovieCollectionLabel.css';
|
|
||||||
|
|
||||||
class MovieCollectionLabel extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
constructor(props, context) {
|
|
||||||
super(props, context);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
hasPosterError: false
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
title,
|
|
||||||
monitored,
|
|
||||||
onMonitorTogglePress
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<MonitorToggleButton
|
|
||||||
className={styles.monitorToggleButton}
|
|
||||||
monitored={monitored}
|
|
||||||
size={15}
|
|
||||||
onPress={onMonitorTogglePress}
|
|
||||||
/>
|
|
||||||
{title}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MovieCollectionLabel.propTypes = {
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
monitored: PropTypes.bool.isRequired,
|
|
||||||
onMonitorTogglePress: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default MovieCollectionLabel;
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import { toggleCollectionMonitored } from 'Store/Actions/movieCollectionActions';
|
|
||||||
import MovieCollectionLabel from './MovieCollectionLabel';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
(state, { tmdbId }) => tmdbId,
|
|
||||||
(state) => state.movieCollections.items,
|
|
||||||
(tmdbId, collections) => {
|
|
||||||
const collection = collections.find((movie) => movie.tmdbId === tmdbId);
|
|
||||||
return {
|
|
||||||
...collection
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
toggleCollectionMonitored
|
|
||||||
};
|
|
||||||
|
|
||||||
class MovieCollectionLabelConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onMonitorTogglePress = (monitored) => {
|
|
||||||
this.props.toggleCollectionMonitored({
|
|
||||||
collectionId: this.props.id,
|
|
||||||
monitored
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<MovieCollectionLabel
|
|
||||||
{...this.props}
|
|
||||||
onMonitorTogglePress={this.onMonitorTogglePress}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MovieCollectionLabelConnector.propTypes = {
|
|
||||||
tmdbId: PropTypes.number.isRequired,
|
|
||||||
id: PropTypes.number.isRequired,
|
|
||||||
monitored: PropTypes.bool.isRequired,
|
|
||||||
toggleCollectionMonitored: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(MovieCollectionLabelConnector);
|
|
||||||
@@ -65,10 +65,10 @@ function DownloadClientOptions(props) {
|
|||||||
<FormInputGroup
|
<FormInputGroup
|
||||||
type={inputTypes.NUMBER}
|
type={inputTypes.NUMBER}
|
||||||
name="checkForFinishedDownloadInterval"
|
name="checkForFinishedDownloadInterval"
|
||||||
min={1}
|
min={0}
|
||||||
max={120}
|
max={120}
|
||||||
unit="minutes"
|
unit="minutes"
|
||||||
helpText={translate('RefreshMonitoredIntervalHelpText')}
|
helpText={translate('HelpText')}
|
||||||
onChange={onInputChange}
|
onChange={onInputChange}
|
||||||
{...settings.checkForFinishedDownloadInterval}
|
{...settings.checkForFinishedDownloadInterval}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ function HostSettings(props) {
|
|||||||
bindAddress,
|
bindAddress,
|
||||||
port,
|
port,
|
||||||
urlBase,
|
urlBase,
|
||||||
instanceName,
|
|
||||||
enableSsl,
|
enableSsl,
|
||||||
sslPort,
|
sslPort,
|
||||||
sslCertPath,
|
sslCertPath,
|
||||||
@@ -74,22 +73,6 @@ function HostSettings(props) {
|
|||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
<FormGroup
|
|
||||||
advancedSettings={advancedSettings}
|
|
||||||
isAdvanced={true}
|
|
||||||
>
|
|
||||||
<FormLabel>{translate('InstanceName')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.TEXT}
|
|
||||||
name="instanceName"
|
|
||||||
helpText={translate('InstanceNameHelpText')}
|
|
||||||
helpTextWarning={translate('RestartRequiredHelpTextWarning')}
|
|
||||||
onChange={onInputChange}
|
|
||||||
{...instanceName}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup
|
<FormGroup
|
||||||
advancedSettings={advancedSettings}
|
advancedSettings={advancedSettings}
|
||||||
isAdvanced={true}
|
isAdvanced={true}
|
||||||
|
|||||||
@@ -15,13 +15,12 @@
|
|||||||
|
|
||||||
.tmdbId,
|
.tmdbId,
|
||||||
.movieYear {
|
.movieYear {
|
||||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
flex: 0 0 70px;
|
||||||
|
|
||||||
width: 80px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.actions {
|
.actions {
|
||||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
width: 70px;
|
flex: 1 0 auto;
|
||||||
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
|
import classNames from 'classnames';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import Icon from 'Components/Icon';
|
import Icon from 'Components/Icon';
|
||||||
import Link from 'Components/Link/Link';
|
import Link from 'Components/Link/Link';
|
||||||
import ConfirmModal from 'Components/Modal/ConfirmModal';
|
import ConfirmModal from 'Components/Modal/ConfirmModal';
|
||||||
import TableRowCell from 'Components/Table/Cells/TableRowCell';
|
|
||||||
import TableSelectCell from 'Components/Table/Cells/TableSelectCell';
|
|
||||||
import TableRow from 'Components/Table/TableRow';
|
|
||||||
import { icons, kinds } from 'Helpers/Props';
|
import { icons, kinds } from 'Helpers/Props';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import EditImportListExclusionModalConnector from './EditImportListExclusionModalConnector';
|
import EditImportListExclusionModalConnector from './EditImportListExclusionModalConnector';
|
||||||
import styles from './ImportListExclusion.css';
|
import styles from './ImportListExclusion.css';
|
||||||
import IconButton from 'Components/Link/IconButton';
|
|
||||||
|
|
||||||
class ImportListExclusion extends Component {
|
class ImportListExclusion extends Component {
|
||||||
|
|
||||||
@@ -58,82 +55,28 @@ class ImportListExclusion extends Component {
|
|||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
id,
|
id,
|
||||||
isSelected,
|
|
||||||
onSelectedChange,
|
|
||||||
columns,
|
|
||||||
movieTitle,
|
movieTitle,
|
||||||
tmdbId,
|
tmdbId,
|
||||||
movieYear
|
movieYear
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableRow>
|
<div
|
||||||
<TableSelectCell
|
className={classNames(
|
||||||
id={id}
|
styles.importExclusion
|
||||||
isSelected={isSelected}
|
)}
|
||||||
onSelectedChange={onSelectedChange}
|
>
|
||||||
/>
|
<div className={styles.tmdbId}>{tmdbId}</div>
|
||||||
|
<div className={styles.movieTitle}>{movieTitle}</div>
|
||||||
|
<div className={styles.movieYear}>{movieYear}</div>
|
||||||
|
|
||||||
{
|
<div className={styles.actions}>
|
||||||
columns.map((column) => {
|
<Link
|
||||||
const {
|
onPress={this.onEditImportExclusionPress}
|
||||||
name,
|
>
|
||||||
isVisible
|
<Icon name={icons.EDIT} />
|
||||||
} = column;
|
</Link>
|
||||||
|
</div>
|
||||||
if (!isVisible) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name === 'tmdbId') {
|
|
||||||
return (
|
|
||||||
<TableRowCell key={name}>
|
|
||||||
{tmdbId}
|
|
||||||
</TableRowCell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name === 'movieTitle') {
|
|
||||||
return (
|
|
||||||
<TableRowCell key={name}>
|
|
||||||
{movieTitle}
|
|
||||||
</TableRowCell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name === 'movieYear') {
|
|
||||||
return (
|
|
||||||
<TableRowCell key={name}>
|
|
||||||
{movieYear}
|
|
||||||
</TableRowCell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name === 'actions') {
|
|
||||||
return (
|
|
||||||
<TableRowCell
|
|
||||||
key={name}
|
|
||||||
className={styles.actions}
|
|
||||||
>
|
|
||||||
<IconButton
|
|
||||||
title={translate('RemoveFromBlocklist')}
|
|
||||||
name={icons.EDIT}
|
|
||||||
onPress={this.onEditImportExclusionPress}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<IconButton
|
|
||||||
title={translate('RemoveFromBlocklist')}
|
|
||||||
name={icons.REMOVE}
|
|
||||||
kind={kinds.DANGER}
|
|
||||||
onPress={this.onDeleteImportExclusionPress}
|
|
||||||
/>
|
|
||||||
</TableRowCell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
<EditImportListExclusionModalConnector
|
<EditImportListExclusionModalConnector
|
||||||
id={id}
|
id={id}
|
||||||
@@ -151,7 +94,7 @@ class ImportListExclusion extends Component {
|
|||||||
onConfirm={this.onConfirmDeleteImportExclusion}
|
onConfirm={this.onConfirmDeleteImportExclusion}
|
||||||
onCancel={this.onDeleteImportExclusionModalClose}
|
onCancel={this.onDeleteImportExclusionModalClose}
|
||||||
/>
|
/>
|
||||||
</TableRow>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -161,9 +104,6 @@ ImportListExclusion.propTypes = {
|
|||||||
movieTitle: PropTypes.string.isRequired,
|
movieTitle: PropTypes.string.isRequired,
|
||||||
tmdbId: PropTypes.number.isRequired,
|
tmdbId: PropTypes.number.isRequired,
|
||||||
movieYear: PropTypes.number.isRequired,
|
movieYear: PropTypes.number.isRequired,
|
||||||
isSelected: PropTypes.bool.isRequired,
|
|
||||||
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
onSelectedChange: PropTypes.func.isRequired,
|
|
||||||
onConfirmDeleteImportExclusion: PropTypes.func.isRequired
|
onConfirmDeleteImportExclusion: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,8 @@ import FieldSet from 'Components/FieldSet';
|
|||||||
import Icon from 'Components/Icon';
|
import Icon from 'Components/Icon';
|
||||||
import Link from 'Components/Link/Link';
|
import Link from 'Components/Link/Link';
|
||||||
import PageSectionContent from 'Components/Page/PageSectionContent';
|
import PageSectionContent from 'Components/Page/PageSectionContent';
|
||||||
import Table from 'Components/Table/Table';
|
|
||||||
import TableBody from 'Components/Table/TableBody';
|
|
||||||
import { icons } from 'Helpers/Props';
|
import { icons } from 'Helpers/Props';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
import selectAll from 'Utilities/Table/selectAll';
|
|
||||||
import toggleSelected from 'Utilities/Table/toggleSelected';
|
|
||||||
import EditImportListExclusionModalConnector from './EditImportListExclusionModalConnector';
|
import EditImportListExclusionModalConnector from './EditImportListExclusionModalConnector';
|
||||||
import ImportListExclusion from './ImportListExclusion';
|
import ImportListExclusion from './ImportListExclusion';
|
||||||
import styles from './ImportListExclusions.css';
|
import styles from './ImportListExclusions.css';
|
||||||
@@ -23,10 +19,6 @@ class ImportListExclusions extends Component {
|
|||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
allSelected: false,
|
|
||||||
allUnselected: false,
|
|
||||||
lastToggled: null,
|
|
||||||
selectedState: {},
|
|
||||||
isAddImportExclusionModalOpen: false
|
isAddImportExclusionModalOpen: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -34,16 +26,6 @@ class ImportListExclusions extends Component {
|
|||||||
//
|
//
|
||||||
// Listeners
|
// Listeners
|
||||||
|
|
||||||
onSelectAllChange = ({ value }) => {
|
|
||||||
this.setState(selectAll(this.state.selectedState, value));
|
|
||||||
};
|
|
||||||
|
|
||||||
onSelectedChange = ({ id, value, shiftKey = false }) => {
|
|
||||||
this.setState((state) => {
|
|
||||||
return toggleSelected(state, this.props.items, id, value, shiftKey);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
onAddImportExclusionPress = () => {
|
onAddImportExclusionPress = () => {
|
||||||
this.setState({ isAddImportExclusionModalOpen: true });
|
this.setState({ isAddImportExclusionModalOpen: true });
|
||||||
};
|
};
|
||||||
@@ -59,50 +41,41 @@ class ImportListExclusions extends Component {
|
|||||||
const {
|
const {
|
||||||
items,
|
items,
|
||||||
onConfirmDeleteImportExclusion,
|
onConfirmDeleteImportExclusion,
|
||||||
columns,
|
|
||||||
...otherProps
|
...otherProps
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const {
|
|
||||||
allSelected,
|
|
||||||
allUnselected,
|
|
||||||
selectedState
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FieldSet legend={translate('ListExclusions')}>
|
<FieldSet legend={translate('ListExclusions')}>
|
||||||
<PageSectionContent
|
<PageSectionContent
|
||||||
errorMessage={translate('UnableToLoadListExclusions')}
|
errorMessage={translate('UnableToLoadListExclusions')}
|
||||||
{...otherProps}
|
{...otherProps}
|
||||||
>
|
>
|
||||||
|
<div className={styles.importListExclusionsHeader}>
|
||||||
|
<div className={styles.tmdbId}>
|
||||||
|
TMDb Id
|
||||||
|
</div>
|
||||||
|
<div className={styles.title}>
|
||||||
|
{translate('Title')}
|
||||||
|
</div>
|
||||||
|
<div className={styles.movieYear}>
|
||||||
|
{translate('Year')}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Table
|
{
|
||||||
selectAll={true}
|
items.map((item, index) => {
|
||||||
allSelected={allSelected}
|
return (
|
||||||
allUnselected={allUnselected}
|
<ImportListExclusion
|
||||||
columns={columns}
|
key={item.id}
|
||||||
{...otherProps}
|
{...item}
|
||||||
onSelectAllChange={this.onSelectAllChange}
|
{...otherProps}
|
||||||
>
|
index={index}
|
||||||
<TableBody>
|
onConfirmDeleteImportExclusion={onConfirmDeleteImportExclusion}
|
||||||
{
|
/>
|
||||||
items.map((item, index) => {
|
);
|
||||||
return (
|
})
|
||||||
<ImportListExclusion
|
}
|
||||||
key={item.id}
|
|
||||||
isSelected={selectedState[item.id] || false}
|
|
||||||
{...item}
|
|
||||||
{...otherProps}
|
|
||||||
columns={columns}
|
|
||||||
index={index}
|
|
||||||
onSelectedChange={this.onSelectedChange}
|
|
||||||
onConfirmDeleteImportExclusion={onConfirmDeleteImportExclusion}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</TableBody>
|
|
||||||
</Table>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.addImportExclusion}>
|
<div className={styles.addImportExclusion}>
|
||||||
@@ -128,7 +101,6 @@ class ImportListExclusions extends Component {
|
|||||||
ImportListExclusions.propTypes = {
|
ImportListExclusions.propTypes = {
|
||||||
isFetching: PropTypes.bool.isRequired,
|
isFetching: PropTypes.bool.isRequired,
|
||||||
error: PropTypes.object,
|
error: PropTypes.object,
|
||||||
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
onConfirmDeleteImportExclusion: PropTypes.func.isRequired
|
onConfirmDeleteImportExclusion: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ function EditImportListModalContent(props) {
|
|||||||
name,
|
name,
|
||||||
enabled,
|
enabled,
|
||||||
enableAuto,
|
enableAuto,
|
||||||
monitor,
|
shouldMonitor,
|
||||||
minimumAvailability,
|
minimumAvailability,
|
||||||
qualityProfileId,
|
qualityProfileId,
|
||||||
rootFolderPath,
|
rootFolderPath,
|
||||||
@@ -121,29 +121,32 @@ function EditImportListModalContent(props) {
|
|||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<FormLabel>{translate('Monitor')}</FormLabel>
|
<FormLabel>{translate('AddMoviesMonitored')}</FormLabel>
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.MOVIE_MONITORED_SELECT}
|
|
||||||
name="monitor"
|
|
||||||
helpText={translate('ShouldMonitorHelpText')}
|
|
||||||
{...monitor}
|
|
||||||
onChange={onInputChange}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('SearchOnAdd')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
<FormInputGroup
|
||||||
type={inputTypes.CHECK}
|
type={inputTypes.CHECK}
|
||||||
name="searchOnAdd"
|
name="shouldMonitor"
|
||||||
helpText={translate('SearchOnAddHelpText')}
|
helpText={translate('ShouldMonitorHelpText')}
|
||||||
{...searchOnAdd}
|
{...shouldMonitor}
|
||||||
onChange={onInputChange}
|
onChange={onInputChange}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
|
{
|
||||||
|
shouldMonitor &&
|
||||||
|
<FormGroup>
|
||||||
|
<FormLabel>{translate('SearchOnAdd')}</FormLabel>
|
||||||
|
|
||||||
|
<FormInputGroup
|
||||||
|
type={inputTypes.CHECK}
|
||||||
|
name="searchOnAdd"
|
||||||
|
helpText={translate('SearchOnAddHelpText')}
|
||||||
|
{...searchOnAdd}
|
||||||
|
onChange={onInputChange}
|
||||||
|
/>
|
||||||
|
</FormGroup>
|
||||||
|
}
|
||||||
|
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<FormLabel>{translate('MinimumAvailability')}</FormLabel>
|
<FormLabel>{translate('MinimumAvailability')}</FormLabel>
|
||||||
<FormInputGroup
|
<FormInputGroup
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ function IndexerOptions(props) {
|
|||||||
min={0}
|
min={0}
|
||||||
max={120}
|
max={120}
|
||||||
unit="minutes"
|
unit="minutes"
|
||||||
helpText={translate('RssSyncHelpText')}
|
helpText={translate('HelpText')}
|
||||||
helpTextWarning={translate('RSSSyncIntervalHelpTextWarning')}
|
helpTextWarning={translate('RSSSyncIntervalHelpTextWarning')}
|
||||||
helpLink="https://wiki.servarr.com/radarr/faq#how-does-radarr-work"
|
helpLink="https://wiki.servarr.com/radarr/faq#how-does-radarr-work"
|
||||||
onChange={onInputChange}
|
onChange={onInputChange}
|
||||||
|
|||||||
@@ -116,11 +116,10 @@ class NamingModal extends Component {
|
|||||||
|
|
||||||
const movieTokens = [
|
const movieTokens = [
|
||||||
{ token: '{Movie Title}', example: 'Movie\'s Title' },
|
{ token: '{Movie Title}', example: 'Movie\'s Title' },
|
||||||
{ token: '{Movie Title:DE}', example: 'Titel des Films' },
|
{ token: '{Movie Title:DE}', example: 'Filetitle' },
|
||||||
{ token: '{Movie CleanTitle}', example: 'Movies Title' },
|
{ token: '{Movie CleanTitle}', example: 'Movies Title' },
|
||||||
{ token: '{Movie TitleThe}', example: 'Movie\'s Title, The' },
|
{ token: '{Movie TitleThe}', example: 'Movie\'s Title, The' },
|
||||||
{ token: '{Movie OriginalTitle}', example: 'Τίτλος ταινίας' },
|
{ token: '{Movie OriginalTitle}', example: 'Τίτλος ταινίας' },
|
||||||
{ token: '{Movie CleanOriginalTitle}', example: 'Τίτλος ταινίας' },
|
|
||||||
{ token: '{Movie TitleFirstCharacter}', example: 'M' },
|
{ token: '{Movie TitleFirstCharacter}', example: 'M' },
|
||||||
{ token: '{Movie Collection}', example: 'The Movie Collection' },
|
{ token: '{Movie Collection}', example: 'The Movie Collection' },
|
||||||
{ token: '{Movie Certification}', example: 'R' },
|
{ token: '{Movie Certification}', example: 'R' },
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ class Notification extends Component {
|
|||||||
onDownload,
|
onDownload,
|
||||||
onUpgrade,
|
onUpgrade,
|
||||||
onRename,
|
onRename,
|
||||||
onMovieAdded,
|
|
||||||
onMovieDelete,
|
onMovieDelete,
|
||||||
onMovieFileDelete,
|
onMovieFileDelete,
|
||||||
onMovieFileDeleteForUpgrade,
|
onMovieFileDeleteForUpgrade,
|
||||||
@@ -69,7 +68,6 @@ class Notification extends Component {
|
|||||||
supportsOnDownload,
|
supportsOnDownload,
|
||||||
supportsOnUpgrade,
|
supportsOnUpgrade,
|
||||||
supportsOnRename,
|
supportsOnRename,
|
||||||
supportsOnMovieAdded,
|
|
||||||
supportsOnMovieDelete,
|
supportsOnMovieDelete,
|
||||||
supportsOnMovieFileDelete,
|
supportsOnMovieFileDelete,
|
||||||
supportsOnMovieFileDeleteForUpgrade,
|
supportsOnMovieFileDeleteForUpgrade,
|
||||||
@@ -119,14 +117,6 @@ class Notification extends Component {
|
|||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
supportsOnMovieAdded && onMovieAdded ?
|
|
||||||
<Label kind={kinds.SUCCESS}>
|
|
||||||
{translate('OnMovieAdded')}
|
|
||||||
</Label> :
|
|
||||||
null
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
supportsOnHealthIssue && onHealthIssue ?
|
supportsOnHealthIssue && onHealthIssue ?
|
||||||
<Label kind={kinds.SUCCESS}>
|
<Label kind={kinds.SUCCESS}>
|
||||||
@@ -206,7 +196,6 @@ Notification.propTypes = {
|
|||||||
onDownload: PropTypes.bool.isRequired,
|
onDownload: PropTypes.bool.isRequired,
|
||||||
onUpgrade: PropTypes.bool.isRequired,
|
onUpgrade: PropTypes.bool.isRequired,
|
||||||
onRename: PropTypes.bool.isRequired,
|
onRename: PropTypes.bool.isRequired,
|
||||||
onMovieAdded: PropTypes.bool.isRequired,
|
|
||||||
onMovieDelete: PropTypes.bool.isRequired,
|
onMovieDelete: PropTypes.bool.isRequired,
|
||||||
onMovieFileDelete: PropTypes.bool.isRequired,
|
onMovieFileDelete: PropTypes.bool.isRequired,
|
||||||
onMovieFileDeleteForUpgrade: PropTypes.bool.isRequired,
|
onMovieFileDeleteForUpgrade: PropTypes.bool.isRequired,
|
||||||
@@ -219,7 +208,6 @@ Notification.propTypes = {
|
|||||||
supportsOnMovieFileDeleteForUpgrade: PropTypes.bool.isRequired,
|
supportsOnMovieFileDeleteForUpgrade: PropTypes.bool.isRequired,
|
||||||
supportsOnUpgrade: PropTypes.bool.isRequired,
|
supportsOnUpgrade: PropTypes.bool.isRequired,
|
||||||
supportsOnRename: PropTypes.bool.isRequired,
|
supportsOnRename: PropTypes.bool.isRequired,
|
||||||
supportsOnMovieAdded: PropTypes.bool.isRequired,
|
|
||||||
supportsOnHealthIssue: PropTypes.bool.isRequired,
|
supportsOnHealthIssue: PropTypes.bool.isRequired,
|
||||||
supportsOnApplicationUpdate: PropTypes.bool.isRequired,
|
supportsOnApplicationUpdate: PropTypes.bool.isRequired,
|
||||||
onConfirmDeleteNotification: PropTypes.func.isRequired
|
onConfirmDeleteNotification: PropTypes.func.isRequired
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ function NotificationEventItems(props) {
|
|||||||
onDownload,
|
onDownload,
|
||||||
onUpgrade,
|
onUpgrade,
|
||||||
onRename,
|
onRename,
|
||||||
onMovieAdded,
|
|
||||||
onMovieDelete,
|
onMovieDelete,
|
||||||
onMovieFileDelete,
|
onMovieFileDelete,
|
||||||
onMovieFileDeleteForUpgrade,
|
onMovieFileDeleteForUpgrade,
|
||||||
@@ -29,7 +28,6 @@ function NotificationEventItems(props) {
|
|||||||
supportsOnDownload,
|
supportsOnDownload,
|
||||||
supportsOnUpgrade,
|
supportsOnUpgrade,
|
||||||
supportsOnRename,
|
supportsOnRename,
|
||||||
supportsOnMovieAdded,
|
|
||||||
supportsOnMovieDelete,
|
supportsOnMovieDelete,
|
||||||
supportsOnMovieFileDelete,
|
supportsOnMovieFileDelete,
|
||||||
supportsOnMovieFileDeleteForUpgrade,
|
supportsOnMovieFileDeleteForUpgrade,
|
||||||
@@ -94,17 +92,6 @@ function NotificationEventItems(props) {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.CHECK}
|
|
||||||
name="onMovieAdded"
|
|
||||||
helpText={translate('OnMovieAddedHelpText')}
|
|
||||||
isDisabled={!supportsOnMovieAdded.value}
|
|
||||||
{...onMovieAdded}
|
|
||||||
onChange={onInputChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<FormInputGroup
|
<FormInputGroup
|
||||||
type={inputTypes.CHECK}
|
type={inputTypes.CHECK}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import PropTypes from 'prop-types';
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import { fetchMovieCollections } from 'Store/Actions/movieCollectionActions';
|
|
||||||
import { cloneQualityProfile, deleteQualityProfile, fetchQualityProfiles } from 'Store/Actions/settingsActions';
|
import { cloneQualityProfile, deleteQualityProfile, fetchQualityProfiles } from 'Store/Actions/settingsActions';
|
||||||
import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
|
import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
|
||||||
import sortByName from 'Utilities/Array/sortByName';
|
import sortByName from 'Utilities/Array/sortByName';
|
||||||
@@ -18,8 +17,7 @@ function createMapStateToProps() {
|
|||||||
const mapDispatchToProps = {
|
const mapDispatchToProps = {
|
||||||
dispatchFetchQualityProfiles: fetchQualityProfiles,
|
dispatchFetchQualityProfiles: fetchQualityProfiles,
|
||||||
dispatchDeleteQualityProfile: deleteQualityProfile,
|
dispatchDeleteQualityProfile: deleteQualityProfile,
|
||||||
dispatchCloneQualityProfile: cloneQualityProfile,
|
dispatchCloneQualityProfile: cloneQualityProfile
|
||||||
dispatchFetchMovieCollections: fetchMovieCollections
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class QualityProfilesConnector extends Component {
|
class QualityProfilesConnector extends Component {
|
||||||
@@ -29,7 +27,6 @@ class QualityProfilesConnector extends Component {
|
|||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.dispatchFetchQualityProfiles();
|
this.props.dispatchFetchQualityProfiles();
|
||||||
this.props.dispatchFetchMovieCollections();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -60,8 +57,7 @@ class QualityProfilesConnector extends Component {
|
|||||||
QualityProfilesConnector.propTypes = {
|
QualityProfilesConnector.propTypes = {
|
||||||
dispatchFetchQualityProfiles: PropTypes.func.isRequired,
|
dispatchFetchQualityProfiles: PropTypes.func.isRequired,
|
||||||
dispatchDeleteQualityProfile: PropTypes.func.isRequired,
|
dispatchDeleteQualityProfile: PropTypes.func.isRequired,
|
||||||
dispatchCloneQualityProfile: PropTypes.func.isRequired,
|
dispatchCloneQualityProfile: PropTypes.func.isRequired
|
||||||
dispatchFetchMovieCollections: PropTypes.func.isRequired
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(QualityProfilesConnector);
|
export default connect(createMapStateToProps, mapDispatchToProps)(QualityProfilesConnector);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import createRemoveItemHandler from 'Store/Actions/Creators/createRemoveItemHand
|
|||||||
import createSaveProviderHandler from 'Store/Actions/Creators/createSaveProviderHandler';
|
import createSaveProviderHandler from 'Store/Actions/Creators/createSaveProviderHandler';
|
||||||
import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/createSetSettingValueReducer';
|
import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/createSetSettingValueReducer';
|
||||||
import { createThunk } from 'Store/thunks';
|
import { createThunk } from 'Store/thunks';
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Variables
|
// Variables
|
||||||
@@ -49,34 +48,7 @@ export default {
|
|||||||
items: [],
|
items: [],
|
||||||
isSaving: false,
|
isSaving: false,
|
||||||
saveError: null,
|
saveError: null,
|
||||||
pendingChanges: {},
|
pendingChanges: {}
|
||||||
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
name: 'tmdbId',
|
|
||||||
label: 'TmdbId',
|
|
||||||
isSortable: true,
|
|
||||||
isVisible: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'movieTitle',
|
|
||||||
label: translate('Title'),
|
|
||||||
isSortable: true,
|
|
||||||
isVisible: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'movieYear',
|
|
||||||
label: translate('Year'),
|
|
||||||
isSortable: true,
|
|
||||||
isVisible: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'actions',
|
|
||||||
columnLabel: translate('Actions'),
|
|
||||||
isVisible: true,
|
|
||||||
isModifiable: false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ export default {
|
|||||||
selectedSchema.onDownload = selectedSchema.supportsOnDownload;
|
selectedSchema.onDownload = selectedSchema.supportsOnDownload;
|
||||||
selectedSchema.onUpgrade = selectedSchema.supportsOnUpgrade;
|
selectedSchema.onUpgrade = selectedSchema.supportsOnUpgrade;
|
||||||
selectedSchema.onRename = selectedSchema.supportsOnRename;
|
selectedSchema.onRename = selectedSchema.supportsOnRename;
|
||||||
selectedSchema.onMovieAdded = selectedSchema.supportsOnMovieAdded;
|
|
||||||
selectedSchema.onMovieDelete = selectedSchema.supportsOnMovieDelete;
|
selectedSchema.onMovieDelete = selectedSchema.supportsOnMovieDelete;
|
||||||
selectedSchema.onMovieFileDelete = selectedSchema.supportsOnMovieFileDelete;
|
selectedSchema.onMovieFileDelete = selectedSchema.supportsOnMovieFileDelete;
|
||||||
selectedSchema.onMovieFileDeleteForUpgrade = selectedSchema.supportsOnMovieFileDeleteForUpgrade;
|
selectedSchema.onMovieFileDeleteForUpgrade = selectedSchema.supportsOnMovieFileDeleteForUpgrade;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export const defaultState = {
|
|||||||
|
|
||||||
defaults: {
|
defaults: {
|
||||||
rootFolderPath: '',
|
rootFolderPath: '',
|
||||||
monitor: 'movieOnly',
|
monitor: 'true',
|
||||||
qualityProfileId: 0,
|
qualityProfileId: 0,
|
||||||
minimumAvailability: 'announced',
|
minimumAvailability: 'announced',
|
||||||
searchForMovie: true,
|
searchForMovie: true,
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export const defaultState = {
|
|||||||
|
|
||||||
defaults: {
|
defaults: {
|
||||||
rootFolderPath: '',
|
rootFolderPath: '',
|
||||||
monitor: 'movieOnly',
|
monitor: 'true',
|
||||||
qualityProfileId: 0,
|
qualityProfileId: 0,
|
||||||
minimumAvailability: 'announced',
|
minimumAvailability: 'announced',
|
||||||
searchForMovie: true,
|
searchForMovie: true,
|
||||||
@@ -188,7 +188,7 @@ export const defaultState = {
|
|||||||
collection: function(item) {
|
collection: function(item) {
|
||||||
const { collection ={} } = item;
|
const { collection ={} } = item;
|
||||||
|
|
||||||
return collection.title;
|
return collection.name;
|
||||||
},
|
},
|
||||||
|
|
||||||
studio: function(item) {
|
studio: function(item) {
|
||||||
|
|||||||
@@ -79,11 +79,6 @@ export const defaultState = {
|
|||||||
label: translate('ReleaseGroup'),
|
label: translate('ReleaseGroup'),
|
||||||
isVisible: false
|
isVisible: false
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'sourceTitle',
|
|
||||||
label: translate('SourceTitle'),
|
|
||||||
isVisible: false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'details',
|
name: 'details',
|
||||||
columnLabel: translate('Details'),
|
columnLabel: translate('Details'),
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import * as importMovie from './importMovieActions';
|
|||||||
import * as interactiveImportActions from './interactiveImportActions';
|
import * as interactiveImportActions from './interactiveImportActions';
|
||||||
import * as movies from './movieActions';
|
import * as movies from './movieActions';
|
||||||
import * as movieBlocklist from './movieBlocklistActions';
|
import * as movieBlocklist from './movieBlocklistActions';
|
||||||
import * as movieCollections from './movieCollectionActions';
|
|
||||||
import * as movieCredits from './movieCreditsActions';
|
import * as movieCredits from './movieCreditsActions';
|
||||||
import * as movieFiles from './movieFileActions';
|
import * as movieFiles from './movieFileActions';
|
||||||
import * as movieHistory from './movieHistoryActions';
|
import * as movieHistory from './movieHistoryActions';
|
||||||
@@ -51,7 +50,6 @@ export default [
|
|||||||
rootFolders,
|
rootFolders,
|
||||||
movies,
|
movies,
|
||||||
movieBlocklist,
|
movieBlocklist,
|
||||||
movieCollections,
|
|
||||||
movieHistory,
|
movieHistory,
|
||||||
movieIndex,
|
movieIndex,
|
||||||
movieCredits,
|
movieCredits,
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export const defaultState = {
|
|||||||
sortKey: 'quality',
|
sortKey: 'quality',
|
||||||
sortDirection: sortDirections.DESCENDING,
|
sortDirection: sortDirections.DESCENDING,
|
||||||
recentFolders: [],
|
recentFolders: [],
|
||||||
importMode: 'chooseImportMode',
|
importMode: 'move',
|
||||||
sortPredicates: {
|
sortPredicates: {
|
||||||
relativePath: function(item, direction) {
|
relativePath: function(item, direction) {
|
||||||
const relativePath = item.relativePath;
|
const relativePath = item.relativePath;
|
||||||
|
|||||||
@@ -157,19 +157,13 @@ export const filterPredicates = {
|
|||||||
imdbRating: function(item, filterValue, type) {
|
imdbRating: function(item, filterValue, type) {
|
||||||
const predicate = filterTypePredicates[type];
|
const predicate = filterTypePredicates[type];
|
||||||
|
|
||||||
|
console.log(item.ratings);
|
||||||
|
|
||||||
const rating = item.ratings.imdb ? item.ratings.imdb.value : 0;
|
const rating = item.ratings.imdb ? item.ratings.imdb.value : 0;
|
||||||
|
|
||||||
return predicate(rating, filterValue);
|
return predicate(rating, filterValue);
|
||||||
},
|
},
|
||||||
|
|
||||||
rottenTomatoesRating: function(item, filterValue, type) {
|
|
||||||
const predicate = filterTypePredicates[type];
|
|
||||||
|
|
||||||
const rating = item.ratings.rottenTomatoes ? item.ratings.rottenTomatoes.value : 0;
|
|
||||||
|
|
||||||
return predicate(rating, filterValue);
|
|
||||||
},
|
|
||||||
|
|
||||||
imdbVotes: function(item, filterValue, type) {
|
imdbVotes: function(item, filterValue, type) {
|
||||||
const predicate = filterTypePredicates[type];
|
const predicate = filterTypePredicates[type];
|
||||||
|
|
||||||
|
|||||||
@@ -1,353 +0,0 @@
|
|||||||
import _ from 'lodash';
|
|
||||||
import { createAction } from 'redux-actions';
|
|
||||||
import { batchActions } from 'redux-batched-actions';
|
|
||||||
import { filterBuilderTypes, filterBuilderValueTypes, sortDirections } from 'Helpers/Props';
|
|
||||||
import { createThunk, handleThunks } from 'Store/thunks';
|
|
||||||
import createAjaxRequest from 'Utilities/createAjaxRequest';
|
|
||||||
import getNewMovie from 'Utilities/Movie/getNewMovie';
|
|
||||||
import { set, update, updateItem } from './baseActions';
|
|
||||||
import createHandleActions from './Creators/createHandleActions';
|
|
||||||
import createSaveProviderHandler from './Creators/createSaveProviderHandler';
|
|
||||||
import createSetClientSideCollectionFilterReducer from './Creators/Reducers/createSetClientSideCollectionFilterReducer';
|
|
||||||
import createSetClientSideCollectionSortReducer from './Creators/Reducers/createSetClientSideCollectionSortReducer';
|
|
||||||
import createSetSettingValueReducer from './Creators/Reducers/createSetSettingValueReducer';
|
|
||||||
|
|
||||||
//
|
|
||||||
// Variables
|
|
||||||
|
|
||||||
export const section = 'movieCollections';
|
|
||||||
|
|
||||||
//
|
|
||||||
// State
|
|
||||||
|
|
||||||
export const defaultState = {
|
|
||||||
isFetching: false,
|
|
||||||
isPopulated: false,
|
|
||||||
error: null,
|
|
||||||
items: [],
|
|
||||||
isSaving: false,
|
|
||||||
saveError: null,
|
|
||||||
isAdding: false,
|
|
||||||
addError: null,
|
|
||||||
sortKey: 'sortTitle',
|
|
||||||
sortDirection: sortDirections.ASCENDING,
|
|
||||||
secondarySortKey: 'sortTitle',
|
|
||||||
secondarySortDirection: sortDirections.ASCENDING,
|
|
||||||
view: 'overview',
|
|
||||||
pendingChanges: {},
|
|
||||||
|
|
||||||
overviewOptions: {
|
|
||||||
detailedProgressBar: false,
|
|
||||||
size: 'medium',
|
|
||||||
showDetails: true,
|
|
||||||
showOverview: true,
|
|
||||||
showPosters: true
|
|
||||||
},
|
|
||||||
|
|
||||||
defaults: {
|
|
||||||
rootFolderPath: '',
|
|
||||||
monitor: 'movieOnly',
|
|
||||||
qualityProfileId: 0,
|
|
||||||
minimumAvailability: 'announced',
|
|
||||||
searchForMovie: true,
|
|
||||||
tags: []
|
|
||||||
},
|
|
||||||
|
|
||||||
selectedFilterKey: 'all',
|
|
||||||
|
|
||||||
filters: [
|
|
||||||
{
|
|
||||||
key: 'all',
|
|
||||||
label: 'All',
|
|
||||||
filters: []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
filterPredicates: {},
|
|
||||||
|
|
||||||
filterBuilderProps: [
|
|
||||||
{
|
|
||||||
name: 'title',
|
|
||||||
label: 'Title',
|
|
||||||
type: filterBuilderTypes.STRING
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'monitored',
|
|
||||||
label: 'Monitored',
|
|
||||||
type: filterBuilderTypes.EXACT,
|
|
||||||
valueType: filterBuilderValueTypes.BOOL
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
export const persistState = [
|
|
||||||
'movieCollections.defaults',
|
|
||||||
'movieCollections.sortKey',
|
|
||||||
'movieCollections.sortDirection',
|
|
||||||
'movieCollections.selectedFilterKey',
|
|
||||||
'movieCollections.customFilters',
|
|
||||||
'movieCollections.options',
|
|
||||||
'movieCollections.overviewOptions'
|
|
||||||
];
|
|
||||||
|
|
||||||
//
|
|
||||||
// Actions Types
|
|
||||||
|
|
||||||
export const FETCH_MOVIE_COLLECTIONS = 'movieCollections/fetchMovieCollections';
|
|
||||||
export const CLEAR_MOVIE_COLLECTIONS = 'movieCollections/clearMovieCollections';
|
|
||||||
export const SAVE_MOVIE_COLLECTION = 'movieCollections/saveMovieCollection';
|
|
||||||
export const SAVE_MOVIE_COLLECTIONS = 'movieCollections/saveMovieCollections';
|
|
||||||
export const SET_MOVIE_COLLECTION_VALUE = 'movieCollections/setMovieCollectionValue';
|
|
||||||
|
|
||||||
export const ADD_MOVIE = 'movieCollections/addMovie';
|
|
||||||
|
|
||||||
export const TOGGLE_COLLECTION_MONITORED = 'movieCollections/toggleCollectionMonitored';
|
|
||||||
|
|
||||||
export const SET_MOVIE_COLLECTIONS_SORT = 'movieCollections/setMovieCollectionsSort';
|
|
||||||
export const SET_MOVIE_COLLECTIONS_FILTER = 'movieCollections/setMovieCollectionsFilter';
|
|
||||||
export const SET_MOVIE_COLLECTIONS_OPTION = 'movieCollections/setMovieCollectionsOption';
|
|
||||||
export const SET_MOVIE_COLLECTIONS_OVERVIEW_OPTION = 'movieCollections/setMovieCollectionsOverviewOption';
|
|
||||||
|
|
||||||
//
|
|
||||||
// Action Creators
|
|
||||||
|
|
||||||
export const fetchMovieCollections = createThunk(FETCH_MOVIE_COLLECTIONS);
|
|
||||||
export const clearMovieCollections = createAction(CLEAR_MOVIE_COLLECTIONS);
|
|
||||||
export const saveMovieCollection = createThunk(SAVE_MOVIE_COLLECTION);
|
|
||||||
export const saveMovieCollections = createThunk(SAVE_MOVIE_COLLECTIONS);
|
|
||||||
|
|
||||||
export const addMovie = createThunk(ADD_MOVIE);
|
|
||||||
|
|
||||||
export const toggleCollectionMonitored = createThunk(TOGGLE_COLLECTION_MONITORED);
|
|
||||||
|
|
||||||
export const setMovieCollectionsSort = createAction(SET_MOVIE_COLLECTIONS_SORT);
|
|
||||||
export const setMovieCollectionsFilter = createAction(SET_MOVIE_COLLECTIONS_FILTER);
|
|
||||||
export const setMovieCollectionsOption = createAction(SET_MOVIE_COLLECTIONS_OPTION);
|
|
||||||
export const setMovieCollectionsOverviewOption = createAction(SET_MOVIE_COLLECTIONS_OVERVIEW_OPTION);
|
|
||||||
|
|
||||||
export const setMovieCollectionValue = createAction(SET_MOVIE_COLLECTION_VALUE, (payload) => {
|
|
||||||
return {
|
|
||||||
section,
|
|
||||||
...payload
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
//
|
|
||||||
// Action Handlers
|
|
||||||
|
|
||||||
export const actionHandlers = handleThunks({
|
|
||||||
|
|
||||||
[SAVE_MOVIE_COLLECTION]: createSaveProviderHandler(section, '/collection'),
|
|
||||||
[FETCH_MOVIE_COLLECTIONS]: function(getState, payload, dispatch) {
|
|
||||||
dispatch(set({ section, isFetching: true }));
|
|
||||||
|
|
||||||
const promise = createAjaxRequest({
|
|
||||||
url: '/collection',
|
|
||||||
data: payload
|
|
||||||
}).request;
|
|
||||||
|
|
||||||
promise.done((data) => {
|
|
||||||
dispatch(batchActions([
|
|
||||||
update({ section, data }),
|
|
||||||
|
|
||||||
set({
|
|
||||||
section,
|
|
||||||
isFetching: false,
|
|
||||||
isPopulated: true,
|
|
||||||
error: null
|
|
||||||
})
|
|
||||||
]));
|
|
||||||
});
|
|
||||||
|
|
||||||
promise.fail((xhr) => {
|
|
||||||
dispatch(set({
|
|
||||||
section,
|
|
||||||
isFetching: false,
|
|
||||||
isPopulated: false,
|
|
||||||
error: xhr
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
[ADD_MOVIE]: function(getState, payload, dispatch) {
|
|
||||||
dispatch(set({ section, isAdding: true }));
|
|
||||||
|
|
||||||
const tmdbId = payload.tmdbId;
|
|
||||||
const title = payload.title;
|
|
||||||
|
|
||||||
const newMovie = getNewMovie({ tmdbId, title }, payload);
|
|
||||||
newMovie.id = 0;
|
|
||||||
|
|
||||||
const promise = createAjaxRequest({
|
|
||||||
url: '/movie',
|
|
||||||
method: 'POST',
|
|
||||||
contentType: 'application/json',
|
|
||||||
data: JSON.stringify(newMovie)
|
|
||||||
}).request;
|
|
||||||
|
|
||||||
promise.done((data) => {
|
|
||||||
dispatch(batchActions([
|
|
||||||
updateItem({ section: 'movies', ...data }),
|
|
||||||
|
|
||||||
set({
|
|
||||||
section,
|
|
||||||
isAdding: false,
|
|
||||||
isAdded: true,
|
|
||||||
addError: null
|
|
||||||
})
|
|
||||||
]));
|
|
||||||
});
|
|
||||||
|
|
||||||
promise.fail((xhr) => {
|
|
||||||
dispatch(set({
|
|
||||||
section,
|
|
||||||
isAdding: false,
|
|
||||||
isAdded: false,
|
|
||||||
addError: xhr
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
[TOGGLE_COLLECTION_MONITORED]: (getState, payload, dispatch) => {
|
|
||||||
const {
|
|
||||||
collectionId: id,
|
|
||||||
monitored
|
|
||||||
} = payload;
|
|
||||||
|
|
||||||
const collection = _.find(getState().movieCollections.items, { id });
|
|
||||||
|
|
||||||
dispatch(updateItem({
|
|
||||||
id,
|
|
||||||
section,
|
|
||||||
isSaving: true
|
|
||||||
}));
|
|
||||||
|
|
||||||
const promise = createAjaxRequest({
|
|
||||||
url: `/collection/${id}`,
|
|
||||||
method: 'PUT',
|
|
||||||
data: JSON.stringify({
|
|
||||||
...collection,
|
|
||||||
monitored
|
|
||||||
}),
|
|
||||||
dataType: 'json'
|
|
||||||
}).request;
|
|
||||||
|
|
||||||
promise.done((data) => {
|
|
||||||
dispatch(updateItem({
|
|
||||||
id,
|
|
||||||
section,
|
|
||||||
isSaving: false,
|
|
||||||
monitored
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
promise.fail((xhr) => {
|
|
||||||
dispatch(updateItem({
|
|
||||||
id,
|
|
||||||
section,
|
|
||||||
isSaving: false
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
[SAVE_MOVIE_COLLECTIONS]: function(getState, payload, dispatch) {
|
|
||||||
const {
|
|
||||||
collectionIds,
|
|
||||||
monitored,
|
|
||||||
monitor,
|
|
||||||
qualityProfileId,
|
|
||||||
rootFolderPath,
|
|
||||||
minimumAvailability
|
|
||||||
} = payload;
|
|
||||||
|
|
||||||
const response = {};
|
|
||||||
|
|
||||||
if (payload.hasOwnProperty('monitored')) {
|
|
||||||
response.monitored = monitored;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (payload.hasOwnProperty('monitor')) {
|
|
||||||
response.monitorMovies = monitor === 'monitored';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (payload.hasOwnProperty('qualityProfileId')) {
|
|
||||||
response.qualityProfileId = qualityProfileId;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (payload.hasOwnProperty('minimumAvailability')) {
|
|
||||||
response.minimumAvailability = minimumAvailability;
|
|
||||||
}
|
|
||||||
|
|
||||||
response.rootFolderPath = rootFolderPath;
|
|
||||||
response.collectionIds = collectionIds;
|
|
||||||
|
|
||||||
dispatch(set({
|
|
||||||
section,
|
|
||||||
isSaving: true
|
|
||||||
}));
|
|
||||||
|
|
||||||
const promise = createAjaxRequest({
|
|
||||||
url: '/collection',
|
|
||||||
method: 'PUT',
|
|
||||||
data: JSON.stringify(response),
|
|
||||||
dataType: 'json'
|
|
||||||
}).request;
|
|
||||||
|
|
||||||
promise.done((data) => {
|
|
||||||
dispatch(fetchMovieCollections());
|
|
||||||
|
|
||||||
dispatch(set({
|
|
||||||
section,
|
|
||||||
isSaving: false,
|
|
||||||
saveError: null
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
promise.fail((xhr) => {
|
|
||||||
dispatch(set({
|
|
||||||
section,
|
|
||||||
isSaving: false,
|
|
||||||
saveError: xhr
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
//
|
|
||||||
// Reducers
|
|
||||||
|
|
||||||
export const reducers = createHandleActions({
|
|
||||||
|
|
||||||
[SET_MOVIE_COLLECTIONS_SORT]: createSetClientSideCollectionSortReducer(section),
|
|
||||||
[SET_MOVIE_COLLECTIONS_FILTER]: createSetClientSideCollectionFilterReducer(section),
|
|
||||||
[SET_MOVIE_COLLECTION_VALUE]: createSetSettingValueReducer(section),
|
|
||||||
|
|
||||||
[SET_MOVIE_COLLECTIONS_OPTION]: function(state, { payload }) {
|
|
||||||
const movieCollectionsOptions = state.options;
|
|
||||||
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
options: {
|
|
||||||
...movieCollectionsOptions,
|
|
||||||
...payload
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
[SET_MOVIE_COLLECTIONS_OVERVIEW_OPTION]: function(state, { payload }) {
|
|
||||||
const overviewOptions = state.overviewOptions;
|
|
||||||
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
overviewOptions: {
|
|
||||||
...overviewOptions,
|
|
||||||
...payload
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
[CLEAR_MOVIE_COLLECTIONS]: (state) => {
|
|
||||||
return Object.assign({}, state, defaultState);
|
|
||||||
}
|
|
||||||
|
|
||||||
}, defaultState, section);
|
|
||||||
@@ -178,20 +178,8 @@ export const defaultState = {
|
|||||||
isVisible: true
|
isVisible: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'tmdbRating',
|
name: 'ratings',
|
||||||
label: translate('TmdbRating'),
|
label: translate('Ratings'),
|
||||||
isSortable: true,
|
|
||||||
isVisible: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'rottenTomatoesRating',
|
|
||||||
label: translate('RottenTomatoesRating'),
|
|
||||||
isSortable: true,
|
|
||||||
isVisible: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'imdbRating',
|
|
||||||
label: translate('ImdbRating'),
|
|
||||||
isSortable: true,
|
isSortable: true,
|
||||||
isVisible: false
|
isVisible: false
|
||||||
},
|
},
|
||||||
@@ -236,22 +224,10 @@ export const defaultState = {
|
|||||||
return originalLanguage.name;
|
return originalLanguage.name;
|
||||||
},
|
},
|
||||||
|
|
||||||
imdbRating: function(item) {
|
ratings: function(item) {
|
||||||
const { ratings = {} } = item;
|
const { ratings = {} } = item;
|
||||||
|
|
||||||
return ratings.imdb ? ratings.imdb.value : 0;
|
return ratings.tmdb? ratings.tmdb.value : 0;
|
||||||
},
|
|
||||||
|
|
||||||
tmdbRating: function(item) {
|
|
||||||
const { ratings = {} } = item;
|
|
||||||
|
|
||||||
return ratings.tmdb ? ratings.tmdb.value : 0;
|
|
||||||
},
|
|
||||||
|
|
||||||
rottenTomatoesRating: function(item) {
|
|
||||||
const { ratings = {} } = item;
|
|
||||||
|
|
||||||
return ratings.rottenTomatoes ? ratings.rottenTomatoes.value : 0;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -437,11 +413,6 @@ export const defaultState = {
|
|||||||
label: translate('ImdbRating'),
|
label: translate('ImdbRating'),
|
||||||
type: filterBuilderTypes.NUMBER
|
type: filterBuilderTypes.NUMBER
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'rottenTomatoesRating',
|
|
||||||
label: translate('RottenTomatoesRating'),
|
|
||||||
type: filterBuilderTypes.NUMBER
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'imdbVotes',
|
name: 'imdbVotes',
|
||||||
label: translate('ImdbVotes'),
|
label: translate('ImdbVotes'),
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user