[Approved] How to Video database section and My Movies get to life (1 Viewer)

Guzzi

Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,161
    747
    AW: Re: How to Video database section and My Movies get to life

    Hi Guzzi, answer is no, it grabs only main picture from actor page.
    Looking at IMDB page it will not be so difficult to grab all of them ie for Christian Bale it's easy to parse how many photo pages are
    Code:
    <span style="padding: 0 1em;">
    1&nbsp;
    <a href="[URL="https://forum.team-mediaportal.com/view-source:http://www.imdb.com/name/nm0000288/mediaindex?page=2"]?page=2[/URL]">2</a>&nbsp;
    <a href="[URL="https://forum.team-mediaportal.com/view-source:http://www.imdb.com/name/nm0000288/mediaindex?page=3"]?page=3[/URL]">3</a>&nbsp;
    <a href="[URL="https://forum.team-mediaportal.com/view-source:http://www.imdb.com/name/nm0000288/mediaindex?page=4"]?page=4[/URL]">4</a>&nbsp;
    <a href="[URL="https://forum.team-mediaportal.com/view-source:http://www.imdb.com/name/nm0000288/mediaindex?page=5"]?page=5[/URL]">5</a>&nbsp;
    <a href="[URL="https://forum.team-mediaportal.com/view-source:http://www.imdb.com/name/nm0000288/mediaindex?page=6"]?page=6[/URL]">6</a>&nbsp;
    <a href="[URL="https://forum.team-mediaportal.com/view-source:http://www.imdb.com/name/nm0000288/mediaindex?page=7"]?page=7[/URL]">7</a>&nbsp;
    </span>
    and links for every page is
    hxxp://www.imdb.com/name/nm0000288/mediaindex?page=1 then
    hxxp://www.imdb.com/name/nm0000288/mediaindex?page=2 ... etc.

    and parse all pics in every page
    Code:
    <div class="thumb_list" style="font-size: 0px;">
    <a title="" href="[URL="https://forum.team-mediaportal.com/view-source:http://www.imdb.com/rg/mediaindex/unknown-thumbnail/media/rm3605759488/nm0000288"]/rg/mediaindex/unknown-thumbnail/media/rm3605759488/nm0000288[/URL]"><img alt="" height="100" width="100"  [B]src="[URL="https://forum.team-mediaportal.com/view-source:http://ia.media-imdb.com/images/M/MV5BODk0MzYxMTQzNl5BMl5BanBnXkFtZTcwMDM3NTI5Mw@@._V1._CR334,0,1331,1331_SS100_.jpg"]http://ia.media-imdb.com/images/M/MV5BODk0MzYxMTQzNl5BMl5BanBnXkFtZTcwMDM3NTI5Mw@@._V1._CR334,0,1331,1331_SS100_.jpg[/URL][/B]" /></a>
    <a title="" href="[URL="https://forum.team-mediaportal.com/view-source:http://www.imdb.com/rg/mediaindex/unknown-thumbnail/media/rm2904588544/nm0000288"]/rg/mediaindex/unknown-thumbnail/media/rm2904588544/nm0000288[/URL]"><img alt="" height="100" width="100"  src="[URL="https://forum.team-mediaportal.com/view-source:http://ia.media-imdb.com/images/M/MV5BMTM1MjgwMzI2NF5BMl5BanBnXkFtZTcwODM3NDk4Mw@@._V1._CR343,0,1362,1362_SS100_.jpg"]http://ia.media-imdb.com/images/M/MV5BMTM1MjgwMzI2NF5BMl5BanBnXkFtZTcwODM3NDk4Mw@@._V1._CR343,0,1362,1362_SS100_.jpg[/URL]" /></a>
    .........
    </div>
    to an array (it's rough idea how to get it and html code is very understandable and easy to parse and fetch)


    Hi Deda,
    thanks for your feedback!
    So I have two questions left ;-)
    First: Do you think this is something that should be part of the MePo classes and thus being added there (as IMDB is a supported source in nMePo)?
    Second: If not (which means I would have to do it myself ....) - can you give me a hint where I find similar code to learn from? I have never dealt with the grabberclasses and -templates that are available and probably would not be able to do that from scratch.
    The approch you mentioned was about the same I was thinking of (checked to imdb source pages) - so it should be possible ...
    ... maybe I first check the existing code that gets the current single picture ... ;-)
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    Right now I don't see any benefit from using that in MP (all MP needs is one PIC, and actor view is not so common view and rarely used by users).
    If you can wait a little I can write small sample how to extract those pics in array so you can implement that in My Films.

    Also if you want you can see how one way of extraction works in MP, look at:
    Databases/Video/Imdb.cs line 753 public bool GetActorDetails(IMDBUrl url, bool director, out IMDBActor actor)

    HTMLParser (using MediaPortal.Util) class is the tool for parsing and extracting.
     

    Guzzi

    Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,161
    747
    AW: Re: How to Video database section and My Movies get to life

    Right now I don't see any benefit from using that in MP (all MP needs is one PIC, and actor view is not so common view and rarely used by users).
    If you can wait a little I can write small sample how to extract those pics in array so you can implement that in My Films.

    Also if you want you can see how one way of extraction works in MP, look at:
    Databases/Video/Imdb.cs line 753 public bool GetActorDetails(IMDBUrl url, bool director, out IMDBActor actor)

    HTMLParser (using MediaPortal.Util) class is the tool for parsing and extracting.

    Hi Deda,

    thanks, will have a look at the existing source - and I would very much appreciate if you could provide me with a code skeleton!
    btw - it's not only the movie- or actor picture galleries - I have seen there is also clip gallery. Grabbing the links to them should be almost the same as with mediaindex - and that would be a nice think and addedvalue ... just have to check if and how those clips can be played (required code should probably be available in onlinevideos plugin...).
     

    yhoogi

    MP Donator
  • Premium Supporter
  • March 9, 2008
    599
    47
    Home Country
    Germany Germany
    Just a question:

    I am struggling each time with deleting non-existing movies as there is - to my awareness at least - no internal clean up function of the database available.
    Re-Scan did not count as it takes an extensive effort to correct all misinterpretations and combine multi part movies in a correct way.

    Is there such functionallity (But I was too dumb to find it)?


    Thanks & Cheers,

    Hi yhoogi, currently there is no auto cleanup option. It can be done manually in Config or in MP Database view one by one. I'm thinking to implement such a option in config but this method will not be safe if it will be done without thinking on missing drives and paths (if they are disconnected somehow) because DB movies should be verified against video files and you can imagine what will happened if you have network drive which is currently disconnected and you check for files there and delete movies from db as they are unreachable on that time.

    Thanks for the info.
    Biggest problem for me is to find the ones missing out of a significant list of files. So, I would opt for a cleanup dialog showing all entries which were not found.
    This would at least give also a second barrier before the entry gots lost

    Cheers,
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    When I show info on a movie in My Videos (F3) and want to change the cover (using the spincontrol) the cover is not updated, until I go back to the list with videos. This makes it hard to pick to the right cover. It DID work on older MP versions, but cannot tell how far back it was...

    Does it work for you?
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    No, cover source is not relevant (Mp will look at TMDB and IMPAwards and show in spin control as number of covers found, if number is 0 then it will look in IMDB). So if number is greater than 1, fetch works. Now q is why cover doesn't change on spin control click. As I know that you use VS, you can trace what's going on upon spin click in GUIVideoInfo.cs, put break point on line 365 and try to debug to see if new cover is in coverArtUrls[item];

    Code:
    -->line 365 (Plugins/WindowPlugins/GUIVideoFiles/GUIVideoInfo.cs)
          if (control == spinImages)
          {
            int item = spinImages.Value - 1;
            if (item < 0 || item >= coverArtUrls.Length)
            {
              item = 0;
            }
            if (currentMovie.ThumbURL == coverArtUrls[item])
            {
              return;
            }
    
            currentMovie.ThumbURL = coverArtUrls[item]; // Set new cover url which will be assigned to image control property #thumb
            // Title suffix for problem with covers and movie with the same name
            string titleExt = currentMovie.Title + "{" + currentMovie.ID + "}";
            string coverArtImage = Util.Utils.GetCoverArtName(Thumbs.MovieTitle, titleExt);
            string largeCoverArtImage = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, titleExt);
            Util.Utils.FileDelete(coverArtImage);
            //
            // 07.11.2010 Deda: Cache entry Flag change for cover thumb file
            //
            Util.Utils.FileLookUpItem fileLookUpItem = new Util.Utils.FileLookUpItem();
            fileLookUpItem.Filename = coverArtImage;
            fileLookUpItem.Exists = false;
            Util.Utils.UpdateLookUpCacheItem(fileLookUpItem, coverArtImage);
            //
            Util.Utils.FileDelete(largeCoverArtImage); // (this delete old cover)
            Refresh(false); // Gets new cover
            Update(); // Update controls and properties
            int idMovie = currentMovie.ID;
            if (idMovie >= 0)
            {
              VideoDatabase.SetThumbURL(idMovie, currentMovie.ThumbURL); // Write new cover url into database
            }
            return;
          }
     

    catavolt

    Design Group Manager
  • Team MediaPortal
  • August 13, 2007
    14,363
    10,399
    Königstein (Taunus)
    Home Country
    Germany Germany
    AW: How to Video database section and My Movies get to life

    Works like a charm here (SVN 27630) ;) Evidence:
     

    Attachments

    • 17-48-21.jpg
      17-48-21.jpg
      179.3 KB
    • 17-48-27.jpg
      17-48-27.jpg
      183.5 KB
    • 17-48-31.jpg
      17-48-31.jpg
      180.4 KB
    • 17-48-34.jpg
      17-48-34.jpg
      181 KB

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    I had just done something stupid - changed the ID of the imagecontrol :(

    Which made me wonder...why is there a #thumb property on the image, when it is updated through the hardcoded ID?

    Either way, it works just fine when ID is correct ;)

    :oops:
     

    Users who are viewing this thread

    Top Bottom