mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 20:12:41 +02:00
Fixed: Rejoin MovieFiles to Movies to fix Cutoff short term
This commit is contained in:
parent
fee8244a74
commit
08b642575f
@ -27,11 +27,14 @@ const selectMovieFiles = createSelector(
|
|||||||
|
|
||||||
const hasMovieFiles = !!items.length;
|
const hasMovieFiles = !!items.length;
|
||||||
|
|
||||||
|
const sizeOnDisk = items.map((item) => item.size).reduce((prev, curr) => prev + curr, 0);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isMovieFilesFetching: isFetching,
|
isMovieFilesFetching: isFetching,
|
||||||
isMovieFilesPopulated: isPopulated,
|
isMovieFilesPopulated: isPopulated,
|
||||||
movieFilesError: error,
|
movieFilesError: error,
|
||||||
hasMovieFiles
|
hasMovieFiles,
|
||||||
|
sizeOnDisk
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -54,8 +57,9 @@ function createMapStateToProps() {
|
|||||||
const {
|
const {
|
||||||
isMovieFilesFetching,
|
isMovieFilesFetching,
|
||||||
isMovieFilesPopulated,
|
isMovieFilesPopulated,
|
||||||
episodeFilesError,
|
movieFilesError,
|
||||||
hasMovieFiles
|
hasMovieFiles,
|
||||||
|
sizeOnDisk
|
||||||
} = movieFiles;
|
} = movieFiles;
|
||||||
|
|
||||||
const previousMovie = sortedMovies[movieIndex - 1] || _.last(sortedMovies);
|
const previousMovie = sortedMovies[movieIndex - 1] || _.last(sortedMovies);
|
||||||
@ -78,11 +82,7 @@ function createMapStateToProps() {
|
|||||||
const isFetching = isMovieFilesFetching;
|
const isFetching = isMovieFilesFetching;
|
||||||
const isPopulated = isMovieFilesPopulated;
|
const isPopulated = isMovieFilesPopulated;
|
||||||
const alternateTitles = _.reduce(movie.alternateTitles, (acc, alternateTitle) => {
|
const alternateTitles = _.reduce(movie.alternateTitles, (acc, alternateTitle) => {
|
||||||
if ((alternateTitle.seasonNumber === -1 || alternateTitle.seasonNumber === undefined) &&
|
acc.push(alternateTitle.title);
|
||||||
(alternateTitle.sceneSeasonNumber === -1 || alternateTitle.sceneSeasonNumber === undefined)) {
|
|
||||||
acc.push(alternateTitle.title);
|
|
||||||
}
|
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -97,8 +97,9 @@ function createMapStateToProps() {
|
|||||||
isRenamingMovie,
|
isRenamingMovie,
|
||||||
isFetching,
|
isFetching,
|
||||||
isPopulated,
|
isPopulated,
|
||||||
episodeFilesError,
|
movieFilesError,
|
||||||
hasMovieFiles,
|
hasMovieFiles,
|
||||||
|
sizeOnDisk,
|
||||||
previousMovie,
|
previousMovie,
|
||||||
nextMovie
|
nextMovie
|
||||||
};
|
};
|
||||||
|
@ -18,11 +18,6 @@ class MovieIndexFooter extends PureComponent {
|
|||||||
let totalFileSize = 0;
|
let totalFileSize = 0;
|
||||||
|
|
||||||
movies.forEach((s) => {
|
movies.forEach((s) => {
|
||||||
const { statistics = {} } = s;
|
|
||||||
|
|
||||||
const {
|
|
||||||
sizeOnDisk = 0
|
|
||||||
} = statistics;
|
|
||||||
|
|
||||||
if (s.hasFile) {
|
if (s.hasFile) {
|
||||||
movieFiles += 1;
|
movieFiles += 1;
|
||||||
@ -38,7 +33,7 @@ class MovieIndexFooter extends PureComponent {
|
|||||||
monitored++;
|
monitored++;
|
||||||
}
|
}
|
||||||
|
|
||||||
totalFileSize += sizeOnDisk;
|
totalFileSize += s.sizeOnDisk;
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -12,13 +12,15 @@ function createUnoptimizedSelector() {
|
|||||||
const {
|
const {
|
||||||
monitored,
|
monitored,
|
||||||
status,
|
status,
|
||||||
statistics
|
statistics,
|
||||||
|
sizeOnDisk
|
||||||
} = s;
|
} = s;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
monitored,
|
monitored,
|
||||||
status,
|
status,
|
||||||
statistics
|
statistics,
|
||||||
|
sizeOnDisk
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
import formatBytes from 'Utilities/Number/formatBytes';
|
||||||
import IconButton from 'Components/Link/IconButton';
|
import IconButton from 'Components/Link/IconButton';
|
||||||
import { icons, kinds } from 'Helpers/Props';
|
import { icons, kinds } from 'Helpers/Props';
|
||||||
import TableRow from 'Components/Table/TableRow';
|
import TableRow from 'Components/Table/TableRow';
|
||||||
@ -70,6 +71,7 @@ class MovieFileEditorRow extends Component {
|
|||||||
const {
|
const {
|
||||||
id,
|
id,
|
||||||
relativePath,
|
relativePath,
|
||||||
|
size,
|
||||||
quality,
|
quality,
|
||||||
qualityCutoffNotMet,
|
qualityCutoffNotMet,
|
||||||
languages
|
languages
|
||||||
@ -105,6 +107,13 @@ class MovieFileEditorRow extends Component {
|
|||||||
/>
|
/>
|
||||||
</TableRowCell>
|
</TableRowCell>
|
||||||
|
|
||||||
|
<TableRowCell
|
||||||
|
className={styles.size}
|
||||||
|
title={size}
|
||||||
|
>
|
||||||
|
{formatBytes(size)}
|
||||||
|
</TableRowCell>
|
||||||
|
|
||||||
<TableRowCellButton
|
<TableRowCellButton
|
||||||
className={styles.language}
|
className={styles.language}
|
||||||
title="Click to change language"
|
title="Click to change language"
|
||||||
|
@ -16,6 +16,11 @@ const columns = [
|
|||||||
label: 'Media Info',
|
label: 'Media Info',
|
||||||
isVisible: true
|
isVisible: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'size',
|
||||||
|
label: 'Size',
|
||||||
|
isVisible: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'languages',
|
name: 'languages',
|
||||||
label: 'Languages',
|
label: 'Languages',
|
||||||
|
@ -278,6 +278,7 @@ protected override QueryBuilder<TActual> AddJoinQueries<TActual>(QueryBuilder<TA
|
|||||||
baseQuery = base.AddJoinQueries(baseQuery);
|
baseQuery = base.AddJoinQueries(baseQuery);
|
||||||
baseQuery = baseQuery.Join<Movie, AlternativeTitle>(JoinType.Left, m => m.AlternativeTitles,
|
baseQuery = baseQuery.Join<Movie, AlternativeTitle>(JoinType.Left, m => m.AlternativeTitles,
|
||||||
(m, t) => m.Id == t.MovieId);
|
(m, t) => m.Id == t.MovieId);
|
||||||
|
baseQuery = baseQuery.Join<Movie, MovieFile>(JoinType.Left, m => m.MovieFile, (m, f) => m.Id == f.MovieId);
|
||||||
|
|
||||||
return baseQuery;
|
return baseQuery;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,6 @@ public MovieResource()
|
|||||||
public DateTime Added { get; set; }
|
public DateTime Added { get; set; }
|
||||||
public AddMovieOptions AddOptions { get; set; }
|
public AddMovieOptions AddOptions { get; set; }
|
||||||
public Ratings Ratings { get; set; }
|
public Ratings Ratings { get; set; }
|
||||||
//public List<string> AlternativeTitles { get; set; }
|
|
||||||
public MovieFileResource MovieFile { get; set; }
|
public MovieFileResource MovieFile { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -75,47 +74,24 @@ public static MovieResource ToResource(this Movie model)
|
|||||||
{
|
{
|
||||||
if (model == null) return null;
|
if (model == null) return null;
|
||||||
|
|
||||||
|
long size = model.MovieFile?.Size ?? 0;
|
||||||
//long size = model.MovieFile?.Size ?? 0;
|
MovieFileResource movieFile = model.MovieFile?.ToResource(model);
|
||||||
//bool downloaded = model.MovieFile != null;
|
|
||||||
//MovieFileResource movieFile = model.MovieFile?.ToResource(model);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*if(model.MovieFile != null)
|
|
||||||
{
|
|
||||||
model.MovieFile.LazyLoad();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (model.MovieFile != null && model.MovieFile.IsLoaded && model.MovieFile.Value != null)
|
|
||||||
{
|
|
||||||
size = model.MovieFile.Value.Size;
|
|
||||||
downloaded = true;
|
|
||||||
movieFile = model.MovieFile.Value.ToResource();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
//model.AlternativeTitles.LazyLoad();
|
|
||||||
|
|
||||||
return new MovieResource
|
return new MovieResource
|
||||||
{
|
{
|
||||||
Id = model.Id,
|
Id = model.Id,
|
||||||
TmdbId = model.TmdbId,
|
TmdbId = model.TmdbId,
|
||||||
Title = model.Title,
|
Title = model.Title,
|
||||||
//AlternateTitles
|
|
||||||
SortTitle = model.SortTitle,
|
SortTitle = model.SortTitle,
|
||||||
InCinemas = model.InCinemas,
|
InCinemas = model.InCinemas,
|
||||||
PhysicalRelease = model.PhysicalRelease,
|
PhysicalRelease = model.PhysicalRelease,
|
||||||
PhysicalReleaseNote = model.PhysicalReleaseNote,
|
PhysicalReleaseNote = model.PhysicalReleaseNote,
|
||||||
HasFile = model.HasFile,
|
HasFile = model.HasFile,
|
||||||
//Downloaded = downloaded,
|
|
||||||
//TotalEpisodeCount
|
SizeOnDisk = size,
|
||||||
//EpisodeCount
|
|
||||||
//EpisodeFileCount
|
|
||||||
//SizeOnDisk = size,
|
|
||||||
Status = model.Status,
|
Status = model.Status,
|
||||||
Overview = model.Overview,
|
Overview = model.Overview,
|
||||||
//NextAiring
|
|
||||||
//PreviousAiring
|
|
||||||
Images = model.Images,
|
Images = model.Images,
|
||||||
|
|
||||||
Year = model.Year,
|
Year = model.Year,
|
||||||
@ -132,8 +108,6 @@ public static MovieResource ToResource(this Movie model)
|
|||||||
IsAvailable = model.IsAvailable(),
|
IsAvailable = model.IsAvailable(),
|
||||||
FolderName = model.FolderName(),
|
FolderName = model.FolderName(),
|
||||||
|
|
||||||
//SizeOnDisk = size,
|
|
||||||
|
|
||||||
Runtime = model.Runtime,
|
Runtime = model.Runtime,
|
||||||
LastInfoSync = model.LastInfoSync,
|
LastInfoSync = model.LastInfoSync,
|
||||||
CleanTitle = model.CleanTitle,
|
CleanTitle = model.CleanTitle,
|
||||||
@ -148,7 +122,7 @@ public static MovieResource ToResource(this Movie model)
|
|||||||
AddOptions = model.AddOptions,
|
AddOptions = model.AddOptions,
|
||||||
AlternateTitles = model.AlternativeTitles.ToResource(),
|
AlternateTitles = model.AlternativeTitles.ToResource(),
|
||||||
Ratings = model.Ratings,
|
Ratings = model.Ratings,
|
||||||
//MovieFile = movieFile,
|
MovieFile = movieFile,
|
||||||
YouTubeTrailerId = model.YouTubeTrailerId,
|
YouTubeTrailerId = model.YouTubeTrailerId,
|
||||||
Studio = model.Studio
|
Studio = model.Studio
|
||||||
};
|
};
|
||||||
@ -164,18 +138,13 @@ public static Movie ToModel(this MovieResource resource)
|
|||||||
TmdbId = resource.TmdbId,
|
TmdbId = resource.TmdbId,
|
||||||
|
|
||||||
Title = resource.Title,
|
Title = resource.Title,
|
||||||
//AlternateTitles
|
|
||||||
SortTitle = resource.SortTitle,
|
SortTitle = resource.SortTitle,
|
||||||
InCinemas = resource.InCinemas,
|
InCinemas = resource.InCinemas,
|
||||||
PhysicalRelease = resource.PhysicalRelease,
|
PhysicalRelease = resource.PhysicalRelease,
|
||||||
PhysicalReleaseNote = resource.PhysicalReleaseNote,
|
PhysicalReleaseNote = resource.PhysicalReleaseNote,
|
||||||
//TotalEpisodeCount
|
|
||||||
//EpisodeCount
|
|
||||||
//EpisodeFileCount
|
|
||||||
//SizeOnDisk
|
|
||||||
Overview = resource.Overview,
|
Overview = resource.Overview,
|
||||||
//NextAiring
|
|
||||||
//PreviousAiring
|
|
||||||
Images = resource.Images,
|
Images = resource.Images,
|
||||||
|
|
||||||
Year = resource.Year,
|
Year = resource.Year,
|
||||||
@ -201,7 +170,6 @@ public static Movie ToModel(this MovieResource resource)
|
|||||||
Tags = resource.Tags,
|
Tags = resource.Tags,
|
||||||
Added = resource.Added,
|
Added = resource.Added,
|
||||||
AddOptions = resource.AddOptions,
|
AddOptions = resource.AddOptions,
|
||||||
//AlternativeTitles = resource.AlternativeTitles,
|
|
||||||
Ratings = resource.Ratings,
|
Ratings = resource.Ratings,
|
||||||
YouTubeTrailerId = resource.YouTubeTrailerId,
|
YouTubeTrailerId = resource.YouTubeTrailerId,
|
||||||
Studio = resource.Studio
|
Studio = resource.Studio
|
||||||
|
Loading…
Reference in New Issue
Block a user