MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Community Skins and Plugins » Plugins


Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here.

Reply
 
Thread Tools Display Modes
Old 2006-11-06, 02:10   #11 (permalink)
Portal User
 
Join Date: Sep 2006
Age: 28
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts


Default

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
JoeDanzer is offline   Reply With Quote
Old 2006-11-08, 13:31   #12 (permalink)
Portal Member
 
Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts


Default

Quote:
Originally Posted by chefkoch View Post
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

Last edited by Hesse; 2006-11-08 at 13:40.
Hesse is offline   Reply With Quote
Old 2006-11-08, 13:37   #13 (permalink)
Portal Member
 
Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts


Default

Quote:
Originally Posted by JoeDanzer View Post
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 is offline   Reply With Quote
Old 2006-11-08, 14:18   #14 (permalink)
Portal Member
 
Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts


Default

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

Last edited by Hesse; 2006-11-09 at 05:40.
Hesse is offline   Reply With Quote
Old 2006-11-08, 22:04   #15 (permalink)
Portal Developer
 
chefkoch's Avatar
 
Join Date: Oct 2004
Location: Germany, Dresden
Age: 22
Posts: 776
Thanks: 154
Thanked 48 Times in 31 Posts

Country:

My System

Send a message via ICQ to chefkoch
Thumbs up

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.

again

Best Regards
chefkoch
__________________
Do not start to moan if something is not working as you want it to be.
Remember that MediaPortal is Open Source.
YOU can improve it!

Last edited by chefkoch; 2006-11-08 at 23:01.
chefkoch is offline   Reply With Quote
Old 2006-11-09, 05:04   #16 (permalink)
Portal Member
 
Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts


Default

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 is offline   Reply With Quote
Old 2006-11-09, 05:39   #17 (permalink)
Portal Member
 
Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts


Default

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

Last edited by Hesse; 2006-11-10 at 03:06.
Hesse is offline   Reply With Quote
Old 2006-11-09, 13:57   #18 (permalink)
Portal Member
 
Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts


Default

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.

Last edited by Hesse; 2006-11-09 at 14:24.
Hesse is offline   Reply With Quote
Old 2006-11-10, 03:05   #19 (permalink)
Portal Member
 
Join Date: Aug 2006
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts


Default

@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
Hesse is offline   Reply With Quote
Old 2006-11-10, 19:08   #20 (permalink)
Portal Developer
 
chefkoch's Avatar
 
Join Date: Oct 2004
Location: Germany, Dresden
Age: 22
Posts: 776
Thanks: 154
Thanked 48 Times in 31 Posts

Country:

My System

Send a message via ICQ to chefkoch
Default

Oh man, FAT stuff, it imported all things good , 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?

for mistakes have only less time now

for your work

regards
chefkoch

short quote from irc:
Quote:
[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
__________________
Do not start to moan if something is not working as you want it to be.
Remember that MediaPortal is Open Source.
YOU can improve it!
chefkoch is offline   Reply With Quote
Reply

Bookmarks

Tags
xmmimporter

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
XMMImporter Plugin/General MediaModule -- Help Needed Hesse Plugins 1 2006-08-22 02:47


All times are GMT +1. The time now is 06:22.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden