How to use the pyexpander.config.TV_PATH.format function in pyexpander

To help you get started, we’ve selected a few pyexpander examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github omerbenamram / py-expander / src / pyexpander / categorize.py View on Github external
def get_path_video(filename):
    guess = guessit.guess_file_info(filename)

    if guess[u'type'] == u'episode':
        series = guess.get(u'series', u'').title()
        season = guess.get(u'season', u'')

        return config.TV_PATH.format(series=series, season=season)
    elif guess[u'type'] == u'movie':
        title = guess.get(u'title', u'').title()
        year = guess.get(u'year', u'')

        return config.MOVIE_PATH.format(title=title, year=year)
    else:
        return None