jkwill87 / mnamer

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

Some cache hijinks going on, plus an error #111

Open paketep opened 4 years ago

paketep commented 4 years ago

So, I have a couple of files: an episode of full frontal, and an episode of discovery. I have a script to run mnamer and I run over the directory that has both files.

If offers me to clean full fruntal's name first. Usually it gets back ok so I barely look at it and I press enter. Then the name for discovery comes back, and.. it's still the name for the full frontal episode. I press ok and hell breaks loose: it copies the discovery file over the full frontal file. So, first thing, bad detection of the second name, plus if you're going to rename to a name belonging to a file that already exists it should give an error and not let you do it.

Ok, so the FF file is kaput, I know have to copies of the DIS episode. I delete one and try to rename the other. I launch the script and it offers me to rename it.. as the full frontal name from the old episode. What?. Is there some kind of cache and it's not querying it anymore?.

Extra ball: the name on the selection panel still does not coincide with the final name (configured via command line).

Thank you for your work!

paketep commented 4 years ago

Indeed, if I move the file to other directory and try to rename it there, then it offers me a different alternative.

Sorry, I see now that there's a clear cache option. So, to sum up:

Thanks!

jkwill87 commented 4 years ago

I have not yet run into this issue. If you would be able to provide the output of mnamer --verbose --batch --test it would be helpful in troubleshooting it. Either way I'll try and take a look into it so thanks for bringing it to my attention.

As you mentioned there is a --clear-cache option to clear cache but there is also a --no-cache and --no-overwrite option which used in conjunction may avoid your current issue in the short term assuming that this is in face a caching issue. Looking forward to mnamer v3 I'm looking to disable cache options generally and just fetching queries concurrently using async.

paketep commented 4 years ago

Wooops, sorry, didn't see the --no-overwrite option. Will add to my alias.

Just happened again, and I was able to reproduce it. This is what I'm using right now:

mnamer --episode-format "{series} {season:01}x{episode:02} {title}{extension}" --movie-format "{name}{extension}" .

Added both the no cache & no overwrite flags, plus yours, and I got this:

testing mode

system

  • date = 2020-11-12
  • platform = Windows-10-10.0.18362-SP0
  • arguments = ['--episode-format', '{series} {season:01}x{episode:02} {title}{extension}', '--movie-format', '{name}{extension}', '--no-overwrite', '--no-cache', '--verbose', '--batch', '--test', '.']
  • cache location = %USERPATH%\AppData\Local\mnamer-py3.7.sql
  • python version = 3.7.4
  • mnamer version = 2.4.2
  • appdirs version = 1.4.3
  • babelfish version = 0.5.5-dev
  • guessit version = 3.1.0
  • requests version = 2.22.0
  • requests cache version = 0.5.2
  • teletype version = 1.0.4

settings

  • targets = [WindowsPath('.')]
  • batch = True
  • lower = False
  • recurse = False
  • scene = False
  • verbose = True
  • hits = 5
  • ignore = ['.sample.', '^RARBG.*']
  • language = None
  • mask = ['.avi', '.m4v', '.mp4', '.mkv', '.ts', '.wmv', '.srt', '.idx', '.sub']
  • no_guess = False
  • no_overwrite = True
  • no_style = False
  • movie_api = tmdb
  • movie_directory = None
  • movie_format = {name}{extension}
  • episode_api = tvmaze
  • episode_directory = None
  • episode_format = {series} {season:01}x{episode:02} {title}{extension}
  • version = False
  • clear_cache = False
  • config_dump = False
  • config_ignore = False
  • config_path = None
  • id_imdb = None
  • id_tmdb = None
  • id_tvdb = None
  • id_tvmaze = None
  • no_cache = True
  • media = None
  • test = True
  • api_key_omdb = None
  • api_key_tmdb = None
  • api_key_tvdb = None
  • api_key_tvmaze = None
  • replace_before = {}
  • replace_after = {'&': 'and', '@': 'at', ';': ','}

targets

  • %WORKDIR%\full.frontal.with.samantha.bee.s05e29.1080p.web.h264-jebaited.mkv
  • %WORKDIR%\star.trek.discovery.s03e05.1080p.web.h264-cakes.mkv Starting mnamer

Processing Episode "full.frontal.with.samantha.bee.s05e29.1080p.web.h264-jebaited.mkv" (757.48MB) %WORKDIR%\full.frontal.with.samantha.bee.s05e29.1080p.web.h264-jebaited.mkv using tvmaze

search parameters

  • container = .mkv
  • group = JEBAITED
  • language = None
  • language_sub = None
  • quality = 1080p web h.264
  • synopsis = None
  • media = episode
  • series = Full Frontal with Samantha Bee
  • season = 5
  • episode = 29
  • date = None
  • title = None
  • id_tvdb = None
  • id_tvmaze = None
  • extension = .mkv

moving to %WORKDIR%\Full Frontal with Samantha Bee 5x29 November 11, 2020.mkv

Processing Episode "star.trek.discovery.s03e05.1080p.web.h264-cakes.mkv" (3.03GB) %WORKDIR%\star.trek.discovery.s03e05.1080p.web.h264-cakes.mkv using tvmaze

search parameters

  • container = .mkv
  • group = JEBAITED[RARBG]
  • language = None
  • language_sub = None
  • quality = 1080p web h.264
  • synopsis = None
  • media = episode
  • series = Full Frontal with Samantha Bee
  • season = 5
  • episode = 29
  • date = None
  • title = None
  • id_tvdb = None
  • id_tvmaze = None
  • extension = .mkv

moving to %WORKDIR%\Full Frontal with Samantha Bee 5x29 November 11, 2020.mkv

2 out of 2 files processed successfully

As you can see, this time it went the other way, tried to rename both episodes as the result of the first one. It's searching for the name of the second file using the parameters from the first, although in the second case it adds [RARBG] to the group, in the first one it doesn't. Weird.

I removed the -test parameter, it renamed the first, and then it tried to rename the second again to the resulting name for the first, but didn't overwrite it since I had added the no-overwrite parameter.

Let me know if I can be of more help.

Thanks!

(I renamed my userdir and workdir, BTW, since they were a bit indiscreet ;) )