htpc broken fanart.jpg

All your suggestions, requests and ideas for future development
Post Reply
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

htpc broken fanart.jpg

Post by kim »

this makes all null only = NO fanart

// select and fetch artwork
def artwork = TheMovieDB.getArtwork(movieInfo.id, category, locale)
- def selection = [locale.language, 'en', null].findResult{ l -> artwork.find{ l == it.language } }
+ def selection = [locale.language, 'en', null].findResult{ lang -> artwork.find{ it.matches(lang) } }

I think because when find = empty/null then fail on matches on null object


log:
null
java.lang.NullPointerException
at net.filebot.web.Artwork.matches(Artwork.java:57)
at Script2$_fetchMovieArtwork_closure9$_closure30.doCall(Script2.groovy:180)
at Script2$_fetchMovieArtwork_closure9.doCall(Script2.groovy:180)
at Script2.fetchMovieArtwork(Script2.groovy:180)
at Script2$_fetchMovieArtworkAndNfo_closure16.doCall(Script2.groovy:508)
at Script2$_fetchMovieArtworkAndNfo_closure16.doCall(Script2.groovy)
at net.filebot.cli.ScriptShellBaseClass.tryLogCatch(ScriptShellBaseClass.java:127)
at Script2.fetchMovieArtworkAndNfo(Script2.groovy:466)
at Script1$_run_closure72$_closure144.doCall(Script1.groovy:410)
at Script1$_run_closure72.doCall(Script1.groovy:404)
at Script1.run(Script1.groovy:358)
at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:62)
at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:72)
at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:114)
at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:29)
at net.filebot.Main.main(Main.java:123)
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: htpc broken fanart.jpg

Post by rednoah »

Fixed.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: htpc broken fanart.jpg

Post by kim »

Well now I tried FileBot 4.6.2 (r3966) / Java(TM) SE Runtime Environment 1.8.0_77

still get:
null
java.lang.NullPointerException
at net.filebot.web.Artwork.matches(Artwork.java:57)
at Script2$_fetchMovieArtwork_closure9$_closure30.doCall(Script2.groovy:181)
at Script2$_fetchMovieArtwork_closure9.doCall(Script2.groovy:181)
at Script2.fetchMovieArtwork(Script2.groovy:181)
at Script2$_fetchMovieArtworkAndNfo_closure16.doCall(Script2.groovy:522)
at Script2$_fetchMovieArtworkAndNfo_closure16.doCall(Script2.groovy)
at net.filebot.cli.ScriptShellBaseClass.tryLogCatch(ScriptShellBaseClass.java:127)
at Script2.fetchMovieArtworkAndNfo(Script2.groovy:480)
at Script1$_run_closure72$_closure144.doCall(Script1.groovy:410)
at Script1$_run_closure72.doCall(Script1.groovy:404)
at Script1.run(Script1.groovy:358)
at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:62)
at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:72)
at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:114)
at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:29)
at net.filebot.Main.main(Main.java:123)
btw: this new rev. broke part of my htpc :(

Code: Select all

									 if (s.'Duration' != null) {
										 int durationinMS = Integer.parseInt(s.'Duration')
										 durationinseconds(Math.round((durationinMS)/1000))
										 durationinminutes(Math.round((durationinMS)/60000))
									 }
This works:

Code: Select all

	 if (category ==~ 'posters') {
		def selection = [locale.language, 'en', 'xx', null].findResult{ lang -> artwork.find{ it.matches(lang) } }
		if (selection == null) {
			log.finest "FROM htpc fetchMovieArtwork selection - Artwork not found: $outputFile"		
			return null
		}
		log.finest "FROM htpc fetchMovieArtwork outputFile - Downloading posters $selection.url => $outputFile"
		return selection.url.saveAs(outputFile)
	 }
	if (category ==~ 'backdrops') {
		def selection = [locale.language, 'en', 'xx', null].findResult{ l -> artwork.find{ l == it.language } }
		if (selection == null) {
			log.finest "FROM htpc fetchMovieArtwork selection - Artwork not found: $outputFile"		
			return null
		}		
		log.finest "FROM htpc fetchMovieArtwork outputFile - Downloading fanart $selection.url => $outputFile"
		return selection.url.saveAs(outputFile)
	}	
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: htpc broken fanart.jpg

Post by rednoah »

1.
I've uploaded a new build. Since SVN Revision and Git Commit Count are not exactly the same, the latest release is currently r3894.

Just sort by Modified for the latest jar:
https://sourceforge.net/projects/filebo ... ebot/HEAD/


2.
What does "broke" mean in terms of error messages? Your code doesn't show anything that might break. I only simplified the Artwork code and moved the common parts into the Java core.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: htpc broken fanart.jpg

Post by kim »

looks like it works in new rev. FileBot 4.7 (r3894)


Fixed it my self :)
OLD: int durationinMS = Integer.parseInt(s.'Duration')
NEW: BigDecimal durationinMS = new BigDecimal(s.'Duration')

Not in log because if left in all in htpc fails (no pics or nfo)
Post Reply