Do NOT update timestamp for files that has not actually modified [#19325]

Help improve MediaMonkey 5 by testing the latest pre-release builds, and reporting bugs and feature requests.

Moderator: Gurus

PotamePierre
Posts: 4
Joined: Fri May 03, 2019 11:38 am

Do NOT update timestamp for files that has not actually modified [#19325]

Post by PotamePierre »

MediaMonkey is incredibly handy for bulk-tagging video files, but there's a problem. When you select a large number of video files for tagging/retagging, you may end up with three classes of files:

(1) Files in formats that MediaMonkey can actually write tags to — MP4s definitely, and apparently at least some AVIs, DIVXs, and WMVs — and whose internal tags actually change as a result of the bulk-tagging operation (because they were "incorrectly" tagged before the operation).

(2) Files in formats that MediaMonkey can actually write tags to and whose internal tags do NOT change as a result of the bulk-tagging operation (because they were already "correctly" tagged before the operation).

(3) Files in formats that MediaMonkey cannot write tags to — FLVs and MKVs, for example — and whose internal tags do NOT change as a result of the bulk-tagging operation (because MediaMonkey is incapable of tagging/retagging those file types).

The problem is that when the "Modify timestamp when updating tags" option is enabled, MediaMonkey modifies the timestamp for files in all three classes, even though the files in classes (2) and (3) have not actually changed.

It's a good bet that most MediaMonkey users maintain backups of their video collections and that, for this purpose, most of them use mechanical hard drives (with relatively slow write speeds over relatively slow connections but at a much lower cost per gigabyte). And if the file-backup/syncing utility they use is set to use a "timestamp and file size" comparison method — the best compromise between speed-of-comparison and accurate identification of changed files — all of the files whose timestamps were modified by MediaMonkey will get re-copied from scratch, including the files that didn't actually change. This can unnecessarily add hours — or, in case of multiple redundant backups, days — to routine backup operations.

By default, MediaMonkey should modify the timestamp only for files it has actually written internal changes to. I can't think of a compelling case for modifying timestamps on files that haven't changed — at least not one that outweighs the huge cost in unnecessary "re-backups" — but if there is one, it could be handled by adding two radio-button sub-options under the "Modify timestamp when updating tags" option:

• Only for files that MediaMonkey successfully writes new or different internal tags to

◦ For all selected files (including files whose internal tags will not change)

And again, the first sub-option needs to be the pre-selected default.

There are ways to work around the problem at the tagging stage, but they are tedious and time-consuming. It's possible to toggle off the "Modify timestamp when updating tags" option and then select only "untaggable" files in a first operation, and then toggle the "Modify timestamp" option back on before manually selecting and bulk-tagging only the "taggable" files that will actually change in a second operation. As I wrote: tedious and time-consuming.

There are also ways to partially work around and mitigate the problem at the backing-up stage, but they come at the cost of complexity and/or time "wasted" doing file-content comparisons. With my current video collection and hardware, backing up my "untaggable" videos with a separate routine that uses "file content" comparison takes a fixed minimum of 50 minutes for the comparison alone, regardless of how many files end up having to be copied. If there are no new files, the backup operation takes 50 minutes. If there is one new movie, the backup operation might take 50 minutes, 30 seconds. Using the "file content" comparison method would have to spare me from needlessly copying at least (very roughly) 100 average-size movies to result in a net savings of time.

By far the best solution is to eliminate the problem at the source and have MediaMonkey stop "updating" files that haven't actually changed.

I have a rather large video collection comprising a mix of taggable and untaggable container formats. I maintain multiple redundant backups of it on multiple external drives. I have bulk-retagged most of my collection at least three times that I can recall — at least once because MediaMonkey rescanned tags from "untaggable" videos when I upgraded from MM4 to MM5 — and this problem has cost me quite literally days of unnecessary copy time. I rate this bug-fix/feature request a HIGH-PRIORITY ITEM.

PS: If I've overlooked an easy fix, I'd be genuinely happy to learn of it. What I'd like is to be able to "Select all," execute a single bulk-tagging command, and have MediaMonkey be smart enough to not update the timestamp for files that haven't actually changed. I'm not a programmer, but I have a pretty strong hunch that what I'm looking for can be done programmatically within MediaMonkey without undue additional resource overhead: (1) Can MediaMonkey write internal tags to this type of file? If not, then don't update the file's timestamp; (2) Will this "internally taggable" file's preexisting internal tags actually change as a result of this operation? If not, then don't update the file's timestamp. Conceptually, it's not rocket science. The only real challenge is to code the subroutines as efficiently as possible.
MiPi
Posts: 868
Joined: Tue Aug 18, 2009 2:56 pm
Location: Czech Republic
Contact:

Re: Tagging Feature Request: Do NOT update timestamp for files that MediaMonkey has not actually modified

Post by MiPi »

Thanks, added as: https://www.ventismedia.com/mantis/view.php?id=19325
We will fix point 3). In point 2) changes are written to files, even though it could lead to the same file as before (but not always, sometimes tags are reorganized or some timestamps are updated). I think it will be enough for most cases.
PotamePierre
Posts: 4
Joined: Fri May 03, 2019 11:38 am

Re: Do NOT update timestamp for files that has not actually modified [#19325]

Post by PotamePierre »

I'm very grateful that you will be trying to fix the "class 3" issue. As for the "class 2" issue ("taggable" files that don't actually change), it seems to me that MediaMonkey already has at least some of the requisite code — when you tag based on filenames, the preview highlights the tags that will actually change and leaves tags that won't change unhighlighted — so perhaps that could help form the basis for exempting at least some "class 2" files from being re-saved and re-timestamped at some time in the future. Still, though, I really appreciate the prospect of not having to needlessly recopy my "untaggable" MKVs, FLVs, et al. (If your primary computer is a laptop, it's not always very convenient to be tethered to your external backup drives for hours — or days — on end.) I appreciate your responsiveness very much; thank you!
MiPi
Posts: 868
Joined: Tue Aug 18, 2009 2:56 pm
Location: Czech Republic
Contact:

Re: Do NOT update timestamp for files that has not actually modified [#19325]

Post by MiPi »

The fix was included in the last beta, you can already try it: https://www.mediamonkey.com/forum/viewt ... 27#p500527
Post Reply