Merge pull request #313 from ritiek/fix-tests

Fix tests
This commit is contained in:
Linus Groh
2018-07-26 21:27:14 +02:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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. """