From 288715112687d33c3193ebae469aaf7d01a52b6d Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 21 Jan 2025 07:10:34 -0400 Subject: upd8, content: preload all file sizes, straight-shot --- src/content/dependencies/generateAlbumAdditionalFilesList.js | 6 +++--- src/content/dependencies/image.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/content') diff --git a/src/content/dependencies/generateAlbumAdditionalFilesList.js b/src/content/dependencies/generateAlbumAdditionalFilesList.js index 9818a43c..ad17206f 100644 --- a/src/content/dependencies/generateAlbumAdditionalFilesList.js +++ b/src/content/dependencies/generateAlbumAdditionalFilesList.js @@ -9,7 +9,7 @@ export default { 'transformContent', ], - extraDependencies: ['getSizeOfAdditionalFile', 'html', 'urls'], + extraDependencies: ['getSizeOfMediaFile', 'html', 'urls'], relations: (relation, album, additionalFiles) => ({ list: @@ -55,7 +55,7 @@ export default { showFileSizes: {type: 'boolean', default: true}, }, - generate: (data, relations, slots, {getSizeOfAdditionalFile, urls}) => + generate: (data, relations, slots, {getSizeOfMediaFile, urls}) => relations.list.slots({ chunks: stitchArrays({ @@ -86,7 +86,7 @@ export default { fileLink: fileLink, fileSize: (slots.showFileSizes - ? getSizeOfAdditionalFile( + ? getSizeOfMediaFile( urls .from('media.root') .to('media.albumAdditionalFile', data.albumDirectory, location)) diff --git a/src/content/dependencies/image.js b/src/content/dependencies/image.js index b1f02819..6cbcb7dd 100644 --- a/src/content/dependencies/image.js +++ b/src/content/dependencies/image.js @@ -5,7 +5,7 @@ export default { extraDependencies: [ 'checkIfImagePathHasCachedThumbnails', 'getDimensionsOfImagePath', - 'getSizeOfImagePath', + 'getSizeOfMediaFile', 'getThumbnailEqualOrSmaller', 'getThumbnailsAvailableForDimensions', 'html', @@ -83,7 +83,7 @@ export default { generate(data, relations, slots, { checkIfImagePathHasCachedThumbnails, getDimensionsOfImagePath, - getSizeOfImagePath, + getSizeOfMediaFile, getThumbnailEqualOrSmaller, getThumbnailsAvailableForDimensions, html, @@ -228,7 +228,7 @@ export default { const fileSize = (willLink && mediaSrc - ? getSizeOfImagePath(mediaSrc) + ? getSizeOfMediaFile(mediaSrc) : null); imgAttributes.add([ -- cgit 1.3.0-6-gf8a5