[Approved] - Fix to "IMDB with AKA grabber" | Page 12

Discussion in 'Submit: Movie Info Grabbers' started by BalduinB, April 3, 2010.

  1. Deda
    • Premium Supporter

    Deda Lead Dev MP1 Videos

    Joined:
    March 18, 2009
    Messages:
    2,423
    Likes Received:
    2,098
    Gender:
    Male
    Occupation:
    IT Consultant
    Location:
    Zagreb
    Ratings:
    +2,385 / 1
    Home Country:
    Croatia Croatia
    Show System Specs
    Try it on Black Glas 2.5 skin https://forum.team-mediaportal.com/black-glass-456/black-glass-skin-2-5-0-a-83241/ it should work there on any view (share or database). Black Glass Nova got a bug with database view but it works on share view.

    It's clean skin with no any additional plugins or files (clean to install and remove if you don't need it). This skin supports fanart handling on My Videos.


     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Paranoid Delusion
    • Premium Supporter

    Paranoid Delusion Moderation Manager

    Joined:
    June 13, 2005
    Messages:
    13,062
    Likes Received:
    1,481
    Gender:
    Male
    Occupation:
    Electrical Engineer
    Location:
    Cheshire
    Ratings:
    +1,482 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Deda

    Looks like a skin issue then as Black Glass works for me as well :)

    edit: just switched skin and its now working with Nova, changed nothing in config :confused:

    :D
     
  4. Deda
    • Premium Supporter

    Deda Lead Dev MP1 Videos

    Joined:
    March 18, 2009
    Messages:
    2,423
    Likes Received:
    2,098
    Gender:
    Male
    Occupation:
    IT Consultant
    Location:
    Zagreb
    Ratings:
    +2,385 / 1
    Home Country:
    Croatia Croatia
    Show System Specs
    Yes it's working with database view on Nova Skin upon switching from gui, but after you restart MP then again it will not work. It's a confirmed bug within Nova Skin https://forum.team-mediaportal.com/black-glass-456/customize-my-videos-83449/#post631079. Solution is simple (you can read it there) if you want to use Nova Skin (I'm using it too without any problem with this bugfix).

    Also, I found if skins support fanart handler plugin, it doesn't mean that My Video is using it too ie. StreamedMP (this is skin related thing so skin creator must implement this into his skin as Tgx did it for his Black Glass skins)

    Also I'm preparing new files for clean solution of this so Fanart will be optional with some checking's and warnings and independent from IMDB script. So finally My Videos will be nice as it should deserve :).
    However, this is not replacement for Moving Pictures or a parallel project, just an upgrade of My Videos to the level where MP is now because it was starting to be unusable for the purpose it was created for in the first place.
     
  5. Paranoid Delusion
    • Premium Supporter

    Paranoid Delusion Moderation Manager

    Joined:
    June 13, 2005
    Messages:
    13,062
    Likes Received:
    1,481
    Gender:
    Male
    Occupation:
    Electrical Engineer
    Location:
    Cheshire
    Ratings:
    +1,482 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Just thinking this should be in a new thread altogether as the imdb script has been accepted, just not sure where, as its a kill two birds with one stone type fix, first imdb, second fanart side.
     
  6. Deda
    • Premium Supporter

    Deda Lead Dev MP1 Videos

    Joined:
    March 18, 2009
    Messages:
    2,423
    Likes Received:
    2,098
    Gender:
    Male
    Occupation:
    IT Consultant
    Location:
    Zagreb
    Ratings:
    +2,385 / 1
    Home Country:
    Croatia Croatia
    Show System Specs
    Well, I agree because this became slightly off-topic :)
     
  7. BalduinB

    BalduinB Portal Member

    Joined:
    July 29, 2009
    Messages:
    36
    Likes Received:
    8
    Ratings:
    +8 / 0
    Home Country:
    Germany Germany
    New thread would be nice, so I don't have to check and change the first post from time to time ;)
     
    • Like Like x 2
  8. NightOwl69

    NightOwl69 Portal Member

    Joined:
    September 4, 2007
    Messages:
    18
    Likes Received:
    2
    Ratings:
    +2 / 0
    Firstly :D for fixing the script, it works much better now. :D

    I'm not sure if this is the right place to post issues with it but it seemed appropriate, :sorry: if its not.

    I got the latest script a couple of days ago and am using it from the video database editor to clean up some data. I've noticed a couple of issues and have a few questions I was hoping you guys might be able to help with.

    1. The 'R' is being dropped from the MPAA rating. e.g. instead of 'Rated PG-13...' I'm getting 'ated PG-13...'. This was easy to fix just change 27 to 26 as per below...

    mpaa += "MPAA</a>:</h5>".Length + 26;

    2. IMDBID is not being set in the database. I'm hoping this is reused when updating existing movies to make sure the data is always grabbed for the right movie when doing a rescan and not skipping files already in the database? I spent days double checking and fixing up my collection the first time I did a scan to get all the right movies - this was a very long time ago (years) so the script has probably got much smarter since then.

    I'd try to do the IMDBID stuff myself but I'm just not that familar with cs script. Any pointers/suggestions appreciated.
     
  9. Deda
    • Premium Supporter

    Deda Lead Dev MP1 Videos

    Joined:
    March 18, 2009
    Messages:
    2,423
    Likes Received:
    2,098
    Gender:
    Male
    Occupation:
    IT Consultant
    Location:
    Zagreb
    Ratings:
    +2,385 / 1
    Home Country:
    Croatia Croatia
    Show System Specs
    Well, I think it's right place :).

    Concerning 1st question (remark) I replaced old Rating procedure totally to more international point of view (sort of :) ) to display ratings by Countries but that is not yet official so you can download it here https://forum.team-mediaportal.com/submit-movie-info-grabbers-287/fix-imdb-aka-grabber-80425/index11.html#post630778 (IMDB_Script.zip)

    2. IMDB ID (aka tt number) is in the database for sure (I'm using it extensively for my little project for fanarts and cover grabbing). Concerning rescanning whole database or particular movie, MP doesn't use it at all. For movie refresh it uses Title name and for database refresh it uses movie filenames and title views if you select to scan movies already in the database.

    Your idea by refreshing according to tt number is great but somehow it will not be in MP so soon (or at all) but you can use patched files (later I will implement this) from the link above (Files for fanart) and it will be there (I will post new files later) so you can try it or leave MP like it is now. As I redesigning Video database section for myself I just share my ideas for anyone who doesn't use Moving Pictures plugin (it's a nice plugin but for my usage of MP it's an overkill, and less plugins, less software problems)
     
    • Like Like x 1
  10. NightOwl69

    NightOwl69 Portal Member

    Joined:
    September 4, 2007
    Messages:
    18
    Likes Received:
    2
    Ratings:
    +2 / 0
    :D for all your hard work Deda.

    I personally didn't want all the countries ratings but thanks to your rewrite it showed me how I could get just my country's rating which is what I've wanted for a long time. So :D again.

    Here's my code just in case anyone else wants to do the same...

    Replace the existing code to get the rating with the following in the GetDetails method in IMDB.csscript.

    Code (Text):
    1.             movieDetails.MPARating = GetCert(url.URL);
    Add the following methods to IMDB.csscript.

    Code (Text):
    1.     private string GetCountryName()
    2.     {
    3.         //One day I should write this so it gets the system's country name according to regional settings;
    4.         return "Australia";
    5.     }
    6.  
    7.     private string GetCountryCode()
    8.     {
    9.         //One day I should write this so it gets the system's country code according to regional settings;
    10.         return "au";
    11.     }
    12.  
    13.     private string GetCert(string strURL)
    14.     {
    15.  
    16.         // ***Grab My Country's Rating***
    17.         // Example of the HTML we're looking for:
    18.         // <a href="/search/title?certificates=au|ma">Australia:MA</a>
    19.  
    20.     string strReturn = "";
    21.  
    22.         // Get system's country values
    23.         string strMyCountryName = GetCountryName();
    24.         string strMyCountryCode = GetCountryCode();
    25.  
    26.         string strAbsURL = "";
    27.  
    28.         // Get the parental advisory page
    29.         string strBody = GetPage(strURL + "parentalguide#certification", "utf-8", out strAbsURL);
    30.  
    31.         // Get my country's rating address element
    32.         string strCertBlock = "<a\\shref=\"/search/title\\?certificates=" + strMyCountryCode + ".*?</a>";
    33.         Match mCert = Regex.Match(HttpUtility.HtmlDecode(strBody), strCertBlock, RegexOptions.Singleline);
    34.  
    35.         // Strip out the html, country name, and delimiter to leave just the rating
    36.         string strCert = MediaPortal.Util.Utils.stripHTMLtags(mCert.Value);
    37.         int iRatingStart = strCert.IndexOf(strMyCountryName);
    38.         if (iRatingStart >= 0)
    39.         {
    40.             iRatingStart += strMyCountryName.Length + 1;
    41.             int iRatingEnd = strCert.Length;
    42.             if (iRatingEnd > 0)
    43.             {
    44.                 strReturn = strCert.Substring(iRatingStart, iRatingEnd - iRatingStart);
    45.             }
    46.         }
    47.         return strReturn;
    48.     }
    Change GetCountryName and GetCountryCode to return your country's values and test it out. If you have any probs make sure your country values match the values used on IMDB's parental advisory page.
     
  11. Deda
    • Premium Supporter

    Deda Lead Dev MP1 Videos

    Joined:
    March 18, 2009
    Messages:
    2,423
    Likes Received:
    2,098
    Gender:
    Male
    Occupation:
    IT Consultant
    Location:
    Zagreb
    Ratings:
    +2,385 / 1
    Home Country:
    Croatia Croatia
    Show System Specs
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!