Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
把元数据给我写完整啊kora!
  • Loading branch information
Aeroblast committed Jul 18, 2019
1 parent 1513263 commit af43372
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion src/EpubBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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];
Expand All @@ -438,6 +440,13 @@ void CreateOPF()

}

{
string metaTemplate = "<meta name=\"{0}\" content=\"{1}\" />\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));
Expand All @@ -453,7 +462,7 @@ void CreateOPF()
{
try
{
guide += string.Format("<reference type=\"{2}\" title=\"{0}\" href=\"{1}\" />\n", g.ref_name, Path.Combine("Text/", xhtml_names[azw3.frag_table[g.num].file_num+1]), g.ref_type);
guide += string.Format("<reference type=\"{2}\" title=\"{0}\" href=\"{1}\" />\n", g.ref_name, Path.Combine("Text/", xhtml_names[azw3.frag_table[g.num].file_num + 1]), g.ref_type);
}
catch (Exception e)
{
Expand Down
2 changes: 1 addition & 1 deletion src/version.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace UnpackKindleS
{
public class Version{public static string version="20190717";}
public class Version{public static string version="20190718";}
}

0 comments on commit af43372

Please sign in to comment.