// The commented out areas are functional, but are never actually updated/changed via api or // other so they are currently pointless to update private void SaveMetadata() { #pragma warning disable CS0618 // Type or member is obsolete TagLibFile.Tag.Artists = new string[] { TagLibProps["Artist"].ToString() }; #pragma warning restore CS0618 // Type or member is obsolete TagLibFile.Tag.AlbumArtists = new string[] { TagLibProps["Artist"].ToString() }; TagLibFile.Tag.Performers = new string[] { TagLibProps["Artist"].ToString() }; TagLibFile.Tag.Album = TagLibProps["Album"].ToString(); TagLibFile.Tag.Genres = new string[] { TagLibProps["Genres"].ToString() }; //TagLibFile.Tag.Lyrics = TagLibProps["Lyrics"].ToString(); TagLibFile.Tag.Title = TagLibProps["Title"].ToString(); TagLibFile.Tag.Track = Convert.ToUInt32(TagLibProps["Track"]); TagLibFile.Tag.Year = Convert.ToUInt32(TagLibProps["Year"]); //try //{ // var tag = TagLibFile.GetTag(TagLib.TagTypes.Id3v2); // var frame = TagLib.Id3v2.PopularimeterFrame.Get((TagLib.Id3v2.Tag)tag, "WindowsUser", true); // frame.Rating = Convert.ToByte(TagLibProps["Rating"]); //} //catch (Exception ex) //{ // var log = new LogWriter($"Can not save rating metadata to {Filepath}. {ex.GetType()}: \"{ex.Message}\" " + // "Possibly invalid tag type (Not Id3v2/Windows)"); //} //try //{ // TagLibFile.Tag.Comment = (bool)TagLibProps["IsLive"] ? "Live" : ""; //} //catch (Exception ex) //{ // var log = new LogWriter($"Can not save database comment data to {Filepath}. {ex.GetType()}: \"{ex.Message}\""); //} try { TagLibFile.Save(); } catch (IOException ex) { var log = new LogWriter($"MasterFile.SaveMetadata() - Can not save taglib data to '{Filepath}'. {ex.GetType()}: \"{ex.Message}\""); } }