diff --git a/frontend/src/Movie/Details/MovieDetailsConnector.js b/frontend/src/Movie/Details/MovieDetailsConnector.js
index 80841898e..9db511778 100644
--- a/frontend/src/Movie/Details/MovieDetailsConnector.js
+++ b/frontend/src/Movie/Details/MovieDetailsConnector.js
@@ -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);
- }
-
+ acc.push(alternateTitle.title);
return acc;
}, []);
@@ -97,8 +97,9 @@ function createMapStateToProps() {
isRenamingMovie,
isFetching,
isPopulated,
- episodeFilesError,
+ movieFilesError,
hasMovieFiles,
+ sizeOnDisk,
previousMovie,
nextMovie
};
diff --git a/frontend/src/Movie/Index/MovieIndexFooter.js b/frontend/src/Movie/Index/MovieIndexFooter.js
index 4e5ba6197..4a26980b0 100644
--- a/frontend/src/Movie/Index/MovieIndexFooter.js
+++ b/frontend/src/Movie/Index/MovieIndexFooter.js
@@ -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 (
diff --git a/frontend/src/Movie/Index/MovieIndexFooterConnector.js b/frontend/src/Movie/Index/MovieIndexFooterConnector.js
index 13f0cb915..937dc78da 100644
--- a/frontend/src/Movie/Index/MovieIndexFooterConnector.js
+++ b/frontend/src/Movie/Index/MovieIndexFooterConnector.js
@@ -12,13 +12,15 @@ function createUnoptimizedSelector() {
const {
monitored,
status,
- statistics
+ statistics,
+ sizeOnDisk
} = s;
return {
monitored,
status,
- statistics
+ statistics,
+ sizeOnDisk
};
});
}
diff --git a/frontend/src/MovieFile/Editor/MovieFileEditorRow.js b/frontend/src/MovieFile/Editor/MovieFileEditorRow.js
index edca5147b..673578470 100644
--- a/frontend/src/MovieFile/Editor/MovieFileEditorRow.js
+++ b/frontend/src/MovieFile/Editor/MovieFileEditorRow.js
@@ -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 {
/>
+
+ {formatBytes(size)}
+
+
AddJoinQueries(QueryBuilder(JoinType.Left, m => m.AlternativeTitles,
(m, t) => m.Id == t.MovieId);
+ baseQuery = baseQuery.Join(JoinType.Left, m => m.MovieFile, (m, f) => m.Id == f.MovieId);
return baseQuery;
}
diff --git a/src/Radarr.Api.V2/Movies/MovieResource.cs b/src/Radarr.Api.V2/Movies/MovieResource.cs
index c45629b90..c6055ae4d 100644
--- a/src/Radarr.Api.V2/Movies/MovieResource.cs
+++ b/src/Radarr.Api.V2/Movies/MovieResource.cs
@@ -64,7 +64,6 @@ public MovieResource()
public DateTime Added { get; set; }
public AddMovieOptions AddOptions { get; set; }
public Ratings Ratings { get; set; }
- //public List 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