diff --git a/PROGRESS.md b/PROGRESS.md index 760ec38..ed3cedb 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -1,4 +1,4 @@ -# Api Progress +# Api Progress ![Progress](http://progressed.io/bar/20) These are all the Last.fm API methods currently available. @@ -6,7 +6,7 @@ These are all the Last.fm API methods currently available. - Methods ~~marked with strikethrough~~ aren't currently implemented. Pull requests are welcome! - Methods _marked with an asterisk *_ aren't listed on [the Last.fm documentation](http://www.last.fm/api), so they might not work! -This list is generated by the [ProgressReport](https://github.com/inflatablefriends/lastfm/tree/master/src/IF.Lastfm.ProgressReport) tool in the solution. Last updated on 26 October 2014 14:27 +This list is generated by the [ProgressReport](https://github.com/inflatablefriends/lastfm/tree/master/src/IF.Lastfm.ProgressReport) tool in the solution. Last updated on 26 October 2014 14:45 ## Album - [album.getInfo](http://www.last.fm/api/show/album.getInfo) diff --git a/src/IF.Lastfm.ProgressReport/Program.cs b/src/IF.Lastfm.ProgressReport/Program.cs index e43cdff..3122a5a 100644 --- a/src/IF.Lastfm.ProgressReport/Program.cs +++ b/src/IF.Lastfm.ProgressReport/Program.cs @@ -17,7 +17,7 @@ public class Program { public const string API_INTRO_PAGE = "http://www.last.fm/api/intro"; - private const string _progressReportIntro = @"# Api Progress + private const string _progressReportIntro = @"# Api Progress ![Progress](http://progressed.io/bar/{0}) These are all the Last.fm API methods currently available. @@ -25,7 +25,7 @@ These are all the Last.fm API methods currently available. - Methods ~~marked with strikethrough~~ aren't currently implemented. Pull requests are welcome! - Methods _marked with an asterisk *_ aren't listed on [the Last.fm documentation](http://www.last.fm/api), so they might not work! -This list is generated by the [ProgressReport](https://github.com/inflatablefriends/lastfm/tree/master/src/IF.Lastfm.ProgressReport) tool in the solution. Last updated on {0} +This list is generated by the [ProgressReport](https://github.com/inflatablefriends/lastfm/tree/master/src/IF.Lastfm.ProgressReport) tool in the solution. Last updated on {1} "; public static void Main(string[] args) @@ -146,7 +146,8 @@ private static string GetApiMethodFromCommandType(Type type) private static void WriteReport(Dictionary> apiGroup, List allImplemented) { var markdownBuilder = new StringBuilder(); - markdownBuilder.AppendFormat(_progressReportIntro, DateTime.UtcNow.ToString("f")); + var percent = (((double)allImplemented.Count)/apiGroup.SelectMany(api => api.Value).Count()) * 100; + markdownBuilder.AppendFormat(_progressReportIntro, (int)Math.Floor(percent), DateTime.UtcNow.ToString("f")); foreach (var group in apiGroup.OrderBy(kv => kv.Key)) {