diff --git a/.vscode/launch.json b/.vscode/launch.json index c6bbe9a..8017882 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ "request": "launch", "preLaunchTask": "build", "program": "${workspaceFolder}/src/bin/Debug/netcoreapp2.2/UnpackKindleS.dll", - "args": ["E:\\UnpackKindleS\\samples\\sample_filename_EBOK"], + "args": ["E:\\UnpackKindleS\\samples\\noname_EBOK"], "cwd": "${workspaceFolder}/src", "console": "internalConsole", "stopAtEntry": false diff --git a/src/EpubBuilder.cs b/src/EpubBuilder.cs index f692ee6..2e05087 100644 --- a/src/EpubBuilder.cs +++ b/src/EpubBuilder.cs @@ -403,6 +403,7 @@ void CreateOPF() } } + if (azw3.mobi_header.extMeta.id_string.ContainsKey(101)) { XmlElement x = meta.CreateElement("dc:publisher"); if (azw3.mobi_header.extMeta.id_string.ContainsKey(522)) @@ -413,6 +414,7 @@ void CreateOPF() x.InnerText = azw3.mobi_header.extMeta.id_string[101]; meta.FirstChild.AppendChild(x); } + if (azw3.mobi_header.extMeta.id_string.ContainsKey(106)) { XmlElement x = meta.CreateElement("dc:date"); string date = azw3.mobi_header.extMeta.id_string[106]; @@ -438,6 +440,13 @@ void CreateOPF() } + { + string metaTemplate = "\n"; + string tempstr = ""; + if (azw3.mobi_header.extMeta.id_string.ContainsKey(503)) + { tempstr += string.Format(metaTemplate, IdMapping.id_map_strings[503], azw3.mobi_header.extMeta.id_string[503]); } + t = t.Replace("{❕othermeta}", tempstr); + } t = t.Replace("{❕meta}", Util.GetInnerXML((XmlElement)meta.FirstChild)); @@ -453,7 +462,7 @@ void CreateOPF() { try { - guide += string.Format("\n", g.ref_name, Path.Combine("Text/", xhtml_names[azw3.frag_table[g.num].file_num+1]), g.ref_type); + guide += string.Format("\n", g.ref_name, Path.Combine("Text/", xhtml_names[azw3.frag_table[g.num].file_num + 1]), g.ref_type); } catch (Exception e) { diff --git a/src/version.cs b/src/version.cs index ad7297e..3827261 100644 --- a/src/version.cs +++ b/src/version.cs @@ -1,4 +1,4 @@ namespace UnpackKindleS { - public class Version{public static string version="20190717";} + public class Version{public static string version="20190718";} } \ No newline at end of file