Merge pull request #653 from ritiek/fix-keyerror

Fix KeyError when a track isn't found on Spotify
This commit is contained in:
Ritiek Malhotra
2020-01-10 01:26:05 -08:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- Fixed a regression where a track would fail to download if it isn't
found on Spotify ([@ritiek](https://github.com/ritiek)) (#653)
## [1.2.3] - 2019-12-20
### Added

View File

@@ -93,7 +93,10 @@ 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"]
try:
format_tags[12] = tags["id"]
except KeyError:
pass
format_tags_sanitized = {
k: sanitize_title(str(v), ok="'-_()[]{}") if slugification else str(v)