This commit is contained in:
Pierre
2026-05-25 23:49:46 +02:00
parent 47d7c42631
commit f05a09a39c
+10 -7
View File
@@ -343,12 +343,13 @@ async function downloadImageToWebDAV(
} }
/** /**
* Download and hash an image, returning its CID * Download and hash an image, returning its CID.
* *
* Images are written via WebDAV PUT to /files/plugin/tmdb/ * Images are written via WebDAV PUT to /files/plugin/tmdb/. The watcher
* The files will be picked up by meta-sort's file watcher and processed like any other file. * indexes that directory as a first-class file root, so each downloaded
* * image becomes a normal metadata entry with a midhash256 alias. The
* @returns {Promise<string | null>} The midhash256 CID of the downloaded image * editor's CID preview then resolves through standard CID resolution —
* no need to store any path in the parent file's metadata.
*/ */
async function downloadAndHashImage( async function downloadAndHashImage(
imagePath: string, imagePath: string,
@@ -593,8 +594,10 @@ async function applyTmdbData(
// Add tmdb-verified tag (same as old processor) // Add tmdb-verified tag (same as old processor)
await metaCore.addToSet(cid, 'tags', 'tmdb-verified'); await metaCore.addToSet(cid, 'tags', 'tmdb-verified');
// Download poster and backdrop images to plugin output folder // Download poster and backdrop images to plugin output folder. The
// The files will be picked up by meta-sort's file watcher and processed like any other file // watcher picks them up as first-class file entries, so all we need to
// store is the CID — `/api/file/{cid}` resolves through the standard
// reverse index, no path companion needed.
if (data.poster_path && tmdbId) { if (data.poster_path && tmdbId) {
const posterCid = await downloadAndHashImage( const posterCid = await downloadAndHashImage(
data.poster_path, data.poster_path,