public string GetTorrentFileName(GroupTorrentInfo torrentInfo) { int year = torrentInfo.RemasterYear != 0 ? torrentInfo.RemasterYear : this.Group.Year; string suggestedName = this.Group.MusicInfo.JoinedArtists + " - " + this.Group.Name + " - " + year + " (" + torrentInfo.Media + " - " + torrentInfo.Format + " - " + torrentInfo.Encoding + ").torrent"; StringBuilder finalName = new StringBuilder(); char[] invalidChars = Path.GetInvalidFileNameChars(); foreach (char c in suggestedName) { if (!invalidChars.Contains(c)) { finalName.Append(c); } } return finalName.ToString(); }
public string GetTorrentFileName(GroupTorrentInfo torrentInfo) { int year = torrentInfo.RemasterYear != 0 ? torrentInfo.RemasterYear : this.Group.Year; string suggestedName = this.Group.MusicInfo.JoinedArtists + " - " + this.Group.Name + " - " + year + " (" + torrentInfo.Media + " - " + torrentInfo.Format + " - " + torrentInfo.Encoding + ").torrent"; StringBuilder finalName = new StringBuilder(); char[] invalidChars = Path.GetInvalidFileNameChars(); foreach (char c in suggestedName) { if (!invalidChars.Contains(c)) { finalName.Append(c); } } return(finalName.ToString()); }