jkwill87 / mnamer

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

mnamer doesn't recognize .mnamer.json in the user's home directory #33

Closed lamahmud closed 5 years ago

lamahmud commented 5 years ago

Hi, I created a .mnamer.json by running the following command in my home directory: mnamer --config_dump >.mnamer.json I then edited the .mnamer.json file using vi to change the TV directory line to:

_"television_directory"/Volumes/Plex/TVShows/{series}/Season {season:02} "", "televisionformat": "{series}.S{season:02}E{episode:02}.{title}{extension}",

Then I then run: _mnamer --configdump, it gives me the default config. Running "mnamer -b /temp/TVUploads/." doesn't use the new config file but uses the default config instead. Note: It claims to use the .mnamer.json file but it actually doesn't Is there a command line switch to specify the config location? Maybe you should put one in. I'm running MacOS 10.13.6 (High Sierra). Output of mnamer -bv below (note the TV directory line and the TV format line aren't changed despite claiming to have loaded my custom config.

➜ ~ mnamer -bv /Volumes/MacHD/Users/user/Temp/TVUploads/. loaded config from /Volumes/MacHD/Users/user/.mnamer.json

CLI Arguments

Preferences

Directives

Targets


Starting mnamer

Processing Television "Fear the Walking Dead - S05E15 - Channel 5"

Processing Television "Black Jesus - S03E01 - The Compton Carter"

Processing Television "Pennyworth - S01E09 - Alma Cogan"

Processing Television "The 100 - S06E08 - The Old Man and The Anomaly"

Processing Television "The Terror - S02E07 - Infamy My Perfect World"

Processing Television "The Terror - S02E06 - Infamy Taizo"

Processing Television "The Terror - S02E05 - Infamy Shatter Like A Pearl"

Processing Television "The Circus - S04E09 - The People on That Stage"

8 out of 8 files processed successfully

lamahmud commented 5 years ago

Output of cat .mnamer.json ➜ ~ cat .mnamer.json { "api_key_omdb": "61652c15", "api_key_tmdb": "db972a607f2760bb19ff8bb34074b4c7", "api_key_tvdb": "E69C7A2CEF2F3152", "batch": false, "blacklist": [ ".sample.", "^RARBG.*" ], "extension_mask": [ "avi", "m4v", "mp4", "mkv", "ts", "wmv" ], "hits": 5, "lowercase": false, "movie_api": "tmdb", "movie_directory": "", "movie_format": "{title} ({year}){extension}", "nocache": false, "noguess": false, "nostyle": false, "recurse": false, "replacements": { "&": "and", ":": ",", ";": ",", "@": "at" }, "scene": false, "television_api": "tvdb", "television_directory"/Volumes/Plex/TVShows/{series}/Season {season:02} "", "television_format": "{series}.S{season:02}E{episode:02}.{title}{extension}", "verbose": false }

fajulleiro commented 5 years ago

Yeah, I have the same problem with latest v2

jkwill87 commented 5 years ago

It looks like there is a syntax issue with your configuration file.

"television_directory"/Volumes/Plex/TVShows/{series}/Season {season:02} "" isn't valid JSON. I think you would want something like "television_directory": "/Volumes/Plex/TVShows/{series}/Season {season:02}".

If its any easier you can also create a config file by passing CLI variables alongside the config-dump command.

e.g. mnamer --television-directory='/Volumes/Plex/TVShows/{series}/Season {season:02}' --config-dump will give you this:

{
    "api_key_omdb": "61652c15",
    "api_key_tmdb": "db972a607f2760bb19ff8bb34074b4c7",
    "api_key_tvdb": "E69C7A2CEF2F3152",
    "batch": false,
    "blacklist": [
        ".*sample.*",
        "^RARBG.*"
    ],
    "extensions": [
        "avi",
        "m4v",
        "mp4",
        "mkv",
        "ts",
        "wmv"
    ],
    "hits": 5,
    "lowercase": false,
    "movie_api": "tmdb",
    "movie_directory": "",
    "movie_format": "{title} ({year}){extension}",
    "nocache": false,
    "noguess": false,
    "nostyle": false,
    "recurse": false,
    "replacements": {
        "&": "and",
        ":": ",",
        ";": ",",
        "@": "at"
    },
    "scene": false,
    "television_api": "tvdb",
    "television_directory": "/Volumes/Plex/TVShows/{series}/Season {season:02}",
    "television_format": "{series} - S{season:02}E{episode:02} - {title}{extension}",
    "verbose": 0
}

Either way, configuration handling seems to be working at the moment in the v2 branch which will be merged and released on Monday. Whether or not this was a bug it seems to be currently working as intended at the moment :sunglasses:.