* [ANN] dtas 0.19.0 - duct tape audio suite for *nix
@ 2021-09-05 8:44 5% Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-09-05 8:44 UTC (permalink / raw)
To: dtas-all, ruby-talk
Free Software command-line tools for audio playback, mastering, and
whatever else related to audio. dtas follows the worse-is-better
philosophy and acts as duct tape to combine existing command-line tools
for flexibility and ease-of-development. dtas is currently implemented
in Ruby (and some embedded shell), but may use other languages in the
future.
Changes:
dtas 0.19.0 - odd pathname fixes
Non-UTF-8-encoded pathnames now handled properly by dtas-mlib.
Shell-unfriendly filenames are handled properly if they require
ffmpeg (they were always handled properly when using sox).
Some minor URL and doc updates, too, and there's a new
"make symlink-install" target for users who lack permissions
to install RubyGems.
6 changes since v0.18.1 (2021-02-13):
mlib: pathnames may be blobs
README: replace NNTP URL with NNTPS
gemspec: allow building gem without setting VERSION
build: add "symlink-install" target
do not shell-quote filenames for environment
doc: use Tor v3 .onion URLs
* homepage: https://80x24.org/dtas/
* https://80x24.org/dtas/INSTALL
* https://80x24.org/dtas/dtas-player.txt
* https://80x24.org/dtas/NEWS.atom
* git clone https://80x24.org/dtas.git
* dtas-all@nongnu.org (plain-text only, no HTML mail, please)
* mail archives: https://80x24.org/dtas-all/
nntps://news.public-inbox.org/inbox.comp.audio.dtas
imaps://anon:mous@public-inbox.org/inbox.comp.audio.dtas.0
nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.audio.dtas
imap://anon:mous@7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.audio.dtas.0
https://80x24.org/dtas-all/new.atom
note: .onion URLs require Tor: <https://www.torproject.org/>
^ permalink raw reply [relevance 5%]
* [PATCH] mlib: pathnames may be blobs
@ 2021-03-19 7:36 7% Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-03-19 7:36 UTC (permalink / raw)
To: dtas-all
POSIX filesystems do not enforce encodings, so we'll convert
non-UTF-8 filenames to blobs for SQLite instead of failing on
encoding errors. This should allow us to work on collections
which feature legacy encodings.
---
lib/dtas/mlib.rb | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/lib/dtas/mlib.rb b/lib/dtas/mlib.rb
index 026e931..eb7554a 100644
--- a/lib/dtas/mlib.rb
+++ b/lib/dtas/mlib.rb
@@ -1,5 +1,5 @@
# -*- encoding: utf-8 -*-
-# Copyright (C) 2015-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) 2015-2021 all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
#
@@ -129,9 +129,13 @@ def worker_work(job)
comments.where(q).delete
tmp.each do |tid, val|
v = vals[val: val]
- q[:val_id] = v ? v[:id] : vals.insert(val: val)
- q[:tag_id] = tid
- comments.insert(q)
+ begin
+ q[:val_id] = v ? v[:id] : vals.insert(val: val)
+ q[:tag_id] = tid
+ comments.insert(q)
+ rescue => e
+ warn "E: #{e.message} (#{e.class}) q=#{q.inspect} val=#{val.inspect}"
+ end
end
end
end
@@ -214,12 +218,16 @@ def scan_any(path, parent_id)
end
end
+ def maybe_blob(path)
+ path.valid_encoding? ? path : Sequel.blob(path)
+ end
+
def scan_file(path, st, parent_id)
return if @suffixes !~ path || st.size == 0
# no-op if no change
unless @force
- if node = @db[:nodes][name: path, parent_id: parent_id]
+ if node = @db[:nodes][name: maybe_blob(path), parent_id: parent_id]
return if st.ctime.to_i == node[:ctime] || node[:tlen] == DM_IGN
end
end
@@ -271,14 +279,16 @@ def node_update_maybe(node, tlen, ctime)
node_id = node.delete(:id)
@db[:nodes].where(id: node_id).update(node.merge(q))
node[:id] = node_id
+ rescue => e
+ warn "E: #{e.message} (#{e.class}) node=#{node.inspect}"
end
def node_lookup(parent_id, name)
- @db[:nodes][name: name, parent_id: parent_id]
+ @db[:nodes][name: maybe_blob(name), parent_id: parent_id]
end
def node_ensure(parent_id, name, tlen, ctime = nil)
- q = { name: name, parent_id: parent_id }
+ q = { name: maybe_blob(name), parent_id: parent_id }
if node = @db[:nodes][q]
node_update_maybe(node, tlen, ctime)
else
@@ -289,6 +299,8 @@ def node_ensure(parent_id, name, tlen, ctime = nil)
node[:id] = @db[:nodes].insert(node)
end
node
+ rescue => e
+ warn "E: #{e.message} (#{e.class}) q=#{q.inspect}"
end
def cd(path)
^ permalink raw reply related [relevance 7%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-03-19 7:36 7% [PATCH] mlib: pathnames may be blobs Eric Wong
2021-09-05 8:44 5% [ANN] dtas 0.19.0 - duct tape audio suite for *nix Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/dtas.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).