mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-16 21:15:33 -04:00
Compare commits
13 Commits
v5.16.3.95
...
v5.17.1.95
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f23c465ee | ||
|
|
af60cca9ae | ||
|
|
d34d23a052 | ||
|
|
0a0da42543 | ||
|
|
e5419f6f06 | ||
|
|
88d9c08f1a | ||
|
|
6b4259757c | ||
|
|
f1d7c56d94 | ||
|
|
c81b2e80ee | ||
|
|
5efefd804b | ||
|
|
38f9543526 | ||
|
|
aae68e681e | ||
|
|
1d21bbf78f |
@@ -9,7 +9,7 @@ variables:
|
||||
testsFolder: './_tests'
|
||||
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
|
||||
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
|
||||
majorVersion: '5.16.3'
|
||||
majorVersion: '5.17.1'
|
||||
minorVersion: $[counter('minorVersion', 2000)]
|
||||
radarrVersion: '$(majorVersion).$(minorVersion)'
|
||||
buildName: '$(Build.SourceBranchName).$(radarrVersion)'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AppSectionProviderState } from 'App/State/AppSectionState';
|
||||
import Metadata from 'typings/Metadata';
|
||||
|
||||
interface MetadataAppState extends AppSectionProviderState<Metadata> {}
|
||||
type MetadataAppState = AppSectionProviderState<Metadata>;
|
||||
|
||||
export default MetadataAppState;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import AppSectionState from 'App/State/AppSectionState';
|
||||
import MovieCredit from 'typings/MovieCredit';
|
||||
|
||||
interface MovieCreditAppState extends AppSectionState<MovieCredit> {}
|
||||
type MovieCreditAppState = AppSectionState<MovieCredit>;
|
||||
|
||||
export default MovieCreditAppState;
|
||||
|
||||
@@ -37,8 +37,7 @@ export interface NamingAppState
|
||||
extends AppSectionItemState<NamingConfig>,
|
||||
AppSectionSaveState {}
|
||||
|
||||
export interface NamingExamplesAppState
|
||||
extends AppSectionItemState<NamingExample> {}
|
||||
export type NamingExamplesAppState = AppSectionItemState<NamingExample>;
|
||||
|
||||
export interface ImportListAppState
|
||||
extends AppSectionState<ImportList>,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { ComponentPropsWithoutRef } from 'react';
|
||||
import styles from './TableRowCell.css';
|
||||
|
||||
export interface TableRowCellProps extends ComponentPropsWithoutRef<'td'> {}
|
||||
export type TableRowCellProps = ComponentPropsWithoutRef<'td'>;
|
||||
|
||||
export default function TableRowCell({
|
||||
className = styles.cell,
|
||||
|
||||
27
frontend/src/MovieFile/Editor/MediaInfo.tsx
Normal file
27
frontend/src/MovieFile/Editor/MediaInfo.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import React from 'react';
|
||||
import DescriptionList from 'Components/DescriptionList/DescriptionList';
|
||||
import DescriptionListItem from 'Components/DescriptionList/DescriptionListItem';
|
||||
import MediaInfoProps from 'typings/MediaInfo';
|
||||
import getEntries from 'Utilities/Object/getEntries';
|
||||
|
||||
function MediaInfo(props: MediaInfoProps) {
|
||||
return (
|
||||
<DescriptionList>
|
||||
{getEntries(props).map(([key, value]) => {
|
||||
const title = key
|
||||
.replace(/([A-Z])/g, ' $1')
|
||||
.replace(/^./, (str) => str.toUpperCase());
|
||||
|
||||
if (!value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<DescriptionListItem key={key} title={title} data={props[key]} />
|
||||
);
|
||||
})}
|
||||
</DescriptionList>
|
||||
);
|
||||
}
|
||||
|
||||
export default MediaInfo;
|
||||
@@ -1,33 +0,0 @@
|
||||
import React from 'react';
|
||||
import DescriptionList from 'Components/DescriptionList/DescriptionList';
|
||||
import DescriptionListItem from 'Components/DescriptionList/DescriptionListItem';
|
||||
|
||||
function MediaInfoPopover(props) {
|
||||
return (
|
||||
<DescriptionList>
|
||||
{
|
||||
Object.keys(props).map((key) => {
|
||||
const title = key
|
||||
.replace(/([A-Z])/g, ' $1')
|
||||
.replace(/^./, (str) => str.toUpperCase());
|
||||
|
||||
const value = props[key];
|
||||
|
||||
if (!value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<DescriptionListItem
|
||||
key={key}
|
||||
title={title}
|
||||
data={props[key]}
|
||||
/>
|
||||
);
|
||||
})
|
||||
}
|
||||
</DescriptionList>
|
||||
);
|
||||
}
|
||||
|
||||
export default MediaInfoPopover;
|
||||
@@ -14,7 +14,7 @@ import MovieFormats from 'Movie/MovieFormats';
|
||||
import MovieLanguages from 'Movie/MovieLanguages';
|
||||
import MovieQuality from 'Movie/MovieQuality';
|
||||
import FileEditModal from 'MovieFile/Edit/FileEditModal';
|
||||
import MediaInfoConnector from 'MovieFile/MediaInfoConnector';
|
||||
import MediaInfo from 'MovieFile/MediaInfo';
|
||||
import * as mediaInfoTypes from 'MovieFile/mediaInfoTypes';
|
||||
import formatBytes from 'Utilities/Number/formatBytes';
|
||||
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
|
||||
@@ -224,7 +224,7 @@ class MovieFileEditorRow extends Component {
|
||||
key={name}
|
||||
className={styles.audio}
|
||||
>
|
||||
<MediaInfoConnector
|
||||
<MediaInfo
|
||||
type={mediaInfoTypes.AUDIO}
|
||||
movieFileId={id}
|
||||
/>
|
||||
@@ -238,7 +238,7 @@ class MovieFileEditorRow extends Component {
|
||||
key={name}
|
||||
className={styles.audioLanguages}
|
||||
>
|
||||
<MediaInfoConnector
|
||||
<MediaInfo
|
||||
type={mediaInfoTypes.AUDIO_LANGUAGES}
|
||||
movieFileId={id}
|
||||
/>
|
||||
@@ -252,7 +252,7 @@ class MovieFileEditorRow extends Component {
|
||||
key={name}
|
||||
className={styles.subtitles}
|
||||
>
|
||||
<MediaInfoConnector
|
||||
<MediaInfo
|
||||
type={mediaInfoTypes.SUBTITLES}
|
||||
movieFileId={id}
|
||||
/>
|
||||
@@ -266,7 +266,7 @@ class MovieFileEditorRow extends Component {
|
||||
key={name}
|
||||
className={styles.video}
|
||||
>
|
||||
<MediaInfoConnector
|
||||
<MediaInfo
|
||||
type={mediaInfoTypes.VIDEO}
|
||||
movieFileId={id}
|
||||
/>
|
||||
@@ -280,7 +280,7 @@ class MovieFileEditorRow extends Component {
|
||||
key={name}
|
||||
className={styles.videoDynamicRangeType}
|
||||
>
|
||||
<MediaInfoConnector
|
||||
<MediaInfo
|
||||
type={mediaInfoTypes.VIDEO_DYNAMIC_RANGE_TYPE}
|
||||
movieFileId={id}
|
||||
/>
|
||||
|
||||
@@ -8,7 +8,7 @@ import ModalFooter from 'Components/Modal/ModalFooter';
|
||||
import ModalHeader from 'Components/Modal/ModalHeader';
|
||||
import { sizes } from 'Helpers/Props';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import MediaInfoPopover from './Editor/MediaInfoPopover';
|
||||
import MediaInfo from './Editor/MediaInfo';
|
||||
|
||||
function FileDetailsModal(props) {
|
||||
const {
|
||||
@@ -31,7 +31,7 @@ function FileDetailsModal(props) {
|
||||
</ModalHeader>
|
||||
|
||||
<ModalBody>
|
||||
<MediaInfoPopover {...mediaInfo} />
|
||||
<MediaInfo {...mediaInfo} />
|
||||
</ModalBody>
|
||||
|
||||
<ModalFooter>
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
import _ from 'lodash';
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import getLanguageName from 'Utilities/String/getLanguageName';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import * as mediaInfoTypes from './mediaInfoTypes';
|
||||
|
||||
function formatLanguages(languages) {
|
||||
if (!languages) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const splitLanguages = _.uniq(languages.split('/')).map((l) => {
|
||||
const simpleLanguage = l.split('_')[0];
|
||||
|
||||
if (simpleLanguage === 'und') {
|
||||
return translate('Unknown');
|
||||
}
|
||||
|
||||
return getLanguageName(simpleLanguage);
|
||||
});
|
||||
|
||||
if (splitLanguages.length > 3) {
|
||||
return (
|
||||
<span title={splitLanguages.join(', ')}>
|
||||
{splitLanguages.slice(0, 2).join(', ')}, {splitLanguages.length - 2} more
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<span>
|
||||
{splitLanguages.join(', ')}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
function MediaInfo(props) {
|
||||
const {
|
||||
type,
|
||||
audioChannels,
|
||||
audioCodec,
|
||||
audioLanguages,
|
||||
subtitles,
|
||||
videoCodec,
|
||||
videoDynamicRangeType
|
||||
} = props;
|
||||
|
||||
if (type === mediaInfoTypes.AUDIO) {
|
||||
return (
|
||||
<span>
|
||||
{
|
||||
audioCodec ? audioCodec : ''
|
||||
}
|
||||
|
||||
{
|
||||
audioCodec && audioChannels ? ' - ' : ''
|
||||
}
|
||||
|
||||
{
|
||||
audioChannels ? audioChannels.toFixed(1) : ''
|
||||
}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
if (type === mediaInfoTypes.AUDIO_LANGUAGES) {
|
||||
return formatLanguages(audioLanguages);
|
||||
}
|
||||
|
||||
if (type === mediaInfoTypes.SUBTITLES) {
|
||||
return formatLanguages(subtitles);
|
||||
}
|
||||
|
||||
if (type === mediaInfoTypes.VIDEO) {
|
||||
return (
|
||||
<span>
|
||||
{videoCodec}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
if (type === mediaInfoTypes.VIDEO_DYNAMIC_RANGE_TYPE) {
|
||||
return (
|
||||
<span>
|
||||
{videoDynamicRangeType}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
MediaInfo.propTypes = {
|
||||
type: PropTypes.string.isRequired,
|
||||
audioChannels: PropTypes.number,
|
||||
audioCodec: PropTypes.string,
|
||||
audioLanguages: PropTypes.string,
|
||||
subtitles: PropTypes.string,
|
||||
videoCodec: PropTypes.string,
|
||||
videoDynamicRangeType: PropTypes.string
|
||||
};
|
||||
|
||||
export default MediaInfo;
|
||||
92
frontend/src/MovieFile/MediaInfo.tsx
Normal file
92
frontend/src/MovieFile/MediaInfo.tsx
Normal file
@@ -0,0 +1,92 @@
|
||||
import React from 'react';
|
||||
import getLanguageName from 'Utilities/String/getLanguageName';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import useMovieFile from './useMovieFile';
|
||||
|
||||
function formatLanguages(languages: string | undefined) {
|
||||
if (!languages) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const splitLanguages = [...new Set(languages.split('/'))].map((l) => {
|
||||
const simpleLanguage = l.split('_')[0];
|
||||
|
||||
if (simpleLanguage === 'und') {
|
||||
return translate('Unknown');
|
||||
}
|
||||
|
||||
return getLanguageName(simpleLanguage);
|
||||
});
|
||||
|
||||
if (splitLanguages.length > 3) {
|
||||
return (
|
||||
<span title={splitLanguages.join(', ')}>
|
||||
{splitLanguages.slice(0, 2).join(', ')}, {splitLanguages.length - 2}{' '}
|
||||
more
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
return <span>{splitLanguages.join(', ')}</span>;
|
||||
}
|
||||
|
||||
export type MediaInfoType =
|
||||
| 'audio'
|
||||
| 'audioLanguages'
|
||||
| 'subtitles'
|
||||
| 'video'
|
||||
| 'videoDynamicRangeType';
|
||||
|
||||
interface MediaInfoProps {
|
||||
movieFileId?: number;
|
||||
type: MediaInfoType;
|
||||
}
|
||||
|
||||
function MediaInfo({ movieFileId, type }: MediaInfoProps) {
|
||||
const movieFile = useMovieFile(movieFileId);
|
||||
|
||||
if (!movieFile?.mediaInfo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const {
|
||||
audioChannels,
|
||||
audioCodec,
|
||||
audioLanguages,
|
||||
subtitles,
|
||||
videoCodec,
|
||||
videoDynamicRangeType,
|
||||
} = movieFile.mediaInfo;
|
||||
|
||||
if (type === 'audio') {
|
||||
return (
|
||||
<span>
|
||||
{audioCodec ? audioCodec : ''}
|
||||
|
||||
{audioCodec && audioChannels ? ' - ' : ''}
|
||||
|
||||
{audioChannels ? audioChannels.toFixed(1) : ''}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
if (type === 'audioLanguages') {
|
||||
return formatLanguages(audioLanguages);
|
||||
}
|
||||
|
||||
if (type === 'subtitles') {
|
||||
return formatLanguages(subtitles);
|
||||
}
|
||||
|
||||
if (type === 'video') {
|
||||
return <span>{videoCodec}</span>;
|
||||
}
|
||||
|
||||
if (type === 'videoDynamicRangeType') {
|
||||
return <span>{videoDynamicRangeType}</span>;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
export default MediaInfo;
|
||||
@@ -1,21 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import createMovieFileSelector from 'Store/Selectors/createMovieFileSelector';
|
||||
import MediaInfo from './MediaInfo';
|
||||
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
createMovieFileSelector(),
|
||||
(movieFile) => {
|
||||
if (movieFile) {
|
||||
return {
|
||||
...movieFile.mediaInfo
|
||||
};
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export default connect(createMapStateToProps)(MediaInfo);
|
||||
@@ -1,17 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import MovieLanguages from 'Movie/MovieLanguages';
|
||||
import createMovieFileSelector from 'Store/Selectors/createMovieFileSelector';
|
||||
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
createMovieFileSelector(),
|
||||
(movieFile) => {
|
||||
return {
|
||||
languages: movieFile ? movieFile.languages : undefined
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export default connect(createMapStateToProps)(MovieLanguages);
|
||||
15
frontend/src/MovieFile/MovieFileLanguages.tsx
Normal file
15
frontend/src/MovieFile/MovieFileLanguages.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
import MovieLanguages from 'Movie/MovieLanguages';
|
||||
import useMovieFile from './useMovieFile';
|
||||
|
||||
interface MovieFileLanguagesProps {
|
||||
movieFileId: number;
|
||||
}
|
||||
|
||||
function MovieFileLanguages({ movieFileId }: MovieFileLanguagesProps) {
|
||||
const movieFile = useMovieFile(movieFileId);
|
||||
|
||||
return <MovieLanguages languages={movieFile?.languages ?? []} />;
|
||||
}
|
||||
|
||||
export default MovieFileLanguages;
|
||||
18
frontend/src/MovieFile/useMovieFile.ts
Normal file
18
frontend/src/MovieFile/useMovieFile.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { useSelector } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import AppState from 'App/State/AppState';
|
||||
|
||||
function createMovieFileSelector(movieFileId?: number) {
|
||||
return createSelector(
|
||||
(state: AppState) => state.movieFiles.items,
|
||||
(movieFiles) => {
|
||||
return movieFiles.find(({ id }) => id === movieFileId);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function useMovieFile(movieFileId: number | undefined) {
|
||||
return useSelector(createMovieFileSelector(movieFileId));
|
||||
}
|
||||
|
||||
export default useMovieFile;
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import AppState from 'App/State/AppState';
|
||||
import Modal from 'Components/Modal/Modal';
|
||||
import { sizes } from 'Helpers/Props';
|
||||
import { clearPendingChanges } from 'Store/Actions/baseActions';
|
||||
@@ -7,7 +8,8 @@ import EditMetadataModalContent, {
|
||||
EditMetadataModalContentProps,
|
||||
} from './EditMetadataModalContent';
|
||||
|
||||
interface EditMetadataModalProps extends EditMetadataModalContentProps {
|
||||
interface EditMetadataModalProps
|
||||
extends Omit<EditMetadataModalContentProps, 'advancedSettings'> {
|
||||
isOpen: boolean;
|
||||
}
|
||||
|
||||
@@ -18,6 +20,10 @@ function EditMetadataModal({
|
||||
}: EditMetadataModalProps) {
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const advancedSettings = useSelector(
|
||||
(state: AppState) => state.settings.advancedSettings
|
||||
);
|
||||
|
||||
const handleModalClose = useCallback(() => {
|
||||
dispatch(clearPendingChanges({ section: 'metadata' }));
|
||||
onModalClose();
|
||||
@@ -27,6 +33,7 @@ function EditMetadataModal({
|
||||
<Modal size={sizes.MEDIUM} isOpen={isOpen} onModalClose={handleModalClose}>
|
||||
<EditMetadataModalContent
|
||||
{...otherProps}
|
||||
advancedSettings={advancedSettings}
|
||||
onModalClose={handleModalClose}
|
||||
/>
|
||||
</Modal>
|
||||
|
||||
@@ -95,7 +95,6 @@ function Metadata({ id, name, enable, fields }: MetadataProps) {
|
||||
) : null}
|
||||
|
||||
<EditMetadataModal
|
||||
advancedSettings={false}
|
||||
id={id}
|
||||
isOpen={isEditMetadataModalOpen}
|
||||
onModalClose={handleModalClose}
|
||||
|
||||
9
frontend/src/Utilities/Object/getEntries.ts
Normal file
9
frontend/src/Utilities/Object/getEntries.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export type Entries<T> = {
|
||||
[K in keyof T]: [K, T[K]];
|
||||
}[keyof T][];
|
||||
|
||||
function getEntries<T extends object>(obj: T): Entries<T> {
|
||||
return Object.entries(obj) as Entries<T>;
|
||||
}
|
||||
|
||||
export default getEntries;
|
||||
@@ -35,7 +35,7 @@ export default function getLanguageName(code: string) {
|
||||
|
||||
try {
|
||||
return languageNames.of(code) ?? code;
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export async function fetchTranslations(): Promise<boolean> {
|
||||
translations = data.Strings;
|
||||
|
||||
resolve(true);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@ import movieEntities from 'Movie/movieEntities';
|
||||
import MovieSearchCell from 'Movie/MovieSearchCell';
|
||||
import MovieStatusConnector from 'Movie/MovieStatusConnector';
|
||||
import MovieTitleLink from 'Movie/MovieTitleLink';
|
||||
import MovieFileLanguageConnector from 'MovieFile/MovieFileLanguageConnector';
|
||||
import MovieFileLanguages from 'MovieFile/MovieFileLanguages';
|
||||
import styles from './CutoffUnmetRow.css';
|
||||
|
||||
function CutoffUnmetRow(props) {
|
||||
@@ -104,7 +104,7 @@ function CutoffUnmetRow(props) {
|
||||
key={name}
|
||||
className={styles.languages}
|
||||
>
|
||||
<MovieFileLanguageConnector
|
||||
<MovieFileLanguages
|
||||
movieFileId={movieFileId}
|
||||
/>
|
||||
</TableRowCell>
|
||||
|
||||
26
package.json
26
package.json
@@ -22,11 +22,11 @@
|
||||
"defaults"
|
||||
],
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-free": "6.6.0",
|
||||
"@fortawesome/fontawesome-svg-core": "6.6.0",
|
||||
"@fortawesome/free-brands-svg-icons": "6.6.0",
|
||||
"@fortawesome/free-regular-svg-icons": "6.6.0",
|
||||
"@fortawesome/free-solid-svg-icons": "6.6.0",
|
||||
"@fortawesome/fontawesome-free": "6.7.1",
|
||||
"@fortawesome/fontawesome-svg-core": "6.7.1",
|
||||
"@fortawesome/free-brands-svg-icons": "6.7.1",
|
||||
"@fortawesome/free-regular-svg-icons": "6.7.1",
|
||||
"@fortawesome/free-solid-svg-icons": "6.7.1",
|
||||
"@fortawesome/react-fontawesome": "0.2.2",
|
||||
"@juggle/resize-observer": "3.4.0",
|
||||
"@microsoft/signalr": "6.0.25",
|
||||
@@ -87,13 +87,13 @@
|
||||
"typescript": "5.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.25.8",
|
||||
"@babel/eslint-parser": "7.25.8",
|
||||
"@babel/plugin-proposal-export-default-from": "7.25.8",
|
||||
"@babel/core": "7.26.0",
|
||||
"@babel/eslint-parser": "7.25.9",
|
||||
"@babel/plugin-proposal-export-default-from": "7.25.9",
|
||||
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
||||
"@babel/preset-env": "7.25.8",
|
||||
"@babel/preset-react": "7.25.7",
|
||||
"@babel/preset-typescript": "7.25.7",
|
||||
"@babel/preset-env": "7.26.0",
|
||||
"@babel/preset-react": "7.26.3",
|
||||
"@babel/preset-typescript": "7.26.0",
|
||||
"@types/lodash": "4.14.195",
|
||||
"@types/react-document-title": "2.0.10",
|
||||
"@types/react-lazyload": "3.2.3",
|
||||
@@ -102,8 +102,8 @@
|
||||
"@types/react-window": "1.8.8",
|
||||
"@types/redux-actions": "2.6.5",
|
||||
"@types/webpack-livereload-plugin": "2.3.6",
|
||||
"@typescript-eslint/eslint-plugin": "6.21.0",
|
||||
"@typescript-eslint/parser": "6.21.0",
|
||||
"@typescript-eslint/eslint-plugin": "8.18.1",
|
||||
"@typescript-eslint/parser": "8.18.1",
|
||||
"autoprefixer": "10.4.20",
|
||||
"babel-loader": "9.2.1",
|
||||
"babel-plugin-inline-classnames": "2.0.1",
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace NzbDrone.Common.Instrumentation.Sentry
|
||||
o.Environment = BuildInfo.Branch;
|
||||
|
||||
// Crash free run statistics (sends a ping for healthy and for crashes sessions)
|
||||
o.AutoSessionTracking = true;
|
||||
o.AutoSessionTracking = false;
|
||||
|
||||
// Caches files in the event device is offline
|
||||
// Sentry creates a 'sentry' sub directory, no need to concat here
|
||||
|
||||
@@ -5,6 +5,7 @@ using FluentAssertions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.CustomFormats;
|
||||
using NzbDrone.Core.DecisionEngine.Specifications;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
@@ -337,5 +338,42 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
|
||||
Subject.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_false_if_quality_profile_does_not_allow_upgrades_but_format_cutoff_is_above_current_score_and_is_revision_upgrade()
|
||||
{
|
||||
var customFormat = new CustomFormat("My Format", new ResolutionSpecification { Value = (int)Resolution.R1080p }) { Id = 1 };
|
||||
|
||||
Mocker.GetMock<IConfigService>()
|
||||
.SetupGet(s => s.DownloadPropersAndRepacks)
|
||||
.Returns(ProperDownloadTypes.DoNotPrefer);
|
||||
|
||||
GivenProfile(new QualityProfile
|
||||
{
|
||||
Cutoff = Quality.SDTV.Id,
|
||||
MinFormatScore = 0,
|
||||
CutoffFormatScore = 10000,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
FormatItems = CustomFormatsTestHelpers.GetSampleFormatItems("My Format"),
|
||||
UpgradeAllowed = false
|
||||
});
|
||||
|
||||
_parseResultSingle.Movie.QualityProfile.FormatItems = new List<ProfileFormatItem>
|
||||
{
|
||||
new ProfileFormatItem
|
||||
{
|
||||
Format = customFormat,
|
||||
Score = 50
|
||||
}
|
||||
};
|
||||
|
||||
GivenFileQuality(new QualityModel(Quality.WEBDL1080p, new Revision(version: 1)));
|
||||
GivenNewQuality(new QualityModel(Quality.WEBDL1080p, new Revision(version: 2)));
|
||||
|
||||
GivenOldCustomFormats(new List<CustomFormat>());
|
||||
GivenNewCustomFormats(new List<CustomFormat> { customFormat });
|
||||
|
||||
Subject.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeFalse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +107,25 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.Should().Be(UpgradeableRejectReason.None);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_false_if_proper_and_autoDownloadPropers_is_do_not_prefer()
|
||||
{
|
||||
GivenAutoDownloadPropers(ProperDownloadTypes.DoNotPrefer);
|
||||
|
||||
var profile = new QualityProfile
|
||||
{
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
};
|
||||
|
||||
Subject.IsUpgradable(
|
||||
profile,
|
||||
new QualityModel(Quality.DVD, new Revision(version: 1)),
|
||||
new List<CustomFormat>(),
|
||||
new QualityModel(Quality.DVD, new Revision(version: 2)),
|
||||
new List<CustomFormat>())
|
||||
.Should().Be(UpgradeableRejectReason.UpgradesNotAllowed);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_false_if_release_and_existing_file_are_the_same()
|
||||
{
|
||||
@@ -121,7 +140,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
new List<CustomFormat>(),
|
||||
new QualityModel(Quality.HDTV720p, new Revision(version: 1)),
|
||||
new List<CustomFormat>())
|
||||
.Should().Be(UpgradeableRejectReason.CustomFormatScore);
|
||||
.Should().Be(UpgradeableRejectReason.UpgradesNotAllowed);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -96,17 +96,9 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
|
||||
case UpgradeableRejectReason.MinCustomFormatScore:
|
||||
return Decision.Reject("Release in queue has Custom Format score within Custom Format score increment: {0}", qualityProfile.MinUpgradeFormatScore);
|
||||
}
|
||||
|
||||
_logger.Debug("Checking if profiles allow upgrading. Queued: {0}", remoteMovie.ParsedMovieInfo.Quality);
|
||||
|
||||
if (!_upgradableSpecification.IsUpgradeAllowed(subject.Movie.QualityProfile,
|
||||
remoteMovie.ParsedMovieInfo.Quality,
|
||||
remoteMovie.CustomFormats,
|
||||
subject.ParsedMovieInfo.Quality,
|
||||
subject.CustomFormats))
|
||||
{
|
||||
return Decision.Reject("Another release is queued and the Quality profile does not allow upgrades");
|
||||
case UpgradeableRejectReason.UpgradesNotAllowed:
|
||||
return Decision.Reject("Release in queue and Quality Profile '{0}' does not allow upgrades", qualityProfile.Name);
|
||||
}
|
||||
|
||||
if (_upgradableSpecification.IsRevisionUpgrade(remoteMovie.ParsedMovieInfo.Quality, subject.ParsedMovieInfo.Quality))
|
||||
|
||||
@@ -107,6 +107,9 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
|
||||
|
||||
case UpgradeableRejectReason.MinCustomFormatScore:
|
||||
return Decision.Reject("{0} grab event in history has Custom Format score within Custom Format score increment: {1}", rejectionSubject, qualityProfile.MinUpgradeFormatScore);
|
||||
|
||||
case UpgradeableRejectReason.UpgradesNotAllowed:
|
||||
return Decision.Reject("{0} grab event in history and Quality Profile '{1}' does not allow upgrades", rejectionSubject, qualityProfile.Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,13 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
return UpgradeableRejectReason.None;
|
||||
}
|
||||
|
||||
if (!qualityProfile.UpgradeAllowed)
|
||||
{
|
||||
_logger.Debug("Quality profile '{0}' does not allow upgrading. Skipping.", qualityProfile.Name);
|
||||
|
||||
return UpgradeableRejectReason.UpgradesNotAllowed;
|
||||
}
|
||||
|
||||
// Reject unless the user does not prefer propers/repacks and it's a revision downgrade.
|
||||
if (downloadPropersAndRepacks != ProperDownloadTypes.DoNotPrefer &&
|
||||
qualityRevisionCompare < 0)
|
||||
@@ -86,7 +93,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
return UpgradeableRejectReason.CustomFormatScore;
|
||||
}
|
||||
|
||||
if (qualityProfile.UpgradeAllowed && currentFormatScore >= qualityProfile.CutoffFormatScore)
|
||||
if (currentFormatScore >= qualityProfile.CutoffFormatScore)
|
||||
{
|
||||
_logger.Debug("Existing item meets cut-off for custom formats, skipping. Existing: [{0}] ({1}). Cutoff score: {2}",
|
||||
currentCustomFormats.ConcatToString(),
|
||||
|
||||
@@ -83,6 +83,9 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
|
||||
case UpgradeableRejectReason.MinCustomFormatScore:
|
||||
return Decision.Reject("Existing file on disk has Custom Format score within Custom Format score increment: {0}", qualityProfile.MinUpgradeFormatScore);
|
||||
|
||||
case UpgradeableRejectReason.UpgradesNotAllowed:
|
||||
return Decision.Reject("Existing file on disk and Quality Profile '{0}' does not allow upgrades", qualityProfile.Name);
|
||||
}
|
||||
|
||||
return Decision.Accept();
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace NzbDrone.Core.DecisionEngine
|
||||
QualityCutoff,
|
||||
CustomFormatScore,
|
||||
CustomFormatCutoff,
|
||||
MinCustomFormatScore
|
||||
MinCustomFormatScore,
|
||||
UpgradesNotAllowed
|
||||
}
|
||||
}
|
||||
|
||||
15
src/NzbDrone.Core/Movies/Events/MoviesBulkEditedEvent.cs
Normal file
15
src/NzbDrone.Core/Movies/Events/MoviesBulkEditedEvent.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Common.Messaging;
|
||||
|
||||
namespace NzbDrone.Core.Movies.Events
|
||||
{
|
||||
public class MoviesBulkEditedEvent : IEvent
|
||||
{
|
||||
public IReadOnlyCollection<Movie> Movies { get; private set; }
|
||||
|
||||
public MoviesBulkEditedEvent(IReadOnlyCollection<Movie> movies)
|
||||
{
|
||||
Movies = movies;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -279,6 +279,7 @@ namespace NzbDrone.Core.Movies
|
||||
|
||||
_movieRepository.UpdateMany(movies);
|
||||
_logger.Debug("{0} movies updated", movies.Count);
|
||||
_eventAggregator.PublishEvent(new MoviesBulkEditedEvent(movies));
|
||||
|
||||
return movies;
|
||||
}
|
||||
@@ -331,6 +332,8 @@ namespace NzbDrone.Core.Movies
|
||||
return true;
|
||||
}
|
||||
|
||||
_logger.Debug("Tags not updated for '{0}'", movie.Title);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
<PackageReference Include="Dapper" Version="2.0.151" />
|
||||
<PackageReference Include="Diacritical.Net" Version="1.0.4" />
|
||||
<PackageReference Include="Equ" Version="2.3.0" />
|
||||
<PackageReference Include="MailKit" Version="3.6.0" />
|
||||
<PackageReference Include="MailKit" Version="4.8.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="6.0.35" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="2.1.7" />
|
||||
<PackageReference Include="Npgsql" Version="7.0.9" />
|
||||
<PackageReference Include="Polly" Version="8.5.0" />
|
||||
<PackageReference Include="Servarr.FFMpegCore" Version="4.7.0-26" />
|
||||
<PackageReference Include="Servarr.FFprobe" Version="5.1.4.112" />
|
||||
<PackageReference Include="System.Memory" Version="4.5.5" />
|
||||
<PackageReference Include="System.Memory" Version="4.6.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="6.0.35" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
|
||||
<PackageReference Include="Servarr.FluentMigrator.Runner" Version="3.3.2.9" />
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace Radarr.Api.V3.Movies
|
||||
IHandle<MovieEditedEvent>,
|
||||
IHandle<MoviesDeletedEvent>,
|
||||
IHandle<MovieRenamedEvent>,
|
||||
IHandle<MoviesBulkEditedEvent>,
|
||||
IHandle<MediaCoversUpdatedEvent>
|
||||
{
|
||||
private readonly IMovieService _moviesService;
|
||||
@@ -370,6 +371,15 @@ namespace Radarr.Api.V3.Movies
|
||||
BroadcastResourceChange(ModelAction.Updated, MapToResource(message.Movie));
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public void Handle(MoviesBulkEditedEvent message)
|
||||
{
|
||||
foreach (var movie in message.Movies)
|
||||
{
|
||||
BroadcastResourceChange(ModelAction.Updated, MapToResource(movie));
|
||||
}
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public void Handle(MediaCoversUpdatedEvent message)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user