Menu

folder.jpg in movie directory

2007-02-25
2013-02-12
  • Nobody/Anonymous

    Would it be possible to add the movie cover to source directory of the movie and to rename it to folder.jpg.

    This would bring up the movie covers in thumbnail view in windows xp when you are viewing you are viewing your folder listing. It was also bring up the movies covers on my xbmc. :-)

     
    • Bro

      Bro - 2007-02-26

      Hi

      I'll see what I can do.

      Bro

       
    • Nobody/Anonymous

      And to my Tvix M5000.
      Yeah! To that feature :-)

      /Jofa

       
    • Nobody/Anonymous

      I have done this on source at home and works great for me:

      net.sf.xmm.moviemanager.commands.MovieManagerCommandAddMultipleMoviesByFile.createMovies(String parentPath)

      ...

              // add a folder.jpg if it exists
              if (new File(tempFile[0].getParentFile(), "folder.jpg").exists())
              {
                  movieInfoModel.model.setCoverData(getRawBytes(new File(tempFile[0].getParentFile(), "folder.jpg")));
                              // give it a unique name in case there is no entry in imdb
                  movieInfoModel.model.setCover(Long.toString(System.currentTimeMillis()));
              }
             
              /*removes dots, double spaces, underscore...*/
              searchString = removeVarious(searchString);
      ...

      net.sf.xmm.moviemanager.DialogIMDB.getIMDbInfo(ModelMovieInfo modelInfo, String key)
      ...
                  /* The cover... */
                  byte[] coverData = modelInfo.model.getCoverData() == null ?
                      imdb.getCover() :
                      modelInfo.model.getCoverData();
                 
                  if (imdb.getCoverOK() || modelInfo.model.getCoverData() != null) {
                      modelInfo.setCover(imdb.getCoverName(), coverData);
                      modelInfo.setSaveCover(true);
                  } else {
                      modelInfo.setCover("", null);
                      modelInfo.setSaveCover(false);
                  }
      ...

       
    • Nobody/Anonymous

      Opps forgot to add this method to  net.sf.xmm.moviemanager.commands.MovieManagerCommandAddMultipleMoviesByFile in my above write up:

          private byte[] getRawBytes(File f)
          {
              if (!f.exists())
              {
                  return null;
              }
             
              // Get the size of the file
              long length = f.length();
         
              // You cannot create an array using a long type.
              // It needs to be an int type.
              // Before converting to an int type, check
              // to ensure that file is not larger than Integer.MAX_VALUE.
              if (length > Integer.MAX_VALUE) {
                  System.err.println("File too large: "+f);
                  return null;
              }
             
              FileInputStream fin = null;
              try{
                  fin = new FileInputStream(f);
                  byte[] buffer = new byte[(int)f.length()];
                  fin.read(buffer);
                  return buffer;
              }
              catch(Exception err)
              {
                  err.printStackTrace();
                  return null;
              }
              finally{
                  try {
                      fin.close();
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              }

          }

       
    • Nobody/Anonymous

      is there a way to do this for the file name
      eg. export the dvd cover as the file name

      -----> movies
          ------> folder
              -------> movie name.avi
                        movie name.jpg

       
      • Bro

        Bro - 2009-05-27

        Hi

        I haven't gotten around to do this yet.

        Bro

         

Log in to post a comment.