[Approved] How to Video database section and My Movies get to life (4 Viewers)

Guzzi

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

    Ok, so I will check with a new/empty DB, so that thumbs are recreated and let you know, if it works...

    Edit:
    Ok, so I deleted the Videdatabase5.db3 - it's autocreted when starting MePo. But still nothing to see.
    The movie gets its entry with description etc., but no picture.
    Launching IMDB context also shows movie infos without 8cover) picture.
    But:
    When refreshing IMDB info - thus reloading infos from internet - info will be downloaded and after that cover appears.

    Edit 2:

    So ... checking the code of the Plugin, it gets path/names by:

    string strThumb = MediaPortal.Util.Utils.GetCoverArtName(Thumbs.MovieTitle, movieDetails.Title);
    string LargeThumb = MediaPortal.Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, movieDetails.Title);

    Did further tests and deleted/renamed Thumbfolder.

    With the code above, thumbs are created in ...Thumbs\Video\Title with "Moviename" and "MovienameL".

    As you've written, this won't be recognized anymore - you require different naming for display.

    What to do?

    I could change the code insode the plugin to modify:

    strThumb = strThumb + "{" + idMovie.ToString() + "}";

    But: MediaPortal.Util.Utils.GetCoverArtName() is a function that might be used by other parts or plugins too.

    Two possibilities:
    - either change GetCoverartName (might break other things?) or
    - alternatively change the code to read old format, if new thumbs can't be found - also not nice, because it might slow down and is not ver "clean"....

    For now I will change the code of the plugin and see, if that works ....
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    No, I didn't changed any function. Examples how covers is found or written:

    Find movie cover cover:

    Code:
          string titleExt = CurrentMovie.Title + "{" + CurrentMovie.ID + "}";
          string strThumb = Util.Utils.GetCoverArtName(Thumbs.MovieTitle, titleExt);
          string largeThumb = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, titleExt);

    or save cover:

    Code:
    string titleExt = CurrentMovie.Title + "{" + CurrentMovie.ID + "}";
    DownloadCoverArt(Thumbs.MovieTitle, _movieDetails.ThumbURL, titleExt);

    I just added suffix for title as {dbID} and passed it to function as old MP and everything is processed as before. And this is only for the movies which are in the db or will be in the db by scanning. Any other video files works as before and they are handled differently.
     

    Guzzi

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

    No, I didn't changed any function. Examples how covers is found or written:

    Find movie cover cover:

    Code:
          string titleExt = CurrentMovie.Title + "{" + CurrentMovie.ID + "}";
          string strThumb = Util.Utils.GetCoverArtName(Thumbs.MovieTitle, titleExt);
          string largeThumb = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, titleExt);

    or save cover:

    Code:
    string titleExt = CurrentMovie.Title + "{" + CurrentMovie.ID + "}";
    DownloadCoverArt(Thumbs.MovieTitle, _movieDetails.ThumbURL, titleExt);

    I just added suffix for title as {dbID} and passed it to function as old MP and everything is processed as before. And this is only for the movies which are in the db or will be in the db by scanning. Any other video files works as before and they are handled differently.

    hmmm, still haven't found the right code to change in the plugin ... but regardless of that:
    Would you say it's best "practice /preferrable" to set player properties instead?
    I am not sure, how MePo is working internally, but it seems, currently infos coming from MyVideoDB by registering information there - will setting playerproperties when launching a file "override" that?
     

    chemelli

    Retired Team Member
  • Premium Supporter
  • September 28, 2006
    6,159
    2,264
    51
    Milano, Italy
    Home Country
    Italy Italy
    Just step in to remember Deda to post required code changes in the wiki so all plugin devs know what to fix for new upcoming version.

    Simone
     

    catavolt

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

    When will this be committed to SVN? I´d like to test it under "real" conditions, not with "avoidversioncheck" ;)
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    Very soon but I don't want to be handled differently as any other, so this patch must be evaluated properly. Chemelli put me on some other assignments so I'm working like multitasking switching from one problem to another but I didn't forget this, also prepared new IMDB script more readable and cleaner and smaller (I admit that I used and slightly adapted new MovingPictures regexes expressions because I don't have a time to check probably new changes on IMDB).
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    Re: AW: Re: How to Video database section and My Movies get to life

    No, I didn't changed any function. Examples how covers is found or written:

    Find movie cover cover:

    Code:
          string titleExt = CurrentMovie.Title + "{" + CurrentMovie.ID + "}";
          string strThumb = Util.Utils.GetCoverArtName(Thumbs.MovieTitle, titleExt);
          string largeThumb = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, titleExt);
    or save cover:

    Code:
    string titleExt = CurrentMovie.Title + "{" + CurrentMovie.ID + "}";
    DownloadCoverArt(Thumbs.MovieTitle, _movieDetails.ThumbURL, titleExt);
    I just added suffix for title as {dbID} and passed it to function as old MP and everything is processed as before. And this is only for the movies which are in the db or will be in the db by scanning. Any other video files works as before and they are handled differently.

    hmmm, still haven't found the right code to change in the plugin ... but regardless of that:
    Would you say it's best "practice /preferrable" to set player properties instead?
    I am not sure, how MePo is working internally, but it seems, currently infos coming from MyVideoDB by registering information there - will setting playerproperties when launching a file "override" that?


    In MePo it look like this in patched files (red are changes):

    Code:
    public void SetPlayProperties()
        {
         [COLOR=Red] // Temporary join plot + user review
          string joinedPlot = Plot;
          if (UserReview != "" && UserReview.ToLower() != "unknown")
          {
            string strReview = GUILocalizeStrings.Get(177).ToUpper();
            string strUserReview = "\n\n****" + strReview + "****\n\n";
            joinedPlot = Plot + strUserReview + UserReview;
          }[/COLOR]
    
         [COLOR=Red] // Changed - cover with the same movie name
          //string strThumb = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, Title);
          // Title suffix for problem with covers and movie with the same name
          string titleExt = Title + "{" + ID + "}";
          string strThumb = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, titleExt);[/COLOR]
          GUIPropertyManager.SetProperty("#Play.Current.Director", Director);
          GUIPropertyManager.SetProperty("#Play.Current.Genre", Genre);
          GUIPropertyManager.SetProperty("#Play.Current.Cast", Cast);
          GUIPropertyManager.SetProperty("#Play.Current.DVDLabel", DVDLabel);
          GUIPropertyManager.SetProperty("#Play.Current.IMDBNumber", IMDBNumber);
          GUIPropertyManager.SetProperty("#Play.Current.File", File);
          GUIPropertyManager.SetProperty("#Play.Current.Plot", joinedPlot); // Changed
          GUIPropertyManager.SetProperty("#Play.Current.PlotOutline", PlotOutline);
          GUIPropertyManager.SetProperty("#Play.Current.Rating", Rating.ToString());
          GUIPropertyManager.SetProperty("#Play.Current.TagLine", TagLine);
          GUIPropertyManager.SetProperty("#Play.Current.Votes", Votes);
          GUIPropertyManager.SetProperty("#Play.Current.Credits", WritingCredits);
          GUIPropertyManager.SetProperty("#Play.Current.Thumb", strThumb);
          GUIPropertyManager.SetProperty("#Play.Current.Title", Title);
          GUIPropertyManager.SetProperty("#Play.Current.Year", Year.ToString());
          GUIPropertyManager.SetProperty("#Play.Current.Runtime", RunTime.ToString());
          GUIPropertyManager.SetProperty("#Play.Current.MPAARating", MPARating);
          string strValue = "no";
          if (Watched > 0)
          {
            strValue = "yes";
          }
          GUIPropertyManager.SetProperty("#Play.Current.IsWatched", strValue);
        }

    then it backs to caller (in file GUIVideoOverlay.cs => private void SetCurrentFile(string fileName)):
    Code:
    ......
           if (bMovieInfoFound)
          {
            [COLOR=Red]movieDetails.SetPlayProperties();[/COLOR] // This is the caller for player properties above
          }
          else if (g_Player.IsTV && g_Player.IsTimeShifting)
          {
            GUIPropertyManager.SetProperty("#Play.Current.Title", GUIPropertyManager.GetProperty("#TV.View.channel"));
            GUIPropertyManager.SetProperty("#Play.Current.Genre", GUIPropertyManager.GetProperty("#TV.View.title"));
          }
          else
          {
            GUIListItem item = new GUIListItem();
            item.IsFolder = false;
            item.Path = fileName;
            Util.Utils.SetThumbnails(ref item);
            GUIPropertyManager.SetProperty("#Play.Current.Thumb", item.ThumbnailImage);
          }
          _thumbLogo = GUIPropertyManager.GetProperty("#Play.Current.Thumb");....

    So as you can see, I added {dbID} through all code which get/set thumbs just to not mess up all MePo (not really easy to maintain and right approach but I didn't want to break other sections beacuse, if I did that, then I would need to update many parts of MePo outside of Videos).

    So probably, you will need to find in My Films all places where thumbs is read and add that {dbID} after movietitle. I will see if I will get permission to change Util.Utils.GetLargeCoverArtName so it will handle {dbID} and good thing is that all changes for that in many places became obsolete, but negative side is that all calls will need to be changed, and I really don't know which plugins uses that so plugins will stop to work, and also in that method there should be some check if call is made for video from VideoDB and handled differently from other videos, pictures and music thumbs.

    Also I need big discussion with dev managers about whole project change because maybe something slips me and have negative effect on some other part of MePo (I didn't found anything yet but I'm sure, if exist, it will be visible in 1.2.0 Alpha).
     

    Guzzi

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

    Hi Deda,

    thanks for the help - so far I assume problem is, that MyFilms creates itself the thumbs to have them available later for SetPlayProperties - and MePo then searches for the new ones with ID added, that are not available. Thus I think I will have to look for the places in the plugin to change - just didn't find them yet.
    100% agree that you should keep MePo things internally clean...
    Have to go to hospital now and will check this later again.
     

    Crazy-Zippo

    Portal Member
    August 29, 2007
    33
    11
    57
    Home Country
    Germany Germany
    AW: How to Video database section and My Movies get to life

    Hi...

    My folder looks like that:

    Folder-> Beim Leben meiner Schwester - [My Sister's Keeper]
    file->fanart.jpg
    file->folder.jpg
    file->tt1078588.iso
    file->tt1078588.nfo

    Now I would like to know if it is possible, to embed the existing folder.jpg as video cover and the
    existing fanart.jpg as background wallpaper.

    The problem is that the automatic search overwrites the folder.jpg. It would be nice, if the program checks whether there is an existing folder.jpg or not and uses the existing one as video cover.

    Furthermore the automatic search does not find the fanart.jpg. I have to do that by hand which costs lots
    of time.

    Thx in adv. for your feedback
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    Not at the moment, but I implemented that right now (will be ready for 1.1.1 as binary files here).

    Note: this will work only if new setting option: "Use folder name for title" is checked, which means, every movie in it's own folder and movie name searched and set as movie title will be taken from folder name.

    As I looking at your folder name, movie search can be confused with combined name (ie. German + English) so it can fail or give wrong result, so I need to create sub option where search name will not be taken from folder but from video file or image file name (this will work in your case as you use ttnumber as file name) ->I see a big problem here if in folder is ripped DVD then file name is always VIDEO_TS.IFO and search movie name will be taken from upper folder and it can easy fail in your folder name case :confused: .

    Btw, what is in your nfo file ?
     

    Users who are viewing this thread

    Top Bottom