XMMImporter (1 Viewer)

JoeDanzer

New Member
September 15, 2006
4
0
Jesse,

I downloaded the exe and attempted to run it. I am using a clean system with the newest version of MP and XMM. I also tried using the new dll in the plugins directory. All of my efforts always end the same unfourtunately though. Basically anytime I hit the import button it just crashed out and allows me to quit or to continue. When I choose continue it dosent really seem to do anything.

I did all of my testing with the example database that came with XMM.

I'm not sure that I'm doing everything correctly though. I did my best to follow the instructions throughout the forum.

I wish I could have been more help. Please let me know if there is anything else I can do to help out.

Keep up the good work with the plugin. Take care.

Joe
 

Hesse

Portal Pro
August 8, 2006
110
0
Hi Jesse

testet your plugin, really good work, but i have two problems:

everytime i started the i have to select the path to xmm and mps database.

the import only apllies to 3 movies in mp-db, but in the xmm one are 22.

regards
chefkoch

Is it possible to PM me with your database? It could be some problems with different language characters that I haven't tested.

It should be saving the settings in a file at C:\XMMImporterSettings.xml. If that path does not exist or that file does not exist, then the settings will not be saved correctly. I will look into saving in the MP directory or some data settings directory perhaps.


Jesse
 

Hesse

Portal Pro
August 8, 2006
110
0
Jesse,

I downloaded the exe and attempted to run it. I am using a clean system with the newest version of MP and XMM. I also tried using the new dll in the plugins directory. All of my efforts always end the same unfourtunately though. Basically anytime I hit the import button it just crashed out and allows me to quit or to continue. When I choose continue it dosent really seem to do anything.

I did all of my testing with the example database that came with XMM.

I'm not sure that I'm doing everything correctly though. I did my best to follow the instructions throughout the forum.

I wish I could have been more help. Please let me know if there is anything else I can do to help out.

Keep up the good work with the plugin. Take care.

Joe

Joe,

Sorry about having so much trouble with the plugin. Its hard for me to track down when I can't reproduce. I can try to make a version with more logging to help track down the problem.

Just to be sure, you have .NET 2.0 installed on your system correct? And you are attempting to import the example database from a recent version of XMM 5.X. If you could copy the information from the crash into a post, it may help to find it. It's some sort of string mismatch error.

Thanks,

Jesse
 

Hesse

Portal Pro
August 8, 2006
110
0
I put some try/catch statements around the section of the code that was crashing in robytex's original screenshot. Joe or someone else who is also experiencing the crash could please test this updated DLL and post their results, I'd appreciate it.

If there is a crash, please post a screenshot of it as robytex did or the contents of that box so I can go to that section of the code to look for problems.

Just to be sure, I also posted a screenshot of what my example DB looks like so that we are working on the same thing.

Jesse

EDIT: Updated dll in post #17
 

chefkoch

Retired Team Member
  • Premium Supporter
  • October 5, 2004
    3,129
    1,634
    Dresden / Munich / Maastricht
    Home Country
    Germany Germany
    Hi Jesse

    At first: Thank you for your answers and big thx that you want to fix the errors

    So i want to make it as easy for you as i can. From now i will post always the db when an error occurs.

    1. Have yet another question, I have to put the files in the following dirs, right?
      System.Data.SQLite.DLL --> ..\Program Files\Team MediaPortal\MediaPortal
      XMMImporter.dll --> ..\Program Files\Team MediaPortal\MediaPortal\plugins\windows
    2. Is the plugin window plugin? it has not to be one, has it? I think it could be a great process plugin.
    3. I would prefer saving the settings in MediaPortal.xml. (easy and fast)
      Code:
        <section name="XMMimporter">
          <entry name="XMMdb">MMMMM</entry>
          <entry name="XMMpath_cover">MMMMM</entry>
          <entry name="....">....</entry>
        </section>
      FritzBox Monitor uses this code to load the settings, I don't know exactly you variables now, sorry hope that this even will help.
      Code:
          private void LoadSettings()
          {
            using (Settings xmlreader = new Settings("MediaPortal.xml"))
            {
              CallClass.m_strFritzBox = xmlreader.GetValueAsString("MyCalls", "FritzBox", "Fritz.Box");
              CallClass.m_strPort = xmlreader.GetValueAsString("MyCalls", "Port", "1012");
              m_stopMedia = xmlreader.GetValueAsBool("MyCalls", "StopMedia", true);
              m_Timeout = xmlreader.GetValueAsInt ("MyCalls", "Timeout", -1);
              string strNumbers = xmlreader.GetValueAsString("MyCalls", "Numbers", "");
              CallClass.m_Numbers = strNumbers.Split(';');
            }
          }
      Code:
              bool SaveConfigFile()
              {
                  using (Settings xmlwriter = new Settings("MediaPortal.xml"))
                  {
                      string strNumbers = "";
                      xmlwriter.SetValue("MyCalls", "FritzBox", txtFritzBox.Text);
                      xmlwriter.SetValue("MyCalls", "Port", txtPort.Text);
                      for (int i = 0; i < lstNumbers.Items.Count; i++)
                      {
                          strNumbers += (lstNumbers.Items[i].ToString() + ";");
                      }
                      xmlwriter.SetValue("MyCalls", "Numbers", strNumbers);
                      xmlwriter.SetValueAsBool("MyCalls", "StopMedia", chkStopMedia.Checked);
                      if (chkTimeout.Checked)
                      {
                          xmlwriter.SetValue("MyCalls", "Timeout", upDown.Value.ToString());
                      }
                      else
                      {
                          xmlwriter.SetValue("MyCalls", "Timeout", "-1");
                      }
                      return true;
                  }
              }
    4. My DB is attached. :( EDIT: sorry i had problems to upload it.

    :D again ;)

    Best Regards
    chefkoch
     

    Hesse

    Portal Pro
    August 8, 2006
    110
    0
    chefkoch,

    I typically put the System.Data.SQLite.dll file in the same directory you put the XMMImporter.dll.

    It does go in the windows plugin directory because I am working on a generic media module which hopefully will be something like Meedio's. The video database in MP is currently too restrictive. I'd like to have more than one DB for videos, etc. I just haven't had much time to work on the other parts of the code.

    Thanks for the code. I will look into it more. I had seen some of the code the MP devs use to save/load settings and it looks the same as you posted, so I will check it out. Probably not have a chance to do any of that soon though. Maybe this weekend.

    Jesse
     

    Hesse

    Portal Pro
    August 8, 2006
    110
    0
    Actually, it seems pretty simple to save/load settings that way. I was able to implement it in a few minutes. Thanks for pointing it out. I just used some code I already had with the xmlreader and now it should work. You can try the updated dll attached to this email. I have to put the Dll file in my main media portal directory AND the \plugins\window directory for some reason.

    There is some code that is available in the SVN that doesn't seem to be in the 0.2.1.0 release. It works on my test system, but it could be more robust by using the full code the devs use to find the location of the mediaportal.xml file.

    After I get your database chefkoch and hopefully figure out somthing with Joe, I can release 0.0.0.2 and the source. I'll also get the views stuff into an alpha state so people can see where its going.

    Jesse
     

    Hesse

    Portal Pro
    August 8, 2006
    110
    0
    I see the cause of chefkoch's problem. The data is all being imported into the database, but the paths to the files with repeated paths are not being imported correctly. I'm not sure why, but if I manually edit the DB for one of those files, the movie then shows up in MP.

    I'll take a look and see if I can debug.

    Jesse

    EDIT: I see a problem. The mediaportal video database doesn't like having movies that have the same filename. For example, all of your DVDs have the same filename and path. If I manually try to do this with the MP database editor, it overwrites one of the entries. I will have to see if I can "trick" MP into accepting these movies.
     

    Hesse

    Portal Pro
    August 8, 2006
    110
    0
    chefkoch

    Please try the new dll file. I think it should work for you now. Let me know how the import goes. The settings load/saving was added. Also, a new file is added for each movie where before, if a file was duplicate, I was not adding it.

    One note about saving the settings. You have to hit OK when exiting the MP configuration. I believe that the configuration program is locking the settings XML file because I cannot update to it. Only after hitting OK (and not cancel) does it update the settings file.

    Jesse
     

    chefkoch

    Retired Team Member
  • Premium Supporter
  • October 5, 2004
    3,129
    1,634
    Dresden / Munich / Maastricht
    Home Country
    Germany Germany
    Oh man, FAT stuff, it imported all things good :D , will try some other tests later.

    What do you think about not using a static path to the db and the thumb folders?
    you can keep the input-objects in config form visible but they could be disabled. now everytime the settings are loaded you get the correct db-path and cover-dir by using this code. it should be edited to fit to your's code.

    Took the code from config.exe:
    Code:
          Log.Info("Using Directories:");
          foreach (string options in Enum.GetNames(typeof(Config.Dir)))
          {
            Log.Info("{0} - {1}", options, Config.GetFolder((Config.Dir)Enum.Parse(typeof(Config.Dir), options)));
          }
          
          Config.GetFile(Config.Dir.Database, "VideoDatabaseV5.db3")
    
    
          Config.Dir.Thumbs

    I think this would be make it a little bit faster ;) no, but why not using the possibilies MP gives us?

    :sorry: for mistakes have only less time now

    :D for your work

    regards
    chefkoch

    short quote from irc:
    [18:54] chefkoch: is it possible to get the path to the videodb?
    [18:54] chefkoch: i found this way: Config.GetFile(Config.Dir.Database, "VideoDatabaseV5.db3")
    [18:55] chefkoch: but what is if the version of the db has changed?
    [18:56] chefkoch: possible, to get always the complete and uptodate filepath?
    [18:57] rtv: if the db has changed you are even less allowed to talk to it directly
    [18:57] rtv: as long as we're using SQLite you mustn't do whatever you intend to right now
    [18:58] rtv: there may be severe multithreading issues
    [18:58] rtv: s/may/will
    [18:59] chefkoch: okay thx rtv have to leave my pc for now, this is for the xmmimporter hesse has written, thx
     

    Users who are viewing this thread

    Top Bottom