diff --git a/Changelog.md b/Changelog.md index 724afb5e..f38e5c03 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,7 +3,8 @@ ## 1.10 (UNRELEASED) * Audio filenames can now be quoted, to support filenames with characters - outside the range `a-zA-Z0-9_` + outside the range `a-zA-Z0-9_`. Audio files can also be given including + their extension. * Support for the `stop` and `restart` codes (generated by default) * The `set-language` command truncates long language names (like `ITALIAN`) automatically. diff --git a/src/TipToiYaml.hs b/src/TipToiYaml.hs index 11c554de..8939fe8e 100644 --- a/src/TipToiYaml.hs +++ b/src/TipToiYaml.hs @@ -843,11 +843,9 @@ ttYaml2tt no_date dir (TipToiYAML {..}) extCodes = do Just (lang, txt) -> do Right <$> readFile' (ttsFileName lang txt) Nothing -> do - let paths = [ combine dir relpath - | ext <- map snd fileMagics - , let pat = fromMaybe "%s" ttyMedia_Path - , let relpath = printf pat fn <.> ext - ] + let pat = fromMaybe "%s" ttyMedia_Path + let basePath = printf pat fn + let paths = map (combine dir) (basePath : [basePath <.> ext | (_,ext) <- fileMagics ]) ex <- filterM doesFileExist paths case ex of [] -> do @@ -955,7 +953,7 @@ parsePlayList :: Parser [String] parsePlayList = P.commaSep lexer $ parseAudioRef parseAudioRef :: Parser String -parseAudioRef = (P.lexeme lexer $ many1 (alphaNum <|> char '_')) <|> P.stringLiteral lexer +parseAudioRef = (P.lexeme lexer $ many1 (alphaNum <|> char '_' <|> char '.')) <|> P.stringLiteral lexer parseScriptRef :: Parser String parseScriptRef = P.lexeme lexer $ many1 (alphaNum <|> char '_')