damienhaynes / moving-pictures

Moving Pictures is a movies plug-in for the MediaPortal media center application. The goal of the plug-in is to create a very focused and refined experience that requires minimal user interaction. The plug-in emphasizes usability and ease of use in managing a movie collection consisting of ripped DVDs, and movies reencoded in common video formats supported by MediaPortal.
12 stars 6 forks source link

Moving Pictures tries to accessan offline drive and impacts DB #1110

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Based on the thread here 
http://forum.team-mediaportal.com/threads/movies-disappear-suddently-and-have-to
-be-re-imported.114555/#post-947256 

What steps will reproduce the problem?
1.Place movies in the external HDD, point Moving pictures db to that drive
2.Put the PC to sleep
3.Mediaportal wakes up and tries to access the drive

What is the expected output? What do you see instead?
The expected output is that all movies will be retained in the DB as they were, 
instead since the drive takes a few more miliseconds to wake up, the db gets 
messed up and movies "disappear" from it

What version of Moving Pictures are you using? What version of MediaPortal? MP 
1.3a Moving Pcitrues 1.4.2.1430
Moving picutres 
What Skin? Streamed MP 1.3

Please attach a screenshot and logs if possible. When submitting log files
please submit DEBUG logs. See here for details:
http://tinyurl.com/aj65su

Original issue reported on code.google.com by ofi...@gmail.com on 2 Jan 2013 at 8:19

Attachments:

GoogleCodeExporter commented 8 years ago
Here is some extra technical information about the issue. The background 
maintenance manager triggers the problem but the root cause is the IsRemoved 
property on DBLocalMedia. This method clearly cannot detected if the file is 
removed in this situation (volume appears to be online but isn't) - File.Exists 
on this state will alwats report false. 

However seeing that the FilesystemWatcher already errors out on creation when 
the volume is nog accessible we should be able to detect and prevent this from 
happening.
THe importer does not scan the path because of this. THe background file 
manager however does not perform this check and just iterates through all local 
media checking IsRemoved.

Possible solution: Before the background file manager actually starts to check 
(and remove) missing files it should do some extra checks on the import path 
itself. Trying to do a list on the import path will probably error out as well, 
if so the filecheck should not be performed on the related local media.

Original comment by apond...@gmail.com on 14 Apr 2013 at 12:09

GoogleCodeExporter commented 8 years ago
in short: DBLocalMedia.IsRemoved cannot determine if the file exists without 
some extra sanity checks on the import path.

Original comment by apond...@gmail.com on 14 Apr 2013 at 12:12

GoogleCodeExporter commented 8 years ago
On closer examination i ended up in the Cornerstone library.
It seems that there already is a "directory listings" check but it is not 
performed unless the path is a reparse path or UNC. Perhaps we can remove these 
two lines (marked below) and always perform the check.

https://code.google.com/p/moving-pictures/source/browse/trunk/Cornerstone/Extens
ions/IO/DirectoryInfoExtensions.cs#22

Original comment by apond...@gmail.com on 14 Apr 2013 at 6:10

GoogleCodeExporter commented 8 years ago
Attached is a custom built Cornerstone.dll. Rename/Backup the old one in 
%\MediaPortal\plugins\Windows and replace it with the attached version to 
verify whether it solves the problem.

Original comment by apond...@gmail.com on 14 Apr 2013 at 6:47

Attachments:

GoogleCodeExporter commented 8 years ago
File has beed downloaded, I will test it over the next 5-7 days and let you know

Original comment by ofi...@gmail.com on 16 Apr 2013 at 7:33

GoogleCodeExporter commented 8 years ago
it would help if you deliberately did the sleep/wakeup scenario a couple of 
times
If you don't encounter the issue then let it run for a couple of days.
Make sure you backup your moving pictures database before you do ;)

Original comment by apond...@gmail.com on 16 Apr 2013 at 8:30

GoogleCodeExporter commented 8 years ago
anything to report yet? :)

Original comment by apond...@gmail.com on 21 Apr 2013 at 12:24

GoogleCodeExporter commented 8 years ago
after 4 days of testing, i can say that things are loooking very good
lets giver it few more days.

Original comment by ofi...@gmail.com on 21 Apr 2013 at 12:59

GoogleCodeExporter commented 8 years ago
is there any way you can duplicate/force the behaviour of your harddisk that is 
causing the issue so we know for sure?

Original comment by apond...@gmail.com on 21 Apr 2013 at 1:36

GoogleCodeExporter commented 8 years ago
The fix is working  thank you for the support
Issue can be closed

Original comment by ofi...@gmail.com on 24 Apr 2013 at 5:51

GoogleCodeExporter commented 8 years ago

Original comment by apond...@gmail.com on 24 Apr 2013 at 11:59

GoogleCodeExporter commented 8 years ago
Issue is happening again in version 1.4

Original comment by ofi...@gmail.com on 2 Jun 2013 at 6:30

GoogleCodeExporter commented 8 years ago

Original comment by apond...@gmail.com on 3 Jun 2013 at 7:05

GoogleCodeExporter commented 8 years ago
Can you make sure the DLL you are using is still the fixed version? Installing 
1.4 plugins might have overwritten it.

Original comment by apond...@gmail.com on 3 Jun 2013 at 7:06

GoogleCodeExporter commented 8 years ago
The version is 1.3 final and not 1.4 ad I mentioned before 
And it's the same file 752 kb 
Maybe I have to register the dll? 

Original comment by ofi...@gmail.com on 3 Jun 2013 at 7:10

GoogleCodeExporter commented 8 years ago
Issue is recurring again in 1.5

Can this be re openend and fixed?

Original comment by ofi...@gmail.com on 8 Dec 2013 at 12:08

GoogleCodeExporter commented 8 years ago
Fix is in 1.6.

Original comment by damien.haynes@gmail.com on 8 Dec 2013 at 12:14

GoogleCodeExporter commented 8 years ago
Closing this, if its still a problem in 1.6 we can re-open and investigate.

Original comment by damien.haynes@gmail.com on 11 Jan 2014 at 10:05