Merge pull request #568 from kadaliao/feat/keep-trackid-as-songname

feat: add file-format key to use track id as saved filename
This commit is contained in:
Ritiek Malhotra
2019-09-07 19:43:00 +05:30
committed by GitHub
2 changed files with 3 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- Added `--no-remove-original-file` ([@NightMachinary](https://github.com/NightMachinary)) (#580)
- Added leading Zeros in `track_number` for correct sorting ([@Dsujan](https://github.com/Dsujan)) (#592)
- Added `track_id` key for `--file-format` parameter ([@kadaliao](https://github.com/kadaliao)) (#568)
### Fixed
- Generate list error --write-m3u ([@arthurlutz](https://github.com/arthurlutz)) (#559)

View File

@@ -32,6 +32,7 @@ formats = {
9: "track_number",
10: "total_tracks",
11: "isrc",
12: "track_id",
}
@@ -92,6 +93,7 @@ def format_string(
format_tags[9] = tags["track_number"]
format_tags[10] = tags["total_tracks"]
format_tags[11] = tags["external_ids"]["isrc"]
format_tags[12] = tags["id"]
format_tags_sanitized = {
k: sanitize_title(str(v), ok="'-_()[]{}") if slugification else str(v)