tvrenamer & hazel

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

tvrenamer & hazel Sat Apr 11, 2015 10:51 am • by wolfkfe
i install tvrenamer and it run in terminal
Code: Select all
tvnamer --always "$1" --config=/Users/repli/mytvnamerconfig.json --series-id=257655 /Volumes/Descargas/AUTOMATIC\ LIBRARY/Arrow
Loading config: /Users/repli/mytvnamerconfig.json
and it rename perfect but when i put in hazel:

/usr/local/bin/tvnamer
Code: Select all
/usr/local/bin/tvnamer --always "$1" --config=/Users/repli/mytvnamerconfig.json --series-id=257655 /Volumes/Descargas/AUTOMATIC\ LIBRARY/Arrow

my result in hazel console is
Code: Select all
Arrow S03E17.mp4: Rule tvnamer matched.
hazelworker[423] [Error] Shell script failed: Error processing shell script on file /Volumes/Descargas/AUTOMATIC LIBRARY/Arrow/carpeta sin título/Arrow S03E17.mp4.
hazelworker[423] Shellscript exited with non-successful status code: 2
hazelworker[423] Done processing folder Arrow

and in system.log
Code: Select all
# Found 1 episode
####################
# Processing file: Arrow S03E17.mp4
# Detected series: Arrow (season: 3, episode: 17)
TVDB Search Results:
1 -> Arrow [en] # http://thetvdb.com/?tab=series&id=257655&lid=7 (default)
2 -> Arrow [sv] # http://thetvdb.com/?tab=series&id=257655&lid=8
3 -> Arrow [da] # http://thetvdb.com/?tab=series&id=257655&lid=10
4 -> Arrow [fi] # http://thetvdb.com/?tab=series&id=257655&lid=11
5 -> Arrow [nl] # http://thetvdb.com/?tab=series&id=257655&lid=13
6 -> Arrow [de] # http://thetvdb.com/?tab=series&id=257655&lid=14
Enter choice (first number, return for default, 'all', ? for help):

i try with "/usr/local/bin/tvnamer --always" and "/usr/local/bin/tvnamer --batch" and also with "batch: true" in mytvnamerconfig.json

Any solution?
Sorry bad english
wolfkfe
 
Posts: 2
Joined: Sat Apr 11, 2015 10:25 am

Re: tvrenamer & hazel Mon Apr 13, 2015 11:12 am • by Mr_Noodle
It looks like it's expecting input, which you can't do with Hazel since it runs in the background. Also, make sure your script defines any environment variables it needs. Running it in Hazel is a different context so you can't expect to have all the env vars defined as you do in an interactive shell.
Mr_Noodle
Site Admin
 
Posts: 11196
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: tvrenamer & hazel Thu Apr 16, 2015 11:36 am • by wolfkfe
ok thanks
the solution was:

/bin/sh
Code: Select all
/usr/local/bin/tvnamer --batch "$1" --config=/Users/repli/mytvnamerconfig.json --series-id=262414
wolfkfe
 
Posts: 2
Joined: Sat Apr 11, 2015 10:25 am


Return to Open Discussion