Author Topic: MB rewrites my date/time tags - Need help creating a tag to convert them back  (Read 6774 times)

sleepless

  • Sr. Member
  • ****
  • Posts: 287
I'm asking for some help here because I suck at this. The MB date/time standard appears to be mm/dd/yyyy hh:mm AM(or PM). I need some help to convert that to the standard yyyy-mm-ddThh:mm:ssZ . So, my date tag that looks like this: 2016-03-25T17:52:00Z is automatically re-written by MB to display this: 3/25/2016 12:52 PM.

-Is it possible that MB is somehow determining my time zone? Why else would it not convert the time to 5:52 PM? I don't remember entering this info at any point. I'm at GMT-6 but use a VPN so that might be the cause?
 
-I would also like to create a second tag which cuts out the time display (yyyy-mm-dd), but I think I can handle that if I can get some help with the full conversion. Also if the full date/time conversion is too complex, I could be satisfied with just the date.

-Unfortunately MB automatically re-writes all of these tags. I can generally avoid this as long as I don't ever save any changes in the tag editor, but I seem to forget often enough and it really sucks when it happens (adding cover art to a single podcast can result in hundreds of my files being rewritten). So besides the display purpose, it'd be nice to have this script to convert the tags back when this happens. Also, I use the yyy-mm-dd template for naming/organizing my podcast files so I can't use MB's naming template until I have this figured.

 Anyway, I have no idea where to even begin with this, so your help here would be very much appreciated.

EDIT: I should also add that another part of the reason I need to keep this format for the date/time tags is because I still need to use itunes for podcasts. Itunes does not read tags in the MB format and will not organize them
Last Edit: March 29, 2016, 11:23:20 AM by sleepless

theta_wave

  • Sr. Member
  • ****
  • Posts: 680
Look into Advanced Search and Replace and try playing with the preset "Split '<Tag 1>' to tags '<Tags2>','<Tags3>'"

I guess the delimiter here would be 'T'.

If it produces a satisfactory result, then place a checkmark next to it and it will automatically split tags in the same manner whenever you import your podcasts.

Use one of the combine tags presets (they allow you to bring back 'T') whenever you find that MB edits the date after using its tag editor.

sleepless

  • Sr. Member
  • ****
  • Posts: 287
Thanks for the reply. I assume you're referring to the Additional Tagging Tools plugin, which I have now installed. However I'm a bit confused by your advice.

-The date/time tag that I was referring to is Episode Date. Is this what I would select as <tag 1>? I can't seem to find that tag in the dropdown list.
-What fields do I select for <tag 2> and <tag 3>?

I'm new to this so I'm sorry but I need some more detailed instructions. Thanks.

boroda

  • Sr. Member
  • ****
  • Posts: 4595
i've asked Steven to add podcast specific tags (eg 'episode date') to mb api, but he didn't responded. i think he is very busy now with mb3 gui improvements.

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
Yeah, I'm waiting for them too :)
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

sleepless

  • Sr. Member
  • ****
  • Posts: 287
I tried creating a virtual tag: $Date(<Episode Date>,yyyy-MM-ddThh-mm-ssZ), but MB automatically changes the minutes from mm to MM, which makes the minutes read as months. Is there a reason MB won't accept the lower-case mm's?

theta_wave

  • Sr. Member
  • ****
  • Posts: 680
Hmmm, I didn't know that those MB's API didn't expose those tags (thanks for the info boroda74). 

But yeah, for future reference, the general idea for splitting the tag is as follows: <Tag 1> the tag you want to split; <Tag2>New tag incorporating the left half of the split; <Tag3> New tag incorporating the right half of the split; <Custom Text 1> the character used as the delimiter

For example: 2016-03-25T17:52:00Z

Set <Tag1> as <Episode Date>, <Tag2> as a custom tag and <Tag3> as another different custom tag and put "T" (without quotes) into the <Custom Text 1> field.

The result should be <Tag2> = 2016-03-25 and <Tag3> = 17:52:00Z

Of course, this could be all moot if MB processes <Episode Date> when splitting this tag.

sleepless

  • Sr. Member
  • ****
  • Posts: 287
Yeah , I already created a virtual tag: $Split(<Episode Date>," ",1). But that just split the already processed date. So 2016-01-12T00:00:00Z reads as 01/12/2016.

sleepless

  • Sr. Member
  • ****
  • Posts: 287
Is there any way to have MB write the episode date tag as the virtual tag: $Date(<Episode Date>,yyyy-MM-ddThh-mm-ssZ)?

theta_wave

  • Sr. Member
  • ****
  • Posts: 680
I tried creating a virtual tag: $Date(<Episode Date>,yyyy-MM-ddThh-mm-ssZ), but MB automatically changes the minutes from mm to MM, which makes the minutes read as months. Is there a reason MB won't accept the lower-case mm's?
From my experience with $Date, you have to format your date field as Year/Month/Day first and then have it spit out what you want.  For example, you have to parse your <Episode Date> field to conform to the YYYY/MM/DD format (see my post: http://getmusicbee.com/forum/index.php?topic=17302.0).  In that post, I had to chop up <Year> (e.g. 1999) and <DateCustom> (e.g. 10, 10.00 or 10.01) to represent YYYY/MM/DD to format it into what I wanted with $Date hence all of the $left and $right functions reading those fields.

I don't have experience with including hours, minutes and seconds, but I would imagine it would be YYYY/MM/DD/hh/mm/ss.  Thus, you have to parse "2016-03-25T17:52:00Z" into "2016/03/25/17/52/00"

Your virtual tag should look like the following: $Date(YYYY/MM/DD/hh/mm/ss,YYYY"-"MM"-"DD"T"hh"-"mm"-"ss"Z")

Then again, I don't know if MB will process your time information when doing this, which would make all of this in the end meaningless.

More info on $Date: http://musicbee.wikia.com/wiki/Functions
Last Edit: March 31, 2016, 12:27:21 AM by ssri

sleepless

  • Sr. Member
  • ****
  • Posts: 287
That's strange because with the VT I created above, everything works perfectly except for the minutes:

2016-01-28T15:26:59Z ---> 01/28/2016 9:26 AM (auto process by MB)
01/28/2016 9:26 AM    ---> 2016-01-28T09-01-00Z (VT- $Date(<Episode Date>,yyyy-MM-ddThh-mm-ssZ)

So the only problems are that:

-the minutes mm(26) becomes the month MM(01)
-the hours read incorrect, but this is due to the first MB conversion process

EDIT: Again, I'm really not too concerned with the time. My main concern here is converting the episode date back to  yyyy-mm-dd
Last Edit: March 31, 2016, 01:53:26 AM by sleepless

redwing

  • Guest
MB displays date format following your Windows short date format. You must have it configured in MM-dd-yyyy format. Change the Windows setting and reboot your machine.

Yet iTunes follows ISO 8601 format (yyyy-MM-dd) regardless of the user's date setting. That's why I posted this wish a while ago: http://getmusicbee.com/forum/index.php?topic=14252.0

For converting the existing episode date, try this: $Date(<Episode Date>,u)
If that works, then you can use "Copy tag" command (replace episode date with the virtual tag) from the Additional Tagging Tools plugin.

sleepless

  • Sr. Member
  • ****
  • Posts: 287
For converting the existing episode date, try this: $Date(<Episode Date>,u)
Thanks redwing. That worked like a charm! That converts to yyyy-MM-dd hh:mm:ssZ, which means only the "T" between the date and time is missing (yyyy-MM-ddThh:mm:ssZ). I don't think that will be a problem.

If that works, then you can use "Copy tag" command (replace episode date with the virtual tag) from the Additional Tagging Tools plugin.
The problem with  the tagging tool is that for some reason <episode date> is not in the dropdown list. Is there a work-around for this?

boroda

  • Sr. Member
  • ****
  • Posts: 4595
The problem with  the tagging tool is that for some reason <episode date> is not in the dropdown list. Is there a work-around for this?
at the moment - no, but i hope Steven could help us later, after releasing 3.0

redwing

  • Guest
The problem with  the tagging tool is that for some reason <episode date> is not in the dropdown list. Is there a work-around for this?

Maybe you could use Mp3tag after saving the virtual tag values to a text file if that supports writing episode date tag.
Last Edit: March 31, 2016, 06:03:44 AM by redwing