The Free Software Media System - Server Backend & API
Var type refinements
1hitsong7d886116fd3b
diff --git a/MediaBrowser.Controller/Lyrics/Lyric.cs b/MediaBrowser.Controller/Lyrics/Lyric.csindex 56a0a8a72d..35cdabbb9b 100644--- a/MediaBrowser.Controller/Lyrics/Lyric.cs+++ b/MediaBrowser.Controller/Lyrics/Lyric.cs@@ -8,7 +8,7 @@ namespace MediaBrowser.Controller.Lyrics/// <summary>/// Gets or sets the start time in ticks./// </summary>- public double? Start { get; set; }+ public long? Start { get; set; }/// <summary>/// Gets or sets the text.diff --git a/MediaBrowser.Controller/Lyrics/LyricResponse.cs b/MediaBrowser.Controller/Lyrics/LyricResponse.csindex 59ee5c7f2c..796ca3bc36 100644--- a/MediaBrowser.Controller/Lyrics/LyricResponse.cs+++ b/MediaBrowser.Controller/Lyrics/LyricResponse.cs@@ -10,9 +10,9 @@ namespace MediaBrowser.Controller.Lyricspublic class LyricResponse{/// <summary>- /// Gets or sets MetaData.+ /// Gets or sets Metadata./// </summary>- public IDictionary<string, object> MetaData { get; set; }+ public IDictionary<string, string> Metadata { get; set; }/// <summary>/// Gets or sets Lyrics.diff --git a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs b/MediaBrowser.Providers/Lyric/LrcLyricProvider.csindex ea42d75255..59a172cee2 100644--- a/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs+++ b/MediaBrowser.Providers/Lyric/LrcLyricProvider.cs@@ -8,6 +8,7 @@ using LrcParser.Model;using LrcParser.Parser;using MediaBrowser.Controller.Entities;using MediaBrowser.Controller.Lyrics;+using Swashbuckle.AspNetCore.SwaggerGen;namespace MediaBrowser.Providers.Lyric{@@ -56,7 +57,7 @@ namespace MediaBrowser.Providers.LyricList<Controller.Lyrics.Lyric> lyricList = new List<Controller.Lyrics.Lyric>();List<LrcParser.Model.Lyric> sortedLyricData = new List<LrcParser.Model.Lyric>();- var metaData = new ExpandoObject() as IDictionary<string, object>;+ IDictionary<string, string> metaData = new Dictionary<string, string>();string lrcFileContent = System.IO.File.ReadAllText(lyricFilePath);try@@ -77,8 +78,8 @@ namespace MediaBrowser.Providers.Lyric{var metaDataField = metaDataRow.Split(":");- string metaDataFieldName = metaDataField[0].Replace("[", string.Empty, StringComparison.Ordinal);- string metaDataFieldValue = metaDataField[1].Replace("]", string.Empty, StringComparison.Ordinal);+ string metaDataFieldName = metaDataField[0].Replace("[", string.Empty, StringComparison.Ordinal).Trim();+ string metaDataFieldValue = metaDataField[1].Replace("]", string.Empty, StringComparison.Ordinal).Trim();metaData.Add(metaDataFieldName, metaDataFieldValue);}@@ -96,13 +97,13 @@ namespace MediaBrowser.Providers.Lyricfor (int i = 0; i < sortedLyricData.Count; i++){var timeData = sortedLyricData[i].TimeTags.ToArray()[0].Value;- double ticks = Convert.ToDouble(timeData, new NumberFormatInfo()) * 10000;- lyricList.Add(new Controller.Lyrics.Lyric { Start = Math.Ceiling(ticks), Text = sortedLyricData[i].Text });+ long ticks = Convert.ToInt64(timeData, new NumberFormatInfo()) * 10000;+ lyricList.Add(new Controller.Lyrics.Lyric { Start = ticks, Text = sortedLyricData[i].Text });}if (metaData.Any()){- return new LyricResponse { MetaData = metaData, Lyrics = lyricList };+ return new LyricResponse { Metadata = metaData, Lyrics = lyricList };}return new LyricResponse { Lyrics = lyricList };