Commit Graph

159 Commits

Author SHA1 Message Date
Martchus 08629ef4ee Improve error handling when setting tags in CLI 2022-08-12 00:28:57 +02:00
Martchus 9eeae7ae22 Use `TagValue::toDisplayString()` instead of handling exception 2022-06-19 13:32:46 +02:00
Martchus b5c12f09b5 Apply clang-format 2022-05-26 21:40:55 +02:00
Martchus 90d2d7bde4 Support all known fields in renaming utility
* Generalize and simplify code for populating tag object
2022-05-24 18:12:50 +02:00
Martchus e8c0450c1c Preserve casing in field mapping consistently for cases where it is wanted 2022-05-24 18:11:33 +02:00
Martchus 794afdb01e Print diagnostic messages to stderr
They contain errors and debugging information so stderr fits better. This
also ensures they don't conflict with the output, e.g. when extracting to
stdout.
2022-05-21 13:25:44 +02:00
Martchus b26b972e25 Return non-zero exit code in all fatal error cases
See https://github.com/Martchus/tageditor/issues/83
2022-05-21 13:06:34 +02:00
Martchus 56ca398dda Apply changes to any Ogg Vorbis comment unless a track has been specified
This is required since the parsed Ogg Vorbis comment's target is set to the
containing Ogg stream as it still makes sense not having to care about the
specific track in most cases.
2022-05-04 00:42:48 +02:00
Martchus 5e808d069b Support many more fields 2022-04-06 01:15:21 +02:00
Martchus a40cff17a9 Apply clang-format 2022-04-05 20:17:33 +02:00
Martchus 32c9cbaae2 Use `makeNativePath()` instead of `u8path()`
On non-Windows platforms the internal representation used for paths is the
configured native (narrow) character set. Most of the time that's UTF-8 but
only on Windows UTF-8 is *always* used for the internal representation.
2022-03-17 22:41:51 +01:00
Martchus 30bf73163f cli: Catch conversion exceptions when making tag values from CLI args 2022-03-16 21:09:20 +01:00
Martchus df1c949f88 cli: Revamp `extract` to allow specifying index of value to extract 2022-03-16 20:37:35 +01:00
Martchus 7f1e234f36 Fix occurrences of wrong encoding handling with `std::filesystem` 2022-03-16 19:51:54 +01:00
Martchus 7ba63ad79f cli: Display at least MIME-type if field cannot be displayed as string 2022-03-16 19:38:51 +01:00
Martchus a21d91e716 Improve coding style in CLI code for parsing specified fields
* Use `std::string_view` instead of C-style strings and e.g. `strncmp`
* Use consistent coding style, e.g. for initialization
2022-01-01 21:15:22 +01:00
Martchus ef637cb361 Use more uniform coding style in `setTagInfo()` 2022-01-01 20:45:06 +01:00
Martchus 28691378ce Avoid creation of targets when relevat values are empty or when using relaxed matching 2022-01-01 20:44:42 +01:00
Martchus 4905aa96b4 Avoid copy when registering interrupt handler 2021-12-31 00:44:52 +01:00
Martchus 2c9be7c223 Fix parsing CLI argument "target-attachments" 2021-12-31 00:42:43 +01:00
Martchus dca5905744 Improve coding style in CLI code
* Use `std::string_view` instead of `const std::string &`
* Use `const` and `auto` where it makes sense
2021-12-31 00:41:56 +01:00
Martchus c71fde86ec Allow relaxed target matching 2021-12-31 00:40:36 +01:00
Martchus 34282ebbe9 Remove handling for comma-separated specifications of targets to remove 2021-12-31 00:35:42 +01:00
Martchus c753c2e1fd Remove unused variable 2021-12-05 17:52:55 +01:00
Martchus 43ebafe6dc Improve error message when trying to assign attachments to format not supporting it
See https://github.com/Martchus/tageditor/issues/74
2021-09-24 21:54:52 +02:00
Martchus fef97aa1db Allow specifying `--validate` flag when displaying file info 2021-08-18 23:12:27 +02:00
Martchus 33b346fb7e Improve error message when file for tag value not found 2021-08-14 14:23:08 +02:00
Martchus 9c1bd4c210 Avoid warning about implicit conversion 2021-07-03 23:53:20 +02:00
Martchus b4d1df8592 Fix typos found via `codespell --skip .git -w` 2021-07-03 19:38:36 +02:00
Martchus a9f3a607a3 Improve showing IO errors
* Make error messages and dialogs more consistent
* Print the actual error message (which might actually contain something
  useful when NativeFileStream is used)
2021-06-01 22:36:48 +02:00
Martchus 523971ad9d Suppress warning about cover type for ID3v1 tag when also an ID3v2 tag is present 2021-06-01 22:05:07 +02:00
Martchus 7ada28b06e cli: Allow preserving the modification time
See https://github.com/Martchus/tageditor/issues/66
2021-06-01 21:56:23 +02:00
Martchus 3203d4403e Apply clang-format 2021-05-27 18:56:53 +02:00
Martchus 9e0ce80c8c cli: Add --quiet flag to set operation 2021-05-27 18:56:42 +02:00
Martchus 53f0f02c72 Fix handling arbitrary files specified as field values
The container offset must not be used here as it may be garbage if the file
format is not recognized (e.g. if the file is an arbitrary text file).
2021-05-22 23:02:55 +02:00
Martchus 54093af53b Add missing include for std::optional 2021-05-22 22:59:52 +02:00
Martchus 5acb9d32ee Show the cover description within the CLI 2021-05-10 20:51:50 +02:00
Martchus 1944773022 Allow setting multiple covers of the same type but different descriptions
The standard actually says that there might be different covers with only
different descriptions:

    Description is a
    short description of the picture, represented as a terminated
    text string. There may be several pictures attached to one file, each
    in their individual "APIC" frame, but only one with the same content
    descriptor. There may only be one picture with the picture type
    declared as picture type $01 and $02 respectively.

I assume "content descriptor" means combination of the type and
description.

This is in accordance with eyeD3.

See https://github.com/Martchus/tageditor/issues/64#issuecomment-833952940
2021-05-10 20:51:15 +02:00
Martchus b56232c1f4 Fix printing cover field of non-ID3v2 tags 2021-04-28 17:48:29 +02:00
Martchus 41fb2069f3 Allow setting covers of special types with description via CLI
See https://github.com/Martchus/tageditor/issues/64
2021-04-28 00:57:57 +02:00
Martchus d31fd79e87 Adapt to changes in tagparser library 2021-04-23 22:18:30 +02:00
Martchus e535e20720 Fix warnings 2021-03-20 21:59:49 +01:00
Martchus 9fbb375924 Adapt to changes in tagparser (without making actually use of the new API) 2021-02-04 23:22:43 +01:00
Martchus 82d0834e75 Adapt to changes in tagparser 2021-02-02 11:02:30 +01:00
Martchus 7ed99a5035 Adapt to changes in tagparser 2021-02-01 17:11:48 +01:00
Martchus 670a9a1c91 Adapt to changes in tagparser 2021-01-30 21:57:09 +01:00
Martchus 06fd8c58d7 Fix invocation of write in interrupt handler 2021-01-30 21:54:59 +01:00
Martchus 0a7d05256c Adapt to changes in tagparser v10 2020-12-14 21:19:49 +01:00
Martchus d98b2612c0 Fix size for writing "Signal received" warning 2020-09-26 20:39:41 +02:00
Martchus bb4bb29ab9 Handle SIGTERM as well (in addition to SIGINT) when saving changes
* e.g. ffmpeg handles SIGTERM as well to finalize writing the file
* not tested yet
2020-06-02 17:19:09 +02:00