mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-18 06:53:07 +03:00
incorporate file length into image cache tag
This commit is contained in:
@@ -1519,6 +1519,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
image.Path = file.FullName;
|
||||
image.DateModified = imageInfo.DateModified;
|
||||
image.Length = imageInfo.Length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1623,11 +1624,14 @@ namespace MediaBrowser.Controller.Entities
|
||||
return null;
|
||||
}
|
||||
|
||||
var fileInfo = new FileInfo(path);
|
||||
|
||||
return new ItemImageInfo
|
||||
{
|
||||
Path = path,
|
||||
DateModified = FileSystem.GetLastWriteTimeUtc(path),
|
||||
Type = imageType
|
||||
DateModified = FileSystem.GetLastWriteTimeUtc(fileInfo),
|
||||
Type = imageType,
|
||||
Length = fileInfo.Length
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1686,6 +1690,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
else
|
||||
{
|
||||
existing.DateModified = FileSystem.GetLastWriteTimeUtc(newImage);
|
||||
existing.Length = ((FileInfo) newImage).Length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1700,7 +1705,8 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
Path = file.FullName,
|
||||
Type = type,
|
||||
DateModified = FileSystem.GetLastWriteTimeUtc(file)
|
||||
DateModified = FileSystem.GetLastWriteTimeUtc(file),
|
||||
Length = ((FileInfo)file).Length
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1739,9 +1745,15 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
FileSystem.SwapFiles(path1, path2);
|
||||
|
||||
var file1 = new FileInfo(info1.Path);
|
||||
var file2 = new FileInfo(info2.Path);
|
||||
|
||||
// Refresh these values
|
||||
info1.DateModified = FileSystem.GetLastWriteTimeUtc(info1.Path);
|
||||
info2.DateModified = FileSystem.GetLastWriteTimeUtc(info2.Path);
|
||||
info1.DateModified = FileSystem.GetLastWriteTimeUtc(file1);
|
||||
info2.DateModified = FileSystem.GetLastWriteTimeUtc(file2);
|
||||
|
||||
info1.Length = file1.Length;
|
||||
info2.Length = file2.Length;
|
||||
|
||||
return UpdateToRepository(ItemUpdateType.ImageUpdate, CancellationToken.None);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user