Renaming .lrc files with music?

Support for Windows users
Post Reply
winecountrymedia
Posts: 13
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: 13
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: 22998
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: 13
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: 13
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: 22998
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: 13
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: 22998
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: 13
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: 22998
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: 13
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: 22998
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: 22998
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: 13
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: 22998
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.
Post Reply