Hi @ecomaniac
I’m happy to share my method. It’s a bit complex to set up, but once you have it running it’s pretty much automatic.
Unfortunately this isn’t a free solution as both apps I’m using are paid products I bought for other projects. Maybe there are alternatives out there?
OK, so I’m using Hazel, BBEdit, and a custom AppleScript.
First, I manually rename the file with this pattern:
Artist - Title (Year).extension
For instance: Cazwell - Tonight (2009).mkv
Hazel watches whatever folder you tell it to and then does stuff based on rules you give it. The Hazel rule I made for the Music Videos folder follows below. (The bulleted words are tokens you make inside Hazel. I won’t explain that part as it’s explained on the Hazel site and it’s pretty straightforward.)
If all the following conditions are met for the current file or folder
Name matches •Artist - •Title (•Year)
Kind is not FolderDo the following to the matched files or folder:
Sort into subfolder with pattern •Artist - •Title (•Year)
Run AppleScript embedded script:
set Artist to item 1 of inputAttributes
set Title to item 2 of inputAttributes
set Year to item 3 of inputAttributes
set nfoFile to "/Volumes/Haunted Glen HD/Plex Media/Music Videos/" & Artist & " - " & Title & " (" & Year & ")/" & Artist & " - " & Title & " (" & Year & ").nfo"
tell application "System Events"
if exists file nfoFile then
else
tell application "BBEdit"
activate
make new document
set text of document 1 to "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<movie>
<title>" & Artist & ": " & Title & "</title>
<sorttitle>" & Artist & ": " & Title & "</sorttitle>
<originaltitle>" & Artist & ": " & Title & "</originaltitle>
<year>" & Year & "</year>
<releasedate>" & Year & "-07-15" & "</releasedate>
<tag>" & Artist & "</tag>
</movie>" as text
save document 1 to "/Volumes/Haunted Glen HD/Plex Media/Music Videos/" & Artist & " - " & Title & " (" & Year & ")/" & Artist & " - " & Title & " (" & Year & ").nfo"
quit
end tell
end if
end tell
So when I put “Cazwell - Tonight (2009).mkv” in the “Music Videos” folder, Hazel sees it, makes a folder called “Cazwell - Tonight (2009)”, adds the file in there, sees there’s no .nfo file, opens BBEdit and creates it, and saves it into the “Cazwell - Tonight (2009)” folder.
Since I am using using XBMCnfoMoviesImporter, the script also adds the artist as a “tag”, so when the music video is imported into Plex, it’s put into a collection named after the artist.
I usually don’t know the exact date, so the script just uses the year and (random date) July 15th in the .nfo file. If I do know the date, it’s easy enough to open the .nfo file and change it with a text editor.
You can also use an .nfo file manager like ViMediaManager to add more details like director, if you know them. It’s also handy to add genres, ratings, sort titles, etc.
Better yet, some music videos are already listed on IMDB and you can use ViMediaManager to download those details directly into the .nfo file.
(I didn’t script any of these extra details because I often don’t know them, and I just want a basic way to add the files to Plex. I can always add more details later.)
The only drawback is that Hazel needs to open BBEdit onscreen, so if you’re doing something else, it will steal the Mac’s focus while it creates the file. It’s super quick though, so after I add a file to the folder I just wait until the script is done.
I hope I explained that clearly enough. Feel free to ask questions if I left something out.