1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-03-09 15:01:39 -04:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Robin Dadswell
bf8d21cd52 initial additions 2021-12-07 16:37:59 +00:00
889 changed files with 13399 additions and 25451 deletions

View File

@@ -19,10 +19,10 @@ indent_size = 4
dotnet_sort_system_directives_first = true
# Avoid "this." and "Me." if not necessary
dotnet_style_qualification_for_field = false:warning
dotnet_style_qualification_for_property = false:warning
dotnet_style_qualification_for_method = false:warning
dotnet_style_qualification_for_event = false:warning
dotnet_style_qualification_for_field = false:refactoring
dotnet_style_qualification_for_property = false:refactoring
dotnet_style_qualification_for_method = false:refactoring
dotnet_style_qualification_for_event = false:refactoring
# Indentation preferences
csharp_indent_block_contents = true
@@ -32,6 +32,10 @@ csharp_indent_case_contents_when_block = true
csharp_indent_switch_labels = true
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.required_prefix = _

4
.gitignore vendored
View File

@@ -187,10 +187,6 @@ packages.config.md5sum
**/.idea/**/*.iml
**/.idea/**/contentModel.xml
**/.idea/**/modules.xml
# ignore node_modules symlink
node_modules
node_modules.nosync
# API doc generation
.config/

View File

@@ -7,20 +7,14 @@ variables:
outputFolder: './_output'
artifactsFolder: './_artifacts'
testsFolder: './_tests'
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
majorVersion: '4.2.0'
majorVersion: '4.0.0'
minorVersion: $[counter('minorVersion', 2000)]
radarrVersion: '$(majorVersion).$(minorVersion)'
buildName: '$(Build.SourceBranchName).$(radarrVersion)'
sentryOrg: 'servarr'
sentryUrl: 'https://sentry.servarr.com'
dotnetVersion: '6.0.202'
nodeVersion: '16.X'
innoVersion: '6.2.0'
windowsImage: 'windows-2022'
linuxImage: 'ubuntu-20.04'
macImage: 'macOS-11'
dotnetVersion: '6.0.100'
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
trigger:
branches:
@@ -35,7 +29,6 @@ pr:
paths:
exclude:
- src/NzbDrone.Core/Localization/Core
- src/Radarr.Api.*/openapi.json
stages:
- stage: Setup
@@ -44,7 +37,7 @@ stages:
- job:
displayName: Build Variables
pool:
vmImage: ${{ variables.linuxImage }}
vmImage: 'ubuntu-18.04'
steps:
# Set the build name properly. The 'name' property won't recursively expand so hack here:
- bash: echo "##vso[build.updatebuildnumber]$RADARRVERSION"
@@ -70,15 +63,15 @@ stages:
matrix:
Linux:
osName: 'Linux'
imageName: ${{ variables.linuxImage }}
imageName: 'ubuntu-18.04'
enableAnalysis: 'true'
Mac:
osName: 'Mac'
imageName: ${{ variables.macImage }}
imageName: 'macos-10.15'
enableAnalysis: 'false'
Windows:
osName: 'Windows'
imageName: ${{ variables.windowsImage }}
imageName: 'windows-2019'
enableAnalysis: 'false'
pool:
@@ -97,14 +90,15 @@ stages:
- bash: |
BUNDLEDVERSIONS=${AGENT_TOOLSDIRECTORY}/dotnet/sdk/${DOTNETVERSION}/Microsoft.NETCoreSdk.BundledVersions.props
echo $BUNDLEDVERSIONS
grep osx-x64 $BUNDLEDVERSIONS
if grep -q freebsd-x64 $BUNDLEDVERSIONS; then
echo "Extra platforms already enabled"
echo "BSD already enabled"
else
echo "Enabling extra platform support"
sed -i.ORI 's/osx-x64/osx-x64;freebsd-x64;linux-x86/' $BUNDLEDVERSIONS
echo "Enabling BSD support"
sed -i.ORI 's/osx-x64/osx-x64;freebsd-x64/' $BUNDLEDVERSIONS
fi
displayName: Enable Extra Platform Support
- bash: ./build.sh --backend --enable-extra-platforms
displayName: Enable FreeBSD Support
- bash: ./build.sh --backend --enable-bsd
displayName: Build Radarr Backend
- bash: |
find ${OUTPUTFOLDER} -type f ! -path "*/publish/*" -exec rm -rf {} \;
@@ -118,28 +112,24 @@ stages:
displayName: Publish Backend
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
- publish: '$(testsFolder)/net6.0/win-x64/publish'
artifact: win-x64-tests
displayName: Publish win-x64 Test Package
artifact: WindowsCoreTests
displayName: Publish Windows Test Package
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
- publish: '$(testsFolder)/net6.0/linux-x64/publish'
artifact: linux-x64-tests
displayName: Publish linux-x64 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
artifact: LinuxCoreTests
displayName: Publish Linux Test Package
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
- publish: '$(testsFolder)/net6.0/linux-musl-x64/publish'
artifact: linux-musl-x64-tests
displayName: Publish linux-musl-x64 Test Package
artifact: LinuxMuslCoreTests
displayName: Publish Linux Musl Test Package
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
- publish: '$(testsFolder)/net6.0/freebsd-x64/publish'
artifact: freebsd-x64-tests
displayName: Publish freebsd-x64 Test Package
artifact: FreebsdCoreTests
displayName: Publish FreeBSD Test Package
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
- publish: '$(testsFolder)/net6.0/osx-x64/publish'
artifact: osx-x64-tests
displayName: Publish osx-x64 Test Package
artifact: MacCoreTests
displayName: Publish MacOS Test Package
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
- stage: Build_Frontend
@@ -151,20 +141,20 @@ stages:
matrix:
Linux:
osName: 'Linux'
imageName: ${{ variables.linuxImage }}
imageName: 'ubuntu-18.04'
Mac:
osName: 'Mac'
imageName: ${{ variables.macImage }}
imageName: 'macos-10.15'
Windows:
osName: 'Windows'
imageName: ${{ variables.windowsImage }}
imageName: 'windows-2019'
pool:
vmImage: $(imageName)
steps:
- task: NodeTool@0
displayName: Set Node.js version
inputs:
versionSpec: $(nodeVersion)
versionSpec: '12.x'
- checkout: self
submodules: true
fetchDepth: 1
@@ -194,7 +184,7 @@ stages:
- job: Windows_Installer
displayName: Create Installer
pool:
vmImage: ${{ variables.windowsImage }}
vmImage: 'windows-2019'
steps:
- checkout: self
fetchDepth: 1
@@ -210,11 +200,16 @@ stages:
artifactName: WindowsFrontend
targetPath: _output
displayName: Fetch Frontend
- bash: ./build.sh --packages
displayName: Create Packages
- bash: |
./build.sh --packages --installer
cp setup/output/Radarr.*win-x64.exe ${BUILD_ARTIFACTSTAGINGDIRECTORY}/Radarr.${BUILDNAME}.windows-core-x64-installer.exe
cp setup/output/Radarr.*win-x86.exe ${BUILD_ARTIFACTSTAGINGDIRECTORY}/Radarr.${BUILDNAME}.windows-core-x86-installer.exe
displayName: Create Installers
setup/inno/ISCC.exe setup/radarr.iss //DFramework=net6.0 //DRuntime=win-x86
cp setup/output/Radarr.*windows.net6.0.exe ${BUILD_ARTIFACTSTAGINGDIRECTORY}/Radarr.${BUILDNAME}.windows-core-x86-installer.exe
displayName: Create .NET Core Windows installer
- bash: |
setup/inno/ISCC.exe setup/radarr.iss //DFramework=net6.0 //DRuntime=win-x64
cp setup/output/Radarr.*windows.net6.0.exe ${BUILD_ARTIFACTSTAGINGDIRECTORY}/Radarr.${BUILDNAME}.windows-core-x64-installer.exe
displayName: Create .NET Core Windows installer
- publish: $(Build.ArtifactStagingDirectory)
artifact: 'WindowsInstaller'
displayName: Publish Installer
@@ -227,7 +222,7 @@ stages:
- job: Other_Packages
displayName: Create Standard Packages
pool:
vmImage: ${{ variables.linuxImage }}
vmImage: 'ubuntu-18.04'
steps:
- checkout: self
fetchDepth: 1
@@ -243,7 +238,7 @@ stages:
artifactName: WindowsFrontend
targetPath: _output
displayName: Fetch Frontend
- bash: ./build.sh --packages --enable-extra-platforms
- bash: ./build.sh --packages --enable-bsd
displayName: Create Packages
- bash: |
find . -name "ffprobe" -exec chmod a+x {} \;
@@ -251,28 +246,28 @@ stages:
find . -name "Radarr.Update" -exec chmod a+x {} \;
displayName: Set executable bits
- task: ArchiveFiles@2
displayName: Create win-x64 zip
displayName: Create Windows Core zip
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).windows-core-x64.zip'
archiveType: 'zip'
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/win-x64/net6.0
- task: ArchiveFiles@2
displayName: Create win-x86 zip
displayName: Create Windows x86 Core zip
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).windows-core-x86.zip'
archiveType: 'zip'
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/win-x86/net6.0
- task: ArchiveFiles@2
displayName: Create osx-x64 app
displayName: Create MacOS x64 Core app
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-app-core-x64.zip'
archiveType: 'zip'
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/osx-x64-app/net6.0
- task: ArchiveFiles@2
displayName: Create osx-x64 tar
displayName: Create MacOS x64 Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-core-x64.tar.gz'
archiveType: 'tar'
@@ -280,14 +275,14 @@ stages:
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/osx-x64/net6.0
- task: ArchiveFiles@2
displayName: Create osx-arm64 app
displayName: Create MacOS arm64 Core app
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-app-core-arm64.zip'
archiveType: 'zip'
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/osx-arm64-app/net6.0
- task: ArchiveFiles@2
displayName: Create osx-arm64 tar
displayName: Create MacOS arm64 Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-core-arm64.tar.gz'
archiveType: 'tar'
@@ -295,7 +290,7 @@ stages:
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/osx-arm64/net6.0
- task: ArchiveFiles@2
displayName: Create linux-x64 tar
displayName: Create Linux Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-x64.tar.gz'
archiveType: 'tar'
@@ -303,7 +298,7 @@ stages:
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/linux-x64/net6.0
- task: ArchiveFiles@2
displayName: Create linux-musl-x64 tar
displayName: Create Linux Musl Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-musl-core-x64.tar.gz'
archiveType: 'tar'
@@ -311,15 +306,7 @@ stages:
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/linux-musl-x64/net6.0
- task: ArchiveFiles@2
displayName: Create linux-x86 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
displayName: Create ARM32 Linux Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-arm.tar.gz'
archiveType: 'tar'
@@ -327,7 +314,7 @@ stages:
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/linux-arm/net6.0
- task: ArchiveFiles@2
displayName: Create linux-musl-arm tar
displayName: Create ARM32 Linux Musl Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-musl-core-arm.tar.gz'
archiveType: 'tar'
@@ -335,7 +322,7 @@ stages:
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/linux-musl-arm/net6.0
- task: ArchiveFiles@2
displayName: Create linux-arm64 tar
displayName: Create ARM64 Linux Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-arm64.tar.gz'
archiveType: 'tar'
@@ -343,7 +330,7 @@ stages:
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/linux-arm64/net6.0
- task: ArchiveFiles@2
displayName: Create linux-musl-arm64 tar
displayName: Create ARM64 Linux Musl Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-musl-core-arm64.tar.gz'
archiveType: 'tar'
@@ -351,7 +338,7 @@ stages:
includeRootFolder: false
rootFolderOrFile: $(artifactsFolder)/linux-musl-arm64/net6.0
- task: ArchiveFiles@2
displayName: Create freebsd-x64 tar
displayName: Create FreeBSD Core Core tar
inputs:
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).freebsd-core-x64.tar.gz'
archiveType: 'tar'
@@ -396,7 +383,7 @@ stages:
jobs:
- job: Prepare
pool:
vmImage: ${{ variables.linuxImage }}
vmImage: 'ubuntu-18.04'
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
@@ -418,22 +405,22 @@ stages:
matrix:
MacCore:
osName: 'Mac'
testName: 'osx-x64'
testName: 'MacCore'
poolName: 'Azure Pipelines'
imageName: ${{ variables.macImage }}
imageName: 'macos-10.15'
WindowsCore:
osName: 'Windows'
testName: 'win-x64'
testName: 'WindowsCore'
poolName: 'Azure Pipelines'
imageName: ${{ variables.windowsImage }}
imageName: 'windows-2019'
LinuxCore:
osName: 'Linux'
testName: 'linux-x64'
testName: 'LinuxCore'
poolName: 'Azure Pipelines'
imageName: ${{ variables.linuxImage }}
imageName: 'ubuntu-18.04'
FreebsdCore:
osName: 'Linux'
testName: 'freebsd-x64'
testName: 'FreebsdCore'
poolName: 'FreeBSD'
imageName:
@@ -452,7 +439,7 @@ stages:
displayName: Download Test Artifact
inputs:
buildType: 'current'
artifactName: '$(testName)-tests'
artifactName: '$(testName)Tests'
targetPath: $(testsFolder)
- powershell: Set-Service SCardSvr -StartupType Manual
displayName: Enable Windows Test Service
@@ -486,15 +473,11 @@ stages:
matrix:
alpine:
testName: 'Musl Net Core'
artifactName: linux-musl-x64-tests
artifactName: LinuxMuslCoreTests
containerImage: ghcr.io/servarr/testimages:alpine
linux-x86:
testName: 'linux-x86'
artifactName: linux-x86-tests
containerImage: ghcr.io/servarr/testimages:linux-x86
pool:
vmImage: ${{ variables.linuxImage }}
vmImage: 'ubuntu-18.04'
container: $[ variables['containerImage'] ]
@@ -502,15 +485,9 @@ stages:
steps:
- task: UseDotNet@2
displayName: 'Install .NET'
displayName: 'Install .net core'
inputs:
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
- task: DownloadPipelineArtifact@2
displayName: Download Test Artifact
@@ -536,61 +513,6 @@ stages:
testResultsFiles: '**/TestResult.xml'
testRunTitle: '$(testName) Unit Tests'
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
displayName: Integration
@@ -599,7 +521,7 @@ stages:
jobs:
- job: Prepare
pool:
vmImage: ${{ variables.linuxImage }}
vmImage: 'ubuntu-18.04'
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
@@ -618,18 +540,18 @@ stages:
matrix:
MacCore:
osName: 'Mac'
testName: 'osx-x64'
imageName: ${{ variables.macImage }}
testName: 'MacCore'
imageName: 'macos-10.15'
pattern: 'Radarr.*.osx-core-x64.tar.gz'
WindowsCore:
osName: 'Windows'
testName: 'win-x64'
imageName: ${{ variables.windowsImage }}
testName: 'WindowsCore'
imageName: 'windows-2019'
pattern: 'Radarr.*.windows-core-x64.zip'
LinuxCore:
osName: 'Linux'
testName: 'linux-x64'
imageName: ${{ variables.linuxImage }}
testName: 'LinuxCore'
imageName: 'ubuntu-18.04'
pattern: 'Radarr.*.linux-core-x64.tar.gz'
pool:
@@ -645,7 +567,7 @@ stages:
displayName: Download Test Artifact
inputs:
buildType: 'current'
artifactName: '$(testName)-tests'
artifactName: '$(testName)Tests'
targetPath: $(testsFolder)
- task: DownloadPipelineArtifact@2
displayName: Download Build Artifact
@@ -675,67 +597,6 @@ stages:
failTaskOnFailedTests: true
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
displayName: Integration Native FreeBSD
dependsOn: Prepare
@@ -753,7 +614,7 @@ stages:
displayName: Download Test Artifact
inputs:
buildType: 'current'
artifactName: 'freebsd-x64-tests'
artifactName: 'FreebsdCoreTests'
targetPath: $(testsFolder)
- task: DownloadPipelineArtifact@2
displayName: Download Build Artifact
@@ -789,17 +650,12 @@ stages:
strategy:
matrix:
alpine:
testName: 'linux-musl-x64'
artifactName: linux-musl-x64-tests
testName: 'Musl Net Core'
artifactName: LinuxMuslCoreTests
containerImage: ghcr.io/servarr/testimages:alpine
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:
vmImage: ${{ variables.linuxImage }}
vmImage: 'ubuntu-18.04'
container: $[ variables['containerImage'] ]
@@ -807,15 +663,9 @@ stages:
steps:
- task: UseDotNet@2
displayName: 'Install .NET'
displayName: 'Install .net core'
inputs:
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
- task: DownloadPipelineArtifact@2
displayName: Download Test Artifact
@@ -861,20 +711,17 @@ stages:
matrix:
Linux:
osName: 'Linux'
artifactName: 'linux-x64'
imageName: ${{ variables.linuxImage }}
imageName: 'ubuntu-18.04'
pattern: 'Radarr.*.linux-core-x64.tar.gz'
failBuild: true
Mac:
osName: 'Mac'
artifactName: 'osx-x64'
imageName: ${{ variables.macImage }}
imageName: 'macos-10.15'
pattern: 'Radarr.*.osx-core-x64.tar.gz'
failBuild: true
Windows:
osName: 'Windows'
artifactName: 'win-x64'
imageName: ${{ variables.windowsImage }}
imageName: 'windows-2019'
pattern: 'Radarr.*.windows-core-x64.zip'
failBuild: true
@@ -891,7 +738,7 @@ stages:
displayName: Download Test Artifact
inputs:
buildType: 'current'
artifactName: '$(artifactName)-tests'
artifactName: '$(osName)CoreTests'
targetPath: $(testsFolder)
- task: DownloadPipelineArtifact@2
displayName: Download Build Artifact
@@ -940,7 +787,7 @@ stages:
jobs:
- job: Prepare
pool:
vmImage: ${{ variables.linuxImage }}
vmImage: 'ubuntu-18.04'
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
@@ -957,17 +804,17 @@ stages:
matrix:
Linux:
osName: 'Linux'
imageName: ${{ variables.linuxImage }}
imageName: 'ubuntu-18.04'
Windows:
osName: 'Windows'
imageName: ${{ variables.windowsImage }}
imageName: 'windows-2019'
pool:
vmImage: $(imageName)
steps:
- task: NodeTool@0
displayName: Set Node.js version
inputs:
versionSpec: $(nodeVersion)
versionSpec: '12.x'
- checkout: self
submodules: true
fetchDepth: 1
@@ -989,7 +836,7 @@ stages:
displayName: Frontend
condition: eq(variables['System.PullRequest.IsFork'], 'False')
pool:
vmImage: ${{ variables.windowsImage }}
vmImage: windows-2019
steps:
- checkout: self # Need history for Sonar analysis
- task: SonarCloudPrepare@1
@@ -1005,60 +852,6 @@ stages:
cliProjectVersion: '$(radarrVersion)'
cliSources: './frontend'
- task: SonarCloudAnalyze@1
- job: Api_Docs
displayName: API Docs
dependsOn: Prepare
condition: |
and
(
and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop')),
and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendNotUpdated'], '0'))
)
pool:
vmImage: ${{ variables.windowsImage }}
steps:
- task: UseDotNet@2
displayName: 'Install .net core'
inputs:
version: $(dotnetVersion)
- checkout: self
submodules: true
persistCredentials: true
fetchDepth: 1
- bash: ./docs.sh Windows
displayName: Create openapi.json
- bash: |
git config --global user.email "development@lidarr.audio"
git config --global user.name "Servarr"
git checkout -b api-docs
git add .
git status
if git status | grep modified
then
git commit -am 'Automated API Docs update'
git push -f --set-upstream origin api-docs
curl -X POST -H "Authorization: token ${GITHUBTOKEN}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/radarr/radarr/pulls -d '{"head":"api-docs","base":"develop","title":"Update API docs"}'
else
echo "No changes since last run"
fi
displayName: Commit API Doc Change
continueOnError: true
env:
GITHUBTOKEN: $(githubToken)
- task: CopyFiles@2
displayName: 'Copy openapi.json to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
**/*openapi.json
TargetFolder: '$(Build.ArtifactStagingDirectory)/api_docs'
- publish: $(Build.ArtifactStagingDirectory)/api_docs
artifact: 'APIDocs'
displayName: Publish API Docs Bundle
condition: and(succeeded(), eq(variables['System.JobAttempt'], '1'))
- job: Analyze_Backend
displayName: Backend
@@ -1070,7 +863,7 @@ stages:
EnableAnalyzers: 'false'
pool:
vmImage: ${{ variables.windowsImage }}
vmImage: windows-2019
steps:
- task: UseDotNet@2
@@ -1127,7 +920,7 @@ stages:
- job:
displayName: Discord Notification
pool:
vmImage: ${{ variables.linuxImage }}
vmImage: 'ubuntu-18.04'
steps:
- task: DownloadPipelineArtifact@2
continueOnError: true

View File

@@ -25,22 +25,14 @@ UpdateVersionNumber()
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')
BUNDLEDVERSIONS="${SDK_PATH}/Microsoft.NETCoreSdk.BundledVersions.props"
if grep -q freebsd-x64 $BUNDLEDVERSIONS; then
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
}
#todo enable sdk with
#SDK_PATH=$(dotnet --list-sdks | grep -P '5\.\d\.\d+' | head -1 | sed 's/\(5\.[0-9]*\.[0-9]*\).*\[\(.*\)\]/\2\/\1/g')
# BUNDLED_VERSIONS="${SDK_PATH}/Microsoft.NETCoreSdk.BundledVersions.props"
EnableExtraPlatforms()
{
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
}
@@ -241,32 +233,6 @@ Package()
esac
}
BuildInstaller()
{
local framework="$1"
local runtime="$2"
./_inno/ISCC.exe setup/radarr.iss "//DFramework=$framework" "//DRuntime=$runtime"
}
InstallInno()
{
ProgressStart "Installing portable Inno Setup"
rm -rf _inno
curl -s --output innosetup.exe "https://files.jrsoftware.org/is/6/innosetup-${INNOVERSION:-6.2.0}.exe"
mkdir _inno
./innosetup.exe //portable=1 //silent //currentuser //dir=.\\_inno
rm innosetup.exe
ProgressEnd "Installed portable Inno Setup"
}
RemoveInno()
{
rm -rf _inno
}
PackageTests()
{
local framework="$1"
@@ -298,10 +264,8 @@ if [ $# -eq 0 ]; then
BACKEND=YES
FRONTEND=YES
PACKAGES=YES
INSTALLER=NO
LINT=YES
ENABLE_EXTRA_PLATFORMS=NO
ENABLE_EXTRA_PLATFORMS_IN_SDK=NO
ENABLE_BSD=NO
fi
while [[ $# -gt 0 ]]
@@ -313,12 +277,8 @@ case $key in
BACKEND=YES
shift # past argument
;;
--enable-bsd|--enable-extra-platforms)
ENABLE_EXTRA_PLATFORMS=YES
shift # past argument
;;
--enable-extra-platforms-in-sdk)
ENABLE_EXTRA_PLATFORMS_IN_SDK=YES
--enable-bsd)
ENABLE_BSD=YES
shift # past argument
;;
-r|--runtime)
@@ -339,10 +299,6 @@ case $key in
PACKAGES=YES
shift # past argument
;;
--installer)
INSTALLER=YES
shift # past argument
;;
--lint)
LINT=YES
shift # past argument
@@ -362,17 +318,12 @@ esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
if [ "$ENABLE_EXTRA_PLATFORMS_IN_SDK" = "YES" ];
then
EnableExtraPlatformsInSDK
fi
if [ "$BACKEND" = "YES" ];
then
UpdateVersionNumber
if [ "$ENABLE_EXTRA_PLATFORMS" = "YES" ];
if [ "$ENABLE_BSD" = "YES" ];
then
EnableExtraPlatforms
EnableBsdSupport
fi
Build
if [[ -z "$RID" || -z "$FRAMEWORK" ]];
@@ -382,10 +333,9 @@ then
PackageTests "net6.0" "linux-x64"
PackageTests "net6.0" "linux-musl-x64"
PackageTests "net6.0" "osx-x64"
if [ "$ENABLE_EXTRA_PLATFORMS" = "YES" ];
if [ "$ENABLE_BSD" = "YES" ];
then
PackageTests "net6.0" "freebsd-x64"
PackageTests "net6.0" "linux-x86"
fi
else
PackageTests "$FRAMEWORK" "$RID"
@@ -424,20 +374,11 @@ then
Package "net6.0" "linux-musl-arm"
Package "net6.0" "osx-x64"
Package "net6.0" "osx-arm64"
if [ "$ENABLE_EXTRA_PLATFORMS" = "YES" ];
if [ "$ENABLE_BSD" = "YES" ];
then
Package "net6.0" "freebsd-x64"
Package "net6.0" "linux-x86"
fi
else
Package "$FRAMEWORK" "$RID"
fi
fi
if [ "$INSTALLER" = "YES" ];
then
InstallInno
BuildInstaller "net6.0" "win-x64"
BuildInstaller "net6.0" "win-x86"
RemoveInno
fi

38
docs.sh
View File

@@ -1,38 +0,0 @@
PLATFORM=$1
if [ "$PLATFORM" = "Windows" ]; then
RUNTIME="win-x64"
elif [ "$PLATFORM" = "Linux" ]; then
WHERE="linux-x64"
elif [ "$PLATFORM" = "Mac" ]; then
WHERE="osx-x64"
else
echo "Platform must be provided as first arguement: Windows, Linux or Mac"
exit 1
fi
outputFolder='_output'
testPackageFolder='_tests'
rm -rf $outputFolder
rm -rf $testPackageFolder
slnFile=src/Radarr.sln
platform=Posix
dotnet clean $slnFile -c Debug
dotnet clean $slnFile -c Release
dotnet msbuild -restore $slnFile -p:Configuration=Debug -p:Platform=$platform -p:RuntimeIdentifiers=$RUNTIME -t:PublishAllRids
dotnet new tool-manifest
dotnet tool install --version 6.3.0 Swashbuckle.AspNetCore.Cli
dotnet tool run swagger tofile --output ./src/Radarr.Api.V3/openapi.json "$outputFolder/net6.0/$RUNTIME/radarr.console.dll" v3 &
sleep 45
kill %1
exit 0

View File

@@ -61,33 +61,33 @@ class Blocklist extends Component {
getSelectedIds = () => {
return getSelectedIds(this.state.selectedState);
};
}
//
// 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);
});
};
}
onRemoveSelectedPress = () => {
this.setState({ isConfirmRemoveModalOpen: true });
};
}
onRemoveSelectedConfirmed = () => {
this.props.onRemoveSelected(this.getSelectedIds());
this.setState({ isConfirmRemoveModalOpen: false });
};
}
onConfirmRemoveModalClose = () => {
this.setState({ isConfirmRemoveModalOpen: false });
};
}
//
// Render
@@ -120,7 +120,7 @@ class Blocklist extends Component {
<PageToolbar>
<PageToolbarSection>
<PageToolbarButton
label={translate('RemoveSelected')}
label="Remove Selected"
iconName={icons.REMOVE}
isDisabled={!selectedIds.length}
isSpinning={isRemoving}

View File

@@ -65,37 +65,37 @@ class BlocklistConnector extends Component {
repopulate = () => {
this.props.fetchBlocklist();
};
}
//
// Listeners
onFirstPagePress = () => {
this.props.gotoBlocklistFirstPage();
};
}
onPreviousPagePress = () => {
this.props.gotoBlocklistPreviousPage();
};
}
onNextPagePress = () => {
this.props.gotoBlocklistNextPage();
};
}
onLastPagePress = () => {
this.props.gotoBlocklistLastPage();
};
}
onPageSelect = (page) => {
this.props.gotoBlocklistPage({ page });
};
}
onRemoveSelected = (ids) => {
this.props.removeBlocklistItems({ ids });
};
}
onSortPress = (sortKey) => {
this.props.setBlocklistSort({ sortKey });
};
}
onTableOptionChange = (payload) => {
this.props.setBlocklistTableOption(payload);
@@ -103,11 +103,11 @@ class BlocklistConnector extends Component {
if (payload.pageSize) {
this.props.gotoBlocklistFirstPage();
}
};
}
onClearBlocklistPress = () => {
this.props.executeCommand({ name: commandNames.CLEAR_BLOCKLIST });
};
}
//
// Render

View File

@@ -32,11 +32,11 @@ class BlocklistRow extends Component {
onDetailsPress = () => {
this.setState({ isDetailsModalOpen: true });
};
}
onDetailsModalClose = () => {
this.setState({ isDetailsModalOpen: false });
};
}
//
// Render

View File

@@ -25,7 +25,6 @@ function HistoryDetails(props) {
releaseGroup,
nzbInfoUrl,
downloadClient,
downloadClientName,
downloadId,
age,
ageHours,
@@ -33,8 +32,6 @@ function HistoryDetails(props) {
publishedDate
} = data;
const downloadClientNameInfo = downloadClientName ?? downloadClient;
return (
<DescriptionList>
<DescriptionListItem
@@ -74,12 +71,11 @@ function HistoryDetails(props) {
}
{
downloadClientNameInfo ?
!!downloadClient &&
<DescriptionListItem
title={translate('DownloadClient')}
data={downloadClientNameInfo}
/> :
null
data={downloadClient}
/>
}
{

View File

@@ -57,38 +57,38 @@ class HistoryConnector extends Component {
repopulate = () => {
this.props.fetchHistory();
};
}
//
// Listeners
onFirstPagePress = () => {
this.props.gotoHistoryFirstPage();
};
}
onPreviousPagePress = () => {
this.props.gotoHistoryPreviousPage();
};
}
onNextPagePress = () => {
this.props.gotoHistoryNextPage();
};
}
onLastPagePress = () => {
this.props.gotoHistoryLastPage();
};
}
onPageSelect = (page) => {
this.props.gotoHistoryPage({ page });
};
}
onSortPress = (sortKey) => {
this.props.setHistorySort({ sortKey });
};
}
onFilterSelect = (selectedFilterKey) => {
this.props.setHistoryFilter({ selectedFilterKey });
};
}
onTableOptionChange = (payload) => {
this.props.setHistoryTableOption(payload);
@@ -96,7 +96,7 @@ class HistoryConnector extends Component {
if (payload.pageSize) {
this.props.gotoHistoryFirstPage();
}
};
}
//
// Render

View File

@@ -41,11 +41,11 @@ class HistoryRow extends Component {
onDetailsPress = () => {
this.setState({ isDetailsModalOpen: true });
};
}
onDetailsModalClose = () => {
this.setState({ isDetailsModalOpen: false });
};
}
//
// Render

View File

@@ -46,7 +46,7 @@ class HistoryRowConnector extends Component {
onMarkAsFailedPress = () => {
this.props.markAsFailed({ id: this.props.id });
};
}
//
// Render

View File

@@ -90,45 +90,45 @@ class Queue extends Component {
getSelectedIds = () => {
return getSelectedIds(this.state.selectedState);
};
}
//
// Listeners
onQueueRowModalOpenOrClose = (isOpen) => {
this._shouldBlockRefresh = isOpen;
};
}
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);
});
};
}
onGrabSelectedPress = () => {
this.props.onGrabSelectedPress(this.getSelectedIds());
};
}
onRemoveSelectedPress = () => {
this.setState({ isConfirmRemoveModalOpen: true }, () => {
this._shouldBlockRefresh = true;
});
};
}
onRemoveSelectedConfirmed = (payload) => {
this._shouldBlockRefresh = false;
this.props.onRemoveSelectedPress({ ids: this.getSelectedIds(), ...payload });
this.setState({ isConfirmRemoveModalOpen: false });
};
}
onConfirmRemoveModalClose = () => {
this._shouldBlockRefresh = false;
this.setState({ isConfirmRemoveModalOpen: false });
};
}
//
// Render

View File

@@ -77,34 +77,34 @@ class QueueConnector extends Component {
repopulate = () => {
this.props.fetchQueue();
};
}
//
// Listeners
onFirstPagePress = () => {
this.props.gotoQueueFirstPage();
};
}
onPreviousPagePress = () => {
this.props.gotoQueuePreviousPage();
};
}
onNextPagePress = () => {
this.props.gotoQueueNextPage();
};
}
onLastPagePress = () => {
this.props.gotoQueueLastPage();
};
}
onPageSelect = (page) => {
this.props.gotoQueuePage({ page });
};
}
onSortPress = (sortKey) => {
this.props.setQueueSort({ sortKey });
};
}
onTableOptionChange = (payload) => {
this.props.setQueueTableOption(payload);
@@ -112,21 +112,21 @@ class QueueConnector extends Component {
if (payload.pageSize) {
this.props.gotoQueueFirstPage();
}
};
}
onRefreshPress = () => {
this.props.executeCommand({
name: commandNames.REFRESH_MONITORED_DOWNLOADS
});
};
}
onGrabSelectedPress = (ids) => {
this.props.grabQueueItems({ ids });
};
}
onRemoveSelectedPress = (payload) => {
this.props.removeQueueItems(payload);
};
}
//
// Render

View File

@@ -42,7 +42,7 @@ class QueueOptions extends Component {
[name]: value
});
});
};
}
//
// Render

View File

@@ -40,7 +40,7 @@ class QueueRow extends Component {
onRemoveQueueItemPress = () => {
this.setState({ isRemoveQueueItemModalOpen: true });
};
}
onRemoveQueueItemModalConfirmed = (blocklist) => {
const {
@@ -52,25 +52,25 @@ class QueueRow extends Component {
onRemoveQueueItemPress(blocklist);
this.setState({ isRemoveQueueItemModalOpen: false });
};
}
onRemoveQueueItemModalClose = () => {
this.props.onQueueRowModalOpenOrClose(false);
this.setState({ isRemoveQueueItemModalOpen: false });
};
}
onInteractiveImportPress = () => {
this.props.onQueueRowModalOpenOrClose(true);
this.setState({ isInteractiveImportModalOpen: true });
};
}
onInteractiveImportModalClose = () => {
this.props.onQueueRowModalOpenOrClose(false);
this.setState({ isInteractiveImportModalOpen: false });
};
}
//
// Render

View File

@@ -37,11 +37,11 @@ class QueueRowConnector extends Component {
onGrabPress = () => {
this.props.grabQueueItem({ id: this.props.id });
};
}
onRemoveQueueItemPress = (payload) => {
this.props.removeQueueItem({ id: this.props.id, ...payload });
};
}
//
// Render

View File

@@ -34,30 +34,30 @@ class RemoveQueueItemModal extends Component {
remove: true,
blocklist: false
});
};
}
//
// Listeners
onRemoveChange = ({ value }) => {
this.setState({ remove: value });
};
}
onBlocklistChange = ({ value }) => {
this.setState({ blocklist: value });
};
}
onRemoveConfirmed = () => {
const state = this.state;
this.resetState();
this.props.onRemovePress(state);
};
}
onModalClose = () => {
this.resetState();
this.props.onModalClose();
};
}
//
// Render

View File

@@ -30,35 +30,35 @@ class RemoveQueueItemsModal extends Component {
//
// Control
resetState = function() {
this.setState({
remove: true,
blocklist: false
});
};
resetState = function() {
this.setState({
remove: true,
blocklist: false
});
}
//
// Listeners
//
// Listeners
onRemoveChange = ({ value }) => {
this.setState({ remove: value });
};
onRemoveChange = ({ value }) => {
this.setState({ remove: value });
}
onBlocklistChange = ({ value }) => {
this.setState({ blocklist: value });
};
}
onRemoveConfirmed = () => {
const state = this.state;
this.resetState();
this.props.onRemovePress(state);
};
}
onModalClose = () => {
this.resetState();
this.props.onModalClose();
};
}
//
// Render

View File

@@ -67,12 +67,12 @@ class AddNewMovie extends Component {
this.props.onClearMovieLookup();
}
});
};
}
onClearMovieLookupPress = () => {
this.setState({ term: '' });
this.props.onClearMovieLookup();
};
}
//
// Render
@@ -161,7 +161,7 @@ class AddNewMovie extends Component {
{translate('YouCanAlsoSearch')}
</div>
<div>
<Link to="https://wiki.servarr.com/radarr/faq#why-can-i-not-add-a-new-movie-to-radarr">
<Link to="https://wiki.servarr.com/radarr/faq#why-cant-i-add-a-new-movie-to-radarr">
{translate('CantFindMovie')}
</Link>
</div>

View File

@@ -79,11 +79,11 @@ class AddNewMovieConnector extends Component {
this.props.lookupMovie({ term });
}, 300);
}
};
}
onClearMovieLookup = () => {
this.props.clearAddMovie();
};
}
//
// Render

View File

@@ -22,11 +22,11 @@ class AddNewMovieModalContent extends Component {
onQualityProfileIdChange = ({ value }) => {
this.props.onInputChange({ name: 'qualityProfileId', value: parseInt(value) });
};
}
onAddMoviePress = () => {
this.props.onAddMoviePress();
};
}
//
// Render

View File

@@ -51,7 +51,7 @@ class AddNewMovieModalContentConnector extends Component {
onInputChange = ({ name, value }) => {
this.props.setAddMovieDefault({ [name]: value });
};
}
onAddMoviePress = () => {
const {
@@ -73,7 +73,7 @@ class AddNewMovieModalContentConnector extends Component {
searchForMovie: searchForMovie.value,
tags: tags.value
});
};
}
//
// Render

View File

@@ -39,15 +39,15 @@ class AddNewMovieSearchResult extends Component {
onPress = () => {
this.setState({ isNewAddMovieModalOpen: true });
};
}
onAddMovieModalClose = () => {
this.setState({ isNewAddMovieModalOpen: false });
};
}
onExternalLinkPress = (event) => {
event.stopPropagation();
};
}
//
// Render
@@ -86,13 +86,6 @@ class AddNewMovieSearchResult extends Component {
} = this.state;
const linkProps = isExistingMovie ? { to: `/movie/${titleSlug}` } : { onPress: this.onPress };
const posterWidth = 167;
const posterHeight = 250;
const elementStyle = {
width: `${posterWidth}px`,
height: `${posterHeight}px`
};
return (
<div className={styles.searchResult}>
@@ -109,7 +102,6 @@ class AddNewMovieSearchResult extends Component {
<div className={styles.posterContainer}>
<MoviePoster
className={styles.poster}
style={elementStyle}
images={images}
size={250}
overflow={true}
@@ -122,7 +114,7 @@ class AddNewMovieSearchResult extends Component {
monitored={monitored}
hasFile={hasFile}
status={status}
posterWidth={posterWidth}
posterWidth={167}
detailedProgressBar={true}
queueStatus={queueStatus}
queueState={queueState}
@@ -191,7 +183,7 @@ class AddNewMovieSearchResult extends Component {
<div>
<Label size={sizes.LARGE}>
<HeartRating
ratings={ratings}
rating={ratings.value}
iconSize={13}
/>
</Label>

View File

@@ -32,25 +32,25 @@ class ImportMovie extends Component {
setScrollerRef = (ref) => {
this.setState({ scroller: ref });
};
}
//
// Listeners
getSelectedIds = () => {
return getSelectedIds(this.state.selectedState, { parseIds: false });
};
}
onSelectAllChange = ({ value }) => {
// Only select non-dupes
this.setState(selectAll(this.state.selectedState, value));
};
}
onSelectedChange = ({ id, value, shiftKey = false }) => {
this.setState((state) => {
return toggleSelected(state, this.props.items, id, value, shiftKey);
});
};
}
onRemoveSelectedStateItem = (id) => {
this.setState((state) => {
@@ -62,15 +62,15 @@ class ImportMovie extends Component {
selectedState
};
});
};
}
onInputChange = ({ name, value }) => {
this.props.onInputChange(this.getSelectedIds(), name, value);
};
}
onImportPress = () => {
this.props.onImportPress(this.getSelectedIds());
};
}
//
// Render

View File

@@ -112,11 +112,11 @@ class ImportMovieConnector extends Component {
[name]: value
});
});
};
}
onImportPress = (ids) => {
this.props.dispatchImportMovie({ ids });
};
}
//
// Render

View File

@@ -83,7 +83,7 @@ class ImportMovieFooter extends Component {
onInputChange = ({ name, value }) => {
this.setState({ [name]: value });
this.props.onInputChange({ name, value });
};
}
//
// Render

View File

@@ -48,7 +48,7 @@ class ImportMovieRowConnector extends Component {
id: this.props.id,
[name]: value
});
};
}
//
// Render

View File

@@ -121,7 +121,7 @@ class ImportMovieTable extends Component {
/>
</VirtualTableRow>
);
};
}
//
// Render

View File

@@ -11,7 +11,7 @@ class ImportMovieSearchResult extends Component {
onPress = () => {
this.props.onPress(this.props.tmdbId);
};
}
//
// Render

View File

@@ -69,7 +69,7 @@ class ImportMovieSelectMovie extends Component {
this.setState({ isOpen: false });
this._removeListener();
}
};
}
onPress = () => {
if (this.state.isOpen) {
@@ -79,7 +79,7 @@ class ImportMovieSelectMovie extends Component {
}
this.setState({ isOpen: !this.state.isOpen });
};
}
onSearchInputChange = ({ value }) => {
if (this._movieLookupTimeout) {
@@ -91,17 +91,17 @@ class ImportMovieSelectMovie extends Component {
this.props.onSearchInputChange(value);
}, 200);
});
};
}
onRefreshPress = () => {
this.props.onSearchInputChange(this.state.term);
};
}
onMovieSelect = (tmdbId) => {
this.setState({ isOpen: false });
this.props.onMovieSelect(tmdbId);
};
}
//
// Render

View File

@@ -36,7 +36,7 @@ class ImportMovieSelectMovieConnector extends Component {
term,
topOfQueue: true
});
};
}
onMovieSelect = (tmdbId) => {
const {
@@ -48,7 +48,7 @@ class ImportMovieSelectMovieConnector extends Component {
id,
selectedMovie: _.find(items, { tmdbId })
});
};
}
//
// Render

View File

@@ -25,7 +25,7 @@ class ImportMovieRootFolderRowConnector extends Component {
onDeletePress = () => {
this.props.deleteRootFolder({ id: this.props.id });
};
}
//
// Render

View File

@@ -55,15 +55,15 @@ class ImportMovieSelectFolder extends Component {
onAddNewRootFolderPress = () => {
this.setState({ isAddNewRootFolderModalOpen: true });
};
}
onNewRootFolderSelect = ({ value }) => {
this.props.onNewRootFolderSelect(value);
};
}
onAddRootFolderModalClose = () => {
this.setState({ isAddNewRootFolderModalOpen: false });
};
}
//
// Render

View File

@@ -58,11 +58,11 @@ class ImportMovieSelectFolderConnector extends Component {
onNewRootFolderSelect = (path) => {
this.props.addRootFolder({ path });
};
}
onDeleteRootFolderPress = (id) => {
this.props.deleteRootFolder({ id });
};
}
//
// Render

View File

@@ -27,11 +27,11 @@ class AgendaEvent extends Component {
onPress = () => {
this.setState({ isDetailsModalOpen: true });
};
}
onDetailsModalClose = () => {
this.setState({ isDetailsModalOpen: false });
};
}
//
// Render

View File

@@ -119,43 +119,43 @@ class CalendarConnector extends Component {
this.props.fetchQueueDetails({ time, view });
this.props.fetchCalendar({ time, view });
};
}
scheduleUpdate = () => {
this.clearUpdateTimeout();
this.updateTimeoutId = setTimeout(this.updateCalendar, UPDATE_DELAY);
};
}
clearUpdateTimeout = () => {
if (this.updateTimeoutId) {
clearTimeout(this.updateTimeoutId);
}
};
}
updateCalendar = () => {
this.props.gotoCalendarToday();
this.scheduleUpdate();
};
}
//
// Listeners
onCalendarViewChange = (view) => {
this.props.setCalendarView({ view });
};
}
onTodayPress = () => {
this.props.gotoCalendarToday();
};
}
onPreviousPress = () => {
this.props.gotoCalendarPreviousRange();
};
}
onNextPress = () => {
this.props.gotoCalendarNextRange();
};
}
//
// Render

View File

@@ -44,23 +44,23 @@ class CalendarPage extends Component {
const days = Math.max(3, Math.min(7, Math.floor(width / MINIMUM_DAY_WIDTH)));
this.props.onDaysCountChange(days);
};
}
onGetCalendarLinkPress = () => {
this.setState({ isCalendarLinkModalOpen: true });
};
}
onGetCalendarLinkModalClose = () => {
this.setState({ isCalendarLinkModalOpen: false });
};
}
onOptionsPress = () => {
this.setState({ isOptionsModalOpen: true });
};
}
onOptionsModalClose = () => {
this.setState({ isOptionsModalOpen: false });
};
}
onSearchMissingPress = () => {
const {
@@ -69,7 +69,7 @@ class CalendarPage extends Component {
} = this.props;
onSearchMissingPress(missingMovieIds);
};
}
//
// Render

View File

@@ -60,20 +60,20 @@ class CalendarDays extends Component {
this.setState({ todaysDate: todaysDate.toISOString() });
this.updateTimeoutId = setTimeout(this.scheduleUpdate, diff);
};
}
clearUpdateTimeout = () => {
if (this.updateTimeoutId) {
clearTimeout(this.updateTimeoutId);
}
};
}
//
// Listeners
onEventModalOpenToggle = (isEventModalOpen) => {
this.setState({ isEventModalOpen });
};
}
onTouchStart = (event) => {
const touches = event.touches;
@@ -92,7 +92,7 @@ class CalendarDays extends Component {
}
this._touchStart = touchStart;
};
}
onTouchEnd = (event) => {
const touches = event.changedTouches;
@@ -109,17 +109,17 @@ class CalendarDays extends Component {
}
this._touchStart = null;
};
}
onTouchCancel = (event) => {
this._touchStart = null;
};
}
onTouchMove = (event) => {
if (!this._touchStart) {
return;
}
};
}
//
// Render

View File

@@ -47,13 +47,13 @@ class DaysOfWeek extends Component {
});
this.updateTimeoutId = setTimeout(this.scheduleUpdate, diff);
};
}
clearUpdateTimeout = () => {
if (this.updateTimeoutId) {
clearTimeout(this.updateTimeoutId);
}
};
}
//
// Render

View File

@@ -43,15 +43,15 @@ class CalendarEvent extends Component {
const link = `/movie/${titleSlug}`;
const eventType = [];
if (inCinemas && moment(date).isSame(moment(inCinemas), 'day')) {
if (moment(date).isSame(moment(inCinemas), 'day')) {
eventType.push('Cinemas');
}
if (physicalRelease && moment(date).isSame(moment(physicalRelease), 'day')) {
if (moment(date).isSame(moment(physicalRelease), 'day')) {
eventType.push('Physical');
}
if (digitalRelease && moment(date).isSame(moment(digitalRelease), 'day')) {
if (moment(date).isSame(moment(digitalRelease), 'day')) {
eventType.push('Digital');
}

View File

@@ -71,7 +71,7 @@ class CalendarHeader extends Component {
this.setState({ view }, () => {
this.props.onViewChange(view);
});
};
}
//
// Render

View File

@@ -41,19 +41,19 @@ class CalendarHeaderConnector extends Component {
onViewChange = (view) => {
this.props.setCalendarView({ view });
};
}
onTodayPress = () => {
this.props.gotoCalendarToday();
};
}
onPreviousPress = () => {
this.props.gotoCalendarPreviousRange();
};
}
onNextPress = () => {
this.props.gotoCalendarNextRange();
};
}
//
// Render

View File

@@ -12,7 +12,7 @@ class CalendarHeaderViewButton extends Component {
onPress = () => {
this.props.onPress(this.props.view);
};
}
//
// Render

View File

@@ -69,7 +69,7 @@ class CalendarOptionsModalContent extends Component {
} = this.props;
dispatchSetCalendarOption({ [name]: value });
};
}
onGlobalInputChange = ({ name, value }) => {
const {
@@ -81,11 +81,11 @@ class CalendarOptionsModalContent extends Component {
this.setState(setting, () => {
dispatchSaveUISettings(setting);
});
};
}
onLinkFocus = (event) => {
event.target.select();
};
}
//
// Render

View File

@@ -84,11 +84,11 @@ class CalendarLinkModalContent extends Component {
[name]: value,
...urls
});
};
}
onLinkFocus = (event) => {
event.target.select();
};
}
//
// Render

View File

@@ -70,18 +70,18 @@ class FileBrowserModalContent extends Component {
} else {
this._scrollerNode = null;
}
};
}
//
// Listeners
onPathInputChange = ({ value }) => {
this.setState({ currentPath: value });
};
}
onRowPress = (path) => {
this.props.onFetchPaths(path);
};
}
onOkPress = () => {
this.props.onChange({
@@ -91,7 +91,7 @@ class FileBrowserModalContent extends Component {
this.props.onClearPaths();
this.props.onModalClose();
};
}
//
// Render

View File

@@ -78,16 +78,16 @@ class FileBrowserModalContentConnector extends Component {
allowFoldersWithoutTrailingSlashes: true,
includeFiles
});
};
}
onClearPaths = () => {
// this.props.dispatchClearPaths();
};
}
onModalClose = () => {
this.props.dispatchClearPaths();
this.props.onModalClose();
};
}
//
// Render

View File

@@ -28,7 +28,7 @@ class FileBrowserRow extends Component {
onPress = () => {
this.props.onPress(this.props.path);
};
}
//
// Render

View File

@@ -103,7 +103,7 @@ class DateFilterBuilderRowValue extends Component {
name: NAME,
value: newValue
});
};
}
onTimeChange = ({ value }) => {
const {
@@ -118,7 +118,7 @@ class DateFilterBuilderRowValue extends Component {
value: filterValue.value
}
});
};
}
//
// Render
@@ -161,7 +161,6 @@ class DateFilterBuilderRowValue extends Component {
<TextInput
name={NAME}
value={filterValue}
type="date"
placeholder="yyyy-mm-dd"
onChange={this.onValueChange}
/>

View File

@@ -63,7 +63,7 @@ class FilterBuilderModalContent extends Component {
onLabelChange = ({ value }) => {
this.setState({ label: value });
};
}
onFilterChange = (index, filter) => {
const filters = [...this.state.filters];
@@ -72,7 +72,7 @@ class FilterBuilderModalContent extends Component {
this.setState({
filters
});
};
}
onAddFilterPress = () => {
const filters = [...this.state.filters];
@@ -81,7 +81,7 @@ class FilterBuilderModalContent extends Component {
this.setState({
filters
});
};
}
onRemoveFilterPress = (index) => {
const filters = [...this.state.filters];
@@ -90,7 +90,7 @@ class FilterBuilderModalContent extends Component {
this.setState({
filters
});
};
}
onSaveFilterPress = () => {
const {
@@ -122,7 +122,7 @@ class FilterBuilderModalContent extends Component {
label,
filters
});
};
}
//
// Render
@@ -166,9 +166,7 @@ class FilterBuilderModalContent extends Component {
</div>
</div>
<div className={styles.label}>
{translate('Filters')}
</div>
<div className={styles.label}>Filters</div>
<div className={styles.rows}>
{

View File

@@ -154,7 +154,7 @@ class FilterBuilderRow extends Component {
this.selectedFilterBuilderProp = selectedFilterBuilderProp;
onFilterChange(index, filter);
};
}
onFilterChange = ({ name, value }) => {
const {
@@ -174,7 +174,7 @@ class FilterBuilderRow extends Component {
filter[name] = value;
onFilterChange(index, filter);
};
}
onAddPress = () => {
const {
@@ -183,7 +183,7 @@ class FilterBuilderRow extends Component {
} = this.props;
onAddPress(index);
};
}
onRemovePress = () => {
const {
@@ -192,7 +192,7 @@ class FilterBuilderRow extends Component {
} = this.props;
onRemovePress(index);
};
}
//
// Render

View File

@@ -84,7 +84,7 @@ class FilterBuilderRowValue extends Component {
name: NAME,
value: [...filterValue, value]
});
};
}
onTagDelete = ({ index }) => {
const {
@@ -98,7 +98,7 @@ class FilterBuilderRowValue extends Component {
name: NAME,
value
});
};
}
//
// Render

View File

@@ -47,7 +47,7 @@ class IndexerFilterBuilderRowValueConnector extends Component {
if (!this.props.isPopulated) {
this.props.dispatchFetchIndexers();
}
};
}
//
// Render

View File

@@ -43,7 +43,7 @@ class QualityFilterBuilderRowValueConnector extends Component {
if (!this.props.isPopulated) {
this.props.dispatchFetchQualityProfileSchema();
}
};
}
//
// Render

View File

@@ -55,7 +55,7 @@ class CustomFilter extends Component {
} = this.props;
onEditPress(id);
};
}
onRemovePress = () => {
const {
@@ -67,7 +67,7 @@ class CustomFilter extends Component {
dispatchDeleteCustomFilter({ id });
});
};
}
//
// Render

View File

@@ -25,14 +25,14 @@ class FilterModal extends Component {
this.setState({
filterBuilder: true
});
};
}
onEditCustomFilter = (id) => {
this.setState({
filterBuilder: true,
id
});
};
}
onCancelPress = () => {
if (this.state.filterBuilder) {
@@ -43,7 +43,7 @@ class FilterModal extends Component {
} else {
this.onModalClose();
}
};
}
onModalClose = () => {
this.setState({
@@ -52,7 +52,7 @@ class FilterModal extends Component {
}, () => {
this.props.onModalClose();
});
};
}
//
// Render

View File

@@ -35,11 +35,11 @@ class AutoCompleteInput extends Component {
name: this.props.name,
value: newValue
});
};
}
onInputBlur = () => {
this.setState({ suggestions: [] });
};
}
onSuggestionsFetchRequested = ({ value }) => {
const { values } = this.props;
@@ -50,11 +50,11 @@ class AutoCompleteInput extends Component {
});
this.setState({ suggestions: filteredValues });
};
}
onSuggestionsClearRequested = () => {
this.setState({ suggestions: [] });
};
}
//
// Render

View File

@@ -49,7 +49,7 @@ class AutoSuggestInput extends Component {
}}
</Reference>
);
};
}
renderSuggestionsContainer = ({ containerProps, children }) => {
return (
@@ -90,7 +90,7 @@ class AutoSuggestInput extends Component {
</Popper>
</Portal>
);
};
}
//
// Listeners
@@ -113,14 +113,14 @@ class AutoSuggestInput extends Component {
data.styles.width = width;
return data;
};
}
onInputChange = (event, { newValue }) => {
this.props.onChange({
name: this.props.name,
value: newValue
});
};
}
onInputKeyDown = (event) => {
const {
@@ -144,7 +144,7 @@ class AutoSuggestInput extends Component {
});
}
}
};
}
//
// Render

View File

@@ -6,7 +6,8 @@ import SelectInput from './SelectInput';
const availabilityOptions = [
{ key: 'announced', value: translate('Announced') },
{ key: 'inCinemas', value: translate('InCinemas') },
{ key: 'released', value: translate('Released') }
{ key: 'released', value: translate('Released') },
{ key: 'preDB', value: translate('PreDB') }
];
function AvailabilitySelectInput(props) {

View File

@@ -39,7 +39,7 @@ class CaptchaInputConnector extends Component {
componentWillUnmount = () => {
this.props.resetCaptcha();
};
}
//
// Listeners
@@ -51,7 +51,7 @@ class CaptchaInputConnector extends Component {
} = this.props;
this.props.refreshCaptcha({ provider, providerData });
};
}
onCaptchaChange = (captchaResponse) => {
// If the captcha has expired `captchaResponse` will be null.
@@ -68,7 +68,7 @@ class CaptchaInputConnector extends Component {
} = this.props;
this.props.getCaptchaCookie({ provider, providerData, captchaResponse });
};
}
//
// Render

View File

@@ -59,14 +59,14 @@ class CheckInput extends Component {
shiftKey
});
}
};
}
//
// Listeners
setRef = (ref) => {
this._checkbox = ref;
};
}
onClick = (event) => {
if (this.props.isDisabled) {
@@ -78,14 +78,14 @@ class CheckInput extends Component {
event.preventDefault();
this.toggleChecked(checked, shiftKey);
};
}
onChange = (event) => {
const checked = event.target.checked;
const shiftKey = event.nativeEvent.shiftKey;
this.toggleChecked(checked, shiftKey);
};
}
//
// Render

View File

@@ -23,7 +23,7 @@ class DeviceInput extends Component {
name,
value: [...value, deviceId]
});
};
}
onTagDelete = ({ index }) => {
const {
@@ -39,7 +39,7 @@ class DeviceInput extends Component {
name,
value: newValue
});
};
}
//
// Render

View File

@@ -48,11 +48,11 @@ class DeviceInputConnector extends Component {
componentDidMount = () => {
this._populate();
};
}
componentWillUnmount = () => {
this.props.dispatchClearOptions({ section: 'devices' });
};
}
//
// Control
@@ -77,7 +77,7 @@ class DeviceInputConnector extends Component {
onRefreshPress = () => {
this._populate();
};
}
//
// Render

View File

@@ -1,100 +0,0 @@
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { fetchDownloadClients } from 'Store/Actions/settingsActions';
import sortByName from 'Utilities/Array/sortByName';
import EnhancedSelectInput from './EnhancedSelectInput';
function createMapStateToProps() {
return createSelector(
(state) => state.settings.downloadClients,
(state, { includeAny }) => includeAny,
(state, { protocol }) => protocol,
(downloadClients, includeAny, protocolFilter) => {
const {
isFetching,
isPopulated,
error,
items
} = downloadClients;
const filteredItems = items.filter((item) => item.protocol === protocolFilter);
const values = _.map(filteredItems.sort(sortByName), (downloadClient) => {
return {
key: downloadClient.id,
value: downloadClient.name
};
});
if (includeAny) {
values.unshift({
key: 0,
value: '(Any)'
});
}
return {
isFetching,
isPopulated,
error,
values
};
}
);
}
const mapDispatchToProps = {
dispatchFetchDownloadClients: fetchDownloadClients
};
class DownloadClientSelectInputConnector extends Component {
//
// Lifecycle
componentDidMount() {
if (!this.props.isPopulated) {
this.props.dispatchFetchDownloadClients();
}
}
//
// Listeners
onChange = ({ name, value }) => {
this.props.onChange({ name, value: parseInt(value) });
};
//
// Render
render() {
return (
<EnhancedSelectInput
{...this.props}
onChange={this.onChange}
/>
);
}
}
DownloadClientSelectInputConnector.propTypes = {
isFetching: PropTypes.bool.isRequired,
isPopulated: PropTypes.bool.isRequired,
name: PropTypes.string.isRequired,
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
values: PropTypes.arrayOf(PropTypes.object).isRequired,
includeAny: PropTypes.bool.isRequired,
onChange: PropTypes.func.isRequired,
dispatchFetchDownloadClients: PropTypes.func.isRequired
};
DownloadClientSelectInputConnector.defaultProps = {
includeAny: false,
protocol: 'torrent'
};
export default connect(createMapStateToProps, mapDispatchToProps)(DownloadClientSelectInputConnector);

View File

@@ -12,9 +12,9 @@ import ModalBody from 'Components/Modal/ModalBody';
import Portal from 'Components/Portal';
import Scroller from 'Components/Scroller/Scroller';
import { icons, scrollDirections, sizes } from 'Helpers/Props';
import { isMobile as isMobileUtil } from 'Utilities/browser';
import * as keyCodes from 'Utilities/Constants/keyCodes';
import getUniqueElememtId from 'Utilities/getUniqueElementId';
import { isMobile as isMobileUtil } from 'Utilities/mobile';
import HintedSelectInputOption from './HintedSelectInputOption';
import HintedSelectInputSelectedValue from './HintedSelectInputSelectedValue';
import TextInput from './TextInput';
@@ -149,7 +149,7 @@ class EnhancedSelectInput extends Component {
}
return data;
};
}
onWindowClick = (event) => {
const button = document.getElementById(this._buttonId);
@@ -168,14 +168,14 @@ class EnhancedSelectInput extends Component {
this.setState({ isOpen: false });
this._removeListener();
}
};
}
onFocus = () => {
if (this.state.isOpen) {
this._removeListener();
this.setState({ isOpen: false });
}
};
}
onBlur = () => {
if (!this.props.isEditable) {
@@ -186,7 +186,7 @@ class EnhancedSelectInput extends Component {
this.setState({ selectedIndex: origIndex });
}
}
};
}
onKeyDown = (event) => {
const {
@@ -253,7 +253,7 @@ class EnhancedSelectInput extends Component {
if (!_.isEmpty(newState)) {
this.setState(newState);
}
};
}
onPress = () => {
if (this.state.isOpen) {
@@ -267,7 +267,7 @@ class EnhancedSelectInput extends Component {
}
this.setState({ isOpen: !this.state.isOpen });
};
}
onSelect = (value) => {
if (Array.isArray(this.props.value)) {
@@ -291,15 +291,15 @@ class EnhancedSelectInput extends Component {
value
});
}
};
}
onMeasure = ({ width }) => {
this.setState({ width });
};
}
onOptionsModalClose = () => {
this.setState({ isOpen: false });
};
}
//
// Render

View File

@@ -73,7 +73,7 @@ class EnhancedSelectInputConnector extends Component {
componentDidMount = () => {
this._populate();
};
}
componentDidUpdate = (prevProps) => {
const prevKey = getProviderDataKey(prevProps.providerData);
@@ -82,11 +82,11 @@ class EnhancedSelectInputConnector extends Component {
if (!_.isEqual(prevKey, nextKey)) {
this.setState({ refetchRequired: true });
}
};
}
componentWillUnmount = () => {
this._cleanup();
};
}
//
// Listeners
@@ -95,7 +95,7 @@ class EnhancedSelectInputConnector extends Component {
if (this.state.refetchRequired) {
this._populate();
}
};
}
//
// Control

View File

@@ -21,11 +21,11 @@ class EnhancedSelectInputOption extends Component {
} = this.props;
onSelect(id);
};
}
onCheckPress = () => {
// CheckInput requires a handler. Swallow the change event because onPress will already handle it via event propagation.
};
}
//
// Render

View File

@@ -8,7 +8,6 @@ import AvailabilitySelectInput from './AvailabilitySelectInput';
import CaptchaInputConnector from './CaptchaInputConnector';
import CheckInput from './CheckInput';
import DeviceInputConnector from './DeviceInputConnector';
import DownloadClientSelectInputConnector from './DownloadClientSelectInputConnector';
import EnhancedSelectInput from './EnhancedSelectInput';
import EnhancedSelectInputConnector from './EnhancedSelectInputConnector';
import FormInputHelpText from './FormInputHelpText';
@@ -74,9 +73,6 @@ function getComponent(type) {
case inputTypes.INDEXER_FLAGS_SELECT:
return IndexerFlagsSelectInputConnector;
case inputTypes.DOWNLOAD_CLIENT_SELECT:
return DownloadClientSelectInputConnector;
case inputTypes.LANGUAGE_SELECT:
return LanguageSelectInputConnector;

View File

@@ -43,7 +43,7 @@ class IndexerFlagsSelectInputConnector extends Component {
});
this.props.onChange({ name, value: indexerFlags });
};
}
//
// Render

View File

@@ -39,7 +39,7 @@ class KeyValueListInput extends Component {
name,
value: newValue
});
};
}
onRemoveItem = (index) => {
const {
@@ -55,13 +55,13 @@ class KeyValueListInput extends Component {
name,
value: newValue
});
};
}
onFocus = () => {
this.setState({
isFocused: true
});
};
}
onBlur = () => {
this.setState({
@@ -88,7 +88,7 @@ class KeyValueListInput extends Component {
value: newValue
});
}
};
}
//
// Render

View File

@@ -18,7 +18,7 @@ class KeyValueListInputItem extends Component {
} = this.props;
onChange(index, { key: keyValue, value });
};
}
onValueChange = ({ value }) => {
// TODO: Validate here or validate at a lower level component
@@ -30,7 +30,7 @@ class KeyValueListInputItem extends Component {
} = this.props;
onChange(index, { key: keyValue, value });
};
}
onRemovePress = () => {
const {
@@ -39,15 +39,15 @@ class KeyValueListInputItem extends Component {
} = this.props;
onRemove(index);
};
}
onFocus = () => {
this.props.onFocus();
};
}
onBlur = () => {
this.props.onBlur();
};
}
//
// Render

View File

@@ -59,11 +59,11 @@ class NumberInput extends Component {
value: parseValue(this.props, value)
});
};
}
onFocus = () => {
this.setState({ isFocused: true });
};
}
onBlur = () => {
const {
@@ -88,7 +88,7 @@ class NumberInput extends Component {
name,
value: parsedValue
});
};
}
//
// Render

View File

@@ -41,7 +41,7 @@ class OAuthInputConnector extends Component {
componentWillUnmount = () => {
this.props.resetOAuth();
};
}
//
// Listeners
@@ -60,7 +60,7 @@ class OAuthInputConnector extends Component {
providerData,
section
});
};
}
//
// Render

View File

@@ -62,7 +62,7 @@ class PathInput extends Component {
onInputChange = ({ value }) => {
this.setState({ value });
};
}
onInputKeyDown = (event) => {
if (event.key === 'Tab') {
@@ -80,7 +80,7 @@ class PathInput extends Component {
}
}
}
};
}
onInputBlur = () => {
this.props.onChange({
@@ -89,28 +89,28 @@ class PathInput extends Component {
});
this.props.onClearPaths();
};
}
onSuggestionsFetchRequested = ({ value }) => {
this.props.onFetchPaths(value);
};
}
onSuggestionsClearRequested = () => {
// Required because props aren't always rendered, but no-op
// because we don't want to reset the paths after a path is selected.
};
}
onSuggestionSelected = (event, { suggestionValue }) => {
this.props.onFetchPaths(suggestionValue);
};
}
onFileBrowserOpenPress = () => {
this.setState({ isFileBrowserModalOpen: true });
};
}
onFileBrowserModalClose = () => {
this.setState({ isFileBrowserModalOpen: false });
};
}
//
// Render

View File

@@ -47,11 +47,11 @@ class PathInputConnector extends Component {
path,
includeFiles
});
};
}
onClearPaths = () => {
this.props.dispatchClearPaths();
};
}
//
// Render

View File

@@ -69,7 +69,7 @@ class QualityProfileSelectInputConnector extends Component {
onChange = ({ name, value }) => {
this.props.onChange({ name, value: parseInt(value) });
};
}
//
// Render

View File

@@ -49,17 +49,17 @@ class RootFolderSelectInput extends Component {
} else {
this.props.onChange({ name, value });
}
};
}
onNewRootFolderSelect = ({ value }) => {
this.setState({ newRootFolderPath: value }, () => {
this.props.onNewRootFolderSelect(value);
});
};
}
onAddRootFolderModalClose = () => {
this.setState({ isAddNewRootFolderModalOpen: false });
};
}
//
// Render

View File

@@ -134,7 +134,7 @@ class RootFolderSelectInputConnector extends Component {
onNewRootFolderSelect = (path) => {
this.props.dispatchAddRootFolder(path);
};
}
//
// Render

View File

@@ -13,7 +13,7 @@ class SelectInput extends Component {
name: this.props.name,
value: event.target.value
});
};
}
//
// Render

View File

@@ -49,7 +49,7 @@ class TagInput extends Component {
_setAutosuggestRef = (ref) => {
this._autosuggestRef = ref;
};
}
getSuggestionValue({ name }) {
return name;
@@ -57,7 +57,7 @@ class TagInput extends Component {
shouldRenderSuggestions = (value) => {
return value.length >= this.props.minQueryLength;
};
}
renderSuggestion({ name }) {
return name;
@@ -70,14 +70,14 @@ class TagInput extends Component {
value: '',
suggestions: []
});
}, 250, { leading: true, trailing: false });
}, 250, { leading: true, trailing: false })
//
// Listeners
onInputContainerPress = () => {
this._autosuggestRef.input.focus();
};
}
onInputChange = (event, { newValue, method }) => {
const value = _.isObject(newValue) ? newValue.name : newValue;
@@ -85,7 +85,7 @@ class TagInput extends Component {
if (method === 'type') {
this.setState({ value });
}
};
}
onInputKeyDown = (event) => {
const {
@@ -125,11 +125,11 @@ class TagInput extends Component {
event.preventDefault();
}
}
};
}
onInputFocus = () => {
this.setState({ isFocused: true });
};
}
onInputBlur = () => {
this.setState({ isFocused: false });
@@ -153,7 +153,7 @@ class TagInput extends Component {
if (tag) {
this.addTag(tag);
}
};
}
onSuggestionsFetchRequested = ({ value }) => {
const lowerCaseValue = value.toLowerCase();
@@ -170,16 +170,16 @@ class TagInput extends Component {
});
this.setState({ suggestions });
};
}
onSuggestionsClearRequested = () => {
// Required because props aren't always rendered, but no-op
// because we don't want to reset the paths after a path is selected.
};
}
onSuggestionSelected = (event, { suggestion }) => {
this.addTag(suggestion);
};
}
//
// Render
@@ -204,7 +204,7 @@ class TagInput extends Component {
onInputContainerPress={this.onInputContainerPress}
/>
);
};
}
render() {
const {

View File

@@ -101,7 +101,7 @@ class TagInputConnector extends Component {
newValue.push(tag.id);
this.props.onChange({ name, value: newValue });
};
}
onTagDelete = ({ index }) => {
const {
@@ -116,7 +116,7 @@ class TagInputConnector extends Component {
name,
value: newValue
});
};
}
onTagCreated = (tag) => {
const {
@@ -128,7 +128,7 @@ class TagInputConnector extends Component {
newValue.push(tag.id);
this.props.onChange({ name, value: newValue });
};
}
//
// Render

View File

@@ -19,7 +19,7 @@ class TagInputInput extends Component {
}
onInputContainerPress();
};
}
render() {
const {

View File

@@ -22,7 +22,7 @@ class TagInputTag extends Component {
index,
id: tag.id
});
};
}
//
// Render

View File

@@ -60,7 +60,7 @@ class TagSelectInputConnector extends Component {
}
this.props.onChange({ name, value: newValue });
};
}
onTagDelete = ({ index }) => {
const {
@@ -75,7 +75,7 @@ class TagSelectInputConnector extends Component {
name,
value: newValue
});
};
}
//
// Render

View File

@@ -35,7 +35,7 @@ class TextArea extends Component {
setInputRef = (ref) => {
this._input = ref;
};
}
selectionChange() {
if (this._selectionTimeout) {
@@ -75,7 +75,7 @@ class TextArea extends Component {
};
onChange(payload);
};
}
onFocus = (event) => {
if (this.props.onFocus) {
@@ -83,19 +83,19 @@ class TextArea extends Component {
}
this.selectionChange();
};
}
onKeyUp = () => {
this.selectionChange();
};
}
onMouseDown = () => {
this._isMouseTarget = true;
};
}
onMouseUp = () => {
this.selectionChange();
};
}
onDocumentMouseUp = () => {
if (this._isMouseTarget) {
@@ -103,7 +103,7 @@ class TextArea extends Component {
}
this._isMouseTarget = false;
};
}
//
// Render

View File

@@ -35,7 +35,7 @@ class TextInput extends Component {
setInputRef = (ref) => {
this._input = ref;
};
}
selectionChange() {
if (this._selectionTimeout) {
@@ -82,7 +82,7 @@ class TextInput extends Component {
}
onChange(payload);
};
}
onFocus = (event) => {
if (this.props.onFocus) {
@@ -90,19 +90,19 @@ class TextInput extends Component {
}
this.selectionChange();
};
}
onKeyUp = () => {
this.selectionChange();
};
}
onMouseDown = () => {
this._isMouseTarget = true;
};
}
onMouseUp = () => {
this.selectionChange();
};
}
onDocumentMouseUp = () => {
if (this._isMouseTarget) {
@@ -110,7 +110,7 @@ class TextInput extends Component {
}
this._isMouseTarget = false;
};
}
//
// Render

View File

@@ -53,7 +53,7 @@ class TextTagInputConnector extends Component {
});
onChange({ name, value: newValue.join(',') });
};
}
onTagDelete = ({ index }) => {
const {
@@ -69,7 +69,7 @@ class TextTagInputConnector extends Component {
name,
value: newValue.join(',')
});
};
}
//
// Render

View File

@@ -1,5 +1,4 @@
.image {
align-content: center;
.heart {
margin-right: 5px;
vertical-align: -0.125em;
color: $themeRed;
}

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +0,0 @@
.image {
align-content: center;
margin-right: 5px;
vertical-align: -0.125em;
}

File diff suppressed because one or more lines are too long

View File

@@ -63,7 +63,7 @@ class ClipboardButton extends Component {
showSuccess: false,
showError: false
});
};
}
//
// Listeners
@@ -72,13 +72,13 @@ class ClipboardButton extends Component {
this.setState({
showSuccess: true
});
};
}
onError = () => {
this.setState({
showError: true
});
};
}
//
// Render

View File

@@ -18,7 +18,7 @@ class Link extends Component {
if (!isDisabled && onPress) {
onPress(event);
}
};
}
//
// Render

View File

@@ -90,7 +90,7 @@ class SpinnerErrorButton extends Component {
hasWarning: false,
hasError: false
});
};
}
//
// Render

View File

@@ -61,7 +61,7 @@ class Marquee extends Component {
} else if (this.state.overflowWidth > 0) {
this.startAnimation();
}
};
}
onHandleMouseLeave = () => {
if (this.props.hoverToStop && this.state.overflowWidth > 0) {
@@ -70,7 +70,7 @@ class Marquee extends Component {
clearTimeout(this.marqueeTimer);
this.setState({ animatedWidth: 0 });
}
};
}
startAnimation = () => {
clearTimeout(this.marqueeTimer);
@@ -108,7 +108,7 @@ class Marquee extends Component {
};
this.marqueeTimer = setTimeout(animate, timeout);
};
}
measureText = () => {
const container = this.container;
@@ -123,7 +123,7 @@ class Marquee extends Component {
this.setState({ overflowWidth });
}
}
};
}
render() {
const style = {

View File

@@ -17,7 +17,7 @@ class Measure extends Component {
onMeasure = _.debounce((payload) => {
this.props.onMeasure(payload);
}, 250, { leading: true, trailing: false });
}, 250, { leading: true, trailing: false })
//
// Render

View File

@@ -25,11 +25,11 @@ class FilterMenu extends Component {
onCustomFiltersPress = () => {
this.setState({ isFilterModalOpen: true });
};
}
onFiltersModalClose = () => {
this.setState({ isFilterModalOpen: false });
};
}
//
// Render

View File

@@ -14,7 +14,7 @@ class FilterMenuItem extends Component {
} = this.props;
onPress(filterKey);
};
}
//
// Render

View File

@@ -124,7 +124,7 @@ class Menu extends Component {
this.setState({ isMenuOpen: false });
this._removeListener();
}
};
}
onTouchStart = (event) => {
const menuButton = document.getElementById(this._menuButtonId);
@@ -148,17 +148,17 @@ class Menu extends Component {
this.setState({ isMenuOpen: false });
this._removeListener();
}
};
}
onWindowResize = () => {
this.setMaxHeight();
};
}
onWindowScroll = (event) => {
if (this.state.isMenuOpen) {
this.setMaxHeight();
}
};
}
onMenuButtonPress = () => {
const state = {
@@ -173,7 +173,7 @@ class Menu extends Component {
}
this.setState(state);
};
}
//
// Render

Some files were not shown because too many files have changed in this diff Show More