jkwill87 / mnamer

media file renaming and organizing tool
https://pypi.org/project/mnamer
MIT License
803 stars 68 forks source link

create directory does not work as expected with colons #139

Open N1ck01as opened 3 years ago

N1ck01as commented 3 years ago

Hello, There is an issue with renaming directories. Here is my command:

mnamer --media=movie --no-cache --test --hits=50 .
testing mode
Starting mnamer

Processing Movie "Le Labyrinthe - La Terre Brûlée (2015).mkv" (3.77GB)
select match
   Mont Saint-Michel : le Labyrinthe de L’archange (2017)
   Le Labyrinthe Secret de Namoroka (2018)
   Le Labyrinthe (2014)
   Le Labyrinthe de L'injustice (2013)
   Évasion 2 : le Labyrinthe D'hadès (2018)
   Le Labyrinthe de La Grisaia (2015)
   Le Labyrinthe du Silence (2014)
 ❱ Le Labyrinthe : La Terre Brûlée (2015)
   Andròn: le Labyrinthe Noir (2015)
   Le Labyrinthe : Le Remède Mortel (2018)
   skip
   quit
moving to /Volumes/downloads/FILMS/Labyrinthe/Le Labyrinthe  La Terre Brûlée (2015)/Le Labyrinthe - La Terre Brûlée (2015).mkv

The directory name is not sanitized with the same parameters as the filename...

Here are my parameters:

{
    "api_key_omdb": null,
    "api_key_tmdb": null,
    "api_key_tvdb": null,
    "api_key_tvmaze": null,
    "batch": false,
    "episode_api": "tvmaze",
    "episode_directory": "{series}/SAISON {season:02}",
    "episode_format": "{series} - S{season:02}E{episode:02} - {title}.{extension}",
    "hits": 20,
    "ignore": [
        ".*sample.*",
        "^RARBG.*"
    ],
    "language": "fr",
    "lower": false,
    "mask": [
        ".avi",
        ".m4v",
        ".mp4",
        ".mkv",
        ".ts",
        ".wmv",
        ".srt",
        ".idx",
        ".sub"
    ],
    "movie_api": "tmdb",
    "movie_directory": "{name} ({year})",
    "movie_format": "{name} ({year}).{extension}",
    "no_guess": false,
    "no_overwrite": false,
    "no_style": false,
    "recurse": false,
    "replace_after": {
        "&": "and",
        ";": ",",
        "@": "at",
        "?":"",
        "/":"-",
        " : ":", ",
        ":":", "
    },
    "replace_before": {},
    "scene": false,
    "verbose": false
}

It seems the directory renaming does not care about the given parameters. I tested a lof of different combinations with no success...

Thanks for your help

N1ck01as commented 3 years ago

It works with a crappy workaround ^^'

line 112
        # dir_tail = str_sanitize(dir_tail)
        dir_tail = filename_replace(dir_tail, self._settings.replace_after)
WaywardWizard commented 3 years ago

This occurs when --episode-format has a path in addition to the filename.

Resolving MR https://github.com/jkwill87/mnamer/pull/150

Resolving commit https://github.com/jkwill87/mnamer/pull/150/commits/a28f18eb8a3ebc16a29df7785c56ca57dac5a20d

WaywardWizard commented 3 years ago

This occurs when --episode-format has a path in addition to the filename.

Resolving MR

150

Resolving commit a28f18e

Please let me know if my assumption that your --episode-format flag or config does not include path in addition to filename is not correct