advanced sorting

Support for Windows users
Post Reply
Movieaholic
Posts: 20
Joined: 31 Jul 2017, 03:17

advanced sorting

Post by Movieaholic »

Hi i just got the amc script going to sort all movies, Tv Shows and music

Code: Select all

filebot -script fn:amc -non-strict "U:/Data/Done" --log-file c:/filebotlogs/amc_films.log --action copy --conflict skip --def plex=1.1.1.2 --def subtitles=n --def clean=y --def "movieFormat=S:/Movies/1080/{n} ({y})/{n} ({y})" --def "seriesFormat=S:/TV Shows/1080/{n}/{n} - {'Season '+s}/{n } - {s00e00}" --def music=y --def "musicFormat=S:/Music/{artist}/{artist} - {album}/{pi.pad(2)} - {t}" artwork=n
What i need help with is to change the naming of the music files to Artist-Title also sorting the movies into 3 catagories 3D,4K and the rest the same with tv shows into 4K and the rest.

Ive got this far by scouring forums cutting and pasting different pieces from different pages and a bit of investigation skills to sort out id3 tagging problem but im not sure where to put which arguments to sort out what i need
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: advanced sorting

Post by rednoah »

1.
--output is a required option and you don't what the default if you don't know what the default is. ;)


2.
The destination path is defined by your custom format. You can have your custom format generate different paths for different files depending on various attributes, such as video resolution or ID3 tags.

You'll want to prototype your custom format in the GUI:
Image
@see https://www.filebot.net/naming.html
:idea: Please read the FAQ and How to Request Help.
Movieaholic
Posts: 20
Joined: 31 Jul 2017, 03:17

Re: advanced sorting

Post by Movieaholic »

Got it sorted for the naming issue. How to i get it to sort 4k/3d media into different folders?
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: advanced sorting

Post by rednoah »

How can you tell which video is 4k and which video is in 3D? You may need to adjust your solution depending your files.

@see viewtopic.php?f=5&t=4191
@see viewtopic.php?f=5&t=4285
:idea: Please read the FAQ and How to Request Help.
Movieaholic
Posts: 20
Joined: 31 Jul 2017, 03:17

Re: advanced sorting

Post by Movieaholic »

yes thats what i was looking for, the files all have 3D or 4K in the title but ive noticed the odd movie get named 3D beacuse it was the 3rd in the series, Im a bit confused as to what im doing to be honest but i added the first one like this

Code: Select all

filebot -script fn:amc -non-strict "C:/Users/Administrator/Desktop/New" --log-file c:/filebotlogs/amc_films.log --action hardlink --def unsorted=y --conflict skip --def plex=1.1.1.2 --def subtitles=n --def clean=y --def "movieFormat=C:/Users/Administrator/Desktop/New/Sorted/ {n} ({y})/{n} ({y})""{fn=~ /3D/ ? '3D':'Movies'}" --def "seriesFormat=S:/TV Shows/1080/{n}/{'Season '+s}/{t} - {s00e00}" --def music=y --def "musicFormat=S:/Music/{artist}/{artist} - {album}/{artist} - {t}" artwork=n
but its only adding 3D to the end of the file name not putting in a totally different folder, have i put it in the right place?
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: advanced sorting

Post by rednoah »

The format your wrote works exactly as it should, because you just copy & pasted the example snipped at the end of your existing custom format.


:idea: I'm fairly sure that you didn't test your format in the GUI first. Do things in the right order, and it'll come together easily. ;)


1. Use the GUI Format Editor and test your format on some real files until it works perfectly
2. Copy and paste your format into a text file
3. Use the @file syntax for reading command-line arguments from external text files


Here's another more complete example:

Code: Select all

{fn =~ /3D/ ? '3D Movies' : 'Movies'}/{n} ({y}){fn =~ /3D/ ? ' [3D] [H-SBS]' : ''}/{n} ({y}) ({vf}){fn =~ /3D/ ? ' H-SBS' : ''}{' CD'+pi}
@see viewtopic.php?f=5&t=2
:idea: Please read the FAQ and How to Request Help.
Movieaholic
Posts: 20
Joined: 31 Jul 2017, 03:17

Re: advanced sorting

Post by Movieaholic »

awesome thanks for your help got it sorted with

Code: Select all

{fn =~ /3D/ ? '3D' : ''}{fn =~ /4K/ ? ' 4K' : ''}/{n} ({y}){fn =~ /4K/ ? ' 4K' : ''}{fn =~ /3D/ ? ' 3D' : ''}/{n} ({y}){fn =~ /3D/ ? ' 3D' : ''}{fn =~ /4K/ ? ' 4K' : ''}
Could it be done any better?
Last edited by Movieaholic on 03 Aug 2017, 09:25, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: advanced sorting

Post by rednoah »

I'd use something like this, but it's not exactly the same:

Code: Select all

{plex.derive{' ' + fn.match(/3D|4K/)}}
:idea: Please read the FAQ and How to Request Help.
Movieaholic
Posts: 20
Joined: 31 Jul 2017, 03:17

Re: advanced sorting

Post by Movieaholic »

Yeah found out it doesnt work quite how I wanted, it names the 4k folder Movies 4k i can sort of see how ive made it do that but im not sure how to write a 3 way arguement or even if thats what will make it work perfect, yours is better but i want it to be named

4K/Angel and Demons 4k/Angel and Demons 4k.mkv
3D/Angel and Demons 3D/Angel and Demons 3D.mkv
1080/Angel and Demons/Angel and Demons.mkv
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: advanced sorting

Post by rednoah »

Since the patterns repeat, the format will look repetitive as well.

For programmers, I'd recommend a more procedural approach with variables and conditionals in a single {...} block, but that'll be much harder to understand for non-programmers.

e.g.

Code: Select all

{
	any{
		// 3D and 4K videos
		def tag = fn.match(/3D|4K/)
		def nyt = ny + ' ' + tag
		tag/nyt/nyt
	}{
		// normal videos
		vf/ny/ny
	}
}
:idea: Please read the FAQ and How to Request Help.
Movieaholic
Posts: 20
Joined: 31 Jul 2017, 03:17

Re: advanced sorting

Post by Movieaholic »

thanks for your help even though i couldnt get the script perfect i made another one the will run automaticlly and fix up the first ones mistakes i have one last question is it possible to put each log file under a different name?
is it like

--log-file c:/filebotlogs/{'amc_films'+pi}.log
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: advanced sorting

Post by rednoah »

No, variables like pi wouldn't be known when starting FileBot. I would recommend using only 1 log file.

That'll also make sure that there's only one running instance of FileBot per log file since it's gonna be rw locked.
:idea: Please read the FAQ and How to Request Help.
Post Reply