Having problems with edited sorty.groovy

Any questions? Need some help?
Post Reply
mAAdhaTTah
Posts: 16
Joined: 15 Sep 2013, 20:27

Having problems with edited sorty.groovy

Post 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?
mAAdhaTTah
Posts: 16
Joined: 15 Sep 2013, 20:27

Re: Having problems with edited sorty.groovy

Post 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 ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 23927
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Having problems with edited sorty.groovy

Post 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.
:idea: Please read the FAQ and How to Request Help.
mAAdhaTTah
Posts: 16
Joined: 15 Sep 2013, 20:27

Re: Having problems with edited sorty.groovy

Post by mAAdhaTTah »

Is this version live? Any way to check which version I'm running?
User avatar
rednoah
The Source
Posts: 23927
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Having problems with edited sorty.groovy

Post by rednoah »

Uploaded a new revision for you. Check FAQ for details.
:idea: Please read the FAQ and How to Request Help.
mAAdhaTTah
Posts: 16
Joined: 15 Sep 2013, 20:27

Re: Having problems with edited sorty.groovy

Post 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?
mAAdhaTTah
Posts: 16
Joined: 15 Sep 2013, 20:27

Re: Having problems with edited sorty.groovy

Post 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?
User avatar
rednoah
The Source
Posts: 23927
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Having problems with edited sorty.groovy

Post 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.
:idea: Please read the FAQ and How to Request Help.
mAAdhaTTah
Posts: 16
Joined: 15 Sep 2013, 20:27

Re: Having problems with edited sorty.groovy

Post by mAAdhaTTah »

Maybe a dumb question, but is there a java user i should give r/w access to?
User avatar
rednoah
The Source
Posts: 23927
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Having problems with edited sorty.groovy

Post 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,
:idea: Please read the FAQ and How to Request Help.
mAAdhaTTah
Posts: 16
Joined: 15 Sep 2013, 20:27

Re: Having problems with edited sorty.groovy

Post 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."
User avatar
rednoah
The Source
Posts: 23927
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Having problems with edited sorty.groovy

Post 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.
:idea: Please read the FAQ and How to Request Help.
mAAdhaTTah
Posts: 16
Joined: 15 Sep 2013, 20:27

Re: Having problems with edited sorty.groovy

Post 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.
User avatar
rednoah
The Source
Posts: 23927
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Having problems with edited sorty.groovy

Post 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. ;)
:idea: Please read the FAQ and How to Request Help.
mAAdhaTTah
Posts: 16
Joined: 15 Sep 2013, 20:27

Re: Having problems with edited sorty.groovy

Post by mAAdhaTTah »

That's what I asked earlier - where are the logs saved? :)
User avatar
rednoah
The Source
Posts: 23927
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Having problems with edited sorty.groovy

Post by rednoah »

cmdline output is printed to the cmdline. You can redirect to file if you want. All logging is printed to cmdline.
:idea: Please read the FAQ and How to Request Help.
mAAdhaTTah
Posts: 16
Joined: 15 Sep 2013, 20:27

Re: Having problems with edited sorty.groovy

Post 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?
mAAdhaTTah
Posts: 16
Joined: 15 Sep 2013, 20:27

Re: Having problems with edited sorty.groovy

Post by mAAdhaTTah »

Nevermind, figured it out. Had to the with the files in particular, permissions, blah blah blah. Thanks for your help!
Post Reply