Author Topic: Convert format, preserve timestamp  (Read 871 times)

MusicBebe

  • Jr. Member
  • **
  • Posts: 60
Is it possible somehow to do a batch format conversion while preserving the timestamp of the source? That seems like it might be an option, but I'm not seeing it in the file conversion dialog.

Any way to indirectly go about it? E.g., by first copying the current modified date to a tag, then (assuming tags are preserved in the converted file), copying the tag back to a modified value? Something like that?

The filenames almost all have a some kind of timestamp, but those are not consistent enough in either their format or their position in the name string, to be able to use them in a straightforward way.
Last Edit: May 10, 2022, 05:38:01 PM by MusicBebe

MusicBebe

  • Jr. Member
  • **
  • Posts: 60
I again find myself wanting to do this, and wondering if it is possible in MusicBee.

Can it be done?

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2450
There's no way to do that now, so this functionality would need to be posted as a request to the Wishlist forum.

As a workaround, there's no easy way either. Even if you could copy the original timestamp value to a tag - which Mp3tag could do - there's no way to then read that value back and apply it to the new file.

I found this PowerShell script that aims to transfer the modified time from one directory to matching files in a second directory:

https://www.reddit.com/r/sysadmin/comments/66ujt2/can_robocopy_update_timestamps_on_files_after/dgmasa4/

I haven't tested it but it looks simple enough. An obvious caveat is that you would need to edit the source and target folders each time.
Bee excellent to each other...

MusicBebe

  • Jr. Member
  • **
  • Posts: 60
Thanks, Zak, for the confirmation that it's not possible in MB. I would think it could be done, as it doesn't seem too different in concept than preserving the timestamp when updating tags.....

Given that all the files I want to do this with all have a consistent yyyy-mm-dd timestamp as part of their filename, I wonder if it is possible to somehow extract that and apply it to the modified time.

I see that the Bulk Rename Utility has some timestamp edit functions, but there doesn't seem a way do that based on a filename string or other input.

It's not too urgent, since the filenames are timestamped, so the files can still (mostly) be sorted by date, but it would be good to have the actual timestamps match.

frankz

  • Sr. Member
  • ****
  • Posts: 3834
Why not use Date Added rather than the time stamp from the file?  This value does get preserved when you convert formats.

MusicBebe

  • Jr. Member
  • **
  • Posts: 60
Using the Date Added is an interesting suggestion. The Copy Tag command will let me copy the file's modified date to the Date Added field, but also to any other field that gets retained with a file conversion.

That won't be of much use for sorting by modified (something I would do mostly in Explorer), but it keeps a record of the date as part of the file itself, should it ever be needed. And I can imagine that some way could be found to modify a timestamp based on a tag.

I would use a tag other than Date Added, since that seems to be filled automatically by MB at least some of the time. But maybe one of the custom tags.

In the tag edit panel, are custom tags and the other tags on the second tab just internal to MB?
Last Edit: May 08, 2022, 08:50:42 PM by MusicBebe

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9303
In the tag edit panel, are custom tags and the other tags on the second tab just internal to MB?
That depends on how you set up the custom tag. By default custom tags are only saved to MB's database, which means they won't be transferred. But there's a dropdown menu when creating a custom tag. I typically assign one of the www.xxx tags, when then will get embedded in the file. But the device the file is being transferred to has to support that tag other wise it will not appear.
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2450
But there's a dropdown menu when creating a custom tag. I typically assign one of the www.xxx tags, when then will get embedded in the file. But the device the file is being transferred to has to support that tag other wise it will not appear.
That seems unnecessary.
Custom tags can be saved to a file with a meaningful name of your choosing, avoiding the need to remember what each of your WWW tags is actually used for. Unless you're using those WWW tags specifically to read them in another program that doesn't support "non-standard" tags at all.
Bee excellent to each other...

MusicBebe

  • Jr. Member
  • **
  • Posts: 60
So those last few posts were really helpful!

In Options, under Tags (1), in custom tag 1, I created a tag with a display name OriginalModDate, and with Copyright for "save to music file as tag."

Then, with Additional Tagging Tools-Copy Tags, I copied "Date Modified" to OriginalModDate. And that was that.

So then, the info in the tag is fully part of the mp3 file, independent of MusicBee, and will be part of any  copy I make of the file - so it appears.

But the info is really in the mp3's Copyright tag, and it is only inside MB where that tag is being aliased as OriginalModDate.

Do I have this right? Do all tags work this way?
Last Edit: May 24, 2022, 07:44:06 AM by MusicBebe

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2450
Yes, I think what you have explained there is all correct.

However, you could also click the Define New Tags... button in that same Preferences > Tags (1) screen and create a custom tag actually called OriginalDateMod instead of hijacking the Copyright tag for that purpose.

There's still no way to use that value to update the file modification time though.
Bee excellent to each other...

MusicBebe

  • Jr. Member
  • **
  • Posts: 60
Thank you again.

I'd rather not hijack Copyright or any other existing link for a custom link. Not sure what made me think that was the way to do it.

But I notice that when I look at the file's properties in Explorer, under details, I can see the Copyright tag, and its content shows the value for OriginalModDate.

But when I used Define New Tags and created a tag called OriginalModDate2, it seemed to work in MB just like the hijacked one, but it doesn't show up when I look at the file properties in Explorer. Is that a limitation of how Explorer presents the properties? Or is one tag less "official" or standard than the others?

It's not clear where "standard" tag functions leave off, and where MB features take over. For example, both my original hijacked tag and the one I made from scratch are listed as custom tags, numbers 1 and 2, respectively.

There's something I'm still not getting about this........

PS. I know that none of this will let me actually update the file's mod time. But having a record of it that travels with the file is sufficient. And I'm thinking that somehow, if I have that info in an accessible tag, I'll eventually be able to turn up some method of transferring it to the mod time if if seems necessary.
Last Edit: May 24, 2022, 07:30:34 PM by MusicBebe

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2450
But when I used Define New Tags and created a tag called OriginalModDate2, it seemed to work in MB just like the hijacked one, but it doesn't show up when I look at the file properties in Explorer. Is that a limitation of how Explorer presents the properties? Or is one tag less "official" or standard than the others?
Yes, that is expected. Explorer will only show the list of properties it has been told to look for, which won't include any custom tags added in MusicBee. It's possible some other programs might read them but as a rule, you shouldn't expect any custom tags to be usable outside of MusicBee.

There are programs/add-ins that might let you work with the custom tags within Explorer if that's something you need to do.
e.g.
AudioShell
http://www.softpointer.com/AudioShell.htm

(Just an example, not an endorsement - I don't use it myself)

It's not clear where "standard" tag functions leave off, and where MB features take over. For example, both my original hijacked tag and the one I made from scratch are listed as custom tags, numbers 1 and 2, respectively.
How much you want to dive into it this depends on your own pain threshold. I'm sure a lot of people spend years building up digital music collections and trying to work this all out and eventually just accept there's a point at which "magic happens".

If you want to read further, this is the closest thing to a list of "official" tags that you could reasonably expect most programs to at least be aware of, if not explicitly support in some way:

https://id3.org/id3v2.3.0

Not all file formats will follow these same conventions, but because ID3 has been around the longest and was supported by MP3 before other formats (i.e. OGG/FLAC/M4A) even existed, the later formats should have an equivalent for these tags too.

PS. I know that none of this will let me actually update the file's mod time. But having a record of it that travels with the file is sufficient. And I'm thinking that somehow, if I have that info in an accessible tag, I'll eventually be able to turn up some method of transferring it to the mod time if if seems necessary.
Some nice person might write a MusicBee plug-in that could read your custom tag and use it to set the file modification time.  8)
Bee excellent to each other...

MusicBebe

  • Jr. Member
  • **
  • Posts: 60
I don't need to work with tags in Explorer. I just use it as a vanilla portal into the file properties.

Nor do I really want to become fluent or even semi fluent in id3. :) Just enough to use some number of custom tags, and to know when  I go from using MB to manage the vanilla and generic and non-custom tags, to using MB's more proprietary features. Not that I don't want to use them. I just want a better handle on what I'm actually doing.

What I think I'm taking away from this is, hijacking a standard tag and letting MB manage the alias while inside MB, keeps the file and its meta in the vanilla realm, and the aliased values will still be accessible by their native tag name when the file read other than by MB.

Mp3tag recognizes the Copyright tag, and shows the values I've given its alias in MB. But when I edit the tag in Mp3tag and save it (and can see that it's been saved by the updated mod date, which MB is set to not do), and I then look at the tag in MB, the edit isn't picked up. Even after rescanning the folder. That surprises me. I can see the Mp3tag edit in Explorer. Interesting.