Page 1 of 1

Having problems with edited sorty.groovy

Posted: 15 Sep 2013, 20:31
by mAAdhaTTah
Here's my edited script:

Code: Select all

// PERSONALIZED SETTINGS
def episodeDir    = '''/media/SharedMedia/Processing/TV Shows'''
def episodeFormat = '''/media/SharedMedia/Media/TV Shows/{n}{'/Season '+s}/{episode}'''
def movieDir      = '''/media/SharedMedia/Processing/Movies'''
def movieFormat   = '''/media/SharedMedia/Media/Movies/{movie} ({y})/{movie} ({y})'''

// ignore chunk, part, par and hidden files
def incomplete(f) { f.name =~ /[.]incomplete|[.]chunk|[.]par$|[.]dat$/ || f.isHidden() }


// extract completed multi-volume rar files
[episodeDir, movieDir].getFolders{ !it.hasFile{ incomplete(it) } && it.hasFile{ it =~ /[.]rar$/ } }.each{ dir ->
        // extract all archives found in this folder
        def paths = extract(folder:dir)

        // delete original archive volumes after successful extraction
        if (paths != null && !paths.isEmpty()) {
                dir.listFiles{ it =~ /[.]rar$|[.]r[\d]+$/ }*.delete()
        }
}


/*
 * Fetch subtitles and sort into folders
 */
episodeDir.getFolders{ !it.hasFile{ incomplete(it) } && it.hasFile{ it.isVideo() } }.each{ dir ->
        println "Processing $dir"
        def files = dir.listFiles{ it.isVideo() }

        // fetch subtitles
        files += getSubtitles(file:files)

        // sort episodes / subtitles
        rename(file:files, db:'TheTVDB', format:episodeFormat)
}

movieDir.getFolders{ !it.hasFile{ incomplete(it) } && it.hasFile{ it.isVideo() } }.each{ dir ->
        println "Processing $dir"
        def files = dir.listFiles{ it.isVideo() }

        // fetch subtitles
        files += getSubtitles(file:files)

        // sort movies / subtitles
        rename(file:files, db:'OpenSubtitles', format:movieFormat)
}
I'm running it using this command:

Code: Select all

filebot -script /usr/bin/filebot/sorty.groovy -non-strict
And I get this error:

Code: Select all

No matching subtitles found: /media/SharedMedia/Processing/TV Shows/ER - Season 1/ER.S01-12.avi
No matching subtitles found: /media/SharedMedia/Processing/TV Shows/ER - Season 1/ER.S01-25.avi
No matching subtitles found: /media/SharedMedia/Processing/TV Shows/ER - Season 1/ER.S01-19.avi
No matching subtitles found: /media/SharedMedia/Processing/TV Shows/ER - Season 1/ER.S01-26.avi
Rename episodes using [TheTVDB]
Auto-detected query: [ER S01]
Failed to fetch episode data: [ER S01]
Exception: Unable to match files to episode data
Done ヾ(@⌒ー⌒@)ノ
The subtitles get downloaded, except for the four listed. And nothing happens to the files.

Help?

Re: Having problems with edited sorty.groovy

Posted: 15 Sep 2013, 22:12
by mAAdhaTTah
Using TVRage gives me this:

Code: Select all

No matching subtitles found: /media/SharedMedia/Processing/TV Shows/ER - Season 1/ER.S01-12.avi
No matching subtitles found: /media/SharedMedia/Processing/TV Shows/ER - Season 1/ER.S01-25.avi
No matching subtitles found: /media/SharedMedia/Processing/TV Shows/ER - Season 1/ER.S01-19.avi
No matching subtitles found: /media/SharedMedia/Processing/TV Shows/ER - Season 1/ER.S01-26.avi
Rename episodes using [TVRage]
Auto-detected query: [ER S01]
Exception: Unable to auto-select search result: [Peter R. de Vries misdaadverslaggever, R U Faster Than a Redneck?, SM Girls Saber Marionette R, Lock N' Load with R. Lee Ermey (2009), Code R, The Irish R. M., Elizabeth R, R U The Girl With T-Boz & Chilli]
Done ヾ(@⌒ー⌒@)ノ

Re: Having problems with edited sorty.groovy

Posted: 16 Sep 2013, 01:55
by rednoah
It can make sense of "ER" when followed by a non-standard SxE format.

EDIT: Improved support for TV shows with short names with r1728.

Re: Having problems with edited sorty.groovy

Posted: 16 Sep 2013, 12:03
by mAAdhaTTah
Is this version live? Any way to check which version I'm running?

Re: Having problems with edited sorty.groovy

Posted: 16 Sep 2013, 15:06
by rednoah
Uploaded a new revision for you. Check FAQ for details.

Re: Having problems with edited sorty.groovy

Posted: 16 Sep 2013, 15:29
by mAAdhaTTah
Ok, I'm running a headless Ubuntu server, so I used this to pull it down:

http://www.filebot.net/forums/viewtopic ... =384#p2592

How do I download the beta versions this way?

Edit: Better question: where is the jar located when I install it this way so can replace it?

Re: Having problems with edited sorty.groovy

Posted: 16 Sep 2013, 15:43
by rednoah

Re: Having problems with edited sorty.groovy

Posted: 16 Sep 2013, 17:04
by mAAdhaTTah
I've updated, but now I'm getting this error whenever I start filebot

Code: Select all

Sep 16, 2013 1:02:41 PM java.util.prefs.FileSystemPreferences$1 run
WARNING: Couldn't create user preferences directory. User preferences are unusable.
Sep 16, 2013 1:02:41 PM java.util.prefs.FileSystemPreferences$1 run
WARNING: java.io.IOException: No such file or directory
I'm sure I did something wrong when I upgraded - maybe this is a permissions issue? Thoughts?

Re: Having problems with edited sorty.groovy

Posted: 16 Sep 2013, 18:01
by rednoah
This is a general Java warning. I doubt that's because of the new jar.

Make sure FileBot can read/write to your $HOME folder. Or call filebot after setting $HOME to some other read/writeable location.

Re: Having problems with edited sorty.groovy

Posted: 16 Sep 2013, 18:06
by mAAdhaTTah
Maybe a dumb question, but is there a java user i should give r/w access to?

Re: Having problems with edited sorty.groovy

Posted: 16 Sep 2013, 18:08
by rednoah
You can set these Java system properties to control where Java Preferences stores it's files:

Code: Select all

java.util.prefs.systemRoot 	"/etc/.java"
java.util.prefs.userRoot 	user.home / ".userPrefs"
java.util.prefs.syncInterval 	30
@see http://allaboutbalance.com/articles/disableprefs/

PS: I don't think there is a Java user or anything like that. However Java is setup to store it's preferences, it's not setup correctly,

Re: Having problems with edited sorty.groovy

Posted: 21 Sep 2013, 14:04
by mAAdhaTTah
Is there a log file I can check? I'm having another unrelated problem but without any error being displayed. I'm running the script and now, instead of doing anything, it just says "Done."

Re: Having problems with edited sorty.groovy

Posted: 21 Sep 2013, 16:42
by rednoah
I don't maintain sorty. Just play with my sample and try different things to figure out what works and what doesn't. It's always helpful to add println statements randomly in the script so you can see which parts of the script are reached or not reached.

Re: Having problems with edited sorty.groovy

Posted: 21 Sep 2013, 21:07
by mAAdhaTTah
Well, it's a new problem: I added println, and it prints out everything, so it's going through the script, but it's not actually manipulating the files. It's not outputting any permissions errors. It's not doing... anything. Is it possible an update broke it? I've updated to the latest FileBot.jar.

Re: Having problems with edited sorty.groovy

Posted: 21 Sep 2013, 21:33
by rednoah
Nope, if anything was broken there would be exceptions flying around everywhere. It's probably just doing nothing, for some reason.

Since you don't send me any logs I have even less of an idea what's going on than you. ;)

Re: Having problems with edited sorty.groovy

Posted: 21 Sep 2013, 22:24
by mAAdhaTTah
That's what I asked earlier - where are the logs saved? :)

Re: Having problems with edited sorty.groovy

Posted: 21 Sep 2013, 22:39
by rednoah
cmdline output is printed to the cmdline. You can redirect to file if you want. All logging is printed to cmdline.

Re: Having problems with edited sorty.groovy

Posted: 30 Sep 2013, 12:08
by mAAdhaTTah
I added a few println's to try and figure out what is going on:

Code: Select all

// PERSONALIZED SETTINGS
def episodeDir    = '''/media/SharedMedia/Processing/TV Shows'''
def episodeFormat = '''/media/SharedMedia/Media/TV Shows/{n}{'/Season '+s}/{episode}'''
def movieDir      = '''/media/SharedMedia/Processing/Movies'''
def movieFormat   = '''/media/SharedMedia/Media/Movies/{movie} ({y})/{movie} ({y})'''
println("Step 0")
// ignore chunk, part, par and hidden files
def incomplete(f) { f.name =~ /[.]incomplete|[.]chunk|[.]par$|[.]dat$/ || f.isHidden() }

println("Step 1")
// extract completed multi-volume rar files
[episodeDir, movieDir].getFolders{ !it.hasFile{ incomplete(it) } && it.hasFile{ it =~ /[.]rar$/ } }.each{ dir ->
        // extract all archives found in this folder
        def paths = extract(folder:dir)

        // delete original archive volumes after successful extraction
        if (paths != null && !paths.isEmpty()) {
                dir.listFiles{ it =~ /[.]rar$|[.]r[\d]+$/ }*.delete()
        }
}

println("Step 2")
/*
 * Fetch subtitles and sort into folders
 */
episodeDir.getFolders{ !it.hasFile{ incomplete(it) } && it.hasFile{ it.isVideo() } }.each{ dir ->
        println "Processing $dir"
        def files = dir.listFiles{ it.isVideo() }

        // fetch subtitles
        files += getSubtitles(file:files)

        // sort episodes / subtitles
        rename(file:files, db:'TheTVDB', format:episodeFormat)
}

println("Step 3")

movieDir.getFolders{ !it.hasFile{ incomplete(it) } && it.hasFile{ it.isVideo() } }.each{ dir ->
        println "Processing $dir"
        def files = dir.listFiles{ it.isVideo() }

        // fetch subtitles
        files += getSubtitles(file:files)

        // sort movies / subtitles
        rename(file:files, db:'OpenSubtitles', format:movieFormat)
}

println("Step 4")
I run it with

Code: Select all

filebot -script sorty.groovy -non-strict
and all I get is this:

Code: Select all

Step 0
Step 1
Step 2
Step 3
Step 4
Done ヾ(@⌒ー⌒@)ノ
There's definitely .rar files in that folder, so I have no idea what's going on with this. Help?

Re: Having problems with edited sorty.groovy

Posted: 30 Sep 2013, 21:56
by mAAdhaTTah
Nevermind, figured it out. Had to the with the files in particular, permissions, blah blah blah. Thanks for your help!