mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-15 10:43:30 +01:00
fix resolution in photo provider
This commit is contained in:
@@ -50,7 +50,8 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
|
||||
Date = DateTime.UtcNow,
|
||||
OriginalPath = path,
|
||||
OriginalFileName = Path.GetFileName(path),
|
||||
Type = FileOrganizerType.Episode
|
||||
Type = FileOrganizerType.Episode,
|
||||
FileSize = new FileInfo(path).Length
|
||||
};
|
||||
|
||||
var seriesName = TVUtils.GetSeriesNameFromEpisodeFile(path);
|
||||
@@ -102,6 +103,17 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
|
||||
_logger.Warn(msg);
|
||||
}
|
||||
|
||||
var previousResult = _organizationService.GetResultBySourcePath(path);
|
||||
|
||||
if (previousResult != null)
|
||||
{
|
||||
// Don't keep saving the same result over and over if nothing has changed
|
||||
if (previousResult.Status == result.Status && result.Status != FileSortingStatus.Success)
|
||||
{
|
||||
return previousResult;
|
||||
}
|
||||
}
|
||||
|
||||
await _organizationService.SaveResult(result, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
return result;
|
||||
|
||||
@@ -64,6 +64,18 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
|
||||
return _repo.GetResult(id);
|
||||
}
|
||||
|
||||
public FileOrganizationResult GetResultBySourcePath(string path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
}
|
||||
|
||||
var id = path.GetMD5().ToString("N");
|
||||
|
||||
return GetResult(id);
|
||||
}
|
||||
|
||||
public Task DeleteOriginalFile(string resultId)
|
||||
{
|
||||
var result = _repo.GetResult(resultId);
|
||||
|
||||
Reference in New Issue
Block a user