psouza4 / mediacentermaster

Issue Tracker for Media Center Master
http://www.MediaCenterMaster.com/
32 stars 10 forks source link

NFO System.UnauthorizedAccessException #1872

Closed p37307 closed 3 years ago

p37307 commented 5 years ago

Hello. I created an account but have not received a verification email.

I signed up to offer my solution to an unresolved problem I read in the forums at http://forums.mediacentermaster.com/viewtopic.php?f=4&t=12275.

Considering the problem still exists, I came here to offer my troubleshooting and solution since I do not have the ability to enter it on the forums.

The problem is: 

MCM: Couldn't write to: .nfo MCM: System.UnauthorizedAccessException: Access to the path 'C:\Program Files (x86)\Media Center Master.nfo' is denied.

Pete responded:

I have not been able to reproduce this problem -- if someone has any information on how to make this happen 100% of the time, please reply with the steps to reproduce so I can investigate what's happening here.

What I figured out, through testing, is if a folder is created in the "Movie Title (Year)" naming format and "Movie Title (Year).mp4" (any video file ext) is not there, MCM will not make the kodi NFO file and return the error in the logs. I am not sure why MCM is setting the wrong calculated path, though.

The error is returned because the movie/show does not exist,  a recording has not finished and has a different, non-video, file extension, or someone is downloading a movie and MCM scanned the folder before the video was completed and still has a non-video file extension.

I'm not sure if other movie naming styles other than title (year) has the issue.

You can reproduce this by fetching a movie you already have by making sure fetching kodi nfo's is set in settings, setting movie naming to title (year) (not sure about other naming schemes) and going to a movie folder, deleting the kodi NFO file, if one is there, renaming the file extension of the movie to something other than a recognized movie ext and running Fetch. Then fix the issue by renaming the file extension to its movie ext and running fetch.

Hope this helps.

Happy2Play commented 5 years ago

To me this would be expected behavior since the nfo naming comes from the media file. If one does not exist then one can not be created.

But @psouza4 will have to comment on this.