Commit Graph

190 Commits

Author SHA1 Message Date
Martchus e58f8a14a5 Make setting covers via CLI work with Windows drive letters
Interpret a single letter plus colon as drive specification followed by the
actual path instead of splitting it and considering the path the cover
type.

See https://github.com/Martchus/tageditor/issues/109
2023-08-09 23:54:01 +02:00
Martchus f4346fb8e6 Allow preserving the muxing/writing application
See https://github.com/Martchus/tageditor/issues/108
2023-08-09 23:27:34 +02:00
Martchus 1cb00c7c41 Rename `mediafileinfoobject.cpp` to `scriptapi.cpp`
The file contains various wrapper "objects" so it makes sense to use a more
generic name.
2023-08-09 22:38:02 +02:00
Martchus 488684a318 Show muxing/writing application when displaying file info 2023-08-08 17:24:37 +02:00
Martchus c4f7d195a0 Allow adding cover via JavaScript 2023-08-07 18:41:19 +02:00
Martchus 7063f1bf03 Fix creation of song description from JavaScript object
It cannot just use `toString()` as this would turn e.g. `undefined` into
the string ´"undefined"` instead of an empty string.
2023-08-07 17:34:06 +02:00
Martchus 44d0ac21c2 Improve logging changes when applying changes in JavaScript
* Don't log non-printable characters
* Make it clear when an explicitly overridden field value is identical to
  the initial value
2023-08-07 17:32:38 +02:00
Martchus d248c63279 Allow passing settings to JavaScript 2023-08-07 17:30:25 +02:00
Martchus e69278634f Overhaul meta-data search
* Improve coding style
* Remove useless code comments
* Hide legacy providers by default
* Add Tekstowo to have at least one functioning provider for lyrics again
* Enable query logging only if an environment variable is set
* Use Tekstowo in example JavaScript
2023-08-06 20:02:00 +02:00
Martchus a191aebd8a Allow basic use of db query via JavaScript 2023-08-05 02:06:26 +02:00
Martchus 485611141c Track "position in set" changes via JavaScript correctly 2023-08-04 00:19:10 +02:00
Martchus 7533761d77 Make function to read directory from JavaScript actually return anything 2023-08-04 00:18:13 +02:00
Martchus 9fd925a6bd Improve path-related properties of MediaFileInfoObject 2023-08-03 23:32:33 +02:00
Martchus cd1e0ce590 Expose DB query functions to JavaScript
Those are likely not very usable as-is because they return a model that is
not yet written for use within the QML engine.
2023-08-02 18:26:01 +02:00
Martchus 73dc64ce6a Expose target to JavaScript 2023-08-02 18:08:35 +02:00
Martchus 1d4c18f474 Allow setting the save path via JavaScript 2023-08-02 17:56:20 +02:00
Martchus ccb516d47b Avoid implicit type conversion 2023-08-02 17:56:01 +02:00
Martchus 24b397b930 Add functions to read dirs/files from the JavaScript 2023-08-02 17:55:36 +02:00
Martchus 9aca90538d Execute JavaScript after tags have been added/removed 2023-08-02 17:42:47 +02:00
Martchus 57b6d38e43 Simplify dealing with fields in JavaScript
* Expose PositionInSet as Object (that is still convertable to String)
* Allow assigning field values directly without having to have a
  TagValueObject and without having to have an Array
2023-08-01 00:50:33 +02:00
Martchus c3af3d43e6 Allow dealing with multiple fields values in JavaScript 2023-07-31 23:53:35 +02:00
Martchus 9cb8702d13 Fix use of QT_BEGIN_NAMESPACE when declaring qHash() function 2023-07-30 16:57:19 +02:00
Martchus 8c2ab29927 Make JavaScript processing code compatible with Qt 5 2023-07-30 16:55:35 +02:00
Martchus 22953ad0da Allow tag processing via JavaScript 2023-07-30 16:15:19 +02:00
Martchus a6231b8442 Add the tag type the "not supported for" message refers to 2023-05-03 21:09:36 +02:00
Martchus 0e36eec6c7 Suppress "field not supported" for ID3v1 fields if writing ID3v2 as well 2023-05-03 21:00:59 +02:00
Martchus b7016f98a2 Add pedantic argument to allow returning a non-zero exit code in case of errors
This is especially useful to check whether a file is complete, e.g. one might
use `tageditor info --validate --pedantic --files …` to check whether the
specified files are ok. (If they were truncated there's be an error about it
and the command would return a non-zero exit code. Without pedantic this would
just return in a non-zero exit code if the file couldn't be parsed at all.)
2023-04-25 23:16:15 +02:00
Martchus b023c26205 Avoid use of non-standard escape character to avoid MSVC warning about it 2023-03-26 21:59:31 +02:00
Martchus 9b143ffbef Avoid unqualified calls to `std::move` 2023-02-20 19:55:16 +01:00
Martchus a220b86672 Disable code relying on `unistd.h` when compiling with MSVC
Not sure what to do instead, so for now let's just disable the logging from
the signal handler completely for MSVC builds so the code at least
compiles.
2023-02-02 00:33:15 +01:00
Stent 3fe8db2c01
Fix language mistakes in cli help text
Closes #96
2022-12-22 13:37:08 +00:00
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