[AMC] Custom File Struture for Audio files
[AMC] Custom File Struture for Audio files
I have just setup Filebot on my Synology NAS.
I have automated it so that every night it will change the names of the files I place in a particular directory. It them renames them and puts the movies in the movie forder etc.
What I want to do is make the audiobooks go into a audiobook folder not the music folder. All the audiobooks have the extension .m4b.
Can this be done?
Thanks
I have automated it so that every night it will change the names of the files I place in a particular directory. It them renames them and puts the movies in the movie forder etc.
What I want to do is make the audiobooks go into a audiobook folder not the music folder. All the audiobooks have the extension .m4b.
Can this be done?
Thanks
Re: Synology Node File Struture
Yes, but I'm not sure if FileBot Node (i.e. amc script) is the way to go. Perhaps a custom --def musicFormat will do if things are already working and you just want to customize the destination file structure.
In general, Plain File Mode might be more suitable for processing audio files and generating file paths based MediaInfo properties.
In general, Plain File Mode might be more suitable for processing audio files and generating file paths based MediaInfo properties.
Re: [AMC] Custom File Struture for Audio files
Maybe I am not that technical. I was hoping for a straightforward solution for making my filebot node on my Synology to send audiobooks into a audiobook folder and music into the music folder automatically every night.
Re: [AMC] Custom File Struture for Audio files
That would require a custom music format that generates audiobook file paths for some audio files and music file paths for other audio files. Notably, you'd need to express in code how to tell apart audiobook files and music files.

Code: Select all
Music/{n}/{album+'/'}{pi.pad(2)+'. '}{artist} - {t}

Code: Select all
{ minutes >= 20 ? 'AudioBooks' : 'Music' }/{n}/{album+'/'}{pi.pad(2)+'. '}{artist} - {t}
Re: [AMC] Custom File Struture for Audio files
This code does not seem to work all the time. For some reason I am having to take out hundreds of books out of the music folder. Is there a way to look for the file extension .m4b instead of a file that is longer than 20min?
Thanks
G
Code: Select all
{ minutes >= 20 ? 'AudioBooks' : 'Music' }/{n}/{album+'/'}{pi.pad(2)+'. '}{artist} - {t}
G
Re: [AMC] Custom File Struture for Audio files
I have tried this bit it does not seem to work.
Code: Select all
{ ext >= m4b ? 'AudioBooks' : 'Music' }/{n}/{album+'/'}{pi.pad(2)+'. '}{artist} - {t}
Re: [AMC] Custom File Struture for Audio files
Learn how works:
https://groovy-lang.org/operators.html
try in GUI
make m4b a string value in order to compare
but >= makes no sense so
e.g. ext = 'm4b' or ext = 'mp3'
https://groovy-lang.org/operators.html
Code: Select all
>= greater than or equal
Code: Select all
{ ext >= m4b }
Code: Select all
groovy.lang.MissingPropertyException: No such property: m4b for class
Code: Select all
{ ext >= 'm4b' }
Code: Select all
{ ext == 'm4b' ? 'AudioBooks' : 'Music' }
Re: [AMC] Custom File Struture for Audio files
So the code works great now. It will now identify the audiobooks with the extension with m4b and put them in the correct folder. But now I have two TV Shows in there and it fails every time. Is this something that I did with adding this code? If I use Filebot on my PC it will identify and rename the files but Filebot Node seems to fail. The two files are Fear.the.Walking.Dead.S07E02.Six.Hours.720p.REPACK.AMZN.WEB-DL.DDP5.1.H.264-NTb & insecure.s05e01.720p.web.h264-ggwp
This is the error when it fails.
This is the error when it fails.
Code: Select all
Run script [dev:amc] at [Wed Oct 27 09:21:42 PDT 2021]
Parameter: music = y
Parameter: subtitles = eng
Parameter: clean = y
Parameter: skipExtract = y
Parameter: musicFormat = { ext == 'm4b' ? 'AudioBooks' : 'Music' }/{n}/{album+'/'}{pi.pad(2)+'. '}{artist} - {t}
Parameter: excludeList = .excludes
Argument[0]: /volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks
Use excludes: /volume1/Media/.excludes (2)
Ignore hidden: /volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks/.DS_Store
No files selected for processing
Done ¯\_(ツ)_/¯
Re: [AMC] Custom File Struture for Audio files
Are the files in the input folder you have specified?
Are the files not on the exclude list you have specified?
Code: Select all
Argument[0]: /volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks
Code: Select all
Use excludes: /volume1/Media/.excludes (2)
Re: [AMC] Custom File Struture for Audio files
Yes the files are in the directory.

No I don't think it would be. Where is the list? These file have been changed recently.

No I don't think it would be. Where is the list? These file have been changed recently.
Re: [AMC] Custom File Struture for Audio files
looks like you used this on the files before:
use this to only rename/move audio files:
Code: Select all
{ minutes >= 20 ? 'AudioBooks' : 'Music' }/{n}/{album+'/'}{pi.pad(2)+'. '}{artist} - {t}
Code: Select all
{ f.isAudio() ? allOf{ ext == 'm4b' ? 'AudioBooks' : 'Music' }{'/' + n + '/'}{album + '/'}{pi.pad(2) + '. '}{artist}{' - ' + t}.join() : fn }
Re: [AMC] Custom File Struture for Audio files
The file is where it says it is in the log. Note that the leading . in the file name means that it's possibly a hidden file.
Re: [AMC] Custom File Struture for Audio files
That seems to have fixed the issues except the one TV show it just ignores. insecure.s05e01.720p.web.h264-ggwp.mkv
Any idea?
Thanks
Any idea?
Thanks
Code: Select all
Run script [dev:amc] at [Thu Oct 28 11:24:19 PDT 2021]
Parameter: music = y
Parameter: subtitles = eng
Parameter: clean = y
Parameter: skipExtract = y
Parameter: musicFormat = { f.isAudio() ? allOf{ ext == 'm4b' ? 'AudioBooks' : 'Music' }{'/' + n + '/'}{album + '/'}{pi.pad(2) + '. '}{artist}{' - ' + t}.join() : fn }
Parameter: excludeList = .excludes
Argument[0]: /volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks
Use excludes: /volume1/Media/.excludes (1)
Ignore hidden: /volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks/.DS_Store
Input: /volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks/Lee Child - Better off Dead.m4b
Group: {Music=/volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks} => [Lee Child - Better off Dead.m4b]
Rename music using [ID3 Tags]
[MOVE] from [/volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks/Lee Child - Better off Dead.m4b] to [/volume1/Media/AudioBooks/Lee Child/Better off Dead/01. Lee Child - Better off Dead.m4b]
[REFRESH] Refresh File Services (/volume1/Media/AudioBooks/Lee Child/Better off Dead)
[REFRESH] Refresh File Services (/volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks)
Processed 1 file
Clean clutter files and empty folders
Keep /volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks/insecure.s05e01.720p.web.h264-ggwp.mkv (not clutter)
Keep /volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks (root folder)
Done ヾ(@⌒ー⌒@)ノ
------------------------------------------
[Process completed]
Re: [AMC] Custom File Struture for Audio files
The file you mentioned doesn't seem to exist:
If there's no Input: ...line for that file in the log, then it's not part of the Input file set, either because it's not there, or because it's on the exclude list, and I'm not aware of any other possible explanations:
Code: Select all
Argument[0]: /volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks
Use excludes: /volume1/Media/.excludes (1)
Ignore hidden: /volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks/.DS_Store
Input: /volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks/Lee Child - Better off Dead.m4b
Code: Select all
Input: ...
Re: [AMC] Custom File Struture for Audio files
So the file is there. As you can see in the image a bunch of files were put in the audiobook folder but again the TV show and one audiobook were left behind. They say (not clutter) and I am unsure what this refers to.


Re: [AMC] Custom File Struture for Audio files
You're using --def clean=y to delete left-behind files; luckily there's a sanity check that prevents this file from being deleted:
I have no idea why the file isn't consider as input, but there are only so many conditions, and most of them print some kind of reason, so it has to be one of the conditions that don't print anything:
https://github.com/filebot/scripts/blob ... roovy#L199
I don't see what you see, but there's still 1 line in the exclude list, and 1 file that's mysteriously ignored, so maybe you can try not using an exclude list at all for the sake of testing to confirm or eliminate that as a reason?
Note that the exclude list contains file paths, but FileBot will then exclude all files by file id, i.e. all hardlinks of the given file path.
Code: Select all
Clean clutter files and empty folders
Keep /volume1/Media/FileBotIn/Erins-imac.local/Users/estrench/Desktop/Audiobooks/insecure.s05e01.720p.web.h264-ggwp.mkv (not clutter)
I have no idea why the file isn't consider as input, but there are only so many conditions, and most of them print some kind of reason, so it has to be one of the conditions that don't print anything:
https://github.com/filebot/scripts/blob ... roovy#L199

Code: Select all
Use excludes: /volume1/Media/.excludes (1)
