Page 1 of 1
Including additions within a derive. Trailing chars missing on empty edition
Posted: 16 Jul 2024, 18:58
by ibcservices
Hello, love filbert. First question I am posting. I am trying to add extra data to the filenames so I can easily see their info. When I try to add the "edition" to the name, it works when a movie has a special edition. However, the problem that I am having is that when there is no edition value, a lot of my file name strings are missing from the output. I cannot figure out why. Could someone help me with my code please?
I have looked at many a forum and tried so many code variations, I am lost at this point.
Here is my code:
Groovy: Select all
_sortedmovies/{plex.derive{" {tmdb-$id} {${ (${tags.first()}}) ?: ‘{edition-${tags.first()}}’},$certification,$rating,$hours,$vf,$vcf,$vc,$acf,$resolution,$bitrate]}"}}
Thank you in advance!
Re: Including additions within a derive. Trailing chars missing on empty edition
Posted: 17 Jul 2024, 04:11
by rednoah
Learn how {expressions} work and useful Helper Functions will explain why you get no value when your top-level
{...} expression fails, e.g. due to undefined variables.

If you want to inject information into the
{plex} binding then you will want to do it like so to allow for one of
edition or
vf|vc|ac to be undefined:
rednoah wrote: ↑12 Sep 2016, 10:03
e.g.
Avatar (2009) {tmdb-19995}/Avatar (2009) {edition-Extended Edition} [720p, x264, AAC]
tags and
certification being undefined is common. Your format will want to account for that at the very least.
Re: Including additions within a derive. Trailing chars missing on empty edition
Posted: 17 Jul 2024, 07:51
by ibcservices
Thanks so much, Noah! Appreciate ya!! FIlebot rules.
Here is the code I ended up with for movies.
Groovy: Select all
/Volumes/plexmedia/Movies/{collection}/{ ~plex ** { " {edition-$edition}" } ** { " {tmdb-$id}" } % { " [${genres[0]}"} % {",$certification"} % {",$rating"} % {",$hours"} % {",$vf"} % {",$vcf"} % {",$vc"} % {",$acf"} % {",$resolution"} % {",$bitrate]"} }
As a beginner, I would ask if you have any advice that would save me time from learning more lessons the hard way? This is my 3rd time restructuring my files due to learning more about Plex naming standards.
Re: Including additions within a derive. Trailing chars missing on empty edition
Posted: 17 Jul 2024, 09:39
by rednoah
ibcservices wrote: ↑17 Jul 2024, 07:51
As a beginner, I would ask if you have any advice that would save me time from learning more lessons the hard way? This is my 3rd time restructuring my files due to learning more about Plex naming standards.
I'd
strictly stick to the
Plex Naming Scheme. I see you're adding a
{collection} folder. If the
Plex Naming Scheme specification does
not explicitly say that you can do that, then you
cannot do that.

The
{plex} format you will want to use is thus simply:
If you have the same movie in multiple editions / multiple video formats / etc then you can add information at the
end of the file path (not in the middle somewhere; i.e. not in the movie folder name) to ensure that each file has a unique file name.

You can of course always ignore the Plex standard a bit here or there, to name things more according to your own preferences, and it probably might work mostly. But do understand that when you stray
(ideally knowingly for a purpose; not unknowingly) from the path then you do create room for error.

Note that you can have the same files at multiple file paths without using additional disk space by using
hardlinks. You thus
can create a pristine structure for Plex
and and a completely different structure for yourself as needed. Please read
Re-process previously organized files using local xattr metadata.
Re: Including additions within a derive. Trailing chars missing on empty edition
Posted: 08 Sep 2024, 02:14
by ibcservices
Awesome. I will definitely look into this hardlink. Thanks for all the help with this. Loving filebot.