terrelsa13 / MUMC

Multi-User Media Cleaner aka MUMC (pronounced Mew-Mick) will go through movies, tv episodes, audio tracks, and audiobooks in your Emby/Jellyfin libraries deleting media items you no longer want.
GNU General Public License v3.0
92 stars 6 forks source link

Fix for custom config file command line argument TypeError bug #93

Closed SysError956 closed 10 months ago

SysError956 commented 10 months ago

Fixing a bug with the custom config file command line argument (-c). Using the -c command line argument (python mumc.py -c "./config/mumc_config.yaml") would trigger a TypeError exception: unsupported operand type(s) for /: 'str' and 'str'

The custom config file logic was using a combination of string concatenation with "/" between path and filename, as well as the / operator, which is the source of the bug. This is because the / operator is not support on str, but was instead meant to be used on Path objects from pathlib (which works fine with the default non-custom config file logic and init_dict['mumc_path'] because it is a Path object).

The bug fixed by converting the custom config file directory (cmdopt_dict['altConfigPath']) from str to Path and only using the / operator in the custom config file logic.