Use collection if possible, otherwise default to movie name

All about user-defined episode / movie / file name format expressions
Post Reply
sevenalive
Posts: 3
Joined: 22 Oct 2014, 06:50

Use collection if possible, otherwise default to movie name

Post by sevenalive »

I'm using this as my movie format (forgot where I got it from, probably github).

Code: Select all

E:\Movies\{collection.replaceFirst(/^(?i)(The)\s(.+)/, /$2, $1/).replaceFirst(/^(?i)(Collection of the)\s(.+)/, /$2 Collection/).replaceAll(/Saga Collection/, "Saga").replaceAll(/[`´‘’ʻ""“”]/, "'").replaceAll(/[:|]/, " - ").replaceAll(/[?]/, "!").replaceAll(/[*\s]+/, " ")}\{norm = {it.upperInitial().lowerTrail().replaceTrailingBrackets().replaceAll(/[`´‘’ʻ""“”]/, "'").replaceAll(/[:|]/, " - ").replaceAll(/[?]/, "!").replaceAll(/[*\s]+/, " ").replaceAll(/\b[IiVvXx]+\b/, { it.upper() }).replaceAll(/\b[0-9](?i:th|nd|rd)\b/, { it.lower() }).replaceFirst(/^(?i)(The)\s(.+)/, /$2, $1/)}; norm(n)}{if (norm(n) != norm(primaryTitle)) ' ('+norm(primaryTitle)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""} ({y})/{norm(n)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'}{" Part $pi"} ({y}){" [$vf $vc $ac $af]"}

I been trying to figure out how I can keep the collection folder but not put the movie files in another folder. I don't want the movies in their own folder. I do like the collection folder though.

Currently it's:
Movies\collection name\movie name\movie name.mkv
Movies\movie name\movie name.mkv

I want:
Movies\collection name\movie.mkv
Movies\NoCollection.mkv
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Need help with movies and collections

Post by rednoah »

Use collection if possible, default to movie name:

Code: Select all

{any{collection}{n}}
:idea: Please read the FAQ and How to Request Help.
chocorem
Posts: 31
Joined: 21 Feb 2015, 18:31

Re: Use collection if possible, otherwise default to movie name

Post by chocorem »

is this

Code: Select all

{any{collection}{n}}
only to put in the movieformat ?

I tried to get

if a collection exist
/Movies/collection Name/movie1.mkv
/Movies/collection Name/movie2.mkv

if no collection
/Movies/movie.mkv

by putting

Code: Select all

{any{collection}{n}}
in movieformat option, I get

if collection
/collection Name1.mkv

if no collection
/Movie.mkv

so if collection, it is not generating the movie and put in the folder but only taking the colletion name as the movie name
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Use collection if possible, otherwise default to movie name

Post by rednoah »

You probably want something like this:

Code: Select all

{any{collection/ny}{ny}}
:idea: Please read the FAQ and How to Request Help.
chocorem
Posts: 31
Joined: 21 Feb 2015, 18:31

Re: Use collection if possible, otherwise default to movie name

Post by chocorem »

putting this inside

Code: Select all

filebot -script fn:amc --output "$CONFIG_OUTPUT" --action move --conflict override -non-strict --log-file /var/log/filebot/amc-jdown.log --def movieFormat="Movies/{any{collection/ny}{ny}}" --def music=y artwork=y ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL"
does not give any movie name at all ...

Code: Select all

Rename movies using [TheMovieDB]
Auto-detect movie from context: [/mnt/raid0/medias/download/jd/xxxxxx.2.2016.FRENCH.BDRip.XViD-FUNKKY.zone-telechargement.com.avi]
[MOVE] Rename [/mnt/raid0/medias/download/jd/xxxxxx.2.2016.FRENCH.BDRip.XViD-FUNKKY.zone-telechargement.com.avi] to [/raid/medias/videos/Movies/.avi]
chocorem
Posts: 31
Joined: 21 Feb 2015, 18:31

Re: Use collection if possible, otherwise default to movie name

Post by chocorem »

I was under 4.6 version, update to 4.7.2 solved the issue !
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Use collection if possible, otherwise default to movie name

Post by rednoah »

The {ny} binding is fairly new, so in older versions it won't work.
:idea: Please read the FAQ and How to Request Help.
chocorem
Posts: 31
Joined: 21 Feb 2015, 18:31

Re: Use collection if possible, otherwise default to movie name

Post by chocorem »

I'm trying to enhance my way of soring the movies

I actually have this movies format

Code: Select all

Blablabla/Blablabla (2016).mkv

Code: Select all

--def movieFormat="Movies/{any{localize.French.collection/localize.French.name/localize.French.name}{localize.French.name/localize.French.name}} ({y})"
I would like in case of no Collection, to have the Movie Year in Front of the Folder

Code: Select all

(2016) Blablabla/Blablabla (2016).mkv
Adding ({y}) didn't work (probably because of the any test) ?
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Use collection if possible, otherwise default to movie name

Post by rednoah »

Read this: viewtopic.php?f=5&t=1895

e.g.

Code: Select all

{any{collection}{"($y) $n"}}/{ny}
:idea: Please read the FAQ and How to Request Help.
Post Reply