INTERACT FORUM

Please login or register.

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

Author Topic: Bugfix: Stop Removing Leading Zeros From My Track Numbers  (Read 1555 times)

Jamil

  • Galactic Citizen
  • ****
  • Posts: 395
Bugfix: Stop Removing Leading Zeros From My Track Numbers
« on: August 12, 2019, 10:17:21 pm »

Fix this issue, and I may trust MC25 enough to no longer block it from writing to my music library on my NAS.

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Bugfix: Stop Removing Leading Zeros From My Track Numbers
« Reply #1 on: August 12, 2019, 11:09:42 pm »

It isn't a bug.

[Track #] is an integer. Always has been. Hence, no leading zeros. Because integers don't have leading zeros. Integers sort numerically, correctly. If [Track #] was a string, which would allow a leading zero, then sorting would be more problematic. In fact, sorting string numbers correctly requires leading zeros, or you get things like sorts of 1,10,11,<snip>,2, 20, 21 etc. Integers don't require leading zeros.

But if you want to use [Track #] in a string field, and have leading zeros, that is easy. Just use the PadNumber function: https://wiki.jriver.com/index.php/Formatting_Functions#PadNumber


So, what is the real issue you are having with MC not writing leading zeros to tags in files? Perhaps the underlying issue you have can be solved.
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

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Bugfix: Stop Removing Leading Zeros From My Track Numbers
« Reply #2 on: August 13, 2019, 12:02:42 am »

Some files formats accept strings in the track # field, and perhaps some other software relies on those leading zeroes?

If your issue is how Rename Move and Copy files names your files, which you want to be alphabetically sortable, use the example in the article Roderick linked to, instead of just [Track #] in the rename/move/copy dialog.
Logged

Jamil

  • Galactic Citizen
  • ****
  • Posts: 395
Re: Bugfix: Stop Removing Leading Zeros From My Track Numbers
« Reply #3 on: August 13, 2019, 03:25:07 pm »

Thanks for your replies, guys.  I will simply continue to disallow MC* write access to my media collection as opposed to any of these work-arounds proposed.

The reason I keep my library read-only for MC is actually that many years ago the first version of it I had used made all sorts of unwanted changes to my tags.  After spending quite a bit of time repairing the damage done, I never again allowed any version of MC write access to my library.  Based on the response above, I am sure other have complained about this 'feature'.

Track number is an integer.  01 is also an integer.  More importantly, 01 is my data that I own.  Change data when it is not needed or leave the user's data the way it is?

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72443
  • Where did I put my teeth?
Re: Bugfix: Stop Removing Leading Zeros From My Track Numbers
« Reply #4 on: August 13, 2019, 03:32:25 pm »

MC doesn't "change" your tags unless you've told it to.

01 isn't an integer.  It's a string.  It's possible some other program displays your track #'s with leading zeros. 
Logged

Jamil

  • Galactic Citizen
  • ****
  • Posts: 395
Re: Bugfix: Stop Removing Leading Zeros From My Track Numbers
« Reply #5 on: August 13, 2019, 03:34:44 pm »

MC has changed my tags many times to disagree with the above.  As a matter of fact, no other media player that I have ever used makes the changes that MC does.  I can name many too.

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Bugfix: Stop Removing Leading Zeros From My Track Numbers
« Reply #6 on: August 13, 2019, 03:48:24 pm »

MC WILL change padded (01) tag value to 1 when any of the fields which triggers tag change is altered. That might be issue for some if one is also using other players that doesn't support padding as UI feature.

So options for you are either to disable tag writing in MC completely or just disable Track # tag writing from options.
Logged

Jamil

  • Galactic Citizen
  • ****
  • Posts: 395
Re: Bugfix: Stop Removing Leading Zeros From My Track Numbers
« Reply #7 on: August 13, 2019, 03:55:05 pm »

MC WILL change padded (01) tag value to 1 when any of the fields which triggers tag change is altered. That might be issue for some if one is also using other players that doesn't support padding as UI feature.

So options for you are either to disable tag writing in MC completely or just disable Track # tag writing from options.

Thanks so much.  This is a very useful post.  I was not even aware of an option that disables track # writing.  Let me find it now.

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Bugfix: Stop Removing Leading Zeros From My Track Numbers
« Reply #8 on: August 13, 2019, 03:56:18 pm »

Thanks so much.  This is a very useful post.  I was not even aware of an option that disables track # writing.  Let me find it now.
Maybe test it still yourself also as Track # is stock field so it options for it could still be hardcoded somehow (Don't know about it but just to be sure). I did a little test with foobar2000 and MC and it seemed that track # tag wasn't rewritten anymore when I unselected tag writing for this field in the options
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Bugfix: Stop Removing Leading Zeros From My Track Numbers
« Reply #9 on: August 13, 2019, 07:52:02 pm »

Thanks so much.  This is a very useful post.  I was not even aware of an option that disables track # writing.  Let me find it now.

Doh! That is why I asked:
So, what is the real issue you are having with MC not writing leading zeros to tags in files? Perhaps the underlying issue you have can be solved.

You say "no other media player that I have ever used makes the changes that MC does", but MC isn't just a media player. It is a Media Manager, 10' Interface, Media Visualisation, etc. Oh, and also a Player. If you have been using MC as just a Player for the last nine years then that means that you are using some other applications for media management. Is the problem with the padded Track # actually an issue in another application?

So my question above stands; What is the real issue you are having, that makes having integer values for the Track # stored in file tags and problem for you?

If you just don't like having the leading zero stripped because of the look, that is just being stubborn. The [Track #] field in MC does what it is supposed to do. If all you really want is to see a track number with leading zeros in MC, that could be easily done. If stripping leading zeros from the tag causes other software to stop working, tell us about it.

You should also note that all tags inside files are saved as strings, because that is all that can be saved to a file. It isn't a database. There isn't a way to mark a tags as an Integer, Floating Point Number, String, etc. All Media Managers and Players make some assumption about what the string content is supposed to be in a tag. That is why a leading zero can be added to the Track # tag inside a file; Because it is a string. MC interprets the Track # tag as an integer, and so correctly strips the leading zero from the string in which it was saved.


As Lepa says, you can turn off writing of individual Track # values to tags via the Manage Library Fields functionality. That works even for standard tags Lepa.


Some other pointers:
You can tell MC to update its Library based on external changes you have made to files in Auto Import Configuration, under Tasks.
You can also tell MC in Auto Import Configuration, under Tasks, to Analyse Audio, get Cover Art, apply optional tags on import, and write those tags to the files, or not write them.
You can tell MC or store Cover Art inside files, or not.
You can turn on tagging in Theatre View, or not.
You can tell MC to update tags when file information in the Library changes, or not. This is the major setting for tagging files, under "Options > General > Importing & Tagging > Update tags when file info changes".

Basically, you are in complete control over whether MC writes tags to files or not, and you don't need to write protect the media files to exert that control.


Also, if MC wrote values to field tags that you didn't want, that means that MC had different values for those fields in its Library, and you had tag writing turned on, so MC updated the tags. All you probably needed to do was select all files and run the "Update Library (from tags)" function to have MC updated with the data you have in tags in your media files. Sure, the Track # tag is a special case. But if you used MC as your only Media Manager, then that probably wouldn't be an issue for you, unless you just want the aesthetics of a padded [Track #] field. As above, I can explain a workaround for that which may be acceptable. Yes, a workaround. They aren't all bad.



With an open mind, a little bit of questioning, cooperation, and learning, you could be getting much more value out of MC.
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

Jamil

  • Galactic Citizen
  • ****
  • Posts: 395
Re: Bugfix: Stop Removing Leading Zeros From My Track Numbers
« Reply #10 on: August 14, 2019, 03:58:09 pm »

Maybe test it still yourself also as Track # is stock field so it options for it could still be hardcoded somehow (Don't know about it but just to be sure). I did a little test with foobar2000 and MC and it seemed that track # tag wasn't rewritten anymore when I unselected tag writing for this field in the options

Thank you again.  This worked perfectly for me.  Now MC no longer alters track number at all.
Pages: [1]   Go Up