mirror of
https://github.com/Radarr/Radarr
synced 2025-01-03 22:04:43 +00:00
Implement https://trello.com/c/a1il1sTd
modified: NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs -modified: DiskProvider.cs added SetFolderAccessTime to the interface added SetFolderAccessTime function -modified MoveEpisodeFile.cs call SetFolderAccessTime from both MoveEpisodeFile
This commit is contained in:
parent
9fa4cedb71
commit
f9384d48dd
2 changed files with 9 additions and 0 deletions
|
@ -39,6 +39,7 @@ public interface IDiskProvider
|
||||||
string GetPathRoot(string path);
|
string GetPathRoot(string path);
|
||||||
void SetPermissions(string filename, WellKnownSidType accountSid, FileSystemRights rights, AccessControlType controlType);
|
void SetPermissions(string filename, WellKnownSidType accountSid, FileSystemRights rights, AccessControlType controlType);
|
||||||
bool IsParent(string parentPath, string childPath);
|
bool IsParent(string parentPath, string childPath);
|
||||||
|
void SetFolderAccessTime(string path, DateTime time){
|
||||||
FileAttributes GetFileAttributes(string path);
|
FileAttributes GetFileAttributes(string path);
|
||||||
void EmptyFolder(string path);
|
void EmptyFolder(string path);
|
||||||
}
|
}
|
||||||
|
@ -451,6 +452,10 @@ private static void RemoveReadOnly(string path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetFolderAccessTime(string path, DateTime time){
|
||||||
|
Directory.SetLastWriteTimeUtc(path,time);
|
||||||
|
}
|
||||||
|
|
||||||
public FileAttributes GetFileAttributes(string path)
|
public FileAttributes GetFileAttributes(string path)
|
||||||
{
|
{
|
||||||
return File.GetAttributes(path);
|
return File.GetAttributes(path);
|
||||||
|
|
|
@ -43,6 +43,8 @@ public string MoveEpisodeFile(EpisodeFile episodeFile, Series series)
|
||||||
var newFileName = _buildFileNames.BuildFilename(episodes, series, episodeFile);
|
var newFileName = _buildFileNames.BuildFilename(episodes, series, episodeFile);
|
||||||
var filePath = _buildFileNames.BuildFilePath(series, episodes.First().SeasonNumber, newFileName, Path.GetExtension(episodeFile.Path));
|
var filePath = _buildFileNames.BuildFilePath(series, episodes.First().SeasonNumber, newFileName, Path.GetExtension(episodeFile.Path));
|
||||||
MoveFile(episodeFile, filePath);
|
MoveFile(episodeFile, filePath);
|
||||||
|
_diskProvider.SetFolderAccessTime( Path.GetDirectoryName(filePath), episodeFile.DateAdded);
|
||||||
|
_diskProvider.SetFolderAccessTime( series.Path, episodeFile.DateAdded);
|
||||||
|
|
||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
|
@ -52,6 +54,8 @@ public string MoveEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode
|
||||||
var newFileName = _buildFileNames.BuildFilename(localEpisode.Episodes, localEpisode.Series, episodeFile);
|
var newFileName = _buildFileNames.BuildFilename(localEpisode.Episodes, localEpisode.Series, episodeFile);
|
||||||
var filePath = _buildFileNames.BuildFilePath(localEpisode.Series, localEpisode.SeasonNumber, newFileName, Path.GetExtension(episodeFile.Path));
|
var filePath = _buildFileNames.BuildFilePath(localEpisode.Series, localEpisode.SeasonNumber, newFileName, Path.GetExtension(episodeFile.Path));
|
||||||
MoveFile(episodeFile, filePath);
|
MoveFile(episodeFile, filePath);
|
||||||
|
_diskProvider.SetFolderAccessTime( Path.GetDirectoryName(filePath), episodeFile.DateAdded);
|
||||||
|
_diskProvider.SetFolderAccessTime( localEpisode.Series.Path, episodeFile.DateAdded);
|
||||||
|
|
||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue