From 517fa36038c3187634a1cb4665e70a1d4081201e Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 9 Feb 2012 13:42:14 +0000 Subject: [PATCH] * update docs for {info} binding movie/series metadata binding --- .../filebot/format/MediaBindingBean.java | 2 +- .../ui/rename/BindingDialog.properties | 2 +- .../sourceforge/filebot/web/TMDbClient.java | 35 +++++++++++++++++++ .../filebot/web/TMDbClientTest.java | 2 +- website/naming.html | 11 ++++++ 5 files changed, 49 insertions(+), 3 deletions(-) diff --git a/source/net/sourceforge/filebot/format/MediaBindingBean.java b/source/net/sourceforge/filebot/format/MediaBindingBean.java index 6e3f4756..7386e2a2 100644 --- a/source/net/sourceforge/filebot/format/MediaBindingBean.java +++ b/source/net/sourceforge/filebot/format/MediaBindingBean.java @@ -304,7 +304,7 @@ public class MediaBindingBean { } - @Define("meta") + @Define("info") public synchronized Object getMetaInfo() throws Exception { if (metaInfo == null) { if (infoObject instanceof Episode) diff --git a/source/net/sourceforge/filebot/ui/rename/BindingDialog.properties b/source/net/sourceforge/filebot/ui/rename/BindingDialog.properties index 7782860b..1a897aa9 100644 --- a/source/net/sourceforge/filebot/ui/rename/BindingDialog.properties +++ b/source/net/sourceforge/filebot/ui/rename/BindingDialog.properties @@ -2,4 +2,4 @@ parameter.exclude: ^StreamKind|Count$ # preview expressions (keys are tagged so they can be sorted alphabetically) -expressions: n,y,s,e,t,airdate,startdate,absolute,special,imdb,episode,sxe,s00e00,movie,vc,ac,cf,vf,af,resolution,ws,sdhd,source,group,crc32,fn,ext,file,pi,pn,lang,media.title,media.durationString,media.overallBitRateString,video.codecID,video.frameRate,video.displayAspectRatioString,video.height,video.scanType,audio.format,audio.bitRateString,audio.language,text.codecInfo,text.language +expressions: n,y,s,e,t,airdate,startdate,absolute,special,imdb,episode,sxe,s00e00,movie,vc,ac,cf,vf,af,resolution,ws,sdhd,source,group,crc32,fn,ext,file,pi,pn,lang,info,info.actors,info.director,media.title,media.durationString,media.overallBitRateString,video.codecID,video.frameRate,video.displayAspectRatioString,video.height,video.scanType,audio.format,audio.bitRateString,audio.language,text.codecInfo,text.language diff --git a/source/net/sourceforge/filebot/web/TMDbClient.java b/source/net/sourceforge/filebot/web/TMDbClient.java index 0df430d1..f09a861c 100644 --- a/source/net/sourceforge/filebot/web/TMDbClient.java +++ b/source/net/sourceforge/filebot/web/TMDbClient.java @@ -377,6 +377,26 @@ public class TMDbClient implements MovieIdentificationService { } + public String getDirector() { + for (Person person : cast) { + if (person.isDirector()) + return person.getName(); + } + return null; + } + + + public List getActors() { + List actors = new ArrayList(); + for (Person person : cast) { + if (person.isActor()) { + actors.add(person.getName()); + } + } + return actors; + } + + public List getImages() { return unmodifiableList(asList(images)); } @@ -506,6 +526,11 @@ public class TMDbClient implements MovieIdentificationService { } + public String getCharacter() { + return get(PersonProperty.character); + } + + public String getJob() { return get(PersonProperty.job); } @@ -525,6 +550,16 @@ public class TMDbClient implements MovieIdentificationService { } + public boolean isActor() { + return "Actor".equals(getJob()); + } + + + public boolean isDirector() { + return "Director".equals(getJob()); + } + + @Override public String toString() { return fields.toString(); diff --git a/test/net/sourceforge/filebot/web/TMDbClientTest.java b/test/net/sourceforge/filebot/web/TMDbClientTest.java index 56f9936e..6ba504df 100644 --- a/test/net/sourceforge/filebot/web/TMDbClientTest.java +++ b/test/net/sourceforge/filebot/web/TMDbClientTest.java @@ -23,7 +23,7 @@ public class TMDbClientTest { List result = tmdb.searchMovie("Serenity", Locale.CHINESE); Movie movie = result.get(0); - assertEquals("冲出???", movie.getName()); + assertEquals("冲出宁静号", movie.getName()); assertEquals(2005, movie.getYear()); assertEquals(379786, movie.getImdbId()); } diff --git a/website/naming.html b/website/naming.html index 5fde50b7..b41cfac3 100644 --- a/website/naming.html +++ b/website/naming.html @@ -278,6 +278,11 @@ detect subtitle language eng + + info + TheTVDB / TheMovieDB metadata + <any metadata> + file file object @@ -339,6 +344,12 @@

replacePart(replacement = "")Replace part identifier (e.g. "Today Is the Day (1)" -> "Today Is the Day, Part 1").

+

+ ascii()Convert Unicode to ASCII. (e.g. "Österreich" -> "Osterreich" or "カタカナ" -> "katakana"). +

+

+ transliterate(identifier)Apply any ICU script transliteration. e.g. "中国".transliterate("han-latin") -> "zhōng guó". +