My Recipes (1 Viewer)

Peter2

MP Donator
  • Premium Supporter
  • September 18, 2006
    848
    53
    Home Country
    Belgium Belgium
    Well, it didn't work on my 1.0.2 but will try again with this version + on the testsystem that I'm running with 1.1RC2.
    Thanks for this update, keep up your good work!
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    I have configured powershell from the instructions in the script and configured cooksunited.co.uk account..
    Opening the plugin i get empty screen, then i clicked on menu "Load" button, after short time MediaPortal was responsive again but nothing's changed on the plugin screen and i get this message in the log:

    Code:
    System.InvalidOperationException: Process must exit before requested information can be determined.
       at System.Diagnostics.Process.EnsureState(State state)
       at System.Diagnostics.Process.get_ExitCode()
       at GUIRecipes.GUIRecipes.loadDatabase()
       at GUIRecipes.GUIRecipes.OnMessage(GUIMessage message)
       at MediaPortal.GUI.Library.GUIWindowManager.SendMessage(GUIMessage message)


    Edit: i tracked it down to process not terminating in the specified time frame (there is a 15 seconds limit set in the code).. Even so, there shouldn't be an error, and also user should be informed..

    Edit2: After i increased the limit to 60 seconds, process terminated fine, and there was no error in the log. Still, I haven't been able to grab any of the recipes from CooksUnited (database was still blank - empty)..

    Edit3: I think i know why database was left blank. It's because i havent added any recipes to my account.. I would be nice if it could download all the recipes..

    Edit4: When i tried to start the script from the command prompt, some errors occured, this was the output:

    Code:
    The term 'try' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.
    At C:\Documents and Settings\All Users\Application Data\Team MediaPortal\MediaPortal\scripts\MyRecipes\get_my_recipes_from_chefkoch_or_cooksunited.ps1:62 char:4
    + try  <<<< {
    The term 'try' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.
    At C:\Documents and Settings\All Users\Application Data\Team MediaPortal\MediaPortal\scripts\MyRecipes\get_my_recipes_from_chefkoch_or_cooksunited.ps1:111 char:4
    + try  <<<< {
    The term 'try' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.
    At C:\Documents and Settings\All Users\Application Data\Team MediaPortal\MediaPortal\scripts\MyRecipes\get_my_recipes_from_chefkoch_or_cooksunited.ps1:117 char:4
    + try  <<<< {
    Property 'CommandText' cannot be found on this object; make sure it exists and is settable.
    At C:\Documents and Settings\All Users\Application Data\Team MediaPortal\MediaPortal\scripts\MyRecipes\get_my_recipes_from_chefkoch_or_cooksunited.ps1:209 char:13
    +     $sqlCmd.C <<<< ommandText = "INSERT INTO category (category_id, title, url, recipes) VALUES ($catId, '$catName', '$catURL', $recipe)"
    You cannot call a method on a null-valued expression.
    At C:\Documents and Settings\All Users\Application Data\Team MediaPortal\MediaPortal\scripts\MyRecipes\get_my_recipes_from_chefkoch_or_cooksunited.ps1:211 char:28
    +     $sqlCmd.ExecuteNonQuery( <<<< ) | Out-Null
    You cannot call a method on a null-valued expression.
    At C:\Documents and Settings\All Users\Application Data\Team MediaPortal\MediaPortal\scripts\MyRecipes\get_my_recipes_from_chefkoch_or_cooksunited.ps1:327 char:14
    + $sqlCon.Close( <<<< )

    I think you have enough data to look into what the problem might be :) Thanks in advance!
     

    flynux

    Portal Member
    January 18, 2010
    13
    4
    Home Country
    Germany Germany
    Thanks for the feedback.
    1.) You are right there is a limit of 15 seconds before the program continues. The download of the recipes tooks around 1 or 2 Minutes. Currently I start the script asyncronously. And I do not get any feedback. YES, THERE ARE SPACE FOR IMPROVEMENTS. I am aware of it. Thanks anyway.
    2.) Please try to run the script from the command prompt the first time. Just to be sure that it runs with no error. Your posted error comes from the Version of Powershell. Powershell Version 1 do not know the Try and catch expression. So please upgrade to Version 2.
    3.) Yes it is true that the script grabs only recipes from your personal cookbook. It works as I have it designed. So first you have to go to the website and add recipes to your personal cookbook. You can create your own categories. You can add your own recipes or existing recipes to your cookbook. I think I will not change the script in the way that I get all recipes, I assume there are thousands.

    So I have the following on my near roadmap:
    1.) Make the script more robust and inform the users if something goes wrong. If possible I will execute it synchronously.
    2.) Currently there are no images of the recipes. In the future the script should download all the images.

    Thanks again, flynux
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    1. OK

    2. Now i have updated powershell (long search for v2 btw), but now i'm getting "Error: DB connection failed" and the script exits

    3. Perhaps it would be wise then to find a web site with recepies with API, for example, BigOven.com ?

    Cheers,
    SE
     

    flynux

    Portal Member
    January 18, 2010
    13
    4
    Home Country
    Germany Germany
    Did you check if the database exist and contains the following tables? "CATEGORY", "RECIPE", "RECIPE_CATEGORY", "INGREDIENT":

    You can check the database with the tool SQLite Database Browser

    3. The site looks pretty nice. I will check it it and implement it for future releases maybe. I keep you updated.

    Thanks
     

    Peter2

    MP Donator
  • Premium Supporter
  • September 18, 2006
    848
    53
    Home Country
    Belgium Belgium
    Hi flynux, I tried it on RC2 but now I cannot find a way to import own recipes anymore...
    The only thing I get is to insert my cookbook credentials - which I don't have.

    Tip: in your startpost, there still a link to the older version of the plugin.
     

    flynux

    Portal Member
    January 18, 2010
    13
    4
    Home Country
    Germany Germany
    Re: Future request

    Print should work, it is old code. If you have a recipe open, than on the menu there is a print option. Please check it and test it. Feedback is welcome.

    OK I changes my startpost.

    I did not test with RC2. What is the problem? You say: The only thing I get is to insert my cookbook credentials - which I don't have. => You have to create an account first on the website and fill your personal cookbook (My Cookbook).
     

    flynux

    Portal Member
    January 18, 2010
    13
    4
    Home Country
    Germany Germany
    ATTENTION: The Powershell script does run only on OS in ENGLISH. So German or other then English users has to change the pathes within the script.

    Sorry, I will correct thsi as soon as possible.
     

    sique

    MP Donator
  • Premium Supporter
  • November 25, 2007
    21
    0
    Stord
    Home Country
    Norway Norway
    First of all, thank you for re-inventing the Recipes plug-in, it gives MP WAF points :)

    But alas, I also get the "Error: DB connection failed" error:
    Code:
    PS C:\ProgramData\Team MediaPortal\MediaPortal\scripts\MyRecipes> get-executionpolicy
    RemoteSigned

    Code:
    PS C:\ProgramData\Team MediaPortal\MediaPortal\scripts\MyRecipes> .\get_my_recipes_from_chefkoch_or_cooksunited.ps1
    Error: DB connection failed
    You cannot call a method on a null-valued expression.
    At C:\ProgramData\Team MediaPortal\MediaPortal\scripts\MyRecipes\get_my_recipes 
    _from_chefkoch_or_cooksunited.ps1:132 char:18
    +     $sqlCon.Close <<<< ()
        + CategoryInfo          : InvalidOperation: (Close:String) [], RuntimeExce
       ption
        + FullyQualifiedErrorId : InvokeMethodOnNull
    
    Property 'CommandText' cannot be found on this object; make sure it exists and is settable.
    At C:\ProgramData\Team MediaPortal\MediaPortal\scripts\MyRecipes\get_my_recipes
    _from_chefkoch_or_cooksunited.ps1:209 char:13
    +     $sqlCmd. <<<< CommandText = "INSERT INTO category (category_id, title, ur
    l, recipes) VALUES ($catId, '$catName', '$catURL', $recipe)"
        + CategoryInfo          : InvalidOperation: (CommandText:String) [], Runti
       meException
        + FullyQualifiedErrorId : PropertyNotFound
    ...
    (The errors are repeated a number of times)

    I've checked the database, and it contains the tables you mentioned in an earlier post.
     

    Users who are viewing this thread

    Top Bottom