HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: timalina on 2024-04-21 22:40:41

Title: Tagging with an iterative loop e.g. tag automatically according to folder order
Post by: timalina on 2024-04-21 22:40:41
Is there any way to create an iterative loop for tagging? Specifically, I want to be able to create a playlist, set the discnumber tag to 1 for the first folder, 2 for the second, and so on.

I'm trying to sort out a large collection and was using Facets. I realised I could save a load of time if, when I've got albums sorted by folder path, if I could somehow transfer the index of the folders into discnumbers. I have lots of multi-disc albums without discnumber tags, but where the individual CDs are in subfolders in the correct order. I basically want to drop a multi-disc album on a playlist, and tag it so that all files in the first folder get tagged 1, the next folder +1, the next +1 and so on.

Is this even possible?
Title: Re: Tagging with an iterative loop e.g. tag automatically according to folder order
Post by: SimBun on 2024-04-22 07:56:02
I know Mp3Tag offers something similar - although I'm not sure it'd reset the disc number across albums - but assuming you have the directories named sensibly e.g. CD01/Disc 01, couldn't you just use something like:
Code: [Select]
$substr($directory(%path%,1),3,4)
Title: Re: Tagging with an iterative loop e.g. tag automatically according to folder order
Post by: ojdo on 2024-04-22 09:54:17
Assuming, your layout looks something like this: ...\Artist - Album\CD 2\9 - Title.ext

You can extract the disc number for all tracks of all albums (just pull them into a playlist) by

1. opening the Properties dialog
2. select Tools > Automatically Fill Values
3. select Source "Other...", to the right enter $directory(%path%,1) (which extracts the name of the parent directory, e.g. "CD 2", from the full file path)
4. in line Pattern, enter CD %discnumber%
5. verify the preview, Ok; Done.
Title: Re: Tagging with an iterative loop e.g. tag automatically according to folder order
Post by: timalina on 2024-04-23 14:55:53
I know Mp3Tag offers something similar - although I'm not sure it'd reset the disc number across albums - but assuming you have the directories named sensibly e.g. CD01/Disc 01, couldn't you just use something like:
Code: [Select]
$substr($directory(%path%,1),3,4)
Assuming, your layout looks something like this: ...\Artist - Album\CD 2\9 - Title.ext

You can extract the disc number for all tracks of all albums (just pull them into a playlist) by

1. opening the Properties dialog
2. select Tools > Automatically Fill Values
3. select Source "Other...", to the right enter $directory(%path%,1) (which extracts the name of the parent directory, e.g. "CD 2", from the full file path)
4. in line Pattern, enter CD %discnumber%
5. verify the preview, Ok; Done.

Thanks, but I've got thousands of folders without a consistent structure, so parsing strings would be laborious.

Also, I'm wanting to edit the album tags as I go (to removed 'CD 1'-type suffixes and make the album tags identical, so manual tagging would be quicker than parsing.

Really, I'd want something that works in a similar way to the 'Auto track number' function, but for Discnumbers.
Title: Re: Tagging with an iterative loop e.g. tag automatically according to folder order
Post by: SimBun on 2024-04-23 16:38:27
Thanks, but I've got thousands of folders without a consistent structure, so parsing strings would be laborious.

Also, I'm wanting to edit the album tags as I go (to removed 'CD 1'-type suffixes and make the album tags identical, so manual tagging would be quicker than parsing.

Really, I'd want something that works in a similar way to the 'Auto track number' function, but for Discnumbers.
You could do it with foo_sqlite (https://www.foobar2000.org/components/view/foo_sqlite), but if you're just doing one album at a time it's probably just as easy to do it with Masstagger scripts and keyboard shortcuts e.g. one script to set discnumber to 1 (Ctrl+1), one to set discnumber to 2 (Ctrl+2) e.t.c., and do it from the playlist window.

I don't use the Properties panel for editing but given there's an 'Auto track number' I'm surprised there's not an equivalent for discnumber.
Title: Re: Tagging with an iterative loop e.g. tag automatically according to folder order
Post by: timalina on 2024-04-24 14:33:05
I want to avoid doing it one disc at a time if possible as I'll be doing other editing as albums (consolidating the Album tags and removing the 'CD1'-type suffixes), because some sets contain quite a lot of CDs (with volumes containing sub-volumes), and because the scope for errors will be greater.

I've never used foo_sqlite or Masstagger, but I'll look into them. Even if it's not the solution I'm looking for, perhaps I'll find a better way once I work them out.
Thanks, but I've got thousands of folders without a consistent structure, so parsing strings would be laborious.

Also, I'm wanting to edit the album tags as I go (to removed 'CD 1'-type suffixes and make the album tags identical, so manual tagging would be quicker than parsing.

Really, I'd want something that works in a similar way to the 'Auto track number' function, but for Discnumbers.
You could do it with foo_sqlite (https://www.foobar2000.org/components/view/foo_sqlite), but if you're just doing one album at a time it's probably just as easy to do it with Masstagger scripts and keyboard shortcuts e.g. one script to set discnumber to 1 (Ctrl+1), one to set discnumber to 2 (Ctrl+2) e.t.c., and do it from the playlist window.

I don't use the Properties panel for editing but given there's an 'Auto track number' I'm surprised there's not an equivalent for discnumber.