Apply tags to album folders based on the tracks within them?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

I'm a new Hazel user, so I'm still figuring out the nuances of this useful program. So far, I've made really simple rules like moving files to certain folders based on their source URL and so forth. I would like to organize my big music library folder by adding tags to album folders based on the tracks within them ("Music Library" folder > Album folders > Audio files).
  • If any of the audio tracks within the album folder contains "(Explicit)" in the file name, then add the "Explicit" tag to the album folder.
  • If any of the audio tracks within the album folder has 24-bit or higher bit depth OR 48.1kHz or higher sampling rate, then add the "Hi-Res" tag to the album folder.
Imagehttps://www.hifireport.com/what-is-high-resolution-audio/
I understand that I would also have to add "Continue matching rules" at the end of each rule since some albums may have both tags. May someone help me achieve this?
thaigrr
 
Posts: 3
Joined: Wed Apr 26, 2023 10:53 am

Look up nested conditions in the manual. Using those, you can set up subconditions that apply to the contents of a folder.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Look up nested conditions in the manual. Using those, you can set up subconditions that apply to the contents of a folder.


Thanks! For those curious to do the same:

If any of the following conditions are met
Name contains 24B
If all of the following conditions are met for any of its subfiles or subfolders
Sample rate is greater than 47999
Do the following to the matched file or folder:
Add tags Hi-Res
Continue matching rules


If all of the following conditions are met
Kind is Folder
If all of the following conditions are met for any of its subfiles or subfolders
Name contains (Explicit)
Do the following to the matched file or folder:
Add tags Explicit
Continue matching rules


Mr_Noodle, how would I create a rule that would automatically move all the files from my Music Library folder (that's in my laptop) to my Music Drive folder (that's in my portable external drive) whenever I connect my external drive to my laptop? I made this rule for my Music Library folder:

If all of the following conditions are met
Any file
Do the following to the matched file or folder:
Move to folder: Music Drive

The problem is that the rule seems not to run automatically every time I connect my portable external drive to my laptop. When I initially created this rule and had my portable external drive connected, it moved all my files. When I connected my external drive a few days later, new files that were in my laptop folder weren't automatically moved to my external drive folder. I had to manually run the rule. How can I fix this?
Last edited by thaigrr on Fri Apr 28, 2023 12:28 pm, edited 1 time in total.
thaigrr
 
Posts: 3
Joined: Wed Apr 26, 2023 10:53 am

Where are the files? Are they directly in the monitored folder or in subfolders? If so, did you read the chapter on going into subfolders?
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Where are the files? Are they directly in the monitored folder or in subfolders? If so, did you read the chapter on going into subfolders?


I connected my external drive again today, and the rule worked! I guess I just didn't allow enough time for Hazel to run the rule on its own.

I also made a new rule for those interested in a Multi-Disc tag (e.g. double albums):

If all of the following conditions are met
Kind is Folder
If all of the following conditions are met for any of its subfiles or subfolders
Subfolder depth is greater than 1
Do the following to the matched file or folder:
Add tags Multi-Disc
Continue matching rules
thaigrr
 
Posts: 3
Joined: Wed Apr 26, 2023 10:53 am


Return to Support