MP 1.8, MyFilms 6.1, aMPed 3.6.2: MyFilms not updating data from movie catalog on resume (1 Viewer)

tano_grasa

Portal Pro
December 31, 2011
122
14
This is an old unsolved problem (see https://forum.team-mediaportal.com/threads/updating-custom-view-entries-strange-behaviour.121489/).
In few words: I never shut down my HTPC, I hibernate it. On resume, MyFilms does not update data from the catalog (xml). I have to close Mediaportal and then reopen it in order to get new data shown. I had this problem for over a year with previous versions of MP and MF. Last saturday I made a clean install from scratch (I mean, I even formatted my HTPC). It has been working fine until yesterday, when the same problem popped up again.
Yesterday I made two changes: I installed an antivirus program (NOD32) and I changed the color for watched movies as per Dadeo's instructions (https://forum.team-mediaportal.com/...d-3-6-2-changing-watched-movies-color.126884/). I uninstalled NOD32 to see what happens but it did not help. And I really don't think that changing the color of movies titles could be the problem.
I have a Silverstone case with a Soundgraph minidisplay. The only way to prevent the minidisplay to light up again when the PC is hibernating (which it does randomly after minutes or hours) is by disabling two options in the Realtek network card: "Wake on Magic Packet" and "Wake on pattern match". I wonder if this could be the cause of the issue.
I attach the complete logs.
For a better understanding of the problem: I use a custom view called "Nuevas" (new movies) based on the MediaLabel field in AMC: for movies I haven't seen yet I write the word "nuovi" on the MediaLabel field. After watching the movie, I simply remove that word and the movie shows no more in the custom view "Nuevas". Today I created a new catalog entry called "dummy" and it did not show at first in the custom view "Nuevas". I had to restart MP to get the new entry shown. All this should be in the logs.
I hope you guys can help me to definitely solve this issue.
 

Guzzi

Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,161
    747
    First of all: I did my own test - and can confirm, that for whatever reason, MyFilms seems not to receive anymore the messages for standby/resume.
    This is an old unsolved problem (see https://forum.team-mediaportal.com/threads/updating-custom-view-entries-strange-behaviour.121489/).
    In few words: I never shut down my HTPC, I hibernate it. On resume, MyFilms does not update data from the catalog (xml). I have to close Mediaportal and then reopen it in order to get new data shown.
    Actually, MyFilms is designed to receive signaling for standby/resume and reload the catalog on resume.
    I had this problem for over a year with previous versions of MP and MF. Last saturday I made a clean install from scratch (I mean, I even formatted my HTPC). It has been working fine until yesterday, when the same problem popped up again.
    That is really strange, but interesting to find out what change happened.
    Yesterday I made two changes: I installed an antivirus program (NOD32) and I changed the color for watched movies as per Dadeo's instructions (https://forum.team-mediaportal.com/...d-3-6-2-changing-watched-movies-color.126884/). I uninstalled NOD32 to see what happens but it did not help. And I really don't think that changing the color of movies titles could be the problem.
    Skin changes for sure are independant. Not sure, if av intercepts anything like messages - but don't think so.
    I have a Silverstone case with a Soundgraph minidisplay. The only way to prevent the minidisplay to light up again when the PC is hibernating (which it does randomly after minutes or hours) is by disabling two options in the Realtek network card: "Wake on Magic Packet" and "Wake on pattern match". I wonder if this could be the cause of the issue.
    No, this only affects if the pc will wake on those events and should not be related - but as MyFIlms listens to os powermanagement changes, revert the change and see, if that brings it back - just to be sure.
    I attach the complete logs.
    I see a lot of errors in the logs about problems loading the database, which are hints about corruption or invalid xml format. Those are not directly related to the standby problem, but could cause other problems, so I would check the reason anyway.
    After looking in the code, I see, that the standby handler register in the activation phase - so any resume actions only work, if you ever had at least once entered MyFilms once (so the handlers are initialized). One test would then be to once enter MyFilms and do standby/resume after that and see, iof it works then as expected. You should find something like "PowerModeChanged() - MyFilms is resuming from standby" in the logs - which means MF has received the message and this will kick the reload.
    If you can confirm, this is working, then I think we have to move the powermanagement handlers to the init phase, as with introduction of precaching, MF indeed can miss DB updates with current approach.
     

    tano_grasa

    Portal Pro
    December 31, 2011
    122
    14
    I made several attempts to find out a pattern in this strange behavior. It doesn't seem to be related with entering MyFilms or not but with the amount of time the HTPC has been hibernating. I tried the following schemes:
    1. Entering MyFilms, putting the HTPC on hibernate, then adding a new database entry or deleting an old one
    2. Not entering MyFilms, i.e. putting the HTPC on hibernate from the Home screen, then adding/deleting a database entry
    In both cases changes in the databse are shown in MF only if the HTPC has been hibernating for, say, not more than half an hour. When it has been hibernating for more time, MF won't reflect database changes, no matter from which screen I put the HTPC on hibernate. This is REALLY strange.
     

    tano_grasa

    Portal Pro
    December 31, 2011
    122
    14
    Sorry, I forgot to say that the database resides on a server and I make changes on it from another PC.
     

    tano_grasa

    Portal Pro
    December 31, 2011
    122
    14
    There is definitely no pattern for this behavior. Sometimes the handlers work as intended and views are updated on resume, but mostly they don't. Since I have two more problems with MyFilms, namely movie thumbs not always showing (see https://forum.team-mediaportal.com/...-thumbs-not-always-shown.126885/#post-1092532) and a limited fanart cycling in the main view (menu view) (see https://forum.team-mediaportal.com/...d-amped-fanarts-handling.126903/#post-1092531), and since I didn't see any more complaints of these kinds by users in the forums, I must conclude that all this is somehow related with my configuration. Now, as I stated in a previous post, my configuration is a brand new one, I made a clean install a few days ago, after formatting the HTPC. The only "old" piece in this configuration is the xml database, wich is several years old and went corrupted a few times in the past. So I suspect that all my problems with MyFilms could be related with this database.
    As Guzzi said after taking a look at my logs:

    I see a lot of errors in the logs about problems loading the database, which are hints about corruption or invalid xml format. Those are not directly related to the standby problem, but could cause other problems, so I would check the reason anyway.


    So my question is, how can I repair my database? Is there any application which I could use? I really don't know where to start from.
     
    Last edited:

    Guzzi

    Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,161
    747
    So my question is, how can I repair my database? Is there any application which I could use? I really don't know where to start from.
    There is two possible errors - one is a currupted file - if you open it with an xml editor, that should easily be visible; the other is invalid characters somewhere in value fields.
    However, the errors you had in the logs state it is at the very beginning of the loading. Try opening and saving e.g. in AMC4.1 or with an XML Editor.
    But you do have several other errors in the log file - e.g. regarding mini display, a GUIWindow dispose exception and a mixer exception - thus errors also can lead to code not being processed properly - maybe even the wakeup/sleep code.
    You could try disabling minidisplay and maybe other plugins and check, if that brings the sleep/wake to a more "consitant" state.
    Then readding one by one to get to the problem. Maybe using a test catalog with only 3 movies to make verification a bit easier.
    Beside that, I moved the powerevent handler to the Init() phase in MyFilms, so at least that issue should be fixed for the next version.
     

    tano_grasa

    Portal Pro
    December 31, 2011
    122
    14
    Given that I still can't find the problem after doing a series of tests by disabling minidisplay, switching to a previous database version and hibernating my HTPC after entering MF, is there any way to somehow 'force' the handler to do his job on resume? Switching views does not work, I'm thinking of a way to 'reload' the plugin without having to close and reopen MP.
     

    Dadeo

    Docs Group Manager
  • Premium Supporter
  • November 26, 2006
    5,340
    3,321
    Himalayas, India
    Home Country
    Canada Canada
    Did you try the test version Guzzi posted here that has the change mentioned above? You didn't mention if you had or not. (you must be logged into wiki to get it)

    The next thing I would try is what Guzzi suggested:
    using a test catalog with only 3 movies to make verification a bit easier.
    Just use the Setup Wizard to create a new catalog and AMC Updater to import a few unwatched movies - easiest is to copy those to a Test folder. I know you said you created a dummy catalog at one point, maybe post the config xml - e.g. dummy.xml so we can see your settings or try to reproduce the issue?

    I'm curious, why don't you use MyFilms Update to auto update watched movies? You could select the Media Label field and value "nuovi" for unwatched and it should auto update it when movie is watched. If you import new movies via AMC Updater you can set it to auto enter "nuovi" in MediaLabel field handling.on the Database fields tab. That way you can use the Global Filter to display only unwatched movies in MyFilms.
     
    Last edited:

    tano_grasa

    Portal Pro
    December 31, 2011
    122
    14
    Hi Dadeo,

    yes, I tried the test version Guzzi posted, but to no avail. I don't use MF update to auto-update watched movies because I'm just used to manage new movies through my custom view. Anyway, your hint about AMCU brought me to a workaround which apparently solved the issue, for which I'm very grateful ;)
    Here is how I did it: I created an AMCU configuration in which just the field "MediaLabel" is scanned and updated. Then, after adding a new movie to my custom view for unwatched movies, or after removing a movie from that view, the next time a wake up my HTPC I perform a global DB update from within MP. And that does it: new movies appear in the custom view and watched movies disappear from it :)
    I know this is just a workaround and that the main issue remains unknown and unsolved. But since I'm apparently the only one who has this problem, I guess it has to do with my database or configuration or whatever.
     

    Dadeo

    Docs Group Manager
  • Premium Supporter
  • November 26, 2006
    5,340
    3,321
    Himalayas, India
    Home Country
    Canada Canada
    Great you figured out a workaround! It's also useful info re the issue - because it sounds like manual updates to data don't take effect immediately, while global updates do (update and reload catalog). That was why I was asking about the auto update of watched status - because it updates and reloads your catalog.
    We were assuming the issue arises due to hibernation, however I think it may be related to how manually updating a field works. IIRC that is very 'old' code, whereas Guzzi has updated and improved a lot about global and watched status updates. There are a number of things in MyFIlms that cause it to update and reload catalog. So it is possible that in some cases (as you reported it worked sometimes) other actions, even in the background, take effect.

    BTW, if you don't want to run global update manually, you could also try the option to update a field when player finishes - set on Update tab.
    I'd be interested to know if my intuition is right and the issue only applies to manual update of field data - especially in your use case where database resides on a server and you make changes to it from another PC.
     

    Users who are viewing this thread

    Top Bottom