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. :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
// 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()));
}
// 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();
}
}
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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. :-)
Hi
I'll see what I can do.
Bro
And to my Tvix M5000.
Yeah! To that feature :-)
/Jofa
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);
}
...
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();
}
}
}
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
Hi
I haven't gotten around to do this yet.
Bro