Support for Ubuntu and other Desktop Linux distributions
dr01dy
Posts: 13 Joined: 16 Mar 2015, 18:18
Post
by dr01dy » 24 Feb 2019, 17:57
Hey All,
Wondering if it's possible to add in dashes for year-month-day city name for when filebot works with music folders that are not your normal album. I tried messing around but can't seem to get it right. If It helps I am a licensed user to FIlebot
Here is an example
Show Name - Phish2019-02-14 Brooklyn, NY flac16
Current Situation
(Folder Structure)
Band Name ->
2019 02 14 Brooklyn, NY
Hopeful end goal
(Folder Structure)
Band Name ->
2019-02-14 Brooklyn, NY
Here is my script -
Code: Select all
#!/bin/bash
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"
TORRENT_PATH=$1
TORRENT_NAME=$2
TORRENT_LABEL=$3
# Subtitle language
SUBLANG=en
SKIP_EXTRACT=n
MUSIC=y
filebot -script /home/user/filebot/scripts/amc.groovy \
--output "$HOME/files" \
-non-strict --encoding utf8 --log all --log-file amc-rtorrent.log --action hardlink --conflict override \
--def artwork=false ut_kind=multi "ut_dir=$TORRENT_PATH" "ut_title=$TORRENT_NAME" \
--def "movieFormat=Movies/{n} ({y})/{n} {hd} {vc} {vf} ({y}){' CD'+pi}{'.'+lang}" \
--def "seriesFormat=TV Shows/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} -
{hd} - {vc} - {vf} - {t.replaceAll(/[\`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part \$1')}{'.'+lang}" \
subtitles=$SUBLANG \
extractFolder="$HOME/files/_extracted" music=$MUSIC skipExtract=$SKIP_EXTRACT &
Best,
Jeff
rednoah
The Source
Posts: 22986 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 25 Feb 2019, 07:20
1.
The amc script probably isn't your friend if you effectively want to do nothing, except replace a few spaces with dashes.
2.
e.g. replace all spaces that are between numbers with dash:
Code: Select all
$ filebot -rename *.flac --db file --format '{fn.replaceAll(/(?<=\d)\s(?=\d)/, /-/)}' --action test
Rename files using [Plain File]
[TEST] from [2019 02 14 Brooklyn, NY.flac] to [2019-02-14 Brooklyn, NY.flac]
Processed 1 files
https://regexr.com/
dr01dy
Posts: 13 Joined: 16 Mar 2015, 18:18
Post
by dr01dy » 25 Feb 2019, 21:11
Thanks for the quick response!
The files are fine it's just the folder name that needs the dashes
Thanks,
Jeff
rednoah
The Source
Posts: 22986 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 25 Feb 2019, 21:18
Same, applied to the entire file path:
Code: Select all
{f.path.replaceAll(/(?<=\d)\s(?=\d)/, /-/)}
dr01dy
Posts: 13 Joined: 16 Mar 2015, 18:18
Post
by dr01dy » 19 Aug 2021, 15:47
Can anyone help me with my command. It's making the folders with full path
Example Music\Band\Volumes\maggot_nas\try\Ablum
I was hoping it would just go to Volumes\maggot_nas\Music\Band\Album
Here is my command
filebot -script fn:amc /Volumes/maggot_nas/try --output /Volumes/maggot_nas/data/Music/ log-file amc.log --action copy -non-strict --def music=y musicFormat="/Volumes/maggot_nas/data/Music/{n}’{f.path.replaceAll(/(?<=\d)\s(?=\d)/, /-/)}"
rednoah
The Source
Posts: 22986 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 19 Aug 2021, 17:33
You'll want to adjust your format to generate the file path you want:
https://www.filebot.net/naming.html
You'll want to prototype your custom
Music Format in the GUI first with a few test files, before adding it into your command-line call in a second step: