Fixed narrator fields.

This commit is contained in:
Michael Bucari-Tovo 2021-06-26 02:09:03 -06:00
parent 4d743df643
commit e32a39085f
3 changed files with 20 additions and 21 deletions

View File

@ -40,7 +40,7 @@ namespace AaxDecrypter
public ChapterInfo chapters { get; private set; }
public string Title => aaxcTagLib.Tag.Title.Replace(" (Unabridged)", "");
public string Author => aaxcTagLib.Tag.FirstPerformer ?? "[unknown]";
public string Narrator => string.IsNullOrWhiteSpace(aaxcTagLib.Tag.FirstComposer) ? aaxcTagLib.GetTag(TagLib.TagTypes.Apple).Narrator : aaxcTagLib.Tag.FirstComposer;
public string Narrator => aaxcTagLib.GetTag(TagLib.TagTypes.Apple).Narrator;
public byte[] CoverArt => aaxcTagLib.Tag.Pictures.Length > 0 ? aaxcTagLib.Tag.Pictures[0].Data.Data : default;
private TagLib.Mpeg4.File aaxcTagLib { get; set; }

View File

@ -6,7 +6,6 @@ using System.Threading.Tasks;
namespace AaxDecrypter
{
/// <summary>
/// Download audible aaxc, decrypt, remux,and add metadata.
/// </summary>

View File

@ -3,28 +3,28 @@ namespace AaxDecrypter
{
public static class NFO
{
public static string CreateContents(string ripper, TagLib.File tags, ChapterInfo chapters)
public static string CreateContents(string ripper, TagLib.File aaxcTagLib, ChapterInfo chapters)
{
var tag = tags.GetTag(TagLib.TagTypes.Apple);
var tag = aaxcTagLib.GetTag(TagLib.TagTypes.Apple);
string narator = string.IsNullOrWhiteSpace(tags.Tag.FirstComposer) ? tag.Narrator : tags.Tag.FirstComposer;
string narator = string.IsNullOrWhiteSpace(aaxcTagLib.Tag.FirstComposer) ? tag.Narrator : aaxcTagLib.Tag.FirstComposer;
var _hours = (int)tags.Properties.Duration.TotalHours;
var _hours = (int)aaxcTagLib.Properties.Duration.TotalHours;
var myDuration
= (_hours > 0 ? _hours + " hours, " : "")
+ tags.Properties.Duration.Minutes + " minutes, "
+ tags.Properties.Duration.Seconds + " seconds";
+ aaxcTagLib.Properties.Duration.Minutes + " minutes, "
+ aaxcTagLib.Properties.Duration.Seconds + " seconds";
var header
= "General Information\r\n"
+ "===================\r\n"
+ $" Title: {tags.Tag.Title.Replace(" (Unabridged)", "")}\r\n"
+ $" Author: {tags.Tag.FirstPerformer ?? "[unknown]"}\r\n"
+ $" Read By: {tags.Tag.FirstPerformer??"[unknown]"}\r\n"
+ $" Copyright: {tags.Tag.Year}\r\n"
+ $" Audiobook Copyright: {tags.Tag.Year}\r\n";
if (!string.IsNullOrEmpty(tags.Tag.FirstGenre))
header += $" Genre: {tags.Tag.FirstGenre}\r\n";
+ $" Title: {aaxcTagLib.Tag.Title.Replace(" (Unabridged)", "")}\r\n"
+ $" Author: {aaxcTagLib.Tag.FirstPerformer ?? "[unknown]"}\r\n"
+ $" Read By: {aaxcTagLib.GetTag(TagLib.TagTypes.Apple).Narrator??"[unknown]"}\r\n"
+ $" Copyright: {aaxcTagLib.Tag.Year}\r\n"
+ $" Audiobook Copyright: {aaxcTagLib.Tag.Year}\r\n";
if (!string.IsNullOrEmpty(aaxcTagLib.Tag.FirstGenre))
header += $" Genre: {aaxcTagLib.Tag.FirstGenre}\r\n";
var s
= header
@ -36,15 +36,15 @@ namespace AaxDecrypter
+ "Media Information\r\n"
+ "=================\r\n"
+ " Source Format: Audible AAX\r\n"
+ $" Source Sample Rate: {tags.Properties.AudioSampleRate} Hz\r\n"
+ $" Source Channels: {tags.Properties.AudioChannels}\r\n"
+ $" Source Bitrate: {tags.Properties.AudioBitrate} kbits\r\n"
+ $" Source Sample Rate: {aaxcTagLib.Properties.AudioSampleRate} Hz\r\n"
+ $" Source Channels: {aaxcTagLib.Properties.AudioChannels}\r\n"
+ $" Source Bitrate: {aaxcTagLib.Properties.AudioBitrate} kbits\r\n"
+ "\r\n"
+ " Lossless Encode: Yes\r\n"
+ " Encoded Codec: AAC / M4B\r\n"
+ $" Encoded Sample Rate: {tags.Properties.AudioSampleRate} Hz\r\n"
+ $" Encoded Channels: {tags.Properties.AudioChannels}\r\n"
+ $" Encoded Bitrate: {tags.Properties.AudioBitrate} kbits\r\n"
+ $" Encoded Sample Rate: {aaxcTagLib.Properties.AudioSampleRate} Hz\r\n"
+ $" Encoded Channels: {aaxcTagLib.Properties.AudioChannels}\r\n"
+ $" Encoded Bitrate: {aaxcTagLib.Properties.AudioBitrate} kbits\r\n"
+ "\r\n"
+ $" Ripper: {ripper}\r\n"
+ "\r\n"