Empty CD folder (When use format)

Running FileBot from the console, Groovy scripting, shell scripts, etc
User avatar
rednoah
The Source
Posts: 22999
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Empty CD folder (When use format)

Post by rednoah »

Yes, {n} is {albumArtist} if {albumArtist} is defined, and otherwise default to {artist} if {albumArtist} is undefined.


:idea: {n} seems to be based on the {artist} in your case:

Properties: Select all

Composer                   : Arash Pournouri / Tim Bergling / Nile Rodgers / Avicii
** if you get different results on different machines, then you might be using different versions of libmediainfo on different machines that yield different results


:?: Which property would you like to use?

Properties: Select all

Performer                  : Peter Dyer (keys, talkbox);Audra Mae (vocals);Sterling Fox (vocals)
Composer                   : Arash Pournouri / Tim Bergling / Nile Rodgers / Avicii
ARTISTSORT                 : Avicii
ARTISTS                    : Avicii
ALBUMARTISTSORT            : Avicii
ARTISTS_SORT               : Avicii
Album/Composer             : Avicii

:idea: You could probably add a condition to do different things for different files and access the appropriate media info property directly:

Format: Select all

{ media.'Album/Composer' ?: media.'Composer' }
It'll work at least for the previously posted files:

Properties: Select all

Composer                   : Cat Stevens
Album/Composer             : Eric Clapton & Friends
Album/Composer             : Avicii
:idea: Please read the FAQ and How to Request Help.
yellowdaemon
Posts: 32
Joined: 07 Jan 2021, 16:09

Re: Empty CD folder (When use format)

Post by yellowdaemon »

@ Rednoah

I did a test with some more albums and as I stated I think that the script worked just fine. On some rare occasions, it creates separate folders for albums with multiple artists. I haven't found out what is the trigger for that. As I said a couple of weeks ago, I use a tool called Picard MusicBrainz and it messed up my albums. I am trying to find out what media information the script is used to create all the separate folders, and if there is a way to change that media info. Maybe I can fix it with a tool called MediaMonkey. If I run the Filebot script 99% of my albums have the desired results. only 1% messed up, so I will not change the script for that.
yellowdaemon
Posts: 32
Joined: 07 Jan 2021, 16:09

Re: Empty CD folder (When use format)

Post by yellowdaemon »

Which property would you like to use?
Albumartist is fine If i have an Album from Avicii it must show Avicci as the Albumartist or artist, even if there are other artist that sang different songs on the album.

How i exactly want it you can find here under

M:/TEST/Various Artists/[2023] - The Best Golden Oldies Album In The World...Ever!/81 - The Righteous Brothers - Unchained Melody

Above you have the album artist which is Various Artists
That is followed by a subdirectory called {2023] - The Best Golden Oldies Album In The World...Ever!
The subdirectory consists of the release year and Album name/title
Because there is no CD section you have the track number on the next subdirectory followed by the performer and track name.

What i mean by the performer is the person/group that is the singer of that track, and not the person who wrote that track.
For example, you can have an Album called Thriller by Michael Jackson but on that same Album track 10 is performed by Usher.
You will start with Michael Jackson first as the Album Artist but on track 10 you will see something like this /10 - Usher - bla bla bla

You could probably add a condition to do different things for different files and access the appropriate media info property directly:

Where does this fit in the script?
User avatar
rednoah
The Source
Posts: 22999
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Empty CD folder (When use format)

Post by rednoah »

yellowdaemon wrote: 25 Jul 2023, 07:19 M:/TEST/Various Artists/[2023] - The Best Golden Oldies Album In The World...Ever!/81 - The Righteous Brothers - Unchained Melody
This file path does not match any of the previously posted media info? "This is what I want" must match one of the media info tables you have previously posted, because all FileBot does is "take information from the file, and generate a file path" and so that is the mindset we must put ourselves into when prototyping a format expression.

But let's say we're working with a file like this:

Properties: Select all

Title                      : Father And Son (Remastered 2020)
Album                      : The Best Golden Oldies Album In The World...Ever!
Album/Performer            : Various Artists
Track                      : Father And Son (Remastered 2020)
Track/Position             : 1
Track/Position_Total       : 102
Performer                  : Cat Stevens
Composer                   : Cat Stevens
Recorded_Date              : 2023-06-09

Code: Select all

M:/TEST/Various Artists/[2023] - The Best Golden Oldies Album In The World...Ever!/102 - Cat Stevens - Father And Son (Remastered 2020)
{n} = Various Artists because:

Properties: Select all

Album/Performer            : Various Artists
{y} = 2023 because:

Properties: Select all

Recorded_Date              : 2023-06-09
{album} = The Best Golden Oldies Album In The World...Ever! because:

Properties: Select all

Album                      : The Best Golden Oldies Album In The World...Ever!
{pi} = 102 because:

Properties: Select all

Track/Position_Total       : 102
{artist} = Cat Stevens because:

Properties: Select all

Performer                  : Cat Stevens
:idea: If {artist} is not what you want, then you can use media.'Composer' instead, which may or may not yield a different value depending on the file at hand:

Properties: Select all

Composer                   : Cat Stevens
{t} = Father And Son (Remastered 2020) because:

Properties: Select all

Track                      : Father And Son (Remastered 2020)

:idea: If something works differently, then you'll want to follow these steps. Check the media info table. Check the values. FileBot uses these values. It's really really very simple. The complexity stems from different files using different media info properties, some missing, some not missing, some having long values you don't want, and that's where adding conditions in the code comes in, i.e. do different things for different files depending on the available information.



yellowdaemon wrote: 25 Jul 2023, 07:19 Where does this fit in the script?
{ media.'Album/Composer' ?: media.'Composer' } will give you Album/Composer if defined and Composer otherwise, exactly what it says in the media info table that you already know how to check. If you believe that files have misleading media info, then you know how to check for that too. You can put this piece of code wherever you want "Album/Composer if defined and Composer otherwise" to appear in the file path. I believe you have the skills to do this by yourself at this point. Just give it a try. Play with it. It's not magic. It's just replacing variables with values. It'll make sense. You can and will understand it if you give it a try.


:idea: Album/Composer means that you will probably want to use this snippet at the album folder level in your format:

Format: Select all

{ media.'Album/Composer' ?: media.'Composer' }

Properties: Select all

Album/Performer            : Various Artists
:idea: Since we have now learned "A, or B if A is undefined" we can now re-apply the same knowledge to your "I prefer the composer in the file name over the performer" use case and add this bit where your format generates the file name:

Format: Select all

{ media.'Composer' ?: media.'Performer' }

Properties: Select all

Performer                  : Cat Stevens
Composer                   : Cat Stevens
:idea: Please read the FAQ and How to Request Help.
yellowdaemon
Posts: 32
Joined: 07 Jan 2021, 16:09

Re: Empty CD folder (When use format)

Post by yellowdaemon »

I adjusted the script and i tested it with a Various Artists' album, Michael Jackson discography, U2 album, and Avicii.

With this script below i get the best results.

Format: Select all

M:/TEST/
{ media.'Album/Performer' ?: media.'Artists' }/
[{y}] - {album}/ {album} - { if (music.medium && music.mediumCount > 1) "CD$music.medium/" }
{pi.pad(2)} - { media.'Performer' ?: media.'Artists' } - {t}

You will never get want you want for every album cause it depends on the media info provided. I am looking for a tool to edit the media info.
yellowdaemon
Posts: 32
Joined: 07 Jan 2021, 16:09

Re: Empty CD folder (When use format)

Post by yellowdaemon »

Since we have now learned "A, or B if A is undefined" we can now re-apply the same knowledge to your "I prefer the composer in the file name over the performer" use case and add this bit where your format generates the file

Yes, it did that. I play with it a little bit to see what the results would be.

If you use composer, it might work in some cases when it is only one person, but composer can be also a group of persons, that's why I got so many names in the example I posted before.
I checked different media info and found out that is better to use the performer option if you want to show the person that sings the song.
And for the first line it is better to use Album/Performer or if not define media artists in my case. That gave me the best results

I might find an album later which gives me different results, but so be it. I cannot keep adjusting my script for every album.
yellowdaemon
Posts: 32
Joined: 07 Jan 2021, 16:09

Re: Empty CD folder (When use format)

Post by yellowdaemon »

I don't know if I need to open a new topic but i asked this question before. In the naming Edit Format you can do a Binding as one of the options, but what are the bindings for? What can i do with Bindings?
What also want to know is, if Filebot is selecting some metadata from MusicBrainz or does it take over all the metadata that is available.
The reason for my question is that for one particular album, i check the Album Artist on MusicBrainz and it was filled in correctly, but when i load the same album on Filebot, it couldn't provide information about the Album Artist. I check the Media info file on Filebot and there was no information on Album Artist
Last question, is it possible to add or edit metadata in Filebot?
User avatar
rednoah
The Source
Posts: 22999
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Empty CD folder (When use format)

Post by rednoah »

If you select AcoustID, then top-level bindings like {n} {artist} {album} etc will be based on AcoustID / MusicBrainz information. If you select ID3 Tags then that information is based solely on ID3 tags embedded in the file itself.


:idea: The Inspect toggle allows you to see the match information you're working with:
Screenshot



:idea: The {media} binding is notably unrelated to match information, and will just make the raw MediaInfo table for any given file directly accessible to you.


:!: FileBot cannot modify files and therefore cannot write / modify ID3 tags.
:idea: Please read the FAQ and How to Request Help.
yellowdaemon
Posts: 32
Joined: 07 Jan 2021, 16:09

Re: Empty CD folder (When use format)

Post by yellowdaemon »

@ rednoah
I don't use acoustic ID. It produces a lot of garbage sometimes.
I only use ID3 tags.

Are you working with a different version of Filebot, cause i didn't find the option to change to dark mode in my version of Filebot. I like the dark mode to be honest.
User avatar
rednoah
The Source
Posts: 22999
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Empty CD folder (When use format)

Post by rednoah »

1.
If you use ID3 Tags then the information that FileBot uses to generate file names is 100% based on the MediaInfo table.

:arrow: If you believe this to not be the case, feel free to share MediaInfo table / format / generated file path, and we'll have a look. You can also share the file itself instead of the MediaInfo table.



2.
You can enable Dark Mode in your Windows settings for all your applications. Alternatively, you can enable Dark Mode for FileBot specifically via a custom configuration file.
:idea: Please read the FAQ and How to Request Help.
yellowdaemon
Posts: 32
Joined: 07 Jan 2021, 16:09

Re: Empty CD folder (When use format)

Post by yellowdaemon »

@ Rednoah

I will the next time. I found it strange that i could see the correct media info Album Artist on MusicBrainz, but in Filebot it was empty. There was no info about the Album Artists. I thought I made a mistake so i load the album again in MusicBrainz and it showed me the Album Artists. i corrected it because you told me how to do it by including the defined options in my script, which said basically that if Album Artist is not defined, then to look for Album/Performer or Albumsort. The problem with Albumsort is that is start with a last name followed by a first name. i edit that in MusicBrainz. For now, it works but if i ran into this again, i will post a PrintScreen for you to see, what i mean.
User avatar
rednoah
The Source
Posts: 22999
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Empty CD folder (When use format)

Post by rednoah »

yellowdaemon wrote: 01 Aug 2023, 09:45 For now, it works but if i ran into this again, i will post a PrintScreen for you to see, what i mean.
It's much easier to stick to text. You can press F7 to copy file name and match information. You already know how to copy & paste the MediaInfo table.
:idea: Please read the FAQ and How to Request Help.
yellowdaemon
Posts: 32
Joined: 07 Jan 2021, 16:09

Re: Empty CD folder (When use format)

Post by yellowdaemon »

The dark mode is nice, except when you want to highlight some text. It is difficult to see the highlighted text.
If i said edit format and want to highlight some text in my naming script i can barely see the highlighted text.

I choose flat dark. That is slightly better with highlighted text than Darcula
User avatar
rednoah
The Source
Posts: 22999
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Empty CD folder (When use format)

Post by rednoah »

Thanks for reporting.

The grey-text-on-grey-background issue should be fixed with the upcoming release sometime this month:
viewtopic.php?t=13783
:idea: Please read the FAQ and How to Request Help.
Post Reply