Skip to content
Browse files

Small updates

  • Loading branch information...
1 parent ce07179 commit 6968e558f327ef5bca2fbda8bf1b3ff0fabcd556 @SharkHunter committed Jul 16, 2012
View
1 .gitignore
@@ -1 +1,2 @@
bin/
+.class
View
BIN net/pms/movieinfo/FileMovieInfoVirtualFolder.class
Binary file not shown.
View
6 net/pms/movieinfo/FileMovieInfoVirtualFolder.java
@@ -22,6 +22,7 @@
import java.util.regex.Pattern;
import java.util.zip.GZIPInputStream;
+import net.pms.dlna.DLNAResource;
import net.pms.dlna.virtual.VirtualFolder;
import net.pms.movieinfo.plugins.Plugin;
@@ -61,6 +62,7 @@
private String nfoId;
private String trailer;
private String cookie;
+ private DLNAResource origRes;
private int cellwrap = 0;
private boolean showtags = true;
@@ -76,6 +78,9 @@ public FileMovieInfoVirtualFolder(String name, String thumbnailIcon, boolean cop
@Override
public void resolve() {
super.resolve();
+
+ if(nfoId == null)
+ nfoId=MovieInfo.extractImdb(origRes);
if (!resolved && getChildren().size() == 0) {
getConfig();
@@ -746,6 +751,7 @@ public FileMovieInfoVirtualFolder(String name, String thumbnailIcon, ResourceExt
className = name;
nfoId = r.imdbId;
thumbfolder = r.thumbfolder;
+ origRes = r.getOriginal();
}
}
View
BIN net/pms/movieinfo/MovieInfo$1.class
Binary file not shown.
View
BIN net/pms/movieinfo/MovieInfo$2.class
Binary file not shown.
View
BIN net/pms/movieinfo/MovieInfo$3.class
Binary file not shown.
View
BIN net/pms/movieinfo/MovieInfo$4.class
Binary file not shown.
View
BIN net/pms/movieinfo/MovieInfo$5.class
Binary file not shown.
View
BIN net/pms/movieinfo/MovieInfo$6.class
Binary file not shown.
View
BIN net/pms/movieinfo/MovieInfo.class
Binary file not shown.
View
35 net/pms/movieinfo/MovieInfo.java
@@ -4,11 +4,14 @@
import javax.swing.JComponent;
import net.pms.dlna.DLNAResource;
+import net.pms.dlna.RealFile;
import net.pms.external.AdditionalResourceFolderListener;
import java.awt.Font;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import javax.swing.JTextField;
@@ -41,12 +44,34 @@
private String Filter="filter";
public void addAdditionalFolder(DLNAResource currentResource, DLNAResource child) {
- if(!(child instanceof net.pms.dlna.RealFile))
- return;
- /*if(currentResource instanceof MovieInfoVirtualFolder)
+ if(child instanceof RealFile) {
+ RealFile rf=(RealFile)child;
+ String imdb=extractImdb(rf);
+ /*if(currentResource instanceof MovieInfoVirtualFolder)
return;*/
- ResourceExtension ext = new ResourceExtension(currentResource);
- ext.addChild(child);
+ ResourceExtension ext = new ResourceExtension(currentResource,imdb);
+ ext.addChild(child);
+ }
+ }
+
+ public static String extractImdb(DLNAResource res) {
+ if(res instanceof RealFile)
+ return extractImdb((RealFile)res);
+ else
+ return null;
+ }
+
+ public static String extractImdb(RealFile file) {
+ String fName=file.getFile().getAbsolutePath();
+ Pattern re=Pattern.compile("_imdb([^_]+)_");
+ Matcher m=re.matcher(fName);
+ String ret="";
+ while(m.find()) {
+ ret=m.group(1);
+ if(!ret.startsWith("tt"))
+ ret="tt"+ret;
+ }
+ return ret;
}
@Override
View
BIN net/pms/movieinfo/MovieInfoTrailer.class
Binary file not shown.
View
1 net/pms/movieinfo/MovieInfoTrailer.java
@@ -77,5 +77,6 @@ else if (elt.startsWith(" \"t\""))
public boolean isTranscodeFolderAvailable() {
return false;
}
+ */
}
View
BIN net/pms/movieinfo/MovieInfoVirtualData$1.class
Binary file not shown.
View
BIN net/pms/movieinfo/MovieInfoVirtualData.class
Binary file not shown.
View
4 net/pms/movieinfo/MovieInfoVirtualData.java
@@ -40,10 +40,6 @@ public String getThumbnailURL(){
public String getName() {
return name;
}
-
- public boolean isTranscodeFolderAvailable() {
- return false;
- }
@Override
public long length() {
View
BIN net/pms/movieinfo/ResourceExtension.class
Binary file not shown.
View
4 net/pms/movieinfo/ResourceExtension.java
@@ -91,5 +91,9 @@ private void getOptions()
} else
logger.trace("MOVIEINFO.conf file not found!");
}
+
+ public DLNAResource getOriginal() {
+ return original;
+ }
}
View
BIN net/pms/movieinfo/plugins/CSFDPlugin.class
Binary file not shown.
View
BIN net/pms/movieinfo/plugins/IMDBPlugin.class
Binary file not shown.

0 comments on commit 6968e55

Please sign in to comment.
Something went wrong with that request. Please try again.