Refactor ModMetadata to have required properties

This commit is contained in:
Yoshi Askharoun
2025-09-03 19:48:41 -04:00
parent 4c482a949e
commit 9aec2061ff
6 changed files with 59 additions and 37 deletions
+14 -1
View File
@@ -1,3 +1,16 @@
namespace ZuneModCore;
public record ModMetadata(string Id, string Title, string Description, string Author, ReleaseVersion Version);
public record ModMetadata
{
public required string Id { get; init; }
public required string Title { get; init; }
public required string Author { get; init; }
public required ReleaseVersion Version { get; init; }
public required string Description { get; init; }
public string? ExtendedDescription { get; init; }
}
+8 -6
View File
@@ -12,12 +12,14 @@ namespace ZuneModCore.Mods;
public class BackgroundImageModFactory : DIModFactoryBase<BackgroundImageMod>
{
private const string Description = "Replaces the \"Zero\" background with an image of your choice.";
private const string Author = "Joshua \"Yoshi\" Askharoun";
public override ModMetadata Metadata => new(nameof(BackgroundImageMod), "Background Image",
Description, Author, new(1, 1));
public override ModMetadata Metadata { get; } = new()
{
Id = nameof(BackgroundImageMod),
Title = "Background Image",
Author = "Joshua \"Yoshi\" Askharoun",
Version = new(1, 1),
Description = "Replaces the \"Zero\" background with an image of your choice.",
};
}
public class BackgroundImageMod(ModMetadata metadata, IModCoreConfig modConfig) : Mod(metadata)
+9 -8
View File
@@ -10,14 +10,15 @@ namespace ZuneModCore.Mods;
public class FeaturesOverrideModFactory : DIModFactoryBase<FeaturesOverrideMod>
{
private const string Description = "Re-enables access to some features disabled by Microsoft, such as the Social and Marketplace tabs.\r\n" +
"Does not restore functionality of those features, but shows them in the software.";
private const string Author = "Rafael Rivera";
public override ModMetadata Metadata => new(nameof(FeaturesOverrideMod), "Features Override",
Description, Author, new(1, 0));
public override ModMetadata Metadata { get; } = new()
{
Id = nameof(FeaturesOverrideMod),
Title = "Features Override",
Author = "Rafael Rivera",
Version = new(1, 0),
Description = "Re-enables UI for some features disabled by Microsoft, such as the Social and Marketplace tabs.\r\n" +
"See the Community Webservices mod to restore functionality of those features.",
};
}
public class FeaturesOverrideMod(ModMetadata metadata) : Mod(metadata), IAsyncInit
+11 -8
View File
@@ -9,14 +9,17 @@ namespace ZuneModCore.Mods;
public class MbidLocatorModFactory : DIModFactoryBase<MbidLocatorMod>
{
private const string Description = "Puts MusicBrainz IDs added by MusicBrainz Picard where the Zune " +
"software can use it to show additional information provided by Community Webservices.\r\n" +
"Note that this will only have an effect if you have used MusicBrainz Picard on your music library.";
private const string Author = "Joshua \"Yoshi\" Askharoun";
public override ModMetadata Metadata => new(nameof(MbidLocatorMod), "MusicBrainz ID Locator",
Description, Author, new(1, 0));
public override ModMetadata Metadata { get; } = new()
{
Id = nameof(MbidLocatorMod),
Title = "Music Tag Fixer",
Author = "Joshua \"Yoshi\" Askharoun",
Version = new(2, 0),
Description = "Fixes music tags to improve Zune compatibility and enable Marketplace features.",
ExtendedDescription = "• If your library is tagged with MusicBrainz Picard, " +
"this places MBIDs where Zune can use them for Marketplace features.\r\n" +
"• Converts ID3v2.4 to ID3v2.3.",
};
}
public class MbidLocatorMod(ModMetadata metadata) : Mod(metadata)
+8 -7
View File
@@ -9,13 +9,14 @@ namespace ZuneModCore.Mods;
public class VideoSyncModFactory : DIModFactoryBase<VideoSyncMod>
{
private const string Description =
"Resolves \"Error C00D11CD\" when attempting to sync video to a Zune device using Windows 10 1607 (Anniversary Update) or newer";
private const string Author = "ส็็็Codix#4833 & sylvathemoth";
public override ModMetadata Metadata => new(nameof(VideoSyncMod), "Fix Video Sync",
Description, Author, new(2, 1));
public override ModMetadata Metadata { get; } = new()
{
Id = nameof(VideoSyncMod),
Title = "Fix Video Sync",
Author = "ส็็็Codix#4833 & sylvathemoth",
Version = new(2, 1),
Description = "Resolves \"Error C00D11CD\" when attempting to sync video to a Zune device using Windows 10 1607 (Anniversary Update) or newer.",
};
}
public class VideoSyncMod(ModMetadata metadata, IModCoreConfig modConfig) : Mod(metadata)
+9 -7
View File
@@ -20,13 +20,15 @@ namespace ZuneModCore.Mods;
public class WebservicesModFactory : DIModFactoryBase<WebservicesMod>
{
private const string Description = "Partially restores online features such as the Marketplace by patching the Zune desktop software " +
"to use the community's recreation of Microsoft's Zune servers at zunes.me (instead of zune.net).";
private const string Author = "Joshua \"Yoshi\" Askharoun";
public override ModMetadata Metadata => new(nameof(WebservicesMod), "Community Webservices",
Description, Author, new(1, 2));
public override ModMetadata Metadata { get; } = new()
{
Id = nameof(WebservicesMod),
Title = "Community Webservices",
Author = "Joshua \"Yoshi\" Askharoun",
Version = new(1, 2),
Description = "Partially restores online features such as the Marketplace by patching the Zune desktop software " +
"to use the community's recreation of the original Zune servers.",
};
}
public partial class WebservicesMod(ModMetadata metadata, IModCoreConfig modConfig, ILogger<WebservicesMod> log) : Mod(metadata), IAsyncInit