mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Use the Volume Label special site code (fixes #337)
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
- Fix saving path settings if set from dialog
|
||||
- Allow default system if skipping system detection enabled
|
||||
- Add internal support for all Redump site codes
|
||||
- Use the Volume Label special site code
|
||||
|
||||
### 2.1 (2021-07-22)
|
||||
- Enum, no more
|
||||
|
||||
@@ -48,7 +48,12 @@ namespace MPF.Core.Data
|
||||
/// <summary>
|
||||
/// Media label as read by Windows
|
||||
/// </summary>
|
||||
public string VolumeLabel
|
||||
public string VolumeLabel => driveInfo?.VolumeLabel;
|
||||
|
||||
/// <summary>
|
||||
/// Media label as read by Windows, formatted to avoid odd outputs
|
||||
/// </summary>
|
||||
public string FormattedVolumeLabel
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -250,7 +255,7 @@ namespace MPF.Core.Data
|
||||
return RedumpSystem.IBMPCcompatible;
|
||||
|
||||
// Audio CD
|
||||
if (this.VolumeLabel.Equals("Audio CD", StringComparison.OrdinalIgnoreCase))
|
||||
if (this.FormattedVolumeLabel.Equals("Audio CD", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return RedumpSystem.AudioCD;
|
||||
}
|
||||
@@ -280,7 +285,7 @@ namespace MPF.Core.Data
|
||||
&& Directory.EnumerateFiles(Path.Combine(drivePath, "VIDEO_TS")).Any())
|
||||
{
|
||||
// TODO: Maybe add video track hashes to compare for Xbox and X360?
|
||||
if (this.VolumeLabel.StartsWith("SEP13011042", StringComparison.OrdinalIgnoreCase))
|
||||
if (this.FormattedVolumeLabel.StartsWith("SEP13011042", StringComparison.OrdinalIgnoreCase))
|
||||
return RedumpSystem.MicrosoftXbox;
|
||||
|
||||
return RedumpSystem.DVDVideo;
|
||||
@@ -346,19 +351,19 @@ namespace MPF.Core.Data
|
||||
}
|
||||
|
||||
// Sony PlayStation 3
|
||||
if (this.VolumeLabel.Equals("PS3VOLUME", StringComparison.OrdinalIgnoreCase))
|
||||
if (this.FormattedVolumeLabel.Equals("PS3VOLUME", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return RedumpSystem.SonyPlayStation3;
|
||||
}
|
||||
|
||||
// Sony PlayStation 4
|
||||
if (this.VolumeLabel.Equals("PS4VOLUME", StringComparison.OrdinalIgnoreCase))
|
||||
if (this.FormattedVolumeLabel.Equals("PS4VOLUME", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return RedumpSystem.SonyPlayStation4;
|
||||
}
|
||||
|
||||
// Sony PlayStation 5
|
||||
if (this.VolumeLabel.Equals("PS5VOLUME", StringComparison.OrdinalIgnoreCase))
|
||||
if (this.FormattedVolumeLabel.Equals("PS5VOLUME", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return RedumpSystem.SonyPlayStation5;
|
||||
}
|
||||
|
||||
@@ -158,6 +158,10 @@ namespace MPF.Library
|
||||
if (!string.IsNullOrWhiteSpace(info.SizeAndChecksums.CRC32))
|
||||
info.TracksAndWriteOffsets.ClrMameProData = null;
|
||||
|
||||
// Add the volume label to comments, if possible
|
||||
if (!string.IsNullOrWhiteSpace(drive?.VolumeLabel) && !info.CommonDiscInfo.Comments.Contains(Template.VolumeLabelCommentField))
|
||||
info.CommonDiscInfo.Comments += $"{Template.VolumeLabelCommentField} {drive.VolumeLabel}\n";
|
||||
|
||||
// Extract info based generically on MediaType
|
||||
switch (mediaType)
|
||||
{
|
||||
|
||||
@@ -827,7 +827,7 @@ namespace MPF.GUI.ViewModels
|
||||
|
||||
// Set the output filename, if we changed drives or it's not already
|
||||
if (driveChanged || string.IsNullOrEmpty(App.Instance.OutputFilenameTextBox.Text))
|
||||
App.Instance.OutputFilenameTextBox.Text = (drive?.VolumeLabel ?? systemType.LongName()) + (extension ?? ".bin");
|
||||
App.Instance.OutputFilenameTextBox.Text = (drive?.FormattedVolumeLabel ?? systemType.LongName()) + (extension ?? ".bin");
|
||||
|
||||
// If the extension for the file changed, update that automatically
|
||||
else if (Path.GetExtension(App.Instance.OutputFilenameTextBox.Text) != extension)
|
||||
|
||||
Reference in New Issue
Block a user