Commit Graph
36 Commits
Author SHA1 Message Date
emeric c9e4ec1eb5 fixed format 2025-06-06 08:24:02 +02:00
Simon Rettberg b2471cccfb FileResourceHandler: Open file once on init, more error handling
Keeping the file open allows better prefetching/caching on both
the application layer (ifstream) and OS level (vfs layer) as
the access pattern is sequential and predictable. We also save
three syscalls (open, seek, close) for every chunk we send to
the client (256kb).
2025-06-06 08:24:02 +02:00
Simon Rettberg 54771e6ddf Minor fixes to ChildProcess
- Don't set FD_CLOEXEC, but close manually before fork:
  Since we don't use pipe2() to set the flag atomically, we're prone to
  races with concurrent fork+execs either way. As ChildProcess uses a
  mutex here anyways, as long as there is no other part in lms that
  would fork+exec, we're not any more or less safe now, but the code
  is shorter and we cannot fail the fcntl.
- Don't make the write-end of the pipe non-blocking. Usually programs
  do not expect this, i.e. they either never check the return code of
  a write to stdout (potential data loss), or if they do, they just
  bail out on any error, and don't handle EAGAIN. ffmpeg seemed
  to handle this fine though (or we were just lucky and always read
  the data faster than ffmpeg could produce it).
- Do not close stdin and stderr. Again ffmpeg seems to handle this,
  at least regarding stdin thanks to -nostdin, but in general if a
  process tries to write to stderr and fd 2 is not open, it might
  just bail out. Even worse, the process might have opened some
  file it wants to work with, and that file got assigned fd 2 (as
  that was the next free fd) - the program would corrupt whatever
  file it opened there whenever it tries to write to stderr.
  Try to open /dev/null instead for stdin and stderr, and if that
  fails, keep whatever lms inherited open, which should be safer
  than relying on the child process to handle this case properly.
- exec() does not return on success, no need to check return code,
  any return from it is a failure.
- Wrong error message in error path when assigning fd to boost stream.
- F_SETPIPE_SZ requires and int, not size_t. This worked on little
  endian systems since the value passed was < 2^32, but on big
  endian systems you'd effectively pass "0" if using a 64bit type.
- Address a few clang-tidy complaints (constness)
2025-06-02 09:18:31 +02:00
emeric dc52ea4ea5 Introduced new transcoding service 2025-05-30 23:27:01 +02:00
emeric 571c0bc5f4 More details for scan error reports #676 2025-05-26 23:33:52 +02:00
emeric a5b130305e Append Z to iso8601 date time strings 2025-04-11 18:02:58 +02:00
emeric 744abefc8b Added xxhash dependency 2025-03-09 15:11:41 +01:00
emeric 923c632878 Setting the size of the ipc pipe buffers is not mandatory, ref #614 2025-02-16 13:16:06 +01:00
emeric 6494d17f99 Use boost asio executor_work_guard to fix build 2025-02-10 17:09:52 +01:00
emeric c9fb398196 Use boost asio post to fix build 2025-02-10 16:54:25 +01:00
emeric 814eaf0a3e Switched the file added info back to a full date time, ref #601 2025-01-26 15:08:31 +01:00
emeric 534df42f9d Distinguish initial scan to import last time write as added time, ref #601 2025-01-24 17:59:25 +01:00
emeric 40416cb907 Fixed code factor issue 2025-01-22 13:42:52 +01:00
emeric 817588a755 Properly exclude 00 for partial dates, fixes #477 2025-01-20 13:43:19 +01:00
emeric 33759def78 Adding support for partial dates (only year or month), fixes #477 2025-01-19 23:50:39 +01:00
emeric c73ff7dc03 Use ENCODINGTIME to set the added time, if present, otherwise use the last modified time of the file (only during the first import), fixes #595 2025-01-18 16:51:31 +01:00
emeric 10d900faf2 Simplified some path writes 2025-01-06 22:29:46 +01:00
emeric 3740c6f899 Allow to use an empty lms.conf file, default values are now all hardcoded, fixes #584 2025-01-05 16:12:25 +01:00
emeric 3661eaccb6 Added playlist import (and sync)from m3u files, ref #391 2024-12-18 14:15:25 +01:00
emeric 38efdfaf87 Prefer first embedded image that contains the 'front' keyword 2024-12-08 11:53:31 +01:00
emeric 45175a721c Various minor cleanup 2024-12-05 20:09:14 +01:00
emeric e46682e346 Fixed bool value badly parsed, fixes #542 2024-10-30 18:55:45 +01:00
emeric f613d16fc2 Now manually parse sync/unsync lyrics frames in id3v2 tags 2024-10-27 15:21:54 +01:00
emeric 72b1367ea6 Added embedded/external lyrics support: parsing + indexing, ref #379 2024-10-26 16:58:13 +02:00
emeric 777c36005b Do not use pipe2 to make code more portable, ref #514 2024-09-13 23:28:28 +02:00
emeric fc27a4f852 Apply all separators, not only the first one found, ref #518 2024-09-07 09:34:45 +02:00
emeric 39941d90a3 Auto reformatted the base, ref #470 2024-05-24 23:31:52 +02:00
emeric 8438da9fde Added db stats in trace metadata 2024-04-03 00:02:48 +02:00
emeric e2f68356fa traces: compacted struct + fix bad json export 2024-04-01 23:10:07 +02:00
emeric 284dc58fce Removed useless include 2024-03-31 23:36:56 +02:00
emeric a3c53e1609 Tracing: added some details for db operations 2024-03-31 23:35:12 +02:00
emeric 4ba8330194 Tracing: use only lower 32bits for thread, to make capture compatible with perfetto UI 2024-03-31 13:07:02 +02:00
emeric ed1be02aaf Added a scan tracker to speed up queries with high offset in very large database 2024-03-17 23:36:40 +01:00
emeric fef4a90ce0 Added build type in trace metadata 2024-03-15 23:23:12 +01:00
emeric a769909ebc Removed useless new line 2024-03-14 00:18:36 +01:00
emeric 4b7c4295ec Refactored namespaces 2024-03-12 08:32:08 +01:00