mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-23 06:45:19 -07:00
Date added in Movie List & Possible Fix for Importing Movies. (#969)
* Is there a need to lazyload? * Update dates in movie list * additional check for moviefile lazy load * lazyload not needed...
This commit is contained in:
parent
6432928b7d
commit
7122962dc8
3 changed files with 25 additions and 30 deletions
|
@ -36,42 +36,29 @@ namespace NzbDrone.Core.MediaFiles
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MovieFileMoveResult UpgradeMovieFile(MovieFile episodeFile, LocalMovie localEpisode, bool copyOnly = false)
|
public MovieFileMoveResult UpgradeMovieFile(MovieFile movieFile, LocalMovie localMovie, bool copyOnly = false)
|
||||||
{
|
{
|
||||||
_logger.Trace("Upgrading existing episode file.");
|
_logger.Trace("Upgrading existing movie file.");
|
||||||
var moveFileResult = new MovieFileMoveResult();
|
var moveFileResult = new MovieFileMoveResult();
|
||||||
localEpisode.Movie.MovieFile.LazyLoad();
|
|
||||||
var existingFile = localEpisode.Movie.MovieFile;
|
|
||||||
existingFile.LazyLoad();
|
|
||||||
|
|
||||||
if (existingFile.IsLoaded && existingFile.Value != null)
|
var existingFile = localMovie.Movie.MovieFile.Value;
|
||||||
|
var movieFilePath = Path.Combine(localMovie.Movie.Path, existingFile.RelativePath);
|
||||||
|
|
||||||
|
if (_diskProvider.FileExists(movieFilePath))
|
||||||
{
|
{
|
||||||
var file = existingFile.Value;
|
_logger.Debug("Removing existing movie file: {0}", existingFile);
|
||||||
var episodeFilePath = Path.Combine(localEpisode.Movie.Path, file.RelativePath);
|
_recycleBinProvider.DeleteFile(movieFilePath);
|
||||||
|
|
||||||
if (_diskProvider.FileExists(episodeFilePath))
|
|
||||||
{
|
|
||||||
_logger.Debug("Removing existing episode file: {0}", file);
|
|
||||||
_recycleBinProvider.DeleteFile(episodeFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
moveFileResult.OldFiles.Add(file);
|
|
||||||
_mediaFileService.Delete(file, DeleteMediaFileReason.Upgrade);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//_logger.Warn("The existing movie file was not lazy loaded.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
moveFileResult.OldFiles.Add(existingFile);
|
||||||
|
_mediaFileService.Delete(existingFile, DeleteMediaFileReason.Upgrade);
|
||||||
if (copyOnly)
|
if (copyOnly)
|
||||||
{
|
{
|
||||||
moveFileResult.MovieFile = _movieFileMover.CopyMovieFile(episodeFile, localEpisode);
|
moveFileResult.MovieFile = _movieFileMover.CopyMovieFile(movieFile, localMovie);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
moveFileResult.MovieFile= _movieFileMover.MoveMovieFile(episodeFile, localEpisode);
|
moveFileResult.MovieFile = _movieFileMover.MoveMovieFile(movieFile, localMovie);
|
||||||
}
|
}
|
||||||
|
|
||||||
return moveFileResult;
|
return moveFileResult;
|
||||||
|
|
|
@ -6,7 +6,8 @@ var ListCollectionView = require('./Overview/SeriesOverviewCollectionView');
|
||||||
var EmptyView = require('./EmptyView');
|
var EmptyView = require('./EmptyView');
|
||||||
var MoviesCollection = require('../MoviesCollection');
|
var MoviesCollection = require('../MoviesCollection');
|
||||||
//var FullMovieCollection = require('../FullMovieCollection');
|
//var FullMovieCollection = require('../FullMovieCollection');
|
||||||
var InCinemasCell = require('../../Cells/InCinemasCell');
|
//var InCinemasCell = require('../../Cells/InCinemasCell');
|
||||||
|
var RelativeDateCell = require('../../Cells/RelativeDateCell');
|
||||||
var MovieTitleCell = require('../../Cells/MovieTitleCell');
|
var MovieTitleCell = require('../../Cells/MovieTitleCell');
|
||||||
var TemplatedCell = require('../../Cells/TemplatedCell');
|
var TemplatedCell = require('../../Cells/TemplatedCell');
|
||||||
var ProfileCell = require('../../Cells/ProfileCell');
|
var ProfileCell = require('../../Cells/ProfileCell');
|
||||||
|
@ -52,6 +53,11 @@ module.exports = Marionette.Layout.extend({
|
||||||
cell : MovieTitleCell,
|
cell : MovieTitleCell,
|
||||||
cellValue : 'this',
|
cellValue : 'this',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name : 'added',
|
||||||
|
label : 'Date Added',
|
||||||
|
cell : RelativeDateCell
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name : "downloadedQuality",
|
name : "downloadedQuality",
|
||||||
label : "Downloaded",
|
label : "Downloaded",
|
||||||
|
@ -66,7 +72,7 @@ module.exports = Marionette.Layout.extend({
|
||||||
{
|
{
|
||||||
name : 'inCinemas',
|
name : 'inCinemas',
|
||||||
label : 'In Cinemas',
|
label : 'In Cinemas',
|
||||||
cell : InCinemasCell
|
cell : RelativeDateCell
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'this',
|
name : 'this',
|
||||||
|
@ -194,9 +200,9 @@ module.exports = Marionette.Layout.extend({
|
||||||
title : 'Title',
|
title : 'Title',
|
||||||
name : 'title'
|
name : 'title'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Downloaded',
|
title: 'Downloaded',
|
||||||
name: 'downloadedQuality'
|
name: 'downloadedQuality'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title : 'Profile',
|
title : 'Profile',
|
||||||
|
|
|
@ -37,7 +37,9 @@
|
||||||
<div class="col-md-8 col-xs-8">
|
<div class="col-md-8 col-xs-8">
|
||||||
<span class="label label-default">{{GetStatus}}</span>
|
<span class="label label-default">{{GetStatus}}</span>
|
||||||
|
|
||||||
<span class="label label-default">{{ShortDate inCinemas}}</span>
|
{{#if inCinemas}}
|
||||||
|
<span class="label label-default">{{RelativeDate inCinemas}}</span>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{profile profileId}}
|
{{profile profileId}}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue