A Linux command-line tool that interacts with CTDB (CUETools Database) to perform metadata retrieval, parity calculation, verification, repair, and uploading using CUE sheets and audio files.
- CTDB parity calculation from CUE + WAV/FLAC (Supports multi-file CUE)
- Error repair using CTDB parity data
- Submitting metadata and parity to CTDB
- Support for Linux (.NET 8.0) environment
- Automatic character encoding detection for CUE files
This tool depends on libraries from cuetools.net.
./configure
make
sudo make installOptions:
./configure --prefix=/usr- Change install prefix (default:/usr/local)make DESTDIR=/path/to/dest install- Specify DESTDIR for packaging
Fetch dependencies and apply patches:
./setup.shWhy Patches Are Needed
- Freedb.csproj: The original project file uses an old format that is not correctly handled by
dotnet buildon Linux, so it is converted to the SDK-style format.- TagLib: The original
CUESheet.csdepends on some properties (likeAudioSampleCount) that are missing in the current TagLib Sharp, so a fix is applied to compensate for this.- UTF.Unknown: Automatically detects the character encoding of CUE files.
Build:
# Test build
dotnet build CTDB.CLI/CTDB.CLI.csproj
# Framework-dependent (lightweight)
dotnet publish CTDB.CLI/CTDB.CLI.csproj -c Release -o publish/dependent
# Self-contained / Single File
# Works even if .NET is not installed on the target machine, but the file size will be larger.
dotnet publish CTDB.CLI/CTDB.CLI.csproj -c Release -r linux-x64 --self-contained -p:PublishSingleFile=true -o publish/standaloneUse dotnet run or the built binary.
ctdb-cli [options] <command> <cue_file> [command_options]dotnet run --project CTDB.CLI/CTDB.CLI.csproj -- [options] <command> <cue_file> [command_options]| Option | Description |
|---|---|
--xml |
Output results in XML format to stdout. Logs and errors are directed to stderr. (XML Output Format) |
Searches for metadata from CTDB based on the CUE sheet and displays Raw XML.
ctdb-cli lookup test.cueReads local audio files and calculates AccurateRip CRC and CTDB CRC.
ctdb-cli calc test.cueMatches data on CTDB with local files to verify the accuracy of the rip.
ctdb-cli verify test.cueUses CTDB parity data to repair errors in a ripped file.
The repaired file is saved as cue_filename_repaired.wav.
ctdb-cli repair test.cueNote: Repair requires sufficient parity data in CTDB. If repair is not possible, an error message will be displayed.
Note: Even if the input is a multi-file CUE, the output will be a single WAV file.
Submits the calculated parity and metadata to CTDB.
Only execute this command if you are highly confident that the data is correct.
ctdb-cli submit test.cue --drive "Drive Name" --quality 100| Argument | Required | Description |
|---|---|---|
--drive |
○ | Drive name (e.g., "PLEXTOR PX-716A") |
--quality |
○ | Quality (1-100) |
How to find the drive name
You can obtain it using the
cd-infocommand (libcdio).$ cd-info -A --no-cddb ... Vendor : Optiarc Model : DVD RW AD-7290H ...In this case, you can specify it as
--drive "Optiarc - DVD RW AD-7290H".According to the source, for a drive name to be accepted, the submitted string must start with a registered vendor name (probably something like PIONEER, ASUS, HL-DT-ST), be followed by any characters, and contain a hyphen (
-) somewhere.
By default, it operates in dry-run mode, which only displays the information to be submitted.
To perform the actual submission, set the CTDB_CLI_CALLER environment variable to identify your application name.
env CTDB_CLI_CALLER="your-app-name" ctdb-cli submit test.cue --drive "drive name" --quality 100