From bb07684ed2a6410ea14ed9a74a0f85e75c13f322 Mon Sep 17 00:00:00 2001 From: Leslie-Wong-H <79917148leslie@gmail.com> Date: Sun, 26 Jul 2026 00:18:28 +0800 Subject: [PATCH 1/2] Refactor to retain preset 6 for higher xz compression rate --- hasher.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hasher.js b/hasher.js index cd87e2e..6b7e413 100644 --- a/hasher.js +++ b/hasher.js @@ -5,7 +5,8 @@ import os from "os"; import fs from "fs-extra"; import child_process from "child_process"; // import lzma from "lzma-native"; -import { compress } from "@napi-rs/lzma/xz"; +// import { compress } from "@napi-rs/lzma/xz"; // original motivation: extend linux/arm64 support +import { Compressor } from "@napi-rs/lzma/xz"; import fetch from "node-fetch"; const { TRACE_API_URL, TRACE_API_SECRET, TRACE_MEDIA_URL } = process.env; @@ -166,7 +167,10 @@ const messageHandle = async (data) => { console.log("Compressing XML"); // const compressedXML = await lzma.compress(parsedXML, { preset: 6 }); - const compressedXML = await compress(parsedXML); + // const compressedXML = await compress(parsedXML); + const compressor = new Compressor({ preset: 6 }); + const parts = [compressor.update(parsedXML), await compressor.finish()]; + const compressedXML = Buffer.concat(parts); console.log(`Uploading ${file}`); await fetch(`${TRACE_API_URL}/hash/${imdbID}/${encodeURIComponent(fileName)}`, { From 12cccdd8e5eea1568e17509c894bd0321f37eab3 Mon Sep 17 00:00:00 2001 From: Leslie-Wong-H <79917148leslie@gmail.com> Date: Sun, 26 Jul 2026 01:14:39 +0800 Subject: [PATCH 2/2] Build: release shotit-worker v0.9.27 --- README.md | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ff479e9..f492631 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/shotit/shotit-worker/docker-image.yml?branch=main&style=flat-square)](https://github.com/shotit/shotit-worker/actions) [![GitHub release](https://img.shields.io/github/release/shotit/shotit-worker.svg)](https://github.com/shotit/shotit-worker/releases/latest) [![Watcher Docker](https://img.shields.io/docker/pulls/shotit/shotit-worker-watcher?style=flat-square)](https://hub.docker.com/r/shotit/shotit-worker-watcher) -[![Watcher Docker Image Size](https://img.shields.io/docker/image-size/shotit/shotit-worker-watcher/v0.9.26?style=flat-square)](https://hub.docker.com/r/shotit/shotit-worker-watcher) +[![Watcher Docker Image Size](https://img.shields.io/docker/image-size/shotit/shotit-worker-watcher/v0.9.27?style=flat-square)](https://hub.docker.com/r/shotit/shotit-worker-watcher) [![Hasher Docker](https://img.shields.io/docker/pulls/shotit/shotit-worker-hasher?style=flat-square)](https://hub.docker.com/r/shotit/shotit-worker-hasher) -[![Hasher Docker Image Size](https://img.shields.io/docker/image-size/shotit/shotit-worker-hasher/v0.9.26?style=flat-square)](https://hub.docker.com/r/shotit/shotit-worker-hasher) +[![Hasher Docker Image Size](https://img.shields.io/docker/image-size/shotit/shotit-worker-hasher/v0.9.27?style=flat-square)](https://hub.docker.com/r/shotit/shotit-worker-hasher) [![Loader Docker](https://img.shields.io/docker/pulls/shotit/shotit-worker-loader?style=flat-square)](https://hub.docker.com/r/shotit/shotit-worker-loader) -[![Loader Docker Image Size](https://img.shields.io/docker/image-size/shotit/shotit-worker-loader/v0.9.26?style=flat-square)](https://hub.docker.com/r/shotit/shotit-worker-loader) +[![Loader Docker Image Size](https://img.shields.io/docker/image-size/shotit/shotit-worker-loader/v0.9.27?style=flat-square)](https://hub.docker.com/r/shotit/shotit-worker-loader) [![Searcher Docker](https://img.shields.io/docker/pulls/shotit/shotit-worker-searcher?style=flat-square)](https://hub.docker.com/r/shotit/shotit-worker-searcher) -[![Searcher Docker Image Size](https://img.shields.io/docker/image-size/shotit/shotit-worker-searcher/v0.9.26?style=flat-square)](https://hub.docker.com/r/shotit/shotit-worker-searcher) +[![Searcher Docker Image Size](https://img.shields.io/docker/image-size/shotit/shotit-worker-searcher/v0.9.27?style=flat-square)](https://hub.docker.com/r/shotit/shotit-worker-searcher) Backend workers for [shotit](https://github.com/shotit/shotit). Four core workers of shotit: watcher, hasher, loader and searcher. diff --git a/package.json b/package.json index 869f9df..dd1984d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shotit-worker", - "version": "0.9.26", + "version": "0.9.27", "description": "Four core workers of shotit: watcher, hasher, loader and searcher", "main": "", "type": "module",