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