Renaming .lrc files with music?

Support for Windows users
Post Reply
winecountrymedia
Posts: 22
Joined: 06 Sep 2023, 04:22

Renaming .lrc files with music?

Post by winecountrymedia »

Hey guys,

I have been downloading music FLAC which rename fine but I also have lrc files or "lyric" files with the music and filebot refuses to name them. How can I fix this?

Im using this with ID3 tags

Format: Select all

{n}/{album+'/'}{n} - {pi.pad(2)+' - '} {t}
winecountrymedia
Posts: 22
Joined: 06 Sep 2023, 04:22

Re: Renaming .lrc files with music?

Post by winecountrymedia »

also to add to this. When the artist sings a song with another artist its put in a separate folder.

Like this
Michael Jackson
Michael Jackson,Janet Jackson

How can I make sure ONLY the main artist is named?
User avatar
rednoah
The Source
Posts: 23389
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming .lrc files with music?

Post by rednoah »

1.
What are *.lrc files? Text files? Binary files? Do they contain ID3 tags?

:!: Music Mode currently does not currently support Type 1 Companion Files. If you can provide sample files / sample file paths then we could look into adding support .flac + .lrc file pairs in the future.


EDIT: FileBot r10009 adds support for Type 1 Companion Files in Music Mode.




2.
FileBot will name and organize files exactly as specified by your format. If your format generates unexpected file paths, then I'd start by checking what values {n} and {album} give you?

:arrow: Please share the media info table for your test file. Please read How do I share MediaInfo properties? for details.
:idea: Please read the FAQ and How to Request Help.
winecountrymedia
Posts: 22
Joined: 06 Sep 2023, 04:22

Re: Renaming .lrc files with music?

Post by winecountrymedia »

I believe they are text files as I can open and read them in notepad++
The MediaInfo did not work for me with the .lrc files
I included a screenshot and an lrc file

https://www.dropbox.com/scl/fo/1btvtp9w ... lka96&dl=0
winecountrymedia
Posts: 22
Joined: 06 Sep 2023, 04:22

Re: Renaming .lrc files with music?

Post by winecountrymedia »

I figured out the mediainfo and added them to the folder I linked above.
User avatar
rednoah
The Source
Posts: 23389
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming .lrc files with music?

Post by rednoah »

1.
winecountrymedia wrote: 06 Sep 2023, 23:47 I believe they are text files as I can open and read them in notepad++
The MediaInfo did not work for me with the .lrc files
:idea: Since the *.lrc file itself does not have ID3 Tags, it won't work. FileBot r10009 (i.e. the latest revision as of 2023-09-06) adds support for processing *.lrc by using the ID3 Tags from the corresponding same-name-same-folder *.flac media file.


EDIT: A custom post-processing script could be created with the current stable release and have custom code move / copy along *.lrc files.





2.
:idea: Your *.flac file has the following ID3 Tags:

Properties: Select all

Title                      : Bad - 2012 Remaster
Album                      : Bad (Remastered)
Track/Position             : 1/11
Performer                  : Michael Jackson
Your format:

Format: Select all

{n}/{album+'/'}{n} - {pi.pad(2)+' - '} {t}
will thus generate the following file path:

Code: Select all

Michael Jackson/Bad (Remastered)/Michael Jackson - 01 - Bad - 2012 Remaster
based on the ID3 Tags above.



winecountrymedia wrote: 06 Sep 2023, 04:31 also to add to this. When the artist sings a song with another artist its put in a separate folder.

Like this
Michael Jackson
Michael Jackson,Janet Jackson

How can I make sure ONLY the main artist is named?
:!: The sample file above notably cannot possibly generate Michael Jackson,Janet Jackson. Are you sure that you get Michael Jackson,Janet Jackson in the target file path with this particular sample file?

:arrow: Please provide the media info table for a file where you don't get the expected file name.
:idea: Please read the FAQ and How to Request Help.
winecountrymedia
Posts: 22
Joined: 06 Sep 2023, 04:22

Re: Renaming .lrc files with music?

Post by winecountrymedia »

No I was just giving an example. Like this one shows
"Tim McGraw,Big & Rich" as the main artist folder.

How do I set it to only use the main artist in the artist folder, and only add the secondary in the FLAC file title itself?

Properties: Select all

# MediaInfoLib - v22.12

[General]
Count                      : 332
StreamCount                : 1
StreamKind                 : General
StreamKind/String          : General
StreamKindID               : 0
AudioCount                 : 1
Audio_Format_List          : FLAC
Audio_Format_WithHint_List : FLAC
Audio_Codec_List           : FLAC
CompleteName               : E:\My Media\Music - All\Spotify\Tim McGraw,Big & Rich\Damn Country Music\10_California.flac
FolderName                 : E:\My Media\Music - All\Spotify\Tim McGraw,Big & Rich\Damn Country Music
FileNameExtension          : 10_California.flac
FileName                   : 10_California
FileExtension              : flac
Format                     : FLAC
Format/String              : FLAC
Format/Info                : Free Lossless Audio Codec
Format/Url                 : https://xiph.org/flac/
Format/Extensions          : fla flac
Format_Commercial          : FLAC
InternetMediaType          : audio/x-flac
FileSize                   : 43384667
FileSize/String            : 41.4 MiB
FileSize/String1           : 41 MiB
FileSize/String2           : 41 MiB
FileSize/String3           : 41.4 MiB
FileSize/String4           : 41.37 MiB
Duration                   : 205752
Duration/String            : 3 min 25 s
Duration/String1           : 3 min 25 s 752 ms
Duration/String2           : 3 min 25 s
Duration/String3           : 00:03:25.752
Duration/String5           : 00:03:25.752
OverallBitRate_Mode        : VBR
OverallBitRate_Mode/String : Variable
OverallBitRate             : 1686872
OverallBitRate/String      : 1 687 kb/s
StreamSize                 : 0
StreamSize/String          : 0.00 Byte (0%)
StreamSize/String1         :  Byte0
StreamSize/String2         : 0.0 Byte
StreamSize/String3         : 0.00 Byte
StreamSize/String4         : 0.000 Byte
StreamSize/String5         : 0.00 Byte (0%)
StreamSize_Proportion      : 0.00000
Title                      : California
Album                      : Damn Country Music
Part                       : 1/1
Track                      : California
Track/Position             : 10/11
Performer                  : Tim McGraw,Big & Rich
Description                : https://open.spotify.com/track/4uJQs0ITK9Mc7vnTp9W3pi
Recorded_Date              : 2015-01-01
File_Created_Date          : UTC 2023-09-08 06:14:33.000
File_Created_Date_Local    : 2023-09-07 23:14:33.000
File_Modified_Date         : UTC 2023-09-08 06:14:33.000
File_Modified_Date_Local   : 2023-09-07 23:14:33.000
Encoded_Application        : Lavf60.3.100
Encoded_Application/String : Lavf60.3.100
Copyright                  : © 2015 McGraw Music, LLC under exclusive license to Big Machine Label Group, LLC
Cover                      : Yes
Cover_Mime                 : image/png
show                       : Damn Country Music

[Audio]
Count                    : 286
StreamCount              : 1
StreamKind               : Audio
StreamKind/String        : Audio
StreamKindID             : 0
Format                   : FLAC
Format/String            : FLAC
Format/Info              : Free Lossless Audio Codec
Format/Url               : https://xiph.org/flac/
Format_Commercial        : FLAC
InternetMediaType        : audio/x-flac
Duration                 : 205752
Duration/String          : 3 min 25 s
Duration/String1         : 3 min 25 s 752 ms
Duration/String2         : 3 min 25 s
Duration/String3         : 00:03:25.752
Duration/String5         : 00:03:25.752
BitRate_Mode             : VBR
BitRate_Mode/String      : Variable
BitRate                  : 1665426
BitRate/String           : 1 665 kb/s
Channel(s)               : 2
Channel(s)/String        : 2 channels
ChannelPositions         : Front: L R
ChannelPositions/String2 : 2/0/0
ChannelLayout            : L R
SamplingRate             : 44100
SamplingRate/String      : 44.1 kHz
SamplingCount            : 9073663
BitDepth                 : 24
BitDepth/String          : 24 bits
Compression_Mode         : Lossless
Compression_Mode/String  : Lossless
StreamSize               : 42833098
StreamSize/String        : 40.8 MiB (99%)
StreamSize/String1       : 41 MiB
StreamSize/String2       : 41 MiB
StreamSize/String3       : 40.8 MiB
StreamSize/String4       : 40.85 MiB
StreamSize/String5       : 40.8 MiB (99%)
StreamSize_Proportion    : 0.98729
Encoded_Library          : Lavf60.3.100
Encoded_Library/String   : Lavf60.3.100
MD5_Unencoded            : BB0CD6DB6E76E168679C54CA127B3A21
User avatar
rednoah
The Source
Posts: 23389
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming .lrc files with music?

Post by rednoah »

:idea: {n} will give you the Performer value verbatim:

Properties: Select all

Performer                  : Tim McGraw,Big & Rich

:arrow: You can work with that value, and extract the bits & pieces you want with custom code:

e.g. split and take first:

Format: Select all

{ n.split(',').first().trim() }

Code: Select all

Tim McGraw
e.g. split and take last:

Format: Select all

{ n.split(',').last().trim() }

Code: Select all

Big & Rich
** The code above considers additional corner cases that you will likely encounter with some of your files: (A) more than 2 performers and (B) additional space characters before / after the performer name.



:!: That said, you may want to consider fixing the FLAC tags at the source instead, i.e. set the appropriate artist, album artist, composer, performer, etc tags first, and then format file paths based on that.
:idea: Please read the FAQ and How to Request Help.
winecountrymedia
Posts: 22
Joined: 06 Sep 2023, 04:22

Re: Renaming .lrc files with music?

Post by winecountrymedia »

That did exactly what I wanted. Thank you! The main folder has just the first artist. Another question. I would like the song title to be the first artist followed song title followed by (Featuring second third etc)

so for the song above for example something like this

Tim McGraw/Damn Country Music/Tim McGraw - 10 - California (Featuring Big & Rich)

How can I accomplish this? Thank you so much for your help!
User avatar
rednoah
The Source
Posts: 23389
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming .lrc files with music?

Post by rednoah »

e.g. split by comma, skip the first value, join values (if any) with the given prefix / postfix / delimiter:

Format: Select all

{ n.tokenize(',').tail().joining(' and ', '(Featuring ', ')') }
:idea: Please read the FAQ and How to Request Help.
winecountrymedia
Posts: 22
Joined: 06 Sep 2023, 04:22

Re: Renaming .lrc files with music?

Post by winecountrymedia »

Wait Im confused so to accomplish "Tim McGraw/Damn Country Music/Tim McGraw - 10 - California (Featuring Big & Rich)"

I would add this?

Format: Select all

{ n.split(',').first().trim() }/{album+'/'}{ n.split(',').first().trim() }- {pi.pad(2)+' - '} {t} { n.tokenize(',').tail().joining(' and ', '(Featuring ', ')') }
I truly appreciate your help
User avatar
rednoah
The Source
Posts: 23389
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming .lrc files with music?

Post by rednoah »

:?: What does the Format Editor say when you try?

Screenshot Screenshot
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 23389
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming .lrc files with music?

Post by rednoah »

You'll want to (1) Load files (2) Match files with Music Mode: ID3 Tags (3) Double-Click the New Names item you want to work with and click Edit Format to (4) open the Format Editor in Music Mode with the selected music file as sample file for testing.
:idea: Please read the FAQ and How to Request Help.
winecountrymedia
Posts: 22
Joined: 06 Sep 2023, 04:22

Re: Renaming .lrc files with music?

Post by winecountrymedia »

last questions I SWEAR lol. Thank you for all your help.

I want to add the disk only if there is one. Im getting either disc in every file or nothing I want it to be like

If a disk exists -
"Tim McGraw/Damn Country Music/CD 01/Tim McGraw - 10 - California (Featuring additional artist after first)"

If not
"Tim McGraw/Damn Country Music/Tim McGraw - 10 - California (Featuring additional artist after first)"
User avatar
rednoah
The Source
Posts: 23389
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming .lrc files with music?

Post by rednoah »

:?: What is the format you're currently using?

:idea: The format you have posted post recently does not generate CD1/2 folders. You seem to have added some code to add that and then not shared your format back here.
:idea: Please read the FAQ and How to Request Help.
winecountrymedia
Posts: 22
Joined: 06 Sep 2023, 04:22

Re: Renaming .lrc files with music?

Post by winecountrymedia »

Hey me again Rednoah,

So I have a new program that I download my music with. It names my files like this

Scotty McCreery - Clear As Day (2011) - 01 - Out Of Summertime.flac

I really like it. How can I setup filebot to do this so I can match all my existing music.

I would like Scotty McCreery (main artist if there are multiple)/Clear As Day (2011)/Scotty McCreery - Clear As Day (2011) - 01 - Out Of Summertime.flac

I truly appreciate you and your program.Thanks again.
User avatar
rednoah
The Source
Posts: 23389
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming .lrc files with music?

Post by rednoah »

:?: What have you tried so far?


:?: Where are you stuck? (make sure to include the MediaInfo properties of the problematic sample file at hand)


:arrow: Presumably, you just need to arrange the available variables in the order that you need to generate the file paths that you want:

Format: Select all

{artist}/{album}/{artist} - {album} - {pi} - {t}
:idea: Please read the FAQ and How to Request Help.
winecountrymedia
Posts: 22
Joined: 06 Sep 2023, 04:22

Re: Renaming .lrc files with music?

Post by winecountrymedia »

I got it ALMOST perfect. This is what I'm getting from this

Format: Select all

{ n.split(',').first().trim() }\{album} ({y})\{artist} - {album} ({y}) - {pi} - {t}

Code: Select all

Brad Paisley\5th Gear (2007)\Brad Paisley, Carrie Underwood - 5th Gear (2007) - 10 - Oh Love (feat. Carrie Underwood).flac
Since it already has "featuring" Carrie Underwood I don't need it also in the track title I'd prefer it be

Brad Paisley - 5th Gear (2007) - 10 - Oh Love (feat. Carrie Underwood).flac



Additionally same album I get the tracks as single digits how do I do 01,02,03 etc

Code: Select all

Brad Paisley - 5th Gear (2007) - 1 - All I Wanted Was a Car.flac
User avatar
rednoah
The Source
Posts: 23389
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming .lrc files with music?

Post by rednoah »

winecountrymedia wrote: 23 Sep 2024, 00:04 Additionally same album I get the tracks as single digits how do I do 01,02,03 etc
Let your past self be your teacher:
winecountrymedia wrote: 06 Sep 2023, 04:26

Format: Select all

{n}/{album+'/'}{n} - {pi.pad(2)+' - '} {t}

winecountrymedia wrote: 23 Sep 2024, 00:04 I got it ALMOST perfect. This is what I'm getting from this

Format: Select all

{ n.split(',').first().trim() }\{album} ({y})\{artist} - {album} ({y}) - {pi} - {t}

Code: Select all

Brad Paisley\5th Gear (2007)\Brad Paisley, Carrie Underwood - 5th Gear (2007) - 10 - Oh Love (feat. Carrie Underwood).flac
Since it already has "featuring" Carrie Underwood I don't need it
You can check if {t} contains some given text (e.g. artist name) and then transform the value of {artist} accordingly:

Groovy: Select all

artist.split(', ').findAll{ !t.contains(it) }.join(', ')


:arrow: So putting it all together:

Format: Select all

{n.before(', ')}/
{album} ({y})/
{artist.split(', ').findAll{ !t.contains(it) }.join(', ')} - {album} ({y}) - {pi.pad(2)} - {t}




EDIT:

Alternatively, you can remove (feat. XYZ) patterns from the {t} value:

Groovy: Select all

t.removeAll(/ \(feat\. (.+?)\)/)
Same as the above, with additional logic to check if {artist} contains (feat. XYZ) to remove / not remove depending on the file at hand:

Groovy: Select all

t.replaceAll(/ \(feat\. (.+?)\)/){ m, f -> artist.contains(f) ? '' : m }
:idea: Please read the FAQ and How to Request Help.
winecountrymedia
Posts: 22
Joined: 06 Sep 2023, 04:22

Re: Renaming .lrc files with music?

Post by winecountrymedia »

You are my hero!!!!! I need to write this down and put it in every place I can find to back it up.

Format: Select all

{ n.split(',').first().trim() }\{album} ({y})\{artist.split(', ').findAll{ !t.contains(it) }.join(', ')} - {album} ({y}) - {pi.pad(2)} - {t}
Writing this for future me that forgets and comes across this again LOL

This gives me this

Code: Select all

Brad Paisley\5th Gear (2007)\Brad Paisley - 5th Gear (2007) - 10 - Oh Love (feat. Carrie Underwood).flac
EXACTLY what I wanted! Thank you so much!

Can I make a donation for all your help?
User avatar
rednoah
The Source
Posts: 23389
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming .lrc files with music?

Post by rednoah »

winecountrymedia wrote: 23 Sep 2024, 04:54 Can I make a donation for all your help?
If you must, you can always recommend FileBot to a friend, or purchase an extra FileBot license for a friend. Not many people use FileBot for music content, so extra marketing in that corner of the internet would be appreciated.
:idea: Please read the FAQ and How to Request Help.
winecountrymedia
Posts: 22
Joined: 06 Sep 2023, 04:22

Re: Renaming .lrc files with music?

Post by winecountrymedia »

I will do that now. I'm sure someone else will appreciate it. I am back sadly it worked on a few artists and now I'm having the issue again. :( Any suggestions to use just the first artist? Like disable anything after & or feat? Thanks again I appreciate your continued help I wish I was as smart as you. There should be some sort of tool on the web to put in your preffered setup and it gives you the correct code. I guess that would be you ;)

https://www.dropbox.com/scl/fi/n9z1ffad ... x9t4g&dl=0
User avatar
rednoah
The Source
Posts: 23389
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming .lrc files with music?

Post by rednoah »

winecountrymedia wrote: 27 Sep 2024, 12:26 There should be some sort of tool on the web to put in your preffered setup and it gives you the correct code.
The problem is that you yourself don't know what you want, until you see that the thing you previously wanted isn't actually what you wanted, as is naturally the case when we find one corner cases after another and fine-tune the code bit by bit as we go along.


e.g. pick A from "A, B" or "A & B" or "A feat. B"

Format: Select all

{ n.split(/[,&]|feat[.]/).first().trim() }
** conceptually same as the above, we just expanded the regex pattern to account for all the potential artist name delimiters
:idea: Please read the FAQ and How to Request Help.
Post Reply