INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Cleared custom field not updating in database  (Read 1161 times)

d_pert

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 398
  • I love music and great audio!
Cleared custom field not updating in database
« on: July 27, 2020, 07:34:00 am »

Hi:

I have a custom field called "Date Acquired (DP)" which I've been using for years in many of my files. It's set to be stored in tags (and it is).

Yesterday on a 'main' PC, using MC, I cleared this field (deleted its contents) in certain files. The tags updated as expected. The files' date modified changed as expected. All was well.

Then I mirrored those changed files to a 'secondary' PC where I also run the same version of MC, with all the same custom fields, settings, etc. This mirroring routine has worked for years, and I've periodically edited custom fields' contents in files before, and the changes have been picked up on the secondary PC's MC, too, upon Import.

However ... this time ... When I ran MC's Import on the secondary PC to update based on the changed tags, MC did not pick up those changes. It did not clear the dates. It kept the old dates that had once been in that custom field.

I discovered that if I changed -- instead of cleared -- the date in the same custom field, in the same files, then mirrored the files again: that kind of change DOES get picked up following Import.

However, clearing (deleting) the field contents does not. The MC database on the secondary PC does not treat the custom field as changed when it's simply been cleared.

It's possible that this has always been the behavior in MC; I don't think I've ever cleared the date from a custom field before.
Logged
Derek Pert
(Windows 11 Pro x64 / 32GB RAM)

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Cleared custom field not updating in database
« Reply #1 on: July 27, 2020, 06:08:12 pm »

I believe that is the designed behaviour. MC doesn't overwrite a Library field with an empty value. It retains the value it had.

I'm not even sure MC will write a tag, custom or standard, to a file if it is empty. I think it just deletes the tag, in which case, there is no empty tag in the file to overwrite the existing field value anyway... Yep. If the custom field is empty, it isn't written to the file, and is deleted if it was already there with a previous value.

Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

d_pert

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 398
  • I love music and great audio!
Re: Cleared custom field not updating in database
« Reply #2 on: July 28, 2020, 08:04:00 pm »

Good to know. Thanks sharing the detailed knowledge.

Could it be made optional, perhaps?
Logged
Derek Pert
(Windows 11 Pro x64 / 32GB RAM)

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Cleared custom field not updating in database
« Reply #3 on: July 28, 2020, 08:34:40 pm »

Making it optional would require empty tags to be written to files, and for empty tags to update the Library.

The first would slow MC quite a lot, as all tags would have to be written to every file every time it was updated. It would mean a lot of redundant (empty) tags would be written to files. That may well break other applications. I thought about using MPL Playlists to transfer the tag changes to a second Library, but MC only write tags with values to those files as well.

The second could well mean that users accidentally overwrite a lot of tags with empty values, losing a lot of metadata that is only stored in the Library.

What you could do it create a Playlist of the files that you are going to edit that date out of, transfer that Playlist to the other Library, and then do the same edit over there.
Or, enter some weird date into the field in the first Library, such as 01/01/2500, let the second Library pick up that date via Auto Import or a manual run of Auto Import, then with background Auto Import turned off, delete the date in both Libraries separately, using a View based on the weird date to find them. Then turn background Auto Import on again, if you wish. Or use some other custom field or keyword to flag which files should have their date deleted. Something like that.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

d_pert

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 398
  • I love music and great audio!
Re: Cleared custom field not updating in database
« Reply #4 on: February 15, 2021, 09:56:24 am »

A belated thank you...

I just experienced this again, and benefited from your post.

However, now I have a suggestion for MC:

Make "Update Library (from tags)" clear custom fields in database which are found non-present/blank in the file(s). That would seem to suit the usual, manual/fix-related context for that function, in a narrow and measured way, and thereby allow folks to get around needing to do more elaborate workarounds without causing all imports to be elongated. Note: I'm only suggesting this for the one direction: tags to database.

Thank you.
Logged
Derek Pert
(Windows 11 Pro x64 / 32GB RAM)
Pages: [1]   Go Up