From 3aff8d02c523fef943e64f1274705f127d23d6ea Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Thu, 26 Jul 2018 21:09:59 +0200 Subject: [PATCH] Fix tests --- core/internals.py | 4 ++-- core/youtube_tools.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/internals.py b/core/internals.py index 9a0ad32..ed033cd 100755 --- a/core/internals.py +++ b/core/internals.py @@ -66,7 +66,7 @@ def is_youtube(raw_song): return status -def format_string(string_format, tags, slugification=False): +def format_string(string_format, tags, slugification=False, force_spaces=False): """ Generate a string of the format '[artist] - [song]' for the given spotify song. """ format_tags = dict(formats) format_tags[0] = tags['name'] @@ -94,7 +94,7 @@ def format_string(string_format, tags, slugification=False): string_format = string_format.replace(format_tag, format_tags[x]) - if const.args.no_spaces: + if const.args.no_spaces and not force_spaces: string_format = string_format.replace(' ', '_') return string_format diff --git a/core/youtube_tools.py b/core/youtube_tools.py index a65c1da..a4e75af 100644 --- a/core/youtube_tools.py +++ b/core/youtube_tools.py @@ -113,7 +113,7 @@ class GenerateYouTubeURL: self.search_query = raw_song else: self.search_query = internals.format_string(const.args.search_format, - meta_tags) + meta_tags, force_spaces=True) def _best_match(self, videos): """ Select the best matching video from a list of videos. """