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; 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> public class BackgroundImageModFactory : DIModFactoryBase<BackgroundImageMod>
{ {
private const string Description = "Replaces the \"Zero\" background with an image of your choice."; public override ModMetadata Metadata { get; } = new()
{
private const string Author = "Joshua \"Yoshi\" Askharoun"; Id = nameof(BackgroundImageMod),
Title = "Background Image",
public override ModMetadata Metadata => new(nameof(BackgroundImageMod), "Background Image", Author = "Joshua \"Yoshi\" Askharoun",
Description, Author, new(1, 1)); Version = new(1, 1),
Description = "Replaces the \"Zero\" background with an image of your choice.",
};
} }
public class BackgroundImageMod(ModMetadata metadata, IModCoreConfig modConfig) : Mod(metadata) 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> public class FeaturesOverrideModFactory : DIModFactoryBase<FeaturesOverrideMod>
{ {
public override ModMetadata Metadata { get; } = new()
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."; Id = nameof(FeaturesOverrideMod),
Title = "Features Override",
private const string Author = "Rafael Rivera"; Author = "Rafael Rivera",
Version = new(1, 0),
public override ModMetadata Metadata => new(nameof(FeaturesOverrideMod), "Features Override", Description = "Re-enables UI for some features disabled by Microsoft, such as the Social and Marketplace tabs.\r\n" +
Description, Author, new(1, 0)); "See the Community Webservices mod to restore functionality of those features.",
};
} }
public class FeaturesOverrideMod(ModMetadata metadata) : Mod(metadata), IAsyncInit public class FeaturesOverrideMod(ModMetadata metadata) : Mod(metadata), IAsyncInit
+11 -8
View File
@@ -9,14 +9,17 @@ namespace ZuneModCore.Mods;
public class MbidLocatorModFactory : DIModFactoryBase<MbidLocatorMod> public class MbidLocatorModFactory : DIModFactoryBase<MbidLocatorMod>
{ {
private const string Description = "Puts MusicBrainz IDs added by MusicBrainz Picard where the Zune " + public override ModMetadata Metadata { get; } = new()
"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."; Id = nameof(MbidLocatorMod),
Title = "Music Tag Fixer",
private const string Author = "Joshua \"Yoshi\" Askharoun"; Author = "Joshua \"Yoshi\" Askharoun",
Version = new(2, 0),
public override ModMetadata Metadata => new(nameof(MbidLocatorMod), "MusicBrainz ID Locator", Description = "Fixes music tags to improve Zune compatibility and enable Marketplace features.",
Description, Author, new(1, 0)); 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) public class MbidLocatorMod(ModMetadata metadata) : Mod(metadata)
+8 -7
View File
@@ -9,13 +9,14 @@ namespace ZuneModCore.Mods;
public class VideoSyncModFactory : DIModFactoryBase<VideoSyncMod> public class VideoSyncModFactory : DIModFactoryBase<VideoSyncMod>
{ {
private const string Description = public override ModMetadata Metadata { get; } = new()
"Resolves \"Error C00D11CD\" when attempting to sync video to a Zune device using Windows 10 1607 (Anniversary Update) or newer"; {
Id = nameof(VideoSyncMod),
private const string Author = "ส็็็Codix#4833 & sylvathemoth"; Title = "Fix Video Sync",
Author = "ส็็็Codix#4833 & sylvathemoth",
public override ModMetadata Metadata => new(nameof(VideoSyncMod), "Fix Video Sync", Version = new(2, 1),
Description, Author, 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) 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> public class WebservicesModFactory : DIModFactoryBase<WebservicesMod>
{ {
private const string Description = "Partially restores online features such as the Marketplace by patching the Zune desktop software " + public override ModMetadata Metadata { get; } = new()
"to use the community's recreation of Microsoft's Zune servers at zunes.me (instead of zune.net)."; {
Id = nameof(WebservicesMod),
private const string Author = "Joshua \"Yoshi\" Askharoun"; Title = "Community Webservices",
Author = "Joshua \"Yoshi\" Askharoun",
public override ModMetadata Metadata => new(nameof(WebservicesMod), "Community Webservices", Version = new(1, 2),
Description, Author, 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 public partial class WebservicesMod(ModMetadata metadata, IModCoreConfig modConfig, ILogger<WebservicesMod> log) : Mod(metadata), IAsyncInit