ZeroQI / Lambda.bundle

Local Media Export, a reverse Plex 'Local Media Assets' agent to export metadata locally
GNU General Public License v3.0
134 stars 18 forks source link

File path incorrectly built #7

Closed Brandonb2014 closed 5 years ago

Brandonb2014 commented 5 years ago

When I started this novel, I thought I had exhausted every lead, but as I was putting this together I tested out one more thing and found a temporary fix. I say temporary because I'm not sure what kind of butterfly effect this may have, so this is what I found and hopefully you can tell me if it will cause more issues than it will fix. I found a bug with movies that start with a number. If it starts with a number then the path to place the images isn't formatted correctly and is placing the images one level above where the movie actually resides. I tested it across my whole library and only the movies starting with a number were doing this. I'll show you what I found in my logs for the movies '8 Seconds (1994)' and 'The 5th Wave (2016)' and hopefully you will have a better understanding as to what is going on. Here is the log for 8 Seconds: 8seconds It should be saving the images in ~Movies\#\8 Seconds (1994) not ~Movies\# Also, notice that #111 is showing up and spitting out: INFO (logkit:16) - rx: (?P\<season>[0-9]{1,2}).* for 8 Seconds but not 5th Wave.

And this is the log for The 5th Wave: 5thWave

I ran a small test and logged the path variable and the path is just fine before line 335, but after that line it is the incorrect path to the folder above where the movie resides: code So, for now, I have actually commented out line 335 and it saves the images correctly for movies that start with a number too. I will start doing deeper testing to see if it causes a bug somewhere else, or if you know whether or not it should be in there, let me know. Thanks again for such a great plug-in!

ZeroQI commented 5 years ago

Excellent report but am swamped at the moment, will try to have a look at work and update.

Alacard commented 5 years ago

i'm also running in to this problem where any tv show or movie that starts with a number it. is getting its info writing to one directory lower then where the movie/tv show is

ZeroQI commented 5 years ago

Apologies for the delay

series_root_folder: F:\Movies# rel_path: "#\9 seconds (1994)" rel_reverse_path: [u'#']m= should be [u'9 seconds (1994), u'#'']

Line 335 line change the path indeeddue to rel_reverse_path missing series folder because rx used is a season rx for a movie library...

Line 329 replace respecting front spacing: for folder in rel_reverse_path: with: for folder in rel_reverse_path if agent_type=='show' else []:

I submitted to the master branch the fix Please test and report, closing if issue is resolved

Alacard commented 5 years ago

Nope, still doing the same thing kinda. example of what my folders look like after a scan

/tv shows/3 musketeers/episode 1.avi /tv shows/3 musketeers/episode 1.nfo /tv shows/3 musketeers/episode 2.avi /tv shows/3 musketeers/episode 2.nfo /tv shows/poster.jpg /tv shows/tvshow.nfo

poster.jpg and tvshow,nfo is still being created in the parent folder of the tv show (3 musketeers). again its only doing this for shows that start with a number, tv shows that dont start with a number is working fine

P.S. only had time to test tv shows before i had to head to work, will test movies when i get home.

ZeroQI commented 5 years ago

fixed the seaon regex in non series but series were still impacted Fixed that now normally, please test and report

ZeroQI commented 5 years ago

Working now?

Alacard commented 5 years ago

Yes, working for both movies and tv shows now