Fully Automated - moving files to existing library

Running FileBot from the console, Groovy scripting, shell scripts, etc
User avatar
slugxl
Donor
Posts: 50
Joined: 21 Jan 2013, 20:11

Re: Fully Automated - moving files to existing library

Post by slugxl »

Right then. Thank you.
User avatar
slugxl
Donor
Posts: 50
Joined: 21 Jan 2013, 20:11

Re: Fully Automated - moving files to existing library

Post by slugxl »

I know you said the rest is easy script but in this case for you...

So the current pushover syntax is this:

Code: Select all

Pushover(pushover).send("Finished processing ${tryQuietly { ut_title } ?: input*.dir.name.unique()} (${getRenameLog().size()} files).")
Should the new code be this?

Code: Select all

def m = getRenameLog().values().name.join(', ')
Pushover(pushover).send("Finished processing ${tryQuietly { ut_title } ?: m")
I know people like me probably annoy the crap out of you but honestly I find the syntax of this code to be very different for me. I understand m holds the value but i do not understand should the m be before or after the ". So will you please let me know if the line I pasted is correct?

BTW - I would test but I am at work atm. I can work on this tonight.

Thanks,
slug.

Also you seemed really happy about the last donation. You happy with the second? I'm still in the double digits :)
User avatar
slugxl
Donor
Posts: 50
Joined: 21 Jan 2013, 20:11

Re: Fully Automated - moving files to existing library

Post by slugxl »

Hey, I just want to share something with you. I've been in your shoes. I spent years writing program for 'subcommuntites' like this. My programs were mostly for the Media Center community, and most specifically the Media Browser community. I wrote a lot of programs. People would say 'I need this or I need that' and I would write programs to do it. In the years that I did this, and had 10+ programs available I probably got 5 donations. I would write a custom program at someone's request - but no donation. The last program I wrote was actually pretty in depth. It performed batch xml editing and was very versitale. What pissed me off is the people using it would not give me any feedback. As I was writing it I was begging for feedback. Does this work for you as you need? How is it going? Any issues? Not a word. But they were downloading it and using it. And, not one donation. So I didn't finish it. I did the movies part and did some of the tv part, but then I stopped. Then I baled. I just left the community and I don't go back. I've popped on a few times and I have all of these messages queued up. 'Make me this program' or 'help me with something'. I don't respond. I'm done. If they won't even give me feedback on this massive program that I need feedback on, forget it.

So, I've donated something liked 26 USD to you. Why? Because you've made an excellent program and you offer excellent support. Again, I've been in your shoes and I am not going to use you like everyone used me. You deserve it. And I hope others read this message and come off a few bucks for you. People don't understand the time that goes into this. Not only the coding and modifications, but all the time you spend answering questions and helping people. I say to the community, this man deserves money if you are going to use his work.

Now regarding the code. I can write .Net. But I stare at this groovy script and I just don't get some of the syntax. I get some of what is going on, but I don't get it all. So I apologize for being so lame at writing for myself. I've turned to you for the help. You created it, you support it, I want to use it but I don't have the time to learn java and groovy. So if I ask stupid questions, or simple questions, I apologize.

I really like what you have created, and your support is top notch. Great work and I say again to the community, this person deserves money if you are going to use his work. Because he has worked hard.

Thanks,
slug.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated - moving files to existing library

Post by rednoah »

No worries, you seemed like you know what you're doing. Groovy is just Java on steroids, and Java is pretty much the same as .NET except of course the APIs.

When I write code from my phone I'll keep it simple. If I'm back home I write code you can just copy and paste. :P

PS: Except for a missing } you already had it. ;)

Since we don't wanna use ut_title anyway here. Just paste that anywhere after files have been renamed:

Code: Select all

def m = getRenameLog().values().name.join(', ')
println "Finished processing ${m}"
Pushover(pushover).send("Finished processing ${m}")
PS2: fyi I appreciate anybody that doesn't need me to escape his double-quotes. haha ;)
:idea: Please read the FAQ and How to Request Help.
User avatar
slugxl
Donor
Posts: 50
Joined: 21 Jan 2013, 20:11

Re: Fully Automated - moving files to existing library

Post by slugxl »

Cool. Thanks for the help. It will be nice to finally have this up and running. slug.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated - moving files to existing library

Post by rednoah »

Ok so I tried including this in the default utorrent-postprocess but I didn't like it, it's just too much clutter. So I won't include that by default.

Here's what I came up with anyway, you can make your mod with that:

Code: Select all

if (pushover) {
	// include webservice utility
	include('fn:lib/ws')
	
	println('Sending Pushover notification')
	def msg = "Finished processing ${tryQuietly { ut_title } ?: input*.dir.name.unique()} (${getRenameLog().size()} files)."
	msg += "\n\nNew Files:\n"
	getRenameLog().values().nameWithoutExtension.each{
		if (!msg.endsWith('...')) {
			if (msg.length() + it.length() < 500) {
				msg += "* ${it}\n"
			} else {
				msg += '...'
			}
		}
	}
	println msg
	println Pushover(pushover).send(msg)
}
:idea: Please read the FAQ and How to Request Help.
User avatar
slugxl
Donor
Posts: 50
Joined: 21 Jan 2013, 20:11

Re: Fully Automated - moving files to existing library

Post by slugxl »

Excellent. Thank you very much.

Hey I did have a question. I've noticed you have put up new HEAD releases since the last time I downloaded one. Do you document anywhere what the changes are in the different releases? I'm not sure if I should just automatically grab the latest whenever I see it.

Thanks again for the code and I understand why you may not want to include it in the general script. It is ok, I am obviously using my own offline version.

Thanks,
slug.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated - moving files to existing library

Post by rednoah »

Unless you're having certain issues no need to update. I'll push a proper releases every month anyway if there's been important changes.

Here's the SVN commit log:
https://sourceforge.net/p/filebot/code/commit_browser
:idea: Please read the FAQ and How to Request Help.
User avatar
slugxl
Donor
Posts: 50
Joined: 21 Jan 2013, 20:11

Re: Fully Automated - moving files to existing library

Post by slugxl »

Thank you.
User avatar
slugxl
Donor
Posts: 50
Joined: 21 Jan 2013, 20:11

Re: Fully Automated - moving files to existing library

Post by slugxl »

Need help please. I modified my groovy script with your code. Then I reinstated filebot (I had stopped using it until things got finished up). So then I downloaded a movie just to test it out.

Here is my utorrent run command:

Code: Select all

E:\uTorrent\invoke.vbs FileBot -script "E:/uTorrent/aj.groovy" "E:/uTorrent/Complete/" --output "E:/uTorrent/UnRar" --action copy --conflict skip -non-strict --def subtitles=n artwork=n "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S"
Here is the log from utorrent that triggered the command:

Code: Select all

[2013-01-30 15:21:20]  Moving files from 'E:\uTorrent\Downloading\The.Cold.Light.of.Day.2012.720p.BluRay.x264.DTS-HDChina' to 'E:\uTorrent\Complete\The.Cold.Light.of.Day.2012.720p.BluRay.x264.DTS-HDChina'
[2013-01-30 15:21:20]  Executing: E:\uTorrent\invoke.vbs FileBot -script "E:/uTorrent/aj.groovy" "E:/uTorrent/Complete/" --output "E:/uTorrent/UnRar" --action copy --conflict skip -non-strict --def subtitles=n artwork=n "ut_dir=E:\uTorrent\Complete\The.Cold.Light.of.Day.2012.720p.BluRay.x264.DTS-HDChina" "ut_file=The.Cold.Light.of.Day.2012.720p.BluRay.x264.DTS-HDChina.mkv" "ut_kind=multi" "ut_title=The.Cold.Light.of.Day.2012.720p.BluRay.x264.DTS-HDChina" "ut_label=" "ut_state=5"
Here's the problem. It did more than process that movie. It went through everything in my complete folder (this is the folder where completed downloads go, and where I seed from)

I had already taken care of everything in there. There is like 30 folders, most with rars inside. The command did things like - I had a 3 volume collection of dubstep downloaded. I had already processed these, organized them using musicbrainz picard, and put them in my music directory. Well they got processed, and it turned each song into an album.

Also some movies were re-extracted and turned into stuff that I don't know what it is. For example, I now have a movie called 'riff raff' but I did not download that and I am going to have to figure otu what movie it actually is. I did the same to another movie. Now, some of the movies it appears nothing happened to, as if the code saw I already had it setup so it stopped.

Bottom line is - what did I do wrong? I only want this to process what is downloaded, not comb through everything I have and process it. Especially things like the dubstep collection. That's a mess on my music directory although it will be easy to clean up.

Maybe I misunderstood how this works, or I've set it up wrong. Either way, can you help me so that when the utorrent command line gets triggered it only process the download and not everything I have?

thanks,
slug.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated - moving files to existing library

Post by rednoah »

You're adding cmdline arguments thus telling the utorrent-script that it's in standalone mode:

Code: Select all

-script "E:/uTorrent/aj.groovy" "E:/uTorrent/Complete/"
Do not pass in anything but filebot options or --def script options. It's getting all input from there.


You can check/revert original names via this script:
http://filebot.sourceforge.net/forums/v ... &t=5#p2485

e.g.

Code: Select all

filebot -script fn:revert E:/uTorrent/UnRar --action test
:idea: Please read the FAQ and How to Request Help.
User avatar
slugxl
Donor
Posts: 50
Joined: 21 Jan 2013, 20:11

Re: Fully Automated - moving files to existing library

Post by slugxl »

so essentially drop the complete dir arg? otherwise ok?

thanks.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated - moving files to existing library

Post by rednoah »

yep, that should work
:idea: Please read the FAQ and How to Request Help.
User avatar
slugxl
Donor
Posts: 50
Joined: 21 Jan 2013, 20:11

Re: Fully Automated - moving files to existing library

Post by slugxl »

When do you sleep? hehe.
User avatar
slugxl
Donor
Posts: 50
Joined: 21 Jan 2013, 20:11

Re: Fully Automated - moving files to existing library

Post by slugxl »

Hey man,
Sorry about the oversight on my command line. I had been doing so much command line testing that I just used what i had worked out and didn't think about the change that needed to be made.

I have a curiosity question for you. Previously I had asked about how the extractions were taking place in my download 'complete' folder. You responded that is normal, they extract there and then are copied to the specified location. The question is why not just extract to the destination rather than extract and then copy? I would imagine you have a reason why it is done this way, but I just wondered if you extract to the destination then you don't have to also do a copy.

I'm sure you are busy so if you care not to respond that's fine.

slug.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated - moving files to existing library

Post by rednoah »

Because I know where the files are. I can't know where your format will want to put the files. And I only know that until I process the files. ;)

Modding extract(..., output:'/temp', ...) and it'll put them there. If you know where best to extract files you can just make it so. ;)
:idea: Please read the FAQ and How to Request Help.
User avatar
slugxl
Donor
Posts: 50
Joined: 21 Jan 2013, 20:11

Re: Fully Automated - moving files to existing library

Post by slugxl »

Ok thank you.
Post Reply