I'm creating an Action to apply to newly recorded content that will become podcasts. I'm trying to make the Action as fully automatic and fool-proof as possible, so that files/directories can't be renamed in the wrong way, even if the Action is run multiple times.
Since posting my last thread I've decided on saving the timestamp to a tag, rather than relying on the File Creation Date, which can change.
Ideally what I'd like my Action to perform (dates based on saved tag, top date represents directory):
- 2012.05.31_John_Doe [original].flac
- 2012.05.31_John_Doe-2 [original].flac
What my Action already does: (will update when finished)
1. Initially the folder is named '_LatestRip' and the files ripped from the original recording CD are saved there (a FLAC and MP3 of each main recording, with generic 'No Artist' filenames/tags).
2. I first manually enter the Artist name for FLAC and MP3 tracks.
3. Running the Action clears the generic tags, then fills in some static tags like 'Album' and 'Genre', etc.
4. It then saves the File Creation Datetime timestamp to the 'ReleaseTime' tag, before reformatting it to the iTunes format (YYYY-MM-DDThh:mm:ssZ).
5. The Filename, Year, and Directory names are then created based on the 'ReleaseTime' tag.
6. Whitespaces are then converted to underscores, and Flac files have the suffix '[original]' appended to the end of their filename.
What I still need my Action to do:
1. The Action initially removes some existing generic tags, but when running the Action a second time on the same files I need the Action to keep the tags I've manually entered (like 'Title', 'Genre').
IE: If the field matches the exact string "Audio Track 1" then remove it, otherwise keep existing content.2. On some days there may be two seperate recordings by the same host, so I'm looking for a way to add a '-2' to the end of these, but leave the first file without the suffix (or at least when there is only one file by the same artist).
IE: If two or more files exist with the same date and the same Artist then add a '-2' (etc) to the most recent filename based on the datetime in the 'ReleaseTime' tag. This would be a per-Artist, per-date counter.
I've decided the above feature is not feasible for Mp3Tag to handle (yet), as it currently requires too many unnecessary steps to accomplish in an Action. See Post #9 for the simpler compromise.
3. The date section of the filename currently looks like '2012-05-31_Artist_Name.mp3', but ideally it should be with periods not dashes. This could be done by replacing all dashes with periods, except I want to use a dash for the suffix numbering (see above). 4. Lastly, I'm lookng for a way to name the directory after the earliest timestamp in the folder [no idea how to achieve this]. Also, currently the directory name is a little messed up, '2012.05.31T105546Z' and it should be '2012.05.31'.
My Action in full: (old code, will update when finished)
Action: Remove fields Fields to remove: Title;Album;Track;Genre;Year;Length Action: Format value Field: Album Format string: Example Album Name Action: Format value Field: Genre Format string: Podcast Action: Format value Field: Podcast Format string: 1 Action: Format value Field: Releasetime Format string: $if2(%releasetime%,%_file_create_datetime%) Action: Format value Field: Releasetime Format string: $ifgreater($strstr(%releasetime%,PM),0,$replace(%releasetime%, 1:,T13:, 2,T14, 3,T15, 4,T16, 5,T17, 6,T18, 7,T19, 8,T20, 9,T21, 10,T22, 11,T23, PM,Z, ,T),$replace(%releasetime%, 12,T00, AM,Z, ,T)) Action: Replace with Regular Expression Regular Expression: ^(\d\d?)\/(\d\d?)\/(\d\d\d\d)T(\d\d?) Replace matches with: $3-$num($1,2)-$num($2,2)T$num($4,2) Action: Format value Field: _Filename Format string: $left(%releasetime%,10) Action: Format value Field: Year Format string: $left(%releasetime%,4) Action: Format value Field: _Directory Format string: $regexp(%releasetime%,(\d\d\d\d)-(\d\d)-(\d\d),$1.$3.$2) Action: Format value Field: _Filename Format string: $if(%artist%,%_filename% %artist%,%_filename%) Action: Format value Field: _Filename Format string: $replace(%_filename%,' ',_) Action: Format value Field: Comment Format string: %podcastdesc%
Thanks to this superb forum I'm half the way there , and apologies for the rather lengthy post .