fix(linux): restore legacy CUPS capture compatibility
Some checks failed
Desktop Release / Bootstrap updater signing key (push) Has been cancelled
Desktop Release / Windows x64 NSIS (push) Has been cancelled
Desktop Release / Linux x64 DEB + AppImage (push) Has been cancelled
Desktop Release / Publish public desktop release (push) Has been cancelled
Some checks failed
Desktop Release / Bootstrap updater signing key (push) Has been cancelled
Desktop Release / Windows x64 NSIS (push) Has been cancelled
Desktop Release / Linux x64 DEB + AppImage (push) Has been cancelled
Desktop Release / Publish public desktop release (push) Has been cancelled
This commit is contained in:
parent
0da470e66d
commit
68052a11ef
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@fieldlens/print",
|
||||
"version": "0.1.25",
|
||||
"version": "0.1.26",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "fieldlens-print"
|
||||
version = "0.1.25"
|
||||
version = "0.1.26"
|
||||
description = "FieldLens print-stream barcode capture companion"
|
||||
authors = ["Arrowstack"]
|
||||
edition = "2021"
|
||||
|
||||
@ -28,6 +28,8 @@ use crate::{
|
||||
#[cfg(target_os = "linux")]
|
||||
const SYSTEM_CUPS_SPOOL_DIR: &str = "/var/lib/fieldlens-print/capture";
|
||||
#[cfg(target_os = "linux")]
|
||||
const LEGACY_CUPS_SPOOL_DIR: &str = "/var/cache/cups/fieldlens-print";
|
||||
#[cfg(target_os = "linux")]
|
||||
const TEST_CAPTURE_SINK_ADDR: &str = "127.0.0.1:9101";
|
||||
|
||||
pub struct CaptureRuntime {
|
||||
@ -65,7 +67,8 @@ pub fn start(config: AppConfig, state: SharedState, app: AppHandle) -> Result<Ca
|
||||
if matches!(config.mode, CaptureMode::SpoolFolder | CaptureMode::Both) {
|
||||
let spool_dir = PathBuf::from(&config.spool_dir);
|
||||
#[cfg(target_os = "linux")]
|
||||
let is_system_cups_spool = spool_dir == PathBuf::from(SYSTEM_CUPS_SPOOL_DIR);
|
||||
let is_system_cups_spool = spool_dir == PathBuf::from(SYSTEM_CUPS_SPOOL_DIR)
|
||||
|| spool_dir == PathBuf::from(LEGACY_CUPS_SPOOL_DIR);
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
let is_system_cups_spool = false;
|
||||
|
||||
@ -93,7 +96,8 @@ pub fn start(config: AppConfig, state: SharedState, app: AppHandle) -> Result<Ca
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
let system_spool = PathBuf::from(SYSTEM_CUPS_SPOOL_DIR);
|
||||
for spool in [SYSTEM_CUPS_SPOOL_DIR, LEGACY_CUPS_SPOOL_DIR] {
|
||||
let system_spool = PathBuf::from(spool);
|
||||
let worker_stop = stop.clone();
|
||||
let worker_state = state.clone();
|
||||
let worker_app = app.clone();
|
||||
@ -107,6 +111,7 @@ pub fn start(config: AppConfig, state: SharedState, app: AppHandle) -> Result<Ca
|
||||
worker_stop,
|
||||
)
|
||||
}));
|
||||
}
|
||||
|
||||
let sink = TcpListener::bind(TEST_CAPTURE_SINK_ADDR)
|
||||
.with_context(|| format!("bind test-capture sink {TEST_CAPTURE_SINK_ADDR}"))?;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "FieldLens Print",
|
||||
"version": "0.1.25",
|
||||
"version": "0.1.26",
|
||||
"identifier": "dev.arrowstack.fieldlens.print",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user