[Approved] Fix to "IMDB with AKA grabber" (1 Viewer)

Deda

Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    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.
     

    Paranoid Delusion

    Moderation Manager
  • Premium Supporter
  • June 13, 2005
    13,062
    2,978
    Cheshire
    Home Country
    United Kingdom United Kingdom
    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
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    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.
     

    Paranoid Delusion

    Moderation Manager
  • Premium Supporter
  • June 13, 2005
    13,062
    2,978
    Cheshire
    Home Country
    United Kingdom United Kingdom
    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.
     

    NightOwl69

    Portal Member
    September 4, 2007
    18
    2
    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.
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    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)
     

    NightOwl69

    Portal Member
    September 4, 2007
    18
    2
    :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:
                movieDetails.MPARating = GetCert(url.URL);

    Add the following methods to IMDB.csscript.

    Code:
        private string GetCountryName()
        {
            //One day I should write this so it gets the system's country name according to regional settings;
            return "Australia";
        }
    
        private string GetCountryCode()
        {
            //One day I should write this so it gets the system's country code according to regional settings;
            return "au";
        }
    
        private string GetCert(string strURL)
        {
    
            // ***Grab My Country's Rating***
            // Example of the HTML we're looking for:
            // <a href="/search/title?certificates=au|ma">Australia:MA</a>
    
    	string strReturn = "";
    
            // Get system's country values
            string strMyCountryName = GetCountryName();
            string strMyCountryCode = GetCountryCode();
    
            string strAbsURL = "";
    
            // Get the parental advisory page
            string strBody = GetPage(strURL + "parentalguide#certification", "utf-8", out strAbsURL);
    
            // Get my country's rating address element
            string strCertBlock = "<a\\shref=\"/search/title\\?certificates=" + strMyCountryCode + ".*?</a>";
            Match mCert = Regex.Match(HttpUtility.HtmlDecode(strBody), strCertBlock, RegexOptions.Singleline);
    
            // Strip out the html, country name, and delimiter to leave just the rating
            string strCert = MediaPortal.Util.Utils.stripHTMLtags(mCert.Value);
            int iRatingStart = strCert.IndexOf(strMyCountryName);
            if (iRatingStart >= 0)
            {
                iRatingStart += strMyCountryName.Length + 1;
                int iRatingEnd = strCert.Length;
                if (iRatingEnd > 0)
                {
                    strReturn = strCert.Substring(iRatingStart, iRatingEnd - iRatingStart);
                }
            }
            return strReturn;
        }

    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.
     

    Users who are viewing this thread

    Top Bottom