Commit Graph

10440 Commits

Author SHA1 Message Date
Philipp Wolfer
c2aaad5eb7 PICARD-2850: Extend file naming examples with additional variables
This includes technical file variables and additional tags that would
be set for the selected recordings.
2024-04-02 19:49:30 +02:00
Laurent Monin
c166041531 Move FILE_INFO_TAGS from class File to module picard.util.tags
It reduces the size of objects, and it doesn't seem we ever needed to change it.
2024-04-02 18:25:33 +02:00
dependabot[bot]
0faaca2e16 Bump softprops/action-gh-release from 1 to 2
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-02 18:07:27 +02:00
ankhedonic
53f2852326 Translated using Weblate (Polish)
Currently translated at 56.1% (661 of 1177 strings)

Co-authored-by: ankhedonic <ankhedonic@gmail.com>
Translate-URL: https://translations.metabrainz.org/projects/picard/3/app/pl/
Translation: Picard/App
2024-04-02 10:28:57 +00:00
Laurent Monin
a124383614 Merge pull request #2381 from zas/version_str_vs_to_string
Replace `Version.to_string()` with `str(v)` and introduce `Version.short_str()` as a separate method
2024-04-01 14:47:29 +02:00
Laurent Monin
8af9db4d94 Remove now unused Version.to_string()
- `v.to_string(short=False)` was replaced by `str(v)`
- `v.to_string(short=True)` was replaced by `v.short_str()`
2024-04-01 12:13:11 +02:00
Laurent Monin
e5b28f21a5 Replace Version.to_string(short=True) by Version.short_str() 2024-04-01 12:10:05 +02:00
Laurent Monin
7c834fef9e Split code between __str__() and short_str(), keeping to_string() for now 2024-04-01 12:07:20 +02:00
Laurent Monin
c86c364a37 Version has __str__() method calls to_string(), so make use of it 2024-04-01 12:06:18 +02:00
Laurent Monin
82e0bbdd8c Merge pull request #2379 from zas/simplify_upgrade_config
Simplify config upgrade code
2024-03-31 23:10:30 +02:00
Laurent Monin
92b09036e9 autodetect_upgrade_hooks(): returns a dict sorted by version and test that 2024-03-31 17:08:41 +02:00
Laurent Monin
5770c2ccc0 Move check for future version upgrade hook to autodetect_upgrade_hooks() 2024-03-31 16:37:36 +02:00
Laurent Monin
de381708d1 autodetect_upgrade_hooks(): throw new UpgradeHooksAutodetectError exception 2024-03-31 16:01:51 +02:00
salo.rock
9f932d46d9 Translated using Weblate (Italian)
Currently translated at 100.0% (1177 of 1177 strings)

Co-authored-by: salo.rock <salo.rock@users.noreply.translations.metabrainz.org>
Translate-URL: https://translations.metabrainz.org/projects/picard/3/app/it/
Translation: Picard/App
2024-03-31 10:28:57 +00:00
Laurent Monin
e87333eb03 Handle another tricky case where 2 methods can be defined for same version
That's because we support small variations in string version (like a/alpha).
So, check if the loop tries to set the same dict key twice and raises an exception in this case.
2024-03-31 00:33:16 +01:00
Laurent Monin
f4967de687 Merge remote-tracking branch 'upstream/master' into simplify_upgrade_config 2024-03-31 00:11:58 +01:00
Laurent Monin
9c91debbed Merge pull request #2380 from zas/stricter_version_from_string
Make `Version.from_string()` stricter, matching from start of string
2024-03-31 00:11:32 +01:00
Laurent Monin
4202e2ac35 Make Version.from_string() stricter, matching from start of string 2024-03-31 00:07:02 +01:00
Laurent Monin
7e0b89ccd5 Add a tricky case for upgrade hooks autodetection
This case is happening because we only match end of string when it comes to version detection
2024-03-31 00:03:47 +01:00
Laurent Monin
9852b8b1cc Add tests for upgrade hooks autodetection 2024-03-30 23:59:44 +01:00
Laurent Monin
005837e891 Make Version.from_string() stricter, matching from start of string 2024-03-30 21:21:16 +01:00
Laurent Monin
c422bae446 Merge remote-tracking branch 'upstream/master' into simplify_upgrade_config
# Conflicts:
#	picard/config_upgrade.py
#	test/test_config_upgrade.py
2024-03-30 18:35:30 +01:00
Laurent Monin
1329c06bde Merge pull request #2378 from zas/rename_toolbar_multiselect
PICARD-2848: Rename option "toolbar_multiselect" to "allow_multi_dirs_selection"
2024-03-30 18:30:28 +01:00
Laurent Monin
db05675957 PICARD-2848: Rename option "toolbar_multiselect" to "allow_multi_dirs_selection"
- the old name isn't explicit enough, and it isn't related to toolbar anymore at all
2024-03-30 14:18:01 +01:00
Laurent Monin
c279edd52e No need to register hooks, since they are executed within same method 2024-03-30 12:47:39 +01:00
Laurent Monin
83d90a26b2 upgrade_config(): improve docstring, as it also executes hooks 2024-03-30 12:30:03 +01:00
Laurent Monin
203cb4ab83 _write_version(): pass a parameter and set Config._version 2024-03-30 12:21:41 +01:00
Laurent Monin
4a688260d3 run_upgrade_hooks(): no need of outputfunc, use log.debug() directly 2024-03-30 12:15:05 +01:00
Laurent Monin
78ce881cad Simplify upgrade hook exception logging
There's no need for extra traceback, use `raise from`.

Before:

```
Traceback (most recent call last):
  File "/home/zas/src/picard/./picard/config.py", line 318, in run_upgrade_hooks
    hook(self)
  File "/home/zas/src/picard/./picard/config_upgrade.py", line 174, in upgrade_to_v1_3_0dev4
    raise Exception("test")
Exception: test

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/zas/src/picard/tagger.py", line 17, in <module>
    main(os.path.join(basedir, 'locale'), True)
  File "/home/zas/src/picard/./picard/tagger.py", line 1567, in main
    tagger = Tagger(picard_args, localedir, autoupdate, pipe_handler=pipe_handler)
  File "/home/zas/src/picard/./picard/tagger.py", line 337, in __init__
    upgrade_config(config)
  File "/home/zas/src/picard/./picard/config_upgrade.py", line 574, in upgrade_config
    config.run_upgrade_hooks(log.debug)
  File "/home/zas/src/picard/./picard/config.py", line 321, in run_upgrade_hooks
    raise ConfigUpgradeError(
picard.config.ConfigUpgradeError: Error during config upgrade from version 1.3.0.dev3 to 1.3.0.dev4 using upgrade_to_v1_3_0dev4():
Traceback (most recent call last):
  File "/home/zas/src/picard/./picard/config.py", line 318, in run_upgrade_hooks
    hook(self)
  File "/home/zas/src/picard/./picard/config_upgrade.py", line 174, in upgrade_to_v1_3_0dev4
    raise Exception("test")
Exception: test
```


After:

```
Traceback (most recent call last):
  File "/home/zas/src/picard/./picard/config.py", line 318, in run_upgrade_hooks
    hook(self)
  File "/home/zas/src/picard/./picard/config_upgrade.py", line 174, in upgrade_to_v1_3_0dev4
    raise Exception("test")
Exception: test

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/zas/src/picard/tagger.py", line 17, in <module>
    main(os.path.join(basedir, 'locale'), True)
  File "/home/zas/src/picard/./picard/tagger.py", line 1567, in main
    tagger = Tagger(picard_args, localedir, autoupdate, pipe_handler=pipe_handler)
  File "/home/zas/src/picard/./picard/tagger.py", line 337, in __init__
    upgrade_config(config)
  File "/home/zas/src/picard/./picard/config_upgrade.py", line 574, in upgrade_config
    config.run_upgrade_hooks(log.debug)
  File "/home/zas/src/picard/./picard/config.py", line 320, in run_upgrade_hooks
    raise ConfigUpgradeError(
picard.config.ConfigUpgradeError: Error during config upgrade from version 1.3.0.dev3 to 1.3.0.dev4 using upgrade_to_v1_3_0dev4()
```
2024-03-30 12:06:59 +01:00
Laurent Monin
01128bc147 Be more precise about hook parameters 2024-03-29 11:50:05 +01:00
Laurent Monin
5f046e663a Declare is_upgrade_hook() inside upgrade_config()
It is only used there and once.
2024-03-29 11:48:21 +01:00
Laurent Monin
b2013447de upgrade_config(): add docstring 2024-03-29 11:48:21 +01:00
Laurent Monin
d0434b1c83 upgrade_config(): cfg variable isn't needed 2024-03-29 11:48:21 +01:00
Laurent Monin
7ed2d13d1b Add a note about upgrade hook docstring 2024-03-29 11:48:21 +01:00
Laurent Monin
127163a48b Update comment about how to name and add an upgrade hook 2024-03-29 11:48:21 +01:00
Laurent Monin
33027a34a3 Rename upgrade methods, extra underscores aren't needed
v1.0.0beta1 -> `upgrade_to_v1_0_0beta1()`

Just replace dots in current version with underscores.

Rename methods in tests
2024-03-29 11:48:11 +01:00
Laurent Monin
8ec27a9de7 No need of an extra dict, just remove hooks that are skipped or executed 2024-03-28 19:39:28 +01:00
Laurent Monin
e70fd7c93c Hooks will be executed in sorted order in Config.run_upgrade_hooks() 2024-03-28 19:13:00 +01:00
Laurent Monin
36afcd7a90 Simplify config upgrade code
- get rid of hook args, all are using `config`
- simplify `config._upgrade_hooks` making it a simple dict
- automatically register hooks based on their name, using suffix as version
2024-03-28 15:13:46 +01:00
Laurent Monin
8af19d40cd Merge pull request #2375 from phw/charset-detection-fixes
Charset detection fixes
2024-03-28 12:52:10 +01:00
wileyfoxyx
7d97ff1204 Translated using Weblate (Russian)
Currently translated at 56.5% (666 of 1177 strings)

Co-authored-by: wileyfoxyx <wileyfoxyx@users.noreply.translations.metabrainz.org>
Translate-URL: https://translations.metabrainz.org/projects/picard/3/app/ru/
Translation: Picard/App
2024-03-25 12:28:56 +00:00
Philipp Wolfer
647fc3bd32 Add syncedlyrics to tags requiring multiline edit 2024-03-23 19:34:23 +01:00
Hosted Weblate
ffa90e3de5 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://translations.metabrainz.org/projects/picard/3/app/
Translation: Picard/App
2024-03-23 18:27:47 +00:00
Philipp Wolfer
c19c38a03a Update picard.pot 2024-03-23 19:27:30 +01:00
Philipp Wolfer
3cc33b5516 Fix tests for detect_file_encoding without charset-normalizer installed 2024-03-23 17:47:42 +01:00
Philipp Wolfer
06ae9d7de9 Fixed utf-32 detection from BOM
- the utf-32-le BOM was in wrong order
- longer BOMs need to be checked first
- added BOM for utf-8-sig
2024-03-23 17:47:42 +01:00
Philipp Wolfer
cb5af096f5 Merge pull request #2373 from twodoorcoupe/synced_lyrics_tag
PICARD-1092: Add support for preserving the SYLT tag
2024-03-23 17:43:00 +01:00
twodoorcoupe
40be536609 Add detail in warning for unsupported files 2024-03-22 18:40:04 +01:00
twodoorcoupe
21ada913d3 Fix handling of other sylt frame formats 2024-03-22 17:41:44 +01:00
twodoorcoupe
70e0e21450 Avoid writing syncedlyrics to other formats 2024-03-21 22:45:41 +01:00