Commit graph

22 commits

Author SHA1 Message Date
d49a241c0c fix handling of non-utf8 filenames
Our SQLite DB requires UTF-8 strings but the filenames from the file
system could use any encoding.  Ideally we'd try to find the right
encoding, but we're already using `str.encode(errors="replace").decode()`
in other places to handle filenames that don't use UTF-8 encoding and so
this is a pragmatic solution that should work for all cases, even though
we loose information - all non-utf8 chars will be converted to "?".
An iteration on this could use an encoding detection mechanism.
2023-02-22 19:57:02 +01:00
9720d75a61 fix change check for dirs
We recalculate the stored dir size for every dir to be the sum of all
ancestors, so comparing the dir size as reported by the file system will
usually always differ.
2023-02-21 21:32:48 +01:00
d995651487 fix file matching for files with non-utf8 encodings
We make sure all filenames are using UTF-8 encoding before committing
them to the database.  For filenames using a different encoding we
convert offending chars to `?` (using `str.encode(errors="replace")`).
When trying to match files from the local filesystem with files from the
database we thus have to use the mangled filenames, not the original
ones.
2023-02-21 18:28:13 +01:00
d8afd3a293 support remove_missing in ingest_rclone_json 2023-02-11 18:48:30 +01:00
19deeb9512 fix matching of descendants during delete 2023-02-11 18:32:36 +01:00
54cdfa4685 minor clean up 2023-02-11 18:30:31 +01:00
d399d7caba use dir sizes to sum up the size of all descendants
This fundamentally changes the way we use size information for dirs in
Metadex.
The implementation is currently hardly optimized and thus might
considerably slow down the application in some circumstances.
2023-02-11 18:29:20 +01:00
22ef62202a fix typing issue 2023-02-11 15:42:31 +01:00
398736c4ad improve typing defs 2023-02-11 14:55:43 +01:00
3a2988b8c7 upgrade to SQLAlchemy v2.0 2023-02-10 20:46:58 +01:00
1e21fb08a5 fix creating empty DB when ingest target does not exist 2023-02-08 23:09:38 +01:00
b6670191e5 run reformatting 2023-02-08 23:04:07 +01:00
6fac05d9d3 update dependencies 2023-02-08 23:04:06 +01:00
02e4415cb4 support type filter for ls for full paths 2023-02-08 23:04:06 +01:00
cc38046c1b move status line helper to utils module 2023-02-08 23:04:06 +01:00
72bd33660b update Mypy & improve typing defs some 2023-02-08 23:04:06 +01:00
1b4fad929c add lint & test tools 2023-02-08 22:42:20 +01:00
06c323ab91 use wcwidth to calculate proper term output width
This fixes an issue with printing some Unicode characters during scan
operations which take up more than 1 terminal cell, which would cause
line breaks or other garbage to remain in the status output line.
2022-12-22 00:46:29 +01:00
954562881a add rclone importer 2022-08-21 14:37:25 +02:00
af1236bc7e minor refactoring 2022-08-19 22:31:38 +02:00
6b65efd8c7 add ls option --stop-on-error 2022-08-19 21:36:30 +02:00
01a96c14d4 wip 2022-08-14 20:41:58 +02:00