Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Ignore useless volume labels #744

Open
Deterous opened this issue Sep 3, 2024 · 8 comments
Open

[Request] Ignore useless volume labels #744

Deterous opened this issue Sep 3, 2024 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@Deterous
Copy link
Member

Deterous commented Sep 3, 2024

Currently MPF outputs ISO volume labels that are useless, e.g. [T:VOL] Young, YOUNG (ISO) or [T:VOL] LIVINGFACTORY (ISO), LivingFactory (Joliet)

TODO: Add logic to delete useless volume labels. Compare them after removing spaces/underscores and normalising case. Drop empty volume labels after this. And ensure that if only one volume label is left, don't add the brackets

e.g. the output after this should be
[T:VOL] Young and ``[T:VOL] LivingFactory`

@Deterous Deterous added the enhancement New feature or request label Sep 3, 2024
@NovaSAurora
Copy link

Strongly request a toggle in options to include them anyway. I'd like to still have them and having it off by default will let the mods be happy.

@mnadareski
Copy link
Collaborator

Is there a preferred order to the "accepted" labels? Like does Windows always take precedence over Joliet? Or if they match (ignoring case), is it always the one that includes at least one lower-case character?

@Deterous
Copy link
Member Author

Deterous commented Oct 10, 2024

Windows > UDF > ISO > Joliet
Windows probably is UDF anyway.
Honestly I've only seen bad results from the joliet label. Maybe it's coded wrong for DIC log parsing..? (my fault if so)

@mnadareski
Copy link
Collaborator

The current formatting code doesn't take into account where the labels are coming from when formatting. It just assumes that they're organized properly. That is, there is no actual distinction between UDF, ISO, and Joliet when the formatting happens. If we go with the hierarchy, that will require special checking cases. Also worth noting that it actually doesn't do any sort of comparisons between labels at the moment.

@mnadareski
Copy link
Collaborator

As discussed in Discord, part of the issue here is needing to rebuild the current mapping dictionary based on the "correct" labels. For a human user, this is nearly trivial to point out, regardless of what the source of the label is. For a computer, it's a bit harder, since either the key in the dictionary needs to be normalized OR a separate mapping needs to be made from the key to the "real label". Neither of these are trivial to implement and neither scales particularly well.

@Deterous
Copy link
Member Author

Deterous commented Oct 11, 2024

Currently, labels exists as a mapping of actual volume labels to zero or more filesystem names ("ISO", "Joliet", "UDF", "UNKNOWN")
It should be possible to compare the volume labels and pick the one with the better filesystem. There is no need to determine which is better through heuristics (which has case sensitivity, etc).

For example:
labels = a mapping of "EXAMPLE_DISC" = (ISO, Joliet) and "Example Disc" = (UDF)

  1. Drop all underscores, spaces, and unicode (foreign language characters) from both labels
  2. Compare without case sensitivity string.Equals(a, b, StringComparison.OrdinalIgnoreCase)
  3. If they are equal, look at the filesystems that the labels are attached to and drop the one that is lower in the heirarchy, in this case UDF is kept over ISO+Joliet. If a label does not have a filesystem, that one is chosen (i.e. it is the Windows one).
  4. Repeat for all remaining labels in the mapping

Note: this logic should occur here:


i.e. after checking that at least one label exists, but before the check for only one label.

@mnadareski
Copy link
Collaborator

You're proposing a static readonly list that defines the hierarchy. It also seems like you're suggesting the "highest ranked" out of each set of label sources would be considered.

@Deterous
Copy link
Member Author

Another request as part of this: don't put any volume labels in submissionInfo for Xbox/Xbox360.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants